diff --git a/Playwright-Cucumber-Exercise-main/.github/workflows/dispatch-to-grader.yml b/Playwright-Cucumber-Exercise-main/.github/workflows/dispatch-to-grader.yml new file mode 100644 index 00000000..c72def8b --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/.github/workflows/dispatch-to-grader.yml @@ -0,0 +1,33 @@ +name: Dispatch to Grader + +on: + pull_request_target: + types: [opened, synchronize, reopened] + workflow_dispatch: + inputs: + pr_number: + description: 'PR number in this repo (e.g., 119)' + required: true + +jobs: + notify-grader: + runs-on: ubuntu-latest + steps: + - name: Verify token can access private grader repo + run: | + code=$(curl -s -o /dev/null -w "%{http_code}\n" \ + -H "Authorization: token ${{ secrets.GRADER_REPO_PAT }}" \ + https://api.github.com/repos/automationExamples/Playwright-Cucumber-Exercise-Eval) + echo "HTTP $code"; test "$code" = "200" + + - name: Send repository_dispatch to grader + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.GRADER_REPO_PAT }} + repository: automationExamples/Playwright-Cucumber-Exercise-Eval + event-type: grade-assessment + client-payload: > + { + "pr_number": "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.pr_number || github.event.pull_request.number }}", + "repo_full": "${{ github.repository }}" + } diff --git a/Playwright-Cucumber-Exercise-main/.gitignore b/Playwright-Cucumber-Exercise-main/.gitignore new file mode 100644 index 00000000..9fd66896 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/.gitignore @@ -0,0 +1,3 @@ +report.json +cucumber_report.html +/node_modules \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/README.md b/Playwright-Cucumber-Exercise-main/README.md new file mode 100644 index 00000000..b9111057 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/README.md @@ -0,0 +1,58 @@ +# Sample Playwright Automation Test + +## System Requirements + +node >= v18.5.x + +npm >= v7 + + +## Setup + +// Install Visual Studio Code (or any editor) + +https://code.visualstudio.com/download + + +// Install Node.js + +https://nodejs.org/en/download + + +```bash +git clone https://github.com/automationExamples/Playwright-Cucumber-Exercise.git +npm install +npx playwright install +``` + +### Recommended vscode extensions + +Cucumber v1.7.0 + +Cucumber (Gherkin) Support enhanced for Behat + + +## Instructions +To run the test +```bash +npm run test +``` + +After running, to generate the cucumber report (cucumber_report.html) +```bash +npm run report +``` + +It is not expected that you complete every task, however, please give your best effort + +You will be scored based on your ability to complete the following tasks: + +- [ ] Install and setup this repository on your personal computer +- [ ] Complete the automation tasks listed below + +### Tasks +- [ ] Modify the scenario 'Validate the login page title' from [login.feature](features/login.feature#8) which runs but fails. Determine the cause of the failure and update the scenario to pass in the test +- [ ] Extend the scenario 'Validate login error message' from [login.feature](features/login.feature#10) which runs and passes but is missing a step. Extend the scenario to validate the error message received. +- [ ] Modify and extend the 'Validate successful purchase text' from [purchase.feature](features/purchase.feature#6) with steps for each comment listed. Consider writing a new steps.ts file along with an appropriate page.ts +- [ ] Modify and extend the 'Validate product sort by price sort' from [product.feature](features/product.feature#6) with steps for each comment listed. Utilize the Scenario Outline and Examples table to parameterize the test +- [ ] Extend the testing coverage with anything you believe would be beneficial diff --git a/Playwright-Cucumber-Exercise-main/cucumber.js b/Playwright-Cucumber-Exercise-main/cucumber.js new file mode 100644 index 00000000..e8192d63 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/cucumber.js @@ -0,0 +1,3 @@ +module.exports = { + default: `--require-module ts-node/register --require './steps/**/*.ts' --require './hooks/**/*.ts --format @cucumber/pretty-formatter` +}; \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/features/login.feature b/Playwright-Cucumber-Exercise-main/features/login.feature new file mode 100644 index 00000000..6f253a1b --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/features/login.feature @@ -0,0 +1,11 @@ +Feature: Login Feature + + Background: + Given I open the "https://www.saucedemo.com/" page + + Scenario: Validate the login page title + Then I should see the title "Swag Labs" + + Scenario: Validate login error message + Then I will login as 'locked_out_user' + And I should see the error message "Epic sadface: Sorry, this user has been locked out." \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/features/logout.feature b/Playwright-Cucumber-Exercise-main/features/logout.feature new file mode 100644 index 00000000..274bbafc --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/features/logout.feature @@ -0,0 +1,10 @@ +Feature: Logout Feature + + Background: + Given I open the "https://www.saucedemo.com/" page + + Scenario: Validate user logout + Then I will login as 'standard_user' + And I open the menu + And I click logout + Then I should be redirected to login page \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/features/product.feature b/Playwright-Cucumber-Exercise-main/features/product.feature new file mode 100644 index 00000000..58a1ccf9 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/features/product.feature @@ -0,0 +1,15 @@ +Feature: Product Feature + + Background: + Given I open the "https://www.saucedemo.com/" page + + # Validate sorting using Scenario Outline + Scenario Outline: Validate product sort by price + Then I will login as 'standard_user' + And I sort the products by "" + Then I validate products are sorted by price "" + + Examples: + | sort | + | Price (low to high) | + | Price (high to low) | \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/features/purchase.feature b/Playwright-Cucumber-Exercise-main/features/purchase.feature new file mode 100644 index 00000000..aae7dcd0 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/features/purchase.feature @@ -0,0 +1,12 @@ +Scenario: Validate successful purchase text + Then I will login as 'standard_user' + Then I will add the backpack to the cart + And I select the cart (top-right) + And I select Checkout + And I fill in checkout details "John" "Doe" "12345" + And I select Continue + And I select Finish + + Then I should see the confirmation header + And I should see the confirmation message + And I should be on the checkout complete page \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/generate-report.js b/Playwright-Cucumber-Exercise-main/generate-report.js new file mode 100644 index 00000000..2df1cc40 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/generate-report.js @@ -0,0 +1,13 @@ +const reporter = require('cucumber-html-reporter'); + +const options = { + theme: 'bootstrap', + jsonFile: 'report.json', + output: 'cucumber_report.html', + reportSuiteAsScenarios: true, + scenarioTimestamp: true, + launchReport: true, + metadata: {} +}; + +reporter.generate(options); \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/hooks/globalHooks.ts b/Playwright-Cucumber-Exercise-main/hooks/globalHooks.ts new file mode 100644 index 00000000..d0be8f55 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/hooks/globalHooks.ts @@ -0,0 +1,17 @@ +import { Before, After } from '@cucumber/cucumber'; +import { chromium, Browser, Page } from '@playwright/test'; +import { pageFixture } from './pageFixture'; + +let browser: Browser; +let page: Page; + +Before(async () => { + browser = await chromium.launch({ headless: false }); + page = await browser.newPage(); + pageFixture.page = page; +}); + +After(async () => { + await page.close(); + await browser.close(); +}); \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/hooks/pageFixture.ts b/Playwright-Cucumber-Exercise-main/hooks/pageFixture.ts new file mode 100644 index 00000000..1f1ab673 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/hooks/pageFixture.ts @@ -0,0 +1,5 @@ +import { Page } from '@playwright/test'; + +export const pageFixture = { + page: undefined as unknown as Page +}; \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/package-lock.json b/Playwright-Cucumber-Exercise-main/package-lock.json new file mode 100644 index 00000000..b90d7c6c --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/package-lock.json @@ -0,0 +1,2762 @@ +{ + "name": "Playwright-Project", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "@cucumber/cucumber": "^10.0.1", + "@cucumber/pretty-formatter": "^1.0.0", + "@playwright/test": "^1.40.1", + "@types/node": "^20.10.3", + "cucumber-html-reporter": "^7.1.1", + "ts-node": "^10.9.1", + "typescript": "^5.3.2" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/runtime": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz", + "integrity": "sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cucumber/ci-environment": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-9.2.0.tgz", + "integrity": "sha512-jLzRtVwdtNt+uAmTwvXwW9iGYLEOJFpDSmnx/dgoMGKXUWRx1UHT86Q696CLdgXO8kyTwsgJY0c6n5SW9VitAA==", + "dev": true + }, + "node_modules/@cucumber/cucumber": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber/-/cucumber-10.0.1.tgz", + "integrity": "sha512-g7W7SQnNMSNnMRQVGubjefCxdgNFyq4P3qxT2Ve7Xhh8ZLoNkoRDcWsyfKQVWnxNfgW3aGJmxbucWRoTi+ZUqg==", + "dev": true, + "dependencies": { + "@cucumber/ci-environment": "9.2.0", + "@cucumber/cucumber-expressions": "16.1.2", + "@cucumber/gherkin": "26.2.0", + "@cucumber/gherkin-streams": "5.0.1", + "@cucumber/gherkin-utils": "8.0.2", + "@cucumber/html-formatter": "20.4.0", + "@cucumber/message-streams": "4.0.1", + "@cucumber/messages": "22.0.0", + "@cucumber/tag-expressions": "5.0.1", + "assertion-error-formatter": "^3.0.0", + "capital-case": "^1.0.4", + "chalk": "^4.1.2", + "cli-table3": "0.6.3", + "commander": "^10.0.0", + "debug": "^4.3.4", + "error-stack-parser": "^2.1.4", + "figures": "^3.2.0", + "glob": "^10.3.10", + "has-ansi": "^4.0.1", + "indent-string": "^4.0.0", + "is-installed-globally": "^0.4.0", + "is-stream": "^2.0.0", + "knuth-shuffle-seeded": "^1.0.6", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "luxon": "3.2.1", + "mkdirp": "^2.1.5", + "mz": "^2.7.0", + "progress": "^2.0.3", + "read-pkg-up": "^7.0.1", + "resolve-pkg": "^2.0.0", + "semver": "7.5.3", + "string-argv": "^0.3.1", + "strip-ansi": "6.0.1", + "supports-color": "^8.1.1", + "tmp": "^0.2.1", + "util-arity": "^1.1.0", + "verror": "^1.10.0", + "xmlbuilder": "^15.1.1", + "yaml": "^2.2.2", + "yup": "1.2.0" + }, + "bin": { + "cucumber-js": "bin/cucumber.js" + }, + "engines": { + "node": "18 || >=20" + } + }, + "node_modules/@cucumber/cucumber-expressions": { + "version": "16.1.2", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-16.1.2.tgz", + "integrity": "sha512-CfHEbxJ5FqBwF6mJyLLz4B353gyHkoi6cCL4J0lfDZ+GorpcWw4n2OUAdxJmP7ZlREANWoTFlp4FhmkLKrCfUA==", + "dev": true, + "dependencies": { + "regexp-match-indices": "1.0.2" + } + }, + "node_modules/@cucumber/gherkin": { + "version": "26.2.0", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-26.2.0.tgz", + "integrity": "sha512-iRSiK8YAIHAmLrn/mUfpAx7OXZ7LyNlh1zT89RoziSVCbqSVDxJS6ckEzW8loxs+EEXl0dKPQOXiDmbHV+C/fA==", + "dev": true, + "dependencies": { + "@cucumber/messages": ">=19.1.4 <=22" + } + }, + "node_modules/@cucumber/gherkin-streams": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin-streams/-/gherkin-streams-5.0.1.tgz", + "integrity": "sha512-/7VkIE/ASxIP/jd4Crlp4JHXqdNFxPGQokqWqsaCCiqBiu5qHoKMxcWNlp9njVL/n9yN4S08OmY3ZR8uC5x74Q==", + "dev": true, + "dependencies": { + "commander": "9.1.0", + "source-map-support": "0.5.21" + }, + "bin": { + "gherkin-javascript": "bin/gherkin" + }, + "peerDependencies": { + "@cucumber/gherkin": ">=22.0.0", + "@cucumber/message-streams": ">=4.0.0", + "@cucumber/messages": ">=17.1.1" + } + }, + "node_modules/@cucumber/gherkin-streams/node_modules/commander": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.1.0.tgz", + "integrity": "sha512-i0/MaqBtdbnJ4XQs4Pmyb+oFQl+q0lsAmokVUH92SlSw4fkeAcG3bVon+Qt7hmtF+u3Het6o4VgrcY3qAoEB6w==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/@cucumber/gherkin-utils": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin-utils/-/gherkin-utils-8.0.2.tgz", + "integrity": "sha512-aQlziN3r3cTwprEDbLEcFoMRQajb9DTOu2OZZp5xkuNz6bjSTowSY90lHUD2pWT7jhEEckZRIREnk7MAwC2d1A==", + "dev": true, + "dependencies": { + "@cucumber/gherkin": "^25.0.0", + "@cucumber/messages": "^19.1.4", + "@teppeis/multimaps": "2.0.0", + "commander": "9.4.1", + "source-map-support": "^0.5.21" + }, + "bin": { + "gherkin-utils": "bin/gherkin-utils" + } + }, + "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/gherkin": { + "version": "25.0.2", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-25.0.2.tgz", + "integrity": "sha512-EdsrR33Y5GjuOoe2Kq5Y9DYwgNRtUD32H4y2hCrT6+AWo7ibUQu7H+oiWTgfVhwbkHsZmksxHSxXz/AwqqyCRQ==", + "dev": true, + "dependencies": { + "@cucumber/messages": "^19.1.4" + } + }, + "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/messages": { + "version": "19.1.4", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-19.1.4.tgz", + "integrity": "sha512-Pksl0pnDz2l1+L5Ug85NlG6LWrrklN9qkMxN5Mv+1XZ3T6u580dnE6mVaxjJRdcOq4tR17Pc0RqIDZMyVY1FlA==", + "dev": true, + "dependencies": { + "@types/uuid": "8.3.4", + "class-transformer": "0.5.1", + "reflect-metadata": "0.1.13", + "uuid": "9.0.0" + } + }, + "node_modules/@cucumber/gherkin-utils/node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", + "dev": true + }, + "node_modules/@cucumber/gherkin-utils/node_modules/commander": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", + "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/@cucumber/html-formatter": { + "version": "20.4.0", + "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-20.4.0.tgz", + "integrity": "sha512-TnLSXC5eJd8AXHENo69f5z+SixEVtQIf7Q2dZuTpT/Y8AOkilGpGl1MQR1Vp59JIw+fF3EQSUKdf+DAThCxUNg==", + "dev": true, + "peerDependencies": { + "@cucumber/messages": ">=18" + } + }, + "node_modules/@cucumber/message-streams": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/message-streams/-/message-streams-4.0.1.tgz", + "integrity": "sha512-Kxap9uP5jD8tHUZVjTWgzxemi/0uOsbGjd4LBOSxcJoOCRbESFwemUzilJuzNTB8pcTQUh8D5oudUyxfkJOKmA==", + "dev": true, + "peerDependencies": { + "@cucumber/messages": ">=17.1.1" + } + }, + "node_modules/@cucumber/messages": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-22.0.0.tgz", + "integrity": "sha512-EuaUtYte9ilkxcKmfqGF9pJsHRUU0jwie5ukuZ/1NPTuHS1LxHPsGEODK17RPRbZHOFhqybNzG2rHAwThxEymg==", + "dev": true, + "dependencies": { + "@types/uuid": "9.0.1", + "class-transformer": "0.5.1", + "reflect-metadata": "0.1.13", + "uuid": "9.0.0" + } + }, + "node_modules/@cucumber/pretty-formatter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/pretty-formatter/-/pretty-formatter-1.0.0.tgz", + "integrity": "sha512-wcnIMN94HyaHGsfq72dgCvr1d8q6VGH4Y6Gl5weJ2TNZw1qn2UY85Iki4c9VdaLUONYnyYH3+178YB+9RFe/Hw==", + "dev": true, + "dependencies": { + "ansi-styles": "^5.0.0", + "cli-table3": "^0.6.0", + "figures": "^3.2.0", + "ts-dedent": "^2.0.0" + }, + "peerDependencies": { + "@cucumber/cucumber": ">=7.0.0", + "@cucumber/messages": "*" + } + }, + "node_modules/@cucumber/tag-expressions": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-5.0.1.tgz", + "integrity": "sha512-N43uWud8ZXuVjza423T9ZCIJsaZhFekmakt7S9bvogTxqdVGbRobjR663s0+uW0Rz9e+Pa8I6jUuWtoBLQD2Mw==", + "dev": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@playwright/test": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", + "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", + "dev": true, + "dependencies": { + "playwright": "1.40.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@teppeis/multimaps": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@teppeis/multimaps/-/multimaps-2.0.0.tgz", + "integrity": "sha512-TL1adzq1HdxUf9WYduLcQ/DNGYiz71U31QRgbnr0Ef1cPyOUOsBojxHVWpFeOSUucB6Lrs0LxFRA14ntgtkc9w==", + "dev": true, + "engines": { + "node": ">=10.17" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/lodash": { + "version": "4.14.202", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.10.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz", + "integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true + }, + "node_modules/@types/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.0.tgz", + "integrity": "sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/assertion-error-formatter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/assertion-error-formatter/-/assertion-error-formatter-3.0.0.tgz", + "integrity": "sha512-6YyAVLrEze0kQ7CmJfUgrLHb+Y7XghmL2Ie7ijVa2Y9ynP3LV+VDiwFk62Dn0qtqbmY0BT0ss6p1xxpiF2PYbQ==", + "dev": true, + "dependencies": { + "diff": "^4.0.1", + "pad-right": "^0.2.2", + "repeat-string": "^1.6.1" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "dev": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chalk/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/chalk/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/class-transformer": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", + "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==", + "dev": true + }, + "node_modules/cli-table3": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cucumber-html-reporter": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/cucumber-html-reporter/-/cucumber-html-reporter-7.1.1.tgz", + "integrity": "sha512-v1OUqM2aSoC27Dt/mUJfh0uxiyUWjfl/9wu7HqHpeT8ojZbTepPpmvYCmM84VGOU5LnyqGclab00mchetzqEEQ==", + "dev": true, + "dependencies": { + "@cucumber/cucumber": "9.1.2", + "chalk": "^2.4.2", + "find": "^0.3.0", + "fs-extra": "^8.1.0", + "js-base64": "^2.3.2", + "jsonfile": "^5.0.0", + "lodash": "^4.17.11", + "node-emoji": "^1.10.0", + "open": "^6.4.0", + "uuid": "^3.3.3" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/ci-environment": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-9.1.0.tgz", + "integrity": "sha512-jdnF6APXP3GawMue8kdMxhu6TBhyRUO4KDRxTowf06NtclLjIw2Ybpo9IcIOMvE8kHukvJyM00uxWX+CfS7JgQ==", + "dev": true + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/cucumber": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber/-/cucumber-9.1.2.tgz", + "integrity": "sha512-0V96qH4Uozfu68vm6BY3DA8ZqbnQWgz8N3rnqw/geOG9sY05QeLUQ1PRGDZCznluqEdxt8iEu/QzoGwR7EjDcg==", + "dev": true, + "dependencies": { + "@cucumber/ci-environment": "9.1.0", + "@cucumber/cucumber-expressions": "16.1.1", + "@cucumber/gherkin": "26.0.3", + "@cucumber/gherkin-streams": "5.0.1", + "@cucumber/gherkin-utils": "8.0.2", + "@cucumber/html-formatter": "20.2.1", + "@cucumber/message-streams": "4.0.1", + "@cucumber/messages": "21.0.1", + "@cucumber/tag-expressions": "5.0.1", + "assertion-error-formatter": "^3.0.0", + "capital-case": "^1.0.4", + "chalk": "^4.1.2", + "cli-table3": "0.6.3", + "commander": "^10.0.0", + "debug": "^4.3.4", + "error-stack-parser": "^2.1.4", + "figures": "^3.2.0", + "glob": "^7.1.6", + "has-ansi": "^4.0.1", + "indent-string": "^4.0.0", + "is-installed-globally": "^0.4.0", + "is-stream": "^2.0.0", + "knuth-shuffle-seeded": "^1.0.6", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "luxon": "3.2.1", + "mkdirp": "^2.1.5", + "mz": "^2.7.0", + "progress": "^2.0.3", + "resolve-pkg": "^2.0.0", + "semver": "7.3.8", + "string-argv": "^0.3.1", + "strip-ansi": "6.0.1", + "supports-color": "^8.1.1", + "tmp": "^0.2.1", + "util-arity": "^1.1.0", + "verror": "^1.10.0", + "xmlbuilder": "^15.1.1", + "yaml": "^2.2.2", + "yup": "^0.32.11" + }, + "bin": { + "cucumber-js": "bin/cucumber.js" + }, + "engines": { + "node": "14 || 16 || >=18" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/cucumber-expressions": { + "version": "16.1.1", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-16.1.1.tgz", + "integrity": "sha512-Ugsb9qxfgrgfUKsGvbx0awVk+69NIFjWfxNT+dnm62YrF2gdTHYxAOzOLuPgvE0yqYTh+3otrFLDDfkHGThM1g==", + "dev": true, + "dependencies": { + "regexp-match-indices": "1.0.2" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/cucumber/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/cucumber/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/cucumber/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/cucumber/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/gherkin": { + "version": "26.0.3", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-26.0.3.tgz", + "integrity": "sha512-xwJHi//bLFEU1drIyw2yswwUHnnVWO4XcyVBbCTDs6DkSh262GkogFI/IWwChZqJfOXnPglzLGxR1DibcZsILA==", + "dev": true, + "dependencies": { + "@cucumber/messages": "19.1.4 - 21" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/html-formatter": { + "version": "20.2.1", + "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-20.2.1.tgz", + "integrity": "sha512-bwwyr1WjlOJ5dEFOLGbtYWbUprloB2eymqXBmmTC10s0xapZXkFn4VfHgMshaH91XiCIY/MoabWNAau3AeMHkQ==", + "dev": true, + "peerDependencies": { + "@cucumber/messages": ">=18" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/messages": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-21.0.1.tgz", + "integrity": "sha512-pGR7iURM4SF9Qp1IIpNiVQ77J9kfxMkPOEbyy+zRmGABnWWCsqMpJdfHeh9Mb3VskemVw85++e15JT0PYdcR3g==", + "dev": true, + "dependencies": { + "@types/uuid": "8.3.4", + "class-transformer": "0.5.1", + "reflect-metadata": "0.1.13", + "uuid": "9.0.0" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@cucumber/messages/node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/cucumber-html-reporter/node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", + "dev": true + }, + "node_modules/cucumber-html-reporter/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cucumber-html-reporter/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/cucumber-html-reporter/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cucumber-html-reporter/node_modules/chalk/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/cucumber-html-reporter/node_modules/chalk/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cucumber-html-reporter/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/cucumber-html-reporter/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cucumber-html-reporter/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cucumber-html-reporter/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/cucumber-html-reporter/node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cucumber-html-reporter/node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/cucumber-html-reporter/node_modules/yup": { + "version": "0.32.11", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.32.11.tgz", + "integrity": "sha512-Z2Fe1bn+eLstG8DRR6FTavGD+MeAwyfmouhHsIUgaADz8jvFKbO/fXc2trJKZg+5EBjh4gGm3iU/t3onKlXHIg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.15.4", + "@types/lodash": "^4.14.175", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "nanoclone": "^0.2.1", + "property-expr": "^2.0.4", + "toposort": "^2.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "dev": true, + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/extsprintf": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz", + "integrity": "sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==", + "dev": true, + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", + "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", + "dev": true, + "dependencies": { + "traverse-chain": "~0.1.0" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-extra/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/global-dirs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "dev": true, + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-ansi": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-4.0.1.tgz", + "integrity": "sha512-Qr4RtTm30xvEdqUXbSBVWDu+PrTokJOwe/FU+VdfJPk+MXAPoeOzKpRyrDTnZIJwAkQ4oBLTU53nu0HrkF/Z2A==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dev": true, + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-5.0.0.tgz", + "integrity": "sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==", + "dev": true, + "dependencies": { + "universalify": "^0.1.2" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/knuth-shuffle-seeded": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/knuth-shuffle-seeded/-/knuth-shuffle-seeded-1.0.6.tgz", + "integrity": "sha512-9pFH0SplrfyKyojCLxZfMcvkhf5hH0d+UwR9nTVJ/DDQJGuzcXjTwB7TP7sDfehSudlGGaOLblmEWqv04ERVWg==", + "dev": true, + "dependencies": { + "seed-random": "~2.2.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "dev": true + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/lru-cache": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", + "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/luxon": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", + "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "dev": true, + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoclone": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/nanoclone/-/nanoclone-0.2.1.tgz", + "integrity": "sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==", + "dev": true + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dev": true, + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-emoji": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", + "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", + "dev": true, + "dependencies": { + "lodash": "^4.17.21" + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/open": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/open/-/open-6.4.0.tgz", + "integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==", + "dev": true, + "dependencies": { + "is-wsl": "^1.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pad-right": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", + "integrity": "sha512-4cy8M95ioIGolCoMmm2cMntGR1lPLEbOMzOKu8bzjuJP6JpzEMQcDHmh7hHLYGgob+nKe1YHFMaG4V59HQa89g==", + "dev": true, + "dependencies": { + "repeat-string": "^1.5.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/playwright": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", + "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", + "dev": true, + "dependencies": { + "playwright-core": "1.40.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", + "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/property-expr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.6.tgz", + "integrity": "sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==", + "dev": true + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true + }, + "node_modules/regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", + "dev": true + }, + "node_modules/regexp-match-indices": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regexp-match-indices/-/regexp-match-indices-1.0.2.tgz", + "integrity": "sha512-DwZuAkt8NF5mKwGGER1EGh2PRqyvhRhhLviH+R8y8dIuaQROlUfXjt4s9ZTXstIsSkptf06BSvwcEmmfheJJWQ==", + "dev": true, + "dependencies": { + "regexp-tree": "^0.1.11" + } + }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "dev": true, + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg/-/resolve-pkg-2.0.0.tgz", + "integrity": "sha512-+1lzwXehGCXSeryaISr6WujZzowloigEofRB+dj75y9RRa/obVcYgbHJd53tdYw8pvZj8GojXaaENws8Ktw/hQ==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/seed-random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", + "integrity": "sha512-34EQV6AAHQGhoc0tn/96a9Fsi6v2xdqe/dMUwljGRaFOzR3EgRmECvD0O8vi8X+/uQ50LGHfkNu/Eue5TPKZkQ==", + "dev": true + }, + "node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", + "dev": true + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "dev": true + }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tiny-case": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz", + "integrity": "sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==", + "dev": true + }, + "node_modules/tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "dependencies": { + "rimraf": "^3.0.0" + }, + "engines": { + "node": ">=8.17.0" + } + }, + "node_modules/toposort": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", + "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==", + "dev": true + }, + "node_modules/traverse-chain": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", + "integrity": "sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg==", + "dev": true + }, + "node_modules/ts-dedent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz", + "integrity": "sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==", + "dev": true, + "engines": { + "node": ">=6.10" + } + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typescript": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "dev": true, + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/util-arity": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/util-arity/-/util-arity-1.1.0.tgz", + "integrity": "sha512-kkyIsXKwemfSy8ZEoaIz06ApApnWsk5hQO0vLjZS6UkBiGiW++Jsyb8vSBoc0WKlffGoGs5yYy/j5pp8zckrFA==", + "dev": true + }, + "node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/verror": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.1.tgz", + "integrity": "sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", + "dev": true, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yup": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/yup/-/yup-1.2.0.tgz", + "integrity": "sha512-PPqYKSAXjpRCgLgLKVGPA33v5c/WgEx3wi6NFjIiegz90zSwyMpvTFp/uGcVnnbx6to28pgnzp/q8ih3QRjLMQ==", + "dev": true, + "dependencies": { + "property-expr": "^2.0.5", + "tiny-case": "^1.0.3", + "toposort": "^2.0.2", + "type-fest": "^2.19.0" + } + }, + "node_modules/yup/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/Playwright-Cucumber-Exercise-main/package.json b/Playwright-Cucumber-Exercise-main/package.json new file mode 100644 index 00000000..ed38f6f5 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/package.json @@ -0,0 +1,15 @@ +{ + "scripts": { + "test": "cucumber-js --format json:report.json --exit", + "report": "node generate-report.js" + }, + "devDependencies": { + "@cucumber/cucumber": "^10.0.1", + "@cucumber/pretty-formatter": "^1.0.0", + "@playwright/test": "^1.40.1", + "@types/node": "^20.10.3", + "cucumber-html-reporter": "^7.1.1", + "ts-node": "^10.9.1", + "typescript": "^5.3.2" + } +} diff --git a/Playwright-Cucumber-Exercise-main/pages/login.page.ts b/Playwright-Cucumber-Exercise-main/pages/login.page.ts new file mode 100644 index 00000000..5a01614b --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/pages/login.page.ts @@ -0,0 +1,26 @@ +import { Page } from "@playwright/test" + +export class Login { + private readonly page: Page + private readonly password: string = 'secret_sauce' + private readonly passwordField: string = 'input[id="password"]' + private readonly userNameField: string = 'input[id="user-name"]' + private readonly loginButton: string = 'input[id="login-button"]' + + constructor(page: Page) { + this.page = page; + } + + public async validateTitle(expectedTitle: string) { + const pageTitle = await this.page.title(); + if (pageTitle !== expectedTitle) { + throw new Error(`Expected title to be ${expectedTitle} but found ${pageTitle}`); + } + } + + public async loginAsUser(userName: string) { + await this.page.locator(this.userNameField).fill(userName) + await this.page.locator(this.passwordField).fill(this.password) + await this.page.locator(this.loginButton).click() + } +} \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/pages/menu.page.ts b/Playwright-Cucumber-Exercise-main/pages/menu.page.ts new file mode 100644 index 00000000..c39dafaa --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/pages/menu.page.ts @@ -0,0 +1,17 @@ +import { Page } from '@playwright/test'; + +export class MenuPage { + private page: Page; + + constructor(page: Page) { + this.page = page; + } + + async openMenu() { + await this.page.locator('#react-burger-menu-btn').click(); + } + + async clickLogout() { + await this.page.locator('#logout_sidebar_link').click(); + } +} \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/pages/product.page.ts b/Playwright-Cucumber-Exercise-main/pages/product.page.ts new file mode 100644 index 00000000..7e2bc5c2 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/pages/product.page.ts @@ -0,0 +1,47 @@ +import { Page } from '@playwright/test'; +import { expect } from '@playwright/test'; + +export class ProductPage { + private page: Page; + + constructor(page: Page) { + this.page = page; + } + + async selectSortOption(sortOption: string) { + await this.page.selectOption('.product_sort_container', { + label: sortOption, + }); + } + + async getProductPrices(): Promise { + const priceElements = this.page.locator('.inventory_item_price'); + const count = await priceElements.count(); + + const prices: number[] = []; + + for (let i = 0; i < count; i++) { + const text = await priceElements.nth(i).innerText(); + prices.push(parseFloat(text.replace('$', ''))); + } + + return prices; + } + + async validateProductSorting(sortOption: string) { + const actualPrices = await this.getProductPrices(); + + // Create a sorted copy + const sortedPrices = [...actualPrices]; + + if (sortOption === 'Price (low to high)') { + sortedPrices.sort((a, b) => a - b); + } else if (sortOption === 'Price (high to low)') { + sortedPrices.sort((a, b) => b - a); + } + + // Validate all 6 items are sorted correctly + expect(actualPrices.length).toBe(6); + expect(actualPrices).toEqual(sortedPrices); + } +} \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/pages/purchasePage.ts b/Playwright-Cucumber-Exercise-main/pages/purchasePage.ts new file mode 100644 index 00000000..85c880eb --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/pages/purchasePage.ts @@ -0,0 +1,52 @@ +import { expect, Page, Locator } from '@playwright/test'; + +export class PurchasePage { + private page: Page; + + private completeHeader: Locator; + private completeMessage: Locator; + + constructor(page: Page) { + this.page = page; + this.completeHeader = page.locator('.complete-header'); + this.completeMessage = page.locator('.complete-text'); + } + + async clickCart() { + await this.page.locator('.shopping_cart_link').click(); + } + + async clickCheckout() { + await this.page.locator('#checkout').click(); + } + + async fillDetails(firstName: string, lastName: string, zip: string) { + await this.page.locator('#first-name').fill(firstName); + await this.page.locator('#last-name').fill(lastName); + await this.page.locator('#postal-code').fill(zip); + } + + async clickContinue() { + await this.page.locator('#continue').click(); + } + + async clickFinish() { + await this.page.locator('#finish').click(); + } + + async validateConfirmation(expectedText: string) { + await expect(this.completeHeader).toHaveText(expectedText); + } + + getConfirmationHeader(): Locator { + return this.completeHeader; + } + + getConfirmationMessage(): Locator { + return this.completeMessage; + } + + getCurrentUrl(): string { + return this.page.url(); + } +} \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/playwright.config.ts b/Playwright-Cucumber-Exercise-main/playwright.config.ts new file mode 100644 index 00000000..7adb387b --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/playwright.config.ts @@ -0,0 +1,9 @@ +import { PlaywrightTestConfig } from '@playwright/test'; + +const config: PlaywrightTestConfig = { + use: { + headless: false, + }, +}; + +export default config; \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/playwrightUtilities.ts b/Playwright-Cucumber-Exercise-main/playwrightUtilities.ts new file mode 100644 index 00000000..93244a29 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/playwrightUtilities.ts @@ -0,0 +1,33 @@ +import { Browser, chromium, Page } from 'playwright'; + +let browser: Browser | null = null; +let page: Page | null = null; +const DEFAULT_TIMEOUT = 30000; + +export const initializeBrowser = async () => { + if (!browser) { + browser = await chromium.launch({ headless: false }); + } +}; + +export const initializePage = async () => { + if (browser && !page) { + page = await browser.newPage(); + page.setDefaultTimeout(DEFAULT_TIMEOUT); + } +}; + +export const getPage = (): Page => { + if (!page) { + throw new Error('Page has not been initialized. Please call initializePage first.'); + } + return page; +}; + +export const closeBrowser = async () => { + if (browser) { + await browser.close(); + browser = null; + page = null; + } +}; \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/steps/common.steps.ts b/Playwright-Cucumber-Exercise-main/steps/common.steps.ts new file mode 100644 index 00000000..c4bee79b --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/steps/common.steps.ts @@ -0,0 +1,6 @@ +import { Given } from "@cucumber/cucumber"; +import { getPage } from "../playwrightUtilities"; + +Given('I open the {string} page', async (url) => { + await getPage().goto(url); + }); \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/steps/login.steps.ts b/Playwright-Cucumber-Exercise-main/steps/login.steps.ts new file mode 100644 index 00000000..c2aa0d80 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/steps/login.steps.ts @@ -0,0 +1,11 @@ +import { Then } from '@cucumber/cucumber'; +import { getPage } from '../playwrightUtilities'; +import { Login } from '../pages/login.page'; + +Then('I should see the title {string}', async (expectedTitle) => { + await new Login(getPage()).validateTitle(expectedTitle); +}); + +Then('I will login as {string}', async (userName) => { + await new Login(getPage()).loginAsUser(userName); +}); \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/steps/logout.steps.ts b/Playwright-Cucumber-Exercise-main/steps/logout.steps.ts new file mode 100644 index 00000000..add75a63 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/steps/logout.steps.ts @@ -0,0 +1,19 @@ +import { Then } from '@cucumber/cucumber'; +import { pageFixture } from '../hooks/pageFixture'; +import { expect } from '@playwright/test'; +import { MenuPage } from '../pages/menu.page'; + +let menuPage: MenuPage; + +Then('I open the menu', async () => { + menuPage = new MenuPage(pageFixture.page); + await menuPage.openMenu(); +}); + +Then('I click logout', async () => { + await menuPage.clickLogout(); +}); + +Then('I should be redirected to login page', async () => { + await expect(pageFixture.page).toHaveURL('https://www.saucedemo.com/'); +}); \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/steps/product.steps.ts b/Playwright-Cucumber-Exercise-main/steps/product.steps.ts new file mode 100644 index 00000000..d9d3ab8b --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/steps/product.steps.ts @@ -0,0 +1,17 @@ +import { Then } from '@cucumber/cucumber'; +import { ProductPage } from '../pages/product.page'; +import { pageFixture } from '../hooks/pageFixture'; + +let productPage: ProductPage; + +Then('I sort the products by {string}', async (sortOption: string) => { + productPage = new ProductPage(pageFixture.page); + await productPage.selectSortOption(sortOption); +}); + +Then( + 'I validate products are sorted by price {string}', + async (sortOption: string) => { + await productPage.validateProductSorting(sortOption); + } +); \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/steps/purchaseSteps.ts b/Playwright-Cucumber-Exercise-main/steps/purchaseSteps.ts new file mode 100644 index 00000000..3caf34d6 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/steps/purchaseSteps.ts @@ -0,0 +1,25 @@ +import { Then } from '@cucumber/cucumber'; +import { PurchasePage } from '../pages/purchasePage'; +import { pageFixture } from '../hooks/pageFixture'; +import { expect } from '@playwright/test'; +import { Product } from '../pages/product.page'; + +let purchasePage: PurchasePage; + +Then('I should see the confirmation header', async () => { + purchasePage = new PurchasePage(pageFixture.page); + const header = await purchasePage.getConfirmationHeader(); + await expect(header).toHaveText('Thank you for your order!'); +}); + +Then('I should see the confirmation message', async () => { + const message = await purchasePage.getConfirmationMessage(); + await expect(message).toContainText( + 'Your order has been dispatched' + ); +}); + +Then('I should be on the checkout complete page', async () => { + const url = await purchasePage.getCurrentUrl(); + await expect(url).toContain('checkout-complete'); +}); \ No newline at end of file diff --git a/Playwright-Cucumber-Exercise-main/tsconfig.json b/Playwright-Cucumber-Exercise-main/tsconfig.json new file mode 100644 index 00000000..9776ba97 --- /dev/null +++ b/Playwright-Cucumber-Exercise-main/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "CommonJS", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "node_modules" + ] + } \ No newline at end of file diff --git a/node_modules/.bin/cucumber-js b/node_modules/.bin/cucumber-js new file mode 100644 index 00000000..6c626054 --- /dev/null +++ b/node_modules/.bin/cucumber-js @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../@cucumber/cucumber/bin/cucumber.js" "$@" +else + exec node "$basedir/../@cucumber/cucumber/bin/cucumber.js" "$@" +fi diff --git a/node_modules/.bin/cucumber-js.cmd b/node_modules/.bin/cucumber-js.cmd new file mode 100644 index 00000000..15e2ea34 --- /dev/null +++ b/node_modules/.bin/cucumber-js.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@cucumber\cucumber\bin\cucumber.js" %* diff --git a/node_modules/.bin/cucumber-js.ps1 b/node_modules/.bin/cucumber-js.ps1 new file mode 100644 index 00000000..753f14f3 --- /dev/null +++ b/node_modules/.bin/cucumber-js.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../@cucumber/cucumber/bin/cucumber.js" $args + } else { + & "$basedir/node$exe" "$basedir/../@cucumber/cucumber/bin/cucumber.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../@cucumber/cucumber/bin/cucumber.js" $args + } else { + & "node$exe" "$basedir/../@cucumber/cucumber/bin/cucumber.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/gherkin-javascript b/node_modules/.bin/gherkin-javascript new file mode 100644 index 00000000..861df298 --- /dev/null +++ b/node_modules/.bin/gherkin-javascript @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../@cucumber/gherkin-streams/bin/gherkin" "$@" +else + exec node "$basedir/../@cucumber/gherkin-streams/bin/gherkin" "$@" +fi diff --git a/node_modules/.bin/gherkin-javascript.cmd b/node_modules/.bin/gherkin-javascript.cmd new file mode 100644 index 00000000..92a8f2f4 --- /dev/null +++ b/node_modules/.bin/gherkin-javascript.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@cucumber\gherkin-streams\bin\gherkin" %* diff --git a/node_modules/.bin/gherkin-javascript.ps1 b/node_modules/.bin/gherkin-javascript.ps1 new file mode 100644 index 00000000..6849c23a --- /dev/null +++ b/node_modules/.bin/gherkin-javascript.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../@cucumber/gherkin-streams/bin/gherkin" $args + } else { + & "$basedir/node$exe" "$basedir/../@cucumber/gherkin-streams/bin/gherkin" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../@cucumber/gherkin-streams/bin/gherkin" $args + } else { + & "node$exe" "$basedir/../@cucumber/gherkin-streams/bin/gherkin" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/gherkin-utils b/node_modules/.bin/gherkin-utils new file mode 100644 index 00000000..6e87fdc2 --- /dev/null +++ b/node_modules/.bin/gherkin-utils @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../@cucumber/gherkin-utils/bin/gherkin-utils" "$@" +else + exec node "$basedir/../@cucumber/gherkin-utils/bin/gherkin-utils" "$@" +fi diff --git a/node_modules/.bin/gherkin-utils.cmd b/node_modules/.bin/gherkin-utils.cmd new file mode 100644 index 00000000..b855b05f --- /dev/null +++ b/node_modules/.bin/gherkin-utils.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@cucumber\gherkin-utils\bin\gherkin-utils" %* diff --git a/node_modules/.bin/gherkin-utils.ps1 b/node_modules/.bin/gherkin-utils.ps1 new file mode 100644 index 00000000..5b7d071b --- /dev/null +++ b/node_modules/.bin/gherkin-utils.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../@cucumber/gherkin-utils/bin/gherkin-utils" $args + } else { + & "$basedir/node$exe" "$basedir/../@cucumber/gherkin-utils/bin/gherkin-utils" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../@cucumber/gherkin-utils/bin/gherkin-utils" $args + } else { + & "node$exe" "$basedir/../@cucumber/gherkin-utils/bin/gherkin-utils" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 100644 index 00000000..7751de3c --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mime/cli.js" "$@" +else + exec node "$basedir/../mime/cli.js" "$@" +fi diff --git a/node_modules/.bin/mime.cmd b/node_modules/.bin/mime.cmd new file mode 100644 index 00000000..54491f12 --- /dev/null +++ b/node_modules/.bin/mime.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mime\cli.js" %* diff --git a/node_modules/.bin/mime.ps1 b/node_modules/.bin/mime.ps1 new file mode 100644 index 00000000..2222f40b --- /dev/null +++ b/node_modules/.bin/mime.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mime/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mime/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mime/cli.js" $args + } else { + & "node$exe" "$basedir/../mime/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 100644 index 00000000..df9a9a4e --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mkdirp/dist/cjs/src/bin.js" "$@" +else + exec node "$basedir/../mkdirp/dist/cjs/src/bin.js" "$@" +fi diff --git a/node_modules/.bin/mkdirp.cmd b/node_modules/.bin/mkdirp.cmd new file mode 100644 index 00000000..90e19d51 --- /dev/null +++ b/node_modules/.bin/mkdirp.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mkdirp\dist\cjs\src\bin.js" %* diff --git a/node_modules/.bin/mkdirp.ps1 b/node_modules/.bin/mkdirp.ps1 new file mode 100644 index 00000000..6d3467bc --- /dev/null +++ b/node_modules/.bin/mkdirp.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mkdirp/dist/cjs/src/bin.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mkdirp/dist/cjs/src/bin.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mkdirp/dist/cjs/src/bin.js" $args + } else { + & "node$exe" "$basedir/../mkdirp/dist/cjs/src/bin.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/playwright b/node_modules/.bin/playwright new file mode 100644 index 00000000..8e4988eb --- /dev/null +++ b/node_modules/.bin/playwright @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../@playwright/test/cli.js" "$@" +else + exec node "$basedir/../@playwright/test/cli.js" "$@" +fi diff --git a/node_modules/.bin/playwright-core b/node_modules/.bin/playwright-core new file mode 100644 index 00000000..bc2c5c8a --- /dev/null +++ b/node_modules/.bin/playwright-core @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../playwright-core/cli.js" "$@" +else + exec node "$basedir/../playwright-core/cli.js" "$@" +fi diff --git a/node_modules/.bin/playwright-core.cmd b/node_modules/.bin/playwright-core.cmd new file mode 100644 index 00000000..11282048 --- /dev/null +++ b/node_modules/.bin/playwright-core.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\playwright-core\cli.js" %* diff --git a/node_modules/.bin/playwright-core.ps1 b/node_modules/.bin/playwright-core.ps1 new file mode 100644 index 00000000..e914b999 --- /dev/null +++ b/node_modules/.bin/playwright-core.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../playwright-core/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../playwright-core/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../playwright-core/cli.js" $args + } else { + & "node$exe" "$basedir/../playwright-core/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/playwright.cmd b/node_modules/.bin/playwright.cmd new file mode 100644 index 00000000..ab9fe6af --- /dev/null +++ b/node_modules/.bin/playwright.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@playwright\test\cli.js" %* diff --git a/node_modules/.bin/playwright.ps1 b/node_modules/.bin/playwright.ps1 new file mode 100644 index 00000000..ccb3b8d9 --- /dev/null +++ b/node_modules/.bin/playwright.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../@playwright/test/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../@playwright/test/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../@playwright/test/cli.js" $args + } else { + & "node$exe" "$basedir/../@playwright/test/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/regexp-tree b/node_modules/.bin/regexp-tree new file mode 100644 index 00000000..e8956074 --- /dev/null +++ b/node_modules/.bin/regexp-tree @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../regexp-tree/bin/regexp-tree" "$@" +else + exec node "$basedir/../regexp-tree/bin/regexp-tree" "$@" +fi diff --git a/node_modules/.bin/regexp-tree.cmd b/node_modules/.bin/regexp-tree.cmd new file mode 100644 index 00000000..7fde5dc4 --- /dev/null +++ b/node_modules/.bin/regexp-tree.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\regexp-tree\bin\regexp-tree" %* diff --git a/node_modules/.bin/regexp-tree.ps1 b/node_modules/.bin/regexp-tree.ps1 new file mode 100644 index 00000000..afc76394 --- /dev/null +++ b/node_modules/.bin/regexp-tree.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../regexp-tree/bin/regexp-tree" $args + } else { + & "$basedir/node$exe" "$basedir/../regexp-tree/bin/regexp-tree" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../regexp-tree/bin/regexp-tree" $args + } else { + & "node$exe" "$basedir/../regexp-tree/bin/regexp-tree" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 100644 index 00000000..97c53279 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd new file mode 100644 index 00000000..9913fa9d --- /dev/null +++ b/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/.bin/semver.ps1 b/node_modules/.bin/semver.ps1 new file mode 100644 index 00000000..314717ad --- /dev/null +++ b/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/yaml b/node_modules/.bin/yaml new file mode 100644 index 00000000..c68b081f --- /dev/null +++ b/node_modules/.bin/yaml @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../yaml/bin.mjs" "$@" +else + exec node "$basedir/../yaml/bin.mjs" "$@" +fi diff --git a/node_modules/.bin/yaml.cmd b/node_modules/.bin/yaml.cmd new file mode 100644 index 00000000..f76090fc --- /dev/null +++ b/node_modules/.bin/yaml.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\yaml\bin.mjs" %* diff --git a/node_modules/.bin/yaml.ps1 b/node_modules/.bin/yaml.ps1 new file mode 100644 index 00000000..68205828 --- /dev/null +++ b/node_modules/.bin/yaml.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../yaml/bin.mjs" $args + } else { + & "$basedir/node$exe" "$basedir/../yaml/bin.mjs" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../yaml/bin.mjs" $args + } else { + & "node$exe" "$basedir/../yaml/bin.mjs" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 00000000..668b8290 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,1319 @@ +{ + "name": "playwrightcheck2", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@cucumber/ci-environment": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-13.0.0.tgz", + "integrity": "sha512-cs+3NzfNkGbcmHPddjEv4TKFiBpZRQ6WJEEufB9mw+ExS22V/4R/zpDSEG+fsJ/iSNCd6A2sATdY8PFOyY3YnA==", + "license": "MIT" + }, + "node_modules/@cucumber/cucumber": { + "version": "12.9.0", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber/-/cucumber-12.9.0.tgz", + "integrity": "sha512-QbgEo/DcKFMRGL+yULh8Kw6peEfdPJjhYjpKp0dYc+6Dv1Bmp6hvxIdTi2CIinYBCXhvCZzNO1Ct/n6Dk1yAtA==", + "license": "MIT", + "dependencies": { + "@cucumber/ci-environment": "13.0.0", + "@cucumber/cucumber-expressions": "19.0.0", + "@cucumber/gherkin": "38.0.0", + "@cucumber/gherkin-streams": "6.0.0", + "@cucumber/gherkin-utils": "11.0.0", + "@cucumber/html-formatter": "23.1.0", + "@cucumber/junit-xml-formatter": "0.13.3", + "@cucumber/message-streams": "4.1.1", + "@cucumber/messages": "32.3.1", + "@cucumber/pretty-formatter": "1.0.1", + "@cucumber/tag-expressions": "9.1.0", + "assertion-error-formatter": "^3.0.0", + "capital-case": "^1.0.4", + "chalk": "^4.1.2", + "cli-table3": "0.6.5", + "commander": "^14.0.0", + "debug": "^4.3.4", + "error-stack-parser": "^2.1.4", + "figures": "^3.2.0", + "glob": "^13.0.0", + "has-ansi": "^4.0.1", + "indent-string": "^4.0.0", + "is-installed-globally": "^0.4.0", + "is-stream": "^2.0.0", + "knuth-shuffle-seeded": "^1.0.6", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "luxon": "3.7.2", + "mkdirp": "^3.0.0", + "mz": "^2.7.0", + "progress": "^2.0.3", + "read-package-up": "^12.0.0", + "semver": "7.7.4", + "string-argv": "0.3.1", + "supports-color": "^8.1.1", + "type-fest": "^4.41.0", + "util-arity": "^1.1.0", + "yaml": "^2.2.2", + "yup": "1.7.1" + }, + "bin": { + "cucumber-js": "bin/cucumber.js" + }, + "engines": { + "node": "20 || 22 || >=24" + }, + "funding": { + "url": "https://opencollective.com/cucumber" + } + }, + "node_modules/@cucumber/cucumber-expressions": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-19.0.0.tgz", + "integrity": "sha512-4FKoOQh2Uf6F6/Ln+1OxuK8LkTg6PyAqekhf2Ix8zqV2M54sH+m7XNJNLhOFOAW/t9nxzRbw2CcvXbCLjcvHZg==", + "license": "MIT", + "dependencies": { + "regexp-match-indices": "1.0.2" + } + }, + "node_modules/@cucumber/gherkin": { + "version": "38.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-38.0.0.tgz", + "integrity": "sha512-duEXK+KDfQUzu3vsSzXjkxQ2tirF5PRsc1Xrts6THKHJO6mjw4RjM8RV+vliuDasmhhrmdLcOcM7d9nurNTJKw==", + "license": "MIT", + "dependencies": { + "@cucumber/messages": ">=31.0.0 <33" + } + }, + "node_modules/@cucumber/gherkin-streams": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin-streams/-/gherkin-streams-6.0.0.tgz", + "integrity": "sha512-HLSHMmdDH0vCr7vsVEURcDA4WwnRLdjkhqr6a4HQ3i4RFK1wiDGPjBGVdGJLyuXuRdJpJbFc6QxHvT8pU4t6jw==", + "license": "MIT", + "dependencies": { + "commander": "14.0.0", + "source-map-support": "0.5.21" + }, + "bin": { + "gherkin-javascript": "bin/gherkin" + }, + "peerDependencies": { + "@cucumber/gherkin": ">=22.0.0", + "@cucumber/message-streams": ">=4.0.0", + "@cucumber/messages": ">=17.1.1" + } + }, + "node_modules/@cucumber/gherkin-streams/node_modules/commander": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.0.tgz", + "integrity": "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==", + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/@cucumber/gherkin-utils": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin-utils/-/gherkin-utils-11.0.0.tgz", + "integrity": "sha512-LJ+s4+TepHTgdKWDR4zbPyT7rQjmYIcukTwNbwNwgqr6i8Gjcmzf6NmtbYDA19m1ZFg6kWbFsmHnj37ZuX+kZA==", + "license": "MIT", + "dependencies": { + "@cucumber/gherkin": "^38.0.0", + "@cucumber/messages": "^32.0.0", + "@teppeis/multimaps": "3.0.0", + "commander": "14.0.2", + "source-map-support": "^0.5.21" + }, + "bin": { + "gherkin-utils": "bin/gherkin-utils" + } + }, + "node_modules/@cucumber/gherkin-utils/node_modules/commander": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", + "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/@cucumber/html-formatter": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-23.1.0.tgz", + "integrity": "sha512-DcCSFoGs6jbwzXPgX1CwgJKEE+ZMcIEzq/0Memg0o24maNn9NJizBFHmoFWG4iv/OxHza+mvc+56cTHetfHndw==", + "license": "MIT", + "peerDependencies": { + "@cucumber/messages": ">=18" + } + }, + "node_modules/@cucumber/junit-xml-formatter": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@cucumber/junit-xml-formatter/-/junit-xml-formatter-0.13.3.tgz", + "integrity": "sha512-w9ujOxiuKDtU6fLzJz+wp4Sgp5Xu6ba7ls00LHJccVmQU0Ba7zs+AHnv3iIgPjKZAQe1w8x93dr8Gaubh7Vqkg==", + "license": "MIT", + "dependencies": { + "@cucumber/query": "^15.0.1", + "@teppeis/multimaps": "^3.0.0", + "luxon": "^3.5.0", + "xmlbuilder": "^15.1.1" + }, + "peerDependencies": { + "@cucumber/messages": "*" + } + }, + "node_modules/@cucumber/message-streams": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cucumber/message-streams/-/message-streams-4.1.1.tgz", + "integrity": "sha512-QCAntLajesWMyX+mZKrj63YghVAts7yKFlZe46XprLbdJZN0ddB+f/Mr9OnyWKC2DHhJ18jzCfKIFCaqpAmUxg==", + "license": "MIT", + "dependencies": { + "mime": "^3.0.0" + }, + "peerDependencies": { + "@cucumber/messages": ">=17.1.1" + } + }, + "node_modules/@cucumber/messages": { + "version": "32.3.1", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-32.3.1.tgz", + "integrity": "sha512-yNQq1KoXRYaEKrWMFmpUQX7TdeQuU9jeGgJAZ3dArTsC/T4NpJ6DnqaJIIgwPnz/wtQIQTNX7/h0rOuF5xY4qQ==", + "license": "MIT", + "dependencies": { + "class-transformer": "0.5.1", + "reflect-metadata": "0.2.2" + } + }, + "node_modules/@cucumber/pretty-formatter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/pretty-formatter/-/pretty-formatter-1.0.1.tgz", + "integrity": "sha512-A1lU4VVP0aUWdOTmpdzvXOyEYuPtBDI0xYwYJnmoMDplzxMdhcHk86lyyvYDoMoPzzq6OkOE3isuosvUU4X7IQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^5.0.0", + "cli-table3": "^0.6.0", + "figures": "^3.2.0", + "ts-dedent": "^2.0.0" + }, + "peerDependencies": { + "@cucumber/cucumber": ">=7.0.0", + "@cucumber/messages": "*" + } + }, + "node_modules/@cucumber/query": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/query/-/query-15.0.1.tgz", + "integrity": "sha512-FMfT3orJblRsOxvU2doECBvQmauizYlj+5JsM8atAKKPbnQTj7v2/OrnuykvQpfZNBf19DYbRq1e832vllRP/g==", + "license": "MIT", + "dependencies": { + "@teppeis/multimaps": "3.0.0", + "lodash.sortby": "^4.7.0" + }, + "peerDependencies": { + "@cucumber/messages": "*" + } + }, + "node_modules/@cucumber/tag-expressions": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-9.1.0.tgz", + "integrity": "sha512-bvHjcRFZ+J1TqIa9eFNO1wGHqwx4V9ZKV3hYgkuK/VahHx73uiP4rKV3JVrvWSMrwrFvJG6C8aEwnCWSvbyFdQ==", + "license": "MIT" + }, + "node_modules/@playwright/test": { + "version": "1.61.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.0.tgz", + "integrity": "sha512-cKA5B6lpFEMyMGjxF54QihfYpB4FkEGH+qZhtArDEG+wezQAJY8Pq6C7T1SjWz+FFzt3TbyoXBQYk/0292TdJA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.61.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@teppeis/multimaps": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@teppeis/multimaps/-/multimaps-3.0.0.tgz", + "integrity": "sha512-ID7fosbc50TbT0MK0EG12O+gAP3W3Aa/Pz4DaTtQtEvlc9Odaqi0de+xuZ7Li2GtK4HzEX7IuRWS/JmZLksR3Q==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "license": "MIT" + }, + "node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "license": "MIT" + }, + "node_modules/assertion-error-formatter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/assertion-error-formatter/-/assertion-error-formatter-3.0.0.tgz", + "integrity": "sha512-6YyAVLrEze0kQ7CmJfUgrLHb+Y7XghmL2Ie7ijVa2Y9ynP3LV+VDiwFk62Dn0qtqbmY0BT0ss6p1xxpiF2PYbQ==", + "license": "MIT", + "dependencies": { + "diff": "^4.0.1", + "pad-right": "^0.2.2", + "repeat-string": "^1.6.1" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/class-transformer": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", + "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==", + "license": "MIT" + }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/diff": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up-simple": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", + "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/global-dirs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "license": "MIT", + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-ansi": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-4.0.1.tgz", + "integrity": "sha512-Qr4RtTm30xvEdqUXbSBVWDu+PrTokJOwe/FU+VdfJPk+MXAPoeOzKpRyrDTnZIJwAkQ4oBLTU53nu0HrkF/Z2A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hosted-git-info": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-9.0.3.tgz", + "integrity": "sha512-Hc+ghLoSt6QaYZUv0WBiIvmMDZuZZ7oaDvdH8MbfOO4lOsxdXLEvuC6ePoGs9H1X9oCLyq6+NVN0MKqD+ydxyg==", + "license": "ISC", + "dependencies": { + "lru-cache": "^11.1.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/index-to-position": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz", + "integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "license": "MIT", + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/knuth-shuffle-seeded": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/knuth-shuffle-seeded/-/knuth-shuffle-seeded-1.0.6.tgz", + "integrity": "sha512-9pFH0SplrfyKyojCLxZfMcvkhf5hH0d+UwR9nTVJ/DDQJGuzcXjTwB7TP7sDfehSudlGGaOLblmEWqv04ERVWg==", + "license": "Apache-2.0", + "dependencies": { + "seed-random": "~2.2.0" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" + }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "license": "MIT" + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "license": "MIT" + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/lru-cache": { + "version": "11.5.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz", + "integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==", + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/luxon": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", + "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "license": "MIT", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/normalize-package-data": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-8.0.0.tgz", + "integrity": "sha512-RWk+PI433eESQ7ounYxIp67CYuVsS1uYSonX3kA6ps/3LWfjVQa/ptEg6Y3T6uAMq1mWpX9PQ+qx+QaHpsc7gQ==", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^9.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pad-right": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", + "integrity": "sha512-4cy8M95ioIGolCoMmm2cMntGR1lPLEbOMzOKu8bzjuJP6JpzEMQcDHmh7hHLYGgob+nKe1YHFMaG4V59HQa89g==", + "license": "MIT", + "dependencies": { + "repeat-string": "^1.5.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse-json": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/playwright": { + "version": "1.61.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.0.tgz", + "integrity": "sha512-Z+7BeeqQPRRzklHsVFP4KTGIyMxKUmfeRA4WisM6G3/XW6nwGeX6fX9qYaDa+CiUqpOkb2f6X3nar05R3kSuJQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.61.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.61.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.0.tgz", + "integrity": "sha512-caX7TrY3Ml6egyDX0WUcTHDxodl/b51y5wJOdCEA36QviK/s2g081hvmGs8eaE3DWb6NYZQ6BjO/QkNRPenoPA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/property-expr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.6.tgz", + "integrity": "sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==", + "license": "MIT" + }, + "node_modules/read-package-up": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-12.0.0.tgz", + "integrity": "sha512-Q5hMVBYur/eQNWDdbF4/Wqqr9Bjvtrw2kjGxxBbKLbx8bVCL8gcArjTy8zDUuLGQicftpMuU0riQNcAsbtOVsw==", + "license": "MIT", + "dependencies": { + "find-up-simple": "^1.0.1", + "read-pkg": "^10.0.0", + "type-fest": "^5.2.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-package-up/node_modules/type-fest": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.7.0.tgz", + "integrity": "sha512-1URUxUqfHFM1c+zfSPsa3gnkO7Aq21qyH75SIduNYz4SzY964rn1X2vCMQaHSHhktiw+0kPa2iyb6PUpXqB6Vg==", + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-10.1.0.tgz", + "integrity": "sha512-I8g2lArQiP78ll51UeMZojewtYgIRCKCWqZEgOO8c/uefTI+XDXvCSXu3+YNUaTNvZzobrL5+SqHjBrByRRTdg==", + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.4", + "normalize-package-data": "^8.0.0", + "parse-json": "^8.3.0", + "type-fest": "^5.4.4", + "unicorn-magic": "^0.4.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.7.0.tgz", + "integrity": "sha512-1URUxUqfHFM1c+zfSPsa3gnkO7Aq21qyH75SIduNYz4SzY964rn1X2vCMQaHSHhktiw+0kPa2iyb6PUpXqB6Vg==", + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0" + }, + "node_modules/regexp-match-indices": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regexp-match-indices/-/regexp-match-indices-1.0.2.tgz", + "integrity": "sha512-DwZuAkt8NF5mKwGGER1EGh2PRqyvhRhhLviH+R8y8dIuaQROlUfXjt4s9ZTXstIsSkptf06BSvwcEmmfheJJWQ==", + "license": "Apache-2.0", + "dependencies": { + "regexp-tree": "^0.1.11" + } + }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "license": "MIT", + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/seed-random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", + "integrity": "sha512-34EQV6AAHQGhoc0tn/96a9Fsi6v2xdqe/dMUwljGRaFOzR3EgRmECvD0O8vi8X+/uQ50LGHfkNu/Eue5TPKZkQ==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.23", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.23.tgz", + "integrity": "sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==", + "license": "CC0-1.0" + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "license": "MIT" + }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tagged-tag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz", + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tiny-case": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz", + "integrity": "sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==", + "license": "MIT" + }, + "node_modules/toposort": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", + "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==", + "license": "MIT" + }, + "node_modules/ts-dedent": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.3.0.tgz", + "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==", + "license": "MIT", + "engines": { + "node": ">=6.10" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/unicorn-magic": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.0.tgz", + "integrity": "sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/util-arity": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/util-arity/-/util-arity-1.1.0.tgz", + "integrity": "sha512-kkyIsXKwemfSy8ZEoaIz06ApApnWsk5hQO0vLjZS6UkBiGiW++Jsyb8vSBoc0WKlffGoGs5yYy/j5pp8zckrFA==", + "license": "MIT" + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", + "license": "MIT", + "engines": { + "node": ">=8.0" + } + }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/yup": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/yup/-/yup-1.7.1.tgz", + "integrity": "sha512-GKHFX2nXul2/4Dtfxhozv701jLQHdf6J34YDh2cEkpqoo8le5Mg6/LrdseVLrFarmFygZTlfIhHx/QKfb/QWXw==", + "license": "MIT", + "dependencies": { + "property-expr": "^2.0.5", + "tiny-case": "^1.0.3", + "toposort": "^2.0.2", + "type-fest": "^2.19.0" + } + }, + "node_modules/yup/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/node_modules/@babel/code-frame/LICENSE b/node_modules/@babel/code-frame/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/code-frame/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/code-frame/README.md b/node_modules/@babel/code-frame/README.md new file mode 100644 index 00000000..71607551 --- /dev/null +++ b/node_modules/@babel/code-frame/README.md @@ -0,0 +1,19 @@ +# @babel/code-frame + +> Generate errors that contain a code frame that point to source locations. + +See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/code-frame +``` + +or using yarn: + +```sh +yarn add @babel/code-frame --dev +``` diff --git a/node_modules/@babel/code-frame/lib/index.js b/node_modules/@babel/code-frame/lib/index.js new file mode 100644 index 00000000..9c5db406 --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js @@ -0,0 +1,217 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var picocolors = require('picocolors'); +var jsTokens = require('js-tokens'); +var helperValidatorIdentifier = require('@babel/helper-validator-identifier'); + +function isColorSupported() { + return (typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported + ); +} +const compose = (f, g) => v => f(g(v)); +function buildDefs(colors) { + return { + keyword: colors.cyan, + capitalized: colors.yellow, + jsxIdentifier: colors.yellow, + punctuator: colors.yellow, + number: colors.magenta, + string: colors.green, + regex: colors.magenta, + comment: colors.gray, + invalid: compose(compose(colors.white, colors.bgRed), colors.bold), + gutter: colors.gray, + marker: compose(colors.red, colors.bold), + message: compose(colors.red, colors.bold), + reset: colors.reset + }; +} +const defsOn = buildDefs(picocolors.createColors(true)); +const defsOff = buildDefs(picocolors.createColors(false)); +function getDefs(enabled) { + return enabled ? defsOn : defsOff; +} + +const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); +const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/; +const BRACKET = /^[()[\]{}]$/; +let tokenize; +const JSX_TAG = /^[a-z][\w-]*$/i; +const getTokenType = function (token, offset, text) { + if (token.type === "name") { + const tokenValue = token.value; + if (helperValidatorIdentifier.isKeyword(tokenValue) || helperValidatorIdentifier.isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) { + return "keyword"; + } + if (JSX_TAG.test(tokenValue) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === " defs[type](str)).join("\n"); + } else { + highlighted += value; + } + } + return highlighted; +} + +let deprecationWarningShown = false; +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +function getMarkerLines(loc, source, opts, startLineBaseZero) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line - startLineBaseZero; + const startColumn = startLoc.column; + const endLine = endLoc.line - startLineBaseZero; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + if (startLine === -1) { + start = 0; + } + if (endLine === -1) { + end = source.length; + } + const lineDiff = endLine - startLine; + const markerLines = {}; + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + return { + start, + end, + markerLines + }; +} +function codeFrameColumns(rawLines, loc, opts = {}) { + const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode; + const startLineBaseZero = (opts.startLine || 1) - 1; + const defs = getDefs(shouldHighlight); + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts, startLineBaseZero); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end + startLineBaseZero).length; + const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines; + let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number + startLineBaseZero}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join(""); + if (lastMarkerLine && opts.message) { + markerLine += " " + defs.message(opts.message); + } + } + return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); + } else { + return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`; + } + }).join("\n"); + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; + } + if (shouldHighlight) { + return defs.reset(frame); + } else { + return frame; + } +} +function index (rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); +} + +exports.codeFrameColumns = codeFrameColumns; +exports.default = index; +exports.highlight = highlight; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/code-frame/lib/index.js.map b/node_modules/@babel/code-frame/lib/index.js.map new file mode 100644 index 00000000..6b85ae49 --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/defs.ts","../src/highlight.ts","../src/index.ts"],"sourcesContent":["import picocolors, { createColors } from \"picocolors\";\nimport type { Colors, Formatter } from \"picocolors/types\";\n\nexport function isColorSupported() {\n return (\n // See https://github.com/alexeyraspopov/picocolors/issues/62\n typeof process === \"object\" &&\n (process.env.FORCE_COLOR === \"0\" || process.env.FORCE_COLOR === \"false\")\n ? false\n : picocolors.isColorSupported\n );\n}\n\nexport type InternalTokenType =\n | \"keyword\"\n | \"capitalized\"\n | \"jsxIdentifier\"\n | \"punctuator\"\n | \"number\"\n | \"string\"\n | \"regex\"\n | \"comment\"\n | \"invalid\";\n\ntype UITokens = \"gutter\" | \"marker\" | \"message\";\n\nexport type Defs = Record;\n\nconst compose: (f: (gv: U) => V, g: (v: T) => U) => (v: T) => V =\n (f, g) => v =>\n f(g(v));\n\n/**\n * Styles for token types.\n */\nfunction buildDefs(colors: Colors): Defs {\n return {\n keyword: colors.cyan,\n capitalized: colors.yellow,\n jsxIdentifier: colors.yellow,\n punctuator: colors.yellow,\n number: colors.magenta,\n string: colors.green,\n regex: colors.magenta,\n comment: colors.gray,\n invalid: compose(compose(colors.white, colors.bgRed), colors.bold),\n\n gutter: colors.gray,\n marker: compose(colors.red, colors.bold),\n message: compose(colors.red, colors.bold),\n\n reset: colors.reset,\n };\n}\n\nconst defsOn = buildDefs(createColors(true));\nconst defsOff = buildDefs(createColors(false));\n\nexport function getDefs(enabled: boolean): Defs {\n return enabled ? defsOn : defsOff;\n}\n","import type { Token as JSToken, JSXToken } from \"js-tokens\";\nimport jsTokens from \"js-tokens\";\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\nimport {\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nimport { getDefs, type InternalTokenType } from \"./defs.ts\";\n\n/**\n * Names that are always allowed as identifiers, but also appear as keywords\n * within certain syntactic productions.\n *\n * https://tc39.es/ecma262/#sec-keywords-and-reserved-words\n *\n * `target` has been omitted since it is very likely going to be a false\n * positive.\n */\nconst sometimesKeywords = new Set([\"as\", \"async\", \"from\", \"get\", \"of\", \"set\"]);\n\ntype Token = {\n type: InternalTokenType | \"uncolored\";\n value: string;\n};\n\n/**\n * RegExp to test for newlines in terminal.\n */\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * RegExp to test for the three types of brackets.\n */\nconst BRACKET = /^[()[\\]{}]$/;\n\nlet tokenize: (\n text: string,\n) => Generator<{ type: InternalTokenType | \"uncolored\"; value: string }>;\n\nif (process.env.BABEL_8_BREAKING) {\n /**\n * Get the type of token, specifying punctuator type.\n */\n const getTokenType = function (\n token: JSToken | JSXToken,\n ): InternalTokenType | \"uncolored\" {\n if (token.type === \"IdentifierName\") {\n const tokenValue = token.value;\n if (\n isKeyword(tokenValue) ||\n isStrictReservedWord(tokenValue, true) ||\n sometimesKeywords.has(tokenValue)\n ) {\n return \"keyword\";\n }\n\n const firstChar = tokenValue.charCodeAt(0);\n if (firstChar < 128) {\n // ASCII characters\n if (\n firstChar >= charCodes.uppercaseA &&\n firstChar <= charCodes.uppercaseZ\n ) {\n return \"capitalized\";\n }\n } else {\n const firstChar = String.fromCodePoint(tokenValue.codePointAt(0));\n if (firstChar !== firstChar.toLowerCase()) {\n return \"capitalized\";\n }\n }\n }\n\n if (token.type === \"Punctuator\" && BRACKET.test(token.value)) {\n return \"uncolored\";\n }\n\n if (token.type === \"Invalid\" && token.value === \"@\") {\n return \"punctuator\";\n }\n\n switch (token.type) {\n case \"NumericLiteral\":\n return \"number\";\n\n case \"StringLiteral\":\n case \"JSXString\":\n case \"NoSubstitutionTemplate\":\n return \"string\";\n\n case \"RegularExpressionLiteral\":\n return \"regex\";\n\n case \"Punctuator\":\n case \"JSXPunctuator\":\n return \"punctuator\";\n\n case \"MultiLineComment\":\n case \"SingleLineComment\":\n return \"comment\";\n\n case \"Invalid\":\n case \"JSXInvalid\":\n return \"invalid\";\n\n case \"JSXIdentifier\":\n return \"jsxIdentifier\";\n\n default:\n return \"uncolored\";\n }\n };\n\n /**\n * Turn a string of JS into an array of objects.\n */\n tokenize = function* (text: string): Generator {\n for (const token of jsTokens(text, { jsx: true })) {\n switch (token.type) {\n case \"TemplateHead\":\n yield { type: \"string\", value: token.value.slice(0, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateMiddle\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1, -2) };\n yield { type: \"punctuator\", value: \"${\" };\n break;\n\n case \"TemplateTail\":\n yield { type: \"punctuator\", value: \"}\" };\n yield { type: \"string\", value: token.value.slice(1) };\n break;\n\n default:\n yield {\n type: getTokenType(token),\n value: token.value,\n };\n }\n }\n };\n} else {\n /**\n * RegExp to test for what seems to be a JSX tag name.\n */\n const JSX_TAG = /^[a-z][\\w-]*$/i;\n\n // The token here is defined in js-tokens@4. However we don't bother\n // typing it since the whole block will be removed in Babel 8\n const getTokenType = function (token: any, offset: number, text: string) {\n if (token.type === \"name\") {\n const tokenValue = token.value;\n if (\n isKeyword(tokenValue) ||\n isStrictReservedWord(tokenValue, true) ||\n sometimesKeywords.has(tokenValue)\n ) {\n return \"keyword\";\n }\n\n if (\n JSX_TAG.test(tokenValue) &&\n (text[offset - 1] === \"<\" || text.slice(offset - 2, offset) === \" defs[type as InternalTokenType](str))\n .join(\"\\n\");\n } else {\n highlighted += value;\n }\n }\n\n return highlighted;\n}\n","import { getDefs, isColorSupported } from \"./defs.ts\";\nimport { highlight } from \"./highlight.ts\";\n\nexport { highlight };\n\nlet deprecationWarningShown = false;\n\ntype Location = {\n column: number;\n line: number;\n};\n\ntype NodeLocation = {\n end?: Location;\n start: Location;\n};\n\nexport interface Options {\n /** Syntax highlight the code as JavaScript for terminals. default: false */\n highlightCode?: boolean;\n /** The number of lines to show above the error. default: 2 */\n linesAbove?: number;\n /** The number of lines to show below the error. default: 3 */\n linesBelow?: number;\n /** The line number corresponding to the first line in `rawLines`. default: 1 */\n startLine?: number;\n /**\n * Forcibly syntax highlight the code as JavaScript (for non-terminals);\n * overrides highlightCode.\n * default: false\n */\n forceColor?: boolean;\n /**\n * Pass in a string to be displayed inline (if possible) next to the\n * highlighted location in the code. If it can't be positioned inline,\n * it will be placed above the code frame.\n * default: nothing\n */\n message?: string;\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\n\ntype MarkerLines = Record;\n\nfunction getMarkerLines(\n loc: NodeLocation,\n source: string[],\n opts: Options,\n startLineBaseZero: number,\n): {\n start: number;\n end: number;\n markerLines: MarkerLines;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start,\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end,\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line - startLineBaseZero;\n const startColumn = startLoc.column;\n const endLine = endLoc.line - startLineBaseZero;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines: MarkerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return { start, end, markerLines };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: Options = {},\n): string {\n const shouldHighlight =\n opts.forceColor || (isColorSupported() && opts.highlightCode);\n const startLineBaseZero = (opts.startLine || 1) - 1;\n const defs = getDefs(shouldHighlight);\n\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(\n loc,\n lines,\n opts,\n startLineBaseZero,\n );\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n\n const numberMaxWidth = String(end + startLineBaseZero).length;\n\n const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;\n\n let frame = highlightedLines\n .split(NEWLINE, end)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number + startLineBaseZero}`.slice(\n -numberMaxWidth,\n );\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n defs.gutter(gutter.replace(/\\d/g, \" \")),\n \" \",\n markerSpacing,\n defs.marker(\"^\").repeat(numberOfMarkers),\n ].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + defs.message(opts.message);\n }\n }\n return [\n defs.marker(\">\"),\n defs.gutter(gutter),\n line.length > 0 ? ` ${line}` : \"\",\n markerLine,\n ].join(\"\");\n } else {\n return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : \"\"}`;\n }\n })\n .join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (shouldHighlight) {\n return defs.reset(frame);\n } else {\n return frame;\n }\n}\n\n/**\n * Create a code frame, adding line numbers, code highlighting, and pointing to a given position.\n */\n\nexport default function (\n rawLines: string,\n lineNumber: number,\n colNumber?: number | null,\n opts: Options = {},\n): string {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n\n const message =\n \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n // A string is directly supplied to emitWarning, because when supplying an\n // Error object node throws in the tests because of different contexts\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n\n const location: NodeLocation = {\n start: { column: colNumber, line: lineNumber },\n };\n\n return codeFrameColumns(rawLines, location, opts);\n}\n"],"names":["isColorSupported","process","env","FORCE_COLOR","picocolors","compose","f","g","v","buildDefs","colors","keyword","cyan","capitalized","yellow","jsxIdentifier","punctuator","number","magenta","string","green","regex","comment","gray","invalid","white","bgRed","bold","gutter","marker","red","message","reset","defsOn","createColors","defsOff","getDefs","enabled","sometimesKeywords","Set","NEWLINE","BRACKET","tokenize","JSX_TAG","getTokenType","token","offset","text","type","tokenValue","value","isKeyword","isStrictReservedWord","has","test","slice","firstChar","String","fromCodePoint","codePointAt","toLowerCase","match","jsTokens","default","exec","matchToToken","index","highlight","defs","highlighted","split","map","str","join","deprecationWarningShown","getMarkerLines","loc","source","opts","startLineBaseZero","startLoc","Object","assign","column","line","start","endLoc","end","linesAbove","linesBelow","startLine","startColumn","endLine","endColumn","Math","max","min","length","lineDiff","markerLines","i","lineNumber","sourceLength","codeFrameColumns","rawLines","shouldHighlight","forceColor","highlightCode","lines","hasColumns","numberMaxWidth","highlightedLines","frame","paddedNumber","hasMarker","lastMarkerLine","markerLine","Array","isArray","markerSpacing","replace","numberOfMarkers","repeat","colNumber","emitWarning","deprecationError","Error","name","console","warn","location"],"mappings":";;;;;;;;AAGO,SAASA,gBAAgBA,GAAG;EACjC,QAEE,OAAOC,OAAO,KAAK,QAAQ,KACxBA,OAAO,CAACC,GAAG,CAACC,WAAW,KAAK,GAAG,IAAIF,OAAO,CAACC,GAAG,CAACC,WAAW,KAAK,OAAO,CAAC,GACtE,KAAK,GACLC,UAAU,CAACJ,gBAAAA;AAAgB,IAAA;AAEnC,CAAA;AAiBA,MAAMK,OAAkE,GACtEA,CAACC,CAAC,EAAEC,CAAC,KAAKC,CAAC,IACTF,CAAC,CAACC,CAAC,CAACC,CAAC,CAAC,CAAC,CAAA;AAKX,SAASC,SAASA,CAACC,MAAc,EAAQ;EACvC,OAAO;IACLC,OAAO,EAAED,MAAM,CAACE,IAAI;IACpBC,WAAW,EAAEH,MAAM,CAACI,MAAM;IAC1BC,aAAa,EAAEL,MAAM,CAACI,MAAM;IA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CAAA;MAC5CC,OAAO,CAACC,IAAI,CAAC,IAAIH,KAAK,CAAC/F,OAAO,CAAC,CAAC,CAAA;AAClC,KAAA;AACF,GAAA;EAEA4F,SAAS,GAAG7B,IAAI,CAACC,GAAG,CAAC4B,SAAS,EAAE,CAAC,CAAC,CAAA;AAElC,EAAA,MAAMO,QAAsB,GAAG;AAC7B7C,IAAAA,KAAK,EAAE;AAAEF,MAAAA,MAAM,EAAEwC,SAAS;AAAEvC,MAAAA,IAAI,EAAEiB,UAAAA;AAAW,KAAA;GAC9C,CAAA;AAED,EAAA,OAAOE,gBAAgB,CAACC,QAAQ,EAAE0B,QAAQ,EAAEpD,IAAI,CAAC,CAAA;AACnD;;;;;;"} \ No newline at end of file diff --git a/node_modules/@babel/code-frame/package.json b/node_modules/@babel/code-frame/package.json new file mode 100644 index 00000000..1f21a379 --- /dev/null +++ b/node_modules/@babel/code-frame/package.json @@ -0,0 +1,32 @@ +{ + "name": "@babel/code-frame", + "version": "7.29.7", + "description": "Generate errors that contain a code frame that point to source locations.", + "author": "The Babel Team (https://babel.dev/team)", + "homepage": "https://babel.dev/docs/en/next/babel-code-frame", + "bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-code-frame" + }, + "main": "./lib/index.js", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "devDependencies": { + "charcodes": "^0.2.0", + "import-meta-resolve": "^4.1.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/LICENSE b/node_modules/@babel/helper-validator-identifier/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/helper-validator-identifier/README.md b/node_modules/@babel/helper-validator-identifier/README.md new file mode 100644 index 00000000..05c19e64 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/README.md @@ -0,0 +1,19 @@ +# @babel/helper-validator-identifier + +> Validate identifier/keywords name + +See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/babel-helper-validator-identifier) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/helper-validator-identifier +``` + +or using yarn: + +```sh +yarn add @babel/helper-validator-identifier +``` diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/node_modules/@babel/helper-validator-identifier/lib/identifier.js new file mode 100644 index 00000000..b12e6e4b --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/identifier.js @@ -0,0 +1,70 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isIdentifierChar = isIdentifierChar; +exports.isIdentifierName = isIdentifierName; +exports.isIdentifierStart = isIdentifierStart; +let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088f\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7dc\ua7f1-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1add\u1ae0-\u1aeb\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; +const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; +const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489]; +const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; +function isInAstralSet(code, set) { + let pos = 0x10000; + for (let i = 0, length = set.length; i < length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } + return false; +} +function isIdentifierStart(code) { + if (code < 65) return code === 36; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes); +} +function isIdentifierChar(code) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code <= 90) return true; + if (code < 97) return code === 95; + if (code <= 122) return true; + if (code <= 0xffff) { + return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} +function isIdentifierName(name) { + let isFirst = true; + for (let i = 0; i < name.length; i++) { + let cp = name.charCodeAt(i); + if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { + const trail = name.charCodeAt(++i); + if ((trail & 0xfc00) === 0xdc00) { + cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); + } + } + if (isFirst) { + isFirst = false; + if (!isIdentifierStart(cp)) { + return false; + } + } else if (!isIdentifierChar(cp)) { + return false; + } + } + return !isFirst; +} + +//# sourceMappingURL=identifier.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map new file mode 100644 index 00000000..71d32ff2 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map @@ -0,0 +1 @@ +{"version":3,"names":["nonASCIIidentifierStartChars","nonASCIIidentifierChars","nonASCIIidentifierStart","RegExp","nonASCIIidentifier","astralIdentifierStartCodes","astralIdentifierCodes","isInAstralSet","code","set","pos","i","length","isIdentifierStart","test","String","fromCharCode","isIdentifierChar","isIdentifierName","name","isFirst","cp","charCodeAt","trail"],"sources":["../src/identifier.ts"],"sourcesContent":["// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point between 0x80 and 0xffff.\n// Generated by `scripts/generate-identifier-regex.cjs`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.cjs`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: readonly number[]): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n\n// Test whether a given string is a valid identifier name\n\nexport function isIdentifierName(name: string): boolean {\n let isFirst = true;\n for (let i = 0; i < name.length; i++) {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `name` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = name.charCodeAt(i);\n if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {\n const trail = name.charCodeAt(++i);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n if (isFirst) {\n isFirst = false;\n if (!isIdentifierStart(cp)) {\n return false;\n }\n } else if (!isIdentifierChar(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3B,IAAI,CAACU,EAAE,GAAG,MAAM,MAAM,MAAM,IAAIV,CAAC,GAAG,CAAC,GAAGQ,IAAI,CAACP,MAAM,EAAE;MACnD,MAAMW,KAAK,GAAGJ,IAAI,CAACG,UAAU,CAAC,EAAEX,CAAC,CAAC;MAClC,IAAI,CAACY,KAAK,GAAG,MAAM,MAAM,MAAM,EAAE;QAC/BF,EAAE,GAAG,OAAO,IAAI,CAACA,EAAE,GAAG,KAAK,KAAK,EAAE,CAAC,IAAIE,KAAK,GAAG,KAAK,CAAC;MACvD;IACF;IACA,IAAIH,OAAO,EAAE;MACXA,OAAO,GAAG,KAAK;MACf,IAAI,CAACP,iBAAiB,CAACQ,EAAE,CAAC,EAAE;QAC1B,OAAO,KAAK;MACd;IACF,CAAC,MAAM,IAAI,CAACJ,gBAAgB,CAACI,EAAE,CAAC,EAAE;MAChC,OAAO,KAAK;IACd;EACF;EACA,OAAO,CAACD,OAAO;AACjB","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js b/node_modules/@babel/helper-validator-identifier/lib/index.js new file mode 100644 index 00000000..76b22822 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/index.js @@ -0,0 +1,57 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "isIdentifierChar", { + enumerable: true, + get: function () { + return _identifier.isIdentifierChar; + } +}); +Object.defineProperty(exports, "isIdentifierName", { + enumerable: true, + get: function () { + return _identifier.isIdentifierName; + } +}); +Object.defineProperty(exports, "isIdentifierStart", { + enumerable: true, + get: function () { + return _identifier.isIdentifierStart; + } +}); +Object.defineProperty(exports, "isKeyword", { + enumerable: true, + get: function () { + return _keyword.isKeyword; + } +}); +Object.defineProperty(exports, "isReservedWord", { + enumerable: true, + get: function () { + return _keyword.isReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindOnlyReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindOnlyReservedWord; + } +}); +Object.defineProperty(exports, "isStrictBindReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictBindReservedWord; + } +}); +Object.defineProperty(exports, "isStrictReservedWord", { + enumerable: true, + get: function () { + return _keyword.isStrictReservedWord; + } +}); +var _identifier = require("./identifier.js"); +var _keyword = require("./keyword.js"); + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/index.js.map b/node_modules/@babel/helper-validator-identifier/lib/index.js.map new file mode 100644 index 00000000..d985f3b9 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_identifier","require","_keyword"],"sources":["../src/index.ts"],"sourcesContent":["export {\n isIdentifierName,\n isIdentifierChar,\n isIdentifierStart,\n} from \"./identifier.ts\";\nexport {\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"./keyword.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/node_modules/@babel/helper-validator-identifier/lib/keyword.js new file mode 100644 index 00000000..054cf847 --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/keyword.js @@ -0,0 +1,35 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isKeyword = isKeyword; +exports.isReservedWord = isReservedWord; +exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; +exports.isStrictBindReservedWord = isStrictBindReservedWord; +exports.isStrictReservedWord = isStrictReservedWord; +const reservedWords = { + keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], + strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], + strictBind: ["eval", "arguments"] +}; +const keywords = new Set(reservedWords.keyword); +const reservedWordsStrictSet = new Set(reservedWords.strict); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); +function isReservedWord(word, inModule) { + return inModule && word === "await" || word === "enum"; +} +function isStrictReservedWord(word, inModule) { + return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); +} +function isStrictBindOnlyReservedWord(word) { + return reservedWordsStrictBindSet.has(word); +} +function isStrictBindReservedWord(word, inModule) { + return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); +} +function isKeyword(word) { + return keywords.has(word); +} + +//# sourceMappingURL=keyword.js.map diff --git a/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map new file mode 100644 index 00000000..3471f78c --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map @@ -0,0 +1 @@ +{"version":3,"names":["reservedWords","keyword","strict","strictBind","keywords","Set","reservedWordsStrictSet","reservedWordsStrictBindSet","isReservedWord","word","inModule","isStrictReservedWord","has","isStrictBindOnlyReservedWord","isStrictBindReservedWord","isKeyword"],"sources":["../src/keyword.ts"],"sourcesContent":["const reservedWords = {\n keyword: [\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n ],\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\nconst keywords = new Set(reservedWords.keyword);\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport function isReservedWord(word: string, inModule: boolean): boolean {\n return (inModule && word === \"await\") || word === \"enum\";\n}\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG;EACpBC,OAAO,EAAE,CACP,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,CACT;EACDC,MAAM,EAAE,CACN,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,CACR;EACDC,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW;AAClC,CAAC;AACD,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAACL,aAAa,CAACC,OAAO,CAAC;AAC/C,MAAMK,sBAAsB,GAAG,IAAID,GAAG,CAACL,aAAa,CAACE,MAAM,CAAC;AAC5D,MAAMK,0BAA0B,GAAG,IAAIF,GAAG,CAACL,aAAa,CAACG,UAAU,CAAC;AAK7D,SAASK,cAAcA,CAACC,IAAY,EAAEC,QAAiB,EAAW;EACvE,OAAQA,QAAQ,IAAID,IAAI,KAAK,OAAO,IAAKA,IAAI,KAAK,MAAM;AAC1D;AAOO,SAASE,oBAAoBA,CAACF,IAAY,EAAEC,QAAiB,EAAW;EAC7E,OAAOF,cAAc,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIJ,sBAAsB,CAACM,GAAG,CAACH,IAAI,CAAC;AAC3E;AAMO,SAASI,4BAA4BA,CAACJ,IAAY,EAAW;EAClE,OAAOF,0BAA0B,CAACK,GAAG,CAACH,IAAI,CAAC;AAC7C;AAOO,SAASK,wBAAwBA,CACtCL,IAAY,EACZC,QAAiB,EACR;EACT,OACEC,oBAAoB,CAACF,IAAI,EAAEC,QAAQ,CAAC,IAAIG,4BAA4B,CAACJ,IAAI,CAAC;AAE9E;AAEO,SAASM,SAASA,CAACN,IAAY,EAAW;EAC/C,OAAOL,QAAQ,CAACQ,GAAG,CAACH,IAAI,CAAC;AAC3B","ignoreList":[]} \ No newline at end of file diff --git a/node_modules/@babel/helper-validator-identifier/package.json b/node_modules/@babel/helper-validator-identifier/package.json new file mode 100644 index 00000000..9904752a --- /dev/null +++ b/node_modules/@babel/helper-validator-identifier/package.json @@ -0,0 +1,31 @@ +{ + "name": "@babel/helper-validator-identifier", + "version": "7.29.7", + "description": "Validate identifier/keywords name", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-helper-validator-identifier" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "exports": { + ".": { + "types": "./lib/index.d.ts", + "default": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "devDependencies": { + "@unicode/unicode-17.0.0": "^1.6.10", + "charcodes": "^0.2.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@colors/colors/LICENSE b/node_modules/@colors/colors/LICENSE new file mode 100644 index 00000000..6b860561 --- /dev/null +++ b/node_modules/@colors/colors/LICENSE @@ -0,0 +1,26 @@ +MIT License + +Original Library + - Copyright (c) Marak Squires + +Additional Functionality + - Copyright (c) Sindre Sorhus (sindresorhus.com) + - Copyright (c) DABH (https://github.com/DABH) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@colors/colors/README.md b/node_modules/@colors/colors/README.md new file mode 100644 index 00000000..e2479ce5 --- /dev/null +++ b/node_modules/@colors/colors/README.md @@ -0,0 +1,219 @@ +# @colors/colors ("colors.js") +[![Build Status](https://github.com/DABH/colors.js/actions/workflows/ci.yml/badge.svg)](https://github.com/DABH/colors.js/actions/workflows/ci.yml) +[![version](https://img.shields.io/npm/v/@colors/colors.svg)](https://www.npmjs.org/package/@colors/colors) + +Please check out the [roadmap](ROADMAP.md) for upcoming features and releases. Please open Issues to provide feedback. + +## get color and style in your node.js console + +![Demo](https://raw.githubusercontent.com/DABH/colors.js/master/screenshots/colors.png) + +## Installation + + npm install @colors/colors + +## colors and styles! + +### text colors + + - black + - red + - green + - yellow + - blue + - magenta + - cyan + - white + - gray + - grey + +### bright text colors + + - brightRed + - brightGreen + - brightYellow + - brightBlue + - brightMagenta + - brightCyan + - brightWhite + +### background colors + + - bgBlack + - bgRed + - bgGreen + - bgYellow + - bgBlue + - bgMagenta + - bgCyan + - bgWhite + - bgGray + - bgGrey + +### bright background colors + + - bgBrightRed + - bgBrightGreen + - bgBrightYellow + - bgBrightBlue + - bgBrightMagenta + - bgBrightCyan + - bgBrightWhite + +### styles + + - reset + - bold + - dim + - italic + - underline + - inverse + - hidden + - strikethrough + +### extras + + - rainbow + - zebra + - america + - trap + - random + + +## Usage + +By popular demand, `@colors/colors` now ships with two types of usages! + +The super nifty way + +```js +var colors = require('@colors/colors'); + +console.log('hello'.green); // outputs green text +console.log('i like cake and pies'.underline.red); // outputs red underlined text +console.log('inverse the color'.inverse); // inverses the color +console.log('OMG Rainbows!'.rainbow); // rainbow +console.log('Run the trap'.trap); // Drops the bass + +``` + +or a slightly less nifty way which doesn't extend `String.prototype` + +```js +var colors = require('@colors/colors/safe'); + +console.log(colors.green('hello')); // outputs green text +console.log(colors.red.underline('i like cake and pies')); // outputs red underlined text +console.log(colors.inverse('inverse the color')); // inverses the color +console.log(colors.rainbow('OMG Rainbows!')); // rainbow +console.log(colors.trap('Run the trap')); // Drops the bass + +``` + +I prefer the first way. Some people seem to be afraid of extending `String.prototype` and prefer the second way. + +If you are writing good code you will never have an issue with the first approach. If you really don't want to touch `String.prototype`, the second usage will not touch `String` native object. + +## Enabling/Disabling Colors + +The package will auto-detect whether your terminal can use colors and enable/disable accordingly. When colors are disabled, the color functions do nothing. You can override this with a command-line flag: + +```bash +node myapp.js --no-color +node myapp.js --color=false + +node myapp.js --color +node myapp.js --color=true +node myapp.js --color=always + +FORCE_COLOR=1 node myapp.js +``` + +Or in code: + +```javascript +var colors = require('@colors/colors'); +colors.enable(); +colors.disable(); +``` + +## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data) + +```js +var name = 'Beowulf'; +console.log(colors.green('Hello %s'), name); +// outputs -> 'Hello Beowulf' +``` + +## Custom themes + +### Using standard API + +```js + +var colors = require('@colors/colors'); + +colors.setTheme({ + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}); + +// outputs red text +console.log("this is an error".error); + +// outputs yellow text +console.log("this is a warning".warn); +``` + +### Using string safe API + +```js +var colors = require('@colors/colors/safe'); + +// set single property +var error = colors.red; +error('this is red'); + +// set theme +colors.setTheme({ + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red' +}); + +// outputs red text +console.log(colors.error("this is an error")); + +// outputs yellow text +console.log(colors.warn("this is a warning")); + +``` + +### Combining Colors + +```javascript +var colors = require('@colors/colors'); + +colors.setTheme({ + custom: ['red', 'underline'] +}); + +console.log('test'.custom); +``` + +*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.* diff --git a/node_modules/@colors/colors/examples/normal-usage.js b/node_modules/@colors/colors/examples/normal-usage.js new file mode 100644 index 00000000..a4bfe7b7 --- /dev/null +++ b/node_modules/@colors/colors/examples/normal-usage.js @@ -0,0 +1,83 @@ +var colors = require('../lib/index'); + +console.log('First some yellow text'.yellow); + +console.log('Underline that text'.yellow.underline); + +console.log('Make it bold and red'.red.bold); + +console.log(('Double Raindows All Day Long').rainbow); + +console.log('Drop the bass'.trap); + +console.log('DROP THE RAINBOW BASS'.trap.rainbow); + +// styles not widely supported +console.log('Chains are also cool.'.bold.italic.underline.red); + +// styles not widely supported +console.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse + + ' styles! '.yellow.bold); +console.log('Zebras are so fun!'.zebra); + +// +// Remark: .strikethrough may not work with Mac OS Terminal App +// +console.log('This is ' + 'not'.strikethrough + ' fun.'); + +console.log('Background color attack!'.black.bgWhite); +console.log('Use random styles on everything!'.random); +console.log('America, Heck Yeah!'.america); + +// eslint-disable-next-line max-len +console.log('Blindingly '.brightCyan + 'bright? '.brightRed + 'Why '.brightYellow + 'not?!'.brightGreen); + +console.log('Setting themes is useful'); + +// +// Custom themes +// +console.log('Generic logging theme as JSON'.green.bold.underline); +// Load theme with JSON literal +colors.setTheme({ + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red', +}); + +// outputs red text +console.log('this is an error'.error); + +// outputs yellow text +console.log('this is a warning'.warn); + +// outputs grey text +console.log('this is an input'.input); + +console.log('Generic logging theme as file'.green.bold.underline); + +// Load a theme from file +try { + colors.setTheme(require(__dirname + '/../themes/generic-logging.js')); +} catch (err) { + console.log(err); +} + +// outputs red text +console.log('this is an error'.error); + +// outputs yellow text +console.log('this is a warning'.warn); + +// outputs grey text +console.log('this is an input'.input); + +// console.log("Don't summon".zalgo) + diff --git a/node_modules/@colors/colors/examples/safe-string.js b/node_modules/@colors/colors/examples/safe-string.js new file mode 100644 index 00000000..fc664745 --- /dev/null +++ b/node_modules/@colors/colors/examples/safe-string.js @@ -0,0 +1,80 @@ +var colors = require('../safe'); + +console.log(colors.yellow('First some yellow text')); + +console.log(colors.yellow.underline('Underline that text')); + +console.log(colors.red.bold('Make it bold and red')); + +console.log(colors.rainbow('Double Raindows All Day Long')); + +console.log(colors.trap('Drop the bass')); + +console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS'))); + +// styles not widely supported +console.log(colors.bold.italic.underline.red('Chains are also cool.')); + +// styles not widely supported +console.log(colors.green('So ') + colors.underline('are') + ' ' + + colors.inverse('inverse') + colors.yellow.bold(' styles! ')); + +console.log(colors.zebra('Zebras are so fun!')); + +console.log('This is ' + colors.strikethrough('not') + ' fun.'); + + +console.log(colors.black.bgWhite('Background color attack!')); +console.log(colors.random('Use random styles on everything!')); +console.log(colors.america('America, Heck Yeah!')); + +// eslint-disable-next-line max-len +console.log(colors.brightCyan('Blindingly ') + colors.brightRed('bright? ') + colors.brightYellow('Why ') + colors.brightGreen('not?!')); + +console.log('Setting themes is useful'); + +// +// Custom themes +// +// console.log('Generic logging theme as JSON'.green.bold.underline); +// Load theme with JSON literal +colors.setTheme({ + silly: 'rainbow', + input: 'blue', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red', +}); + +// outputs red text +console.log(colors.error('this is an error')); + +// outputs yellow text +console.log(colors.warn('this is a warning')); + +// outputs blue text +console.log(colors.input('this is an input')); + + +// console.log('Generic logging theme as file'.green.bold.underline); + +// Load a theme from file +colors.setTheme(require(__dirname + '/../themes/generic-logging.js')); + +// outputs red text +console.log(colors.error('this is an error')); + +// outputs yellow text +console.log(colors.warn('this is a warning')); + +// outputs grey text +console.log(colors.input('this is an input')); + +// console.log(colors.zalgo("Don't summon him")) + + diff --git a/node_modules/@colors/colors/index.d.ts b/node_modules/@colors/colors/index.d.ts new file mode 100644 index 00000000..df3f2e6a --- /dev/null +++ b/node_modules/@colors/colors/index.d.ts @@ -0,0 +1,136 @@ +// Type definitions for @colors/colors 1.4+ +// Project: https://github.com/Marak/colors.js +// Definitions by: Bart van der Schoor , Staffan Eketorp +// Definitions: https://github.com/DABH/colors.js + +export interface Color { + (text: string): string; + + strip: Color; + stripColors: Color; + + black: Color; + red: Color; + green: Color; + yellow: Color; + blue: Color; + magenta: Color; + cyan: Color; + white: Color; + gray: Color; + grey: Color; + + bgBlack: Color; + bgRed: Color; + bgGreen: Color; + bgYellow: Color; + bgBlue: Color; + bgMagenta: Color; + bgCyan: Color; + bgWhite: Color; + + reset: Color; + bold: Color; + dim: Color; + italic: Color; + underline: Color; + inverse: Color; + hidden: Color; + strikethrough: Color; + + rainbow: Color; + zebra: Color; + america: Color; + trap: Color; + random: Color; + zalgo: Color; +} + +export function enable(): void; +export function disable(): void; +export function setTheme(theme: any): void; + +export let enabled: boolean; + +export const strip: Color; +export const stripColors: Color; + +export const black: Color; +export const red: Color; +export const green: Color; +export const yellow: Color; +export const blue: Color; +export const magenta: Color; +export const cyan: Color; +export const white: Color; +export const gray: Color; +export const grey: Color; + +export const bgBlack: Color; +export const bgRed: Color; +export const bgGreen: Color; +export const bgYellow: Color; +export const bgBlue: Color; +export const bgMagenta: Color; +export const bgCyan: Color; +export const bgWhite: Color; + +export const reset: Color; +export const bold: Color; +export const dim: Color; +export const italic: Color; +export const underline: Color; +export const inverse: Color; +export const hidden: Color; +export const strikethrough: Color; + +export const rainbow: Color; +export const zebra: Color; +export const america: Color; +export const trap: Color; +export const random: Color; +export const zalgo: Color; + +declare global { + interface String { + strip: string; + stripColors: string; + + black: string; + red: string; + green: string; + yellow: string; + blue: string; + magenta: string; + cyan: string; + white: string; + gray: string; + grey: string; + + bgBlack: string; + bgRed: string; + bgGreen: string; + bgYellow: string; + bgBlue: string; + bgMagenta: string; + bgCyan: string; + bgWhite: string; + + reset: string; + // @ts-ignore + bold: string; + dim: string; + italic: string; + underline: string; + inverse: string; + hidden: string; + strikethrough: string; + + rainbow: string; + zebra: string; + america: string; + trap: string; + random: string; + zalgo: string; + } +} diff --git a/node_modules/@colors/colors/lib/colors.js b/node_modules/@colors/colors/lib/colors.js new file mode 100644 index 00000000..d9fb0876 --- /dev/null +++ b/node_modules/@colors/colors/lib/colors.js @@ -0,0 +1,211 @@ +/* + +The MIT License (MIT) + +Original Library + - Copyright (c) Marak Squires + +Additional functionality + - Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +var colors = {}; +module['exports'] = colors; + +colors.themes = {}; + +var util = require('util'); +var ansiStyles = colors.styles = require('./styles'); +var defineProps = Object.defineProperties; +var newLineRegex = new RegExp(/[\r\n]+/g); + +colors.supportsColor = require('./system/supports-colors').supportsColor; + +if (typeof colors.enabled === 'undefined') { + colors.enabled = colors.supportsColor() !== false; +} + +colors.enable = function() { + colors.enabled = true; +}; + +colors.disable = function() { + colors.enabled = false; +}; + +colors.stripColors = colors.strip = function(str) { + return ('' + str).replace(/\x1B\[\d+m/g, ''); +}; + +// eslint-disable-next-line no-unused-vars +var stylize = colors.stylize = function stylize(str, style) { + if (!colors.enabled) { + return str+''; + } + + var styleMap = ansiStyles[style]; + + // Stylize should work for non-ANSI styles, too + if (!styleMap && style in colors) { + // Style maps like trap operate as functions on strings; + // they don't have properties like open or close. + return colors[style](str); + } + + return styleMap.open + str + styleMap.close; +}; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; +var escapeStringRegexp = function(str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + return str.replace(matchOperatorsRe, '\\$&'); +}; + +function build(_styles) { + var builder = function builder() { + return applyStyle.apply(builder, arguments); + }; + builder._styles = _styles; + // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + builder.__proto__ = proto; + return builder; +} + +var styles = (function() { + var ret = {}; + ansiStyles.grey = ansiStyles.gray; + Object.keys(ansiStyles).forEach(function(key) { + ansiStyles[key].closeRe = + new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + ret[key] = { + get: function() { + return build(this._styles.concat(key)); + }, + }; + }); + return ret; +})(); + +var proto = defineProps(function colors() {}, styles); + +function applyStyle() { + var args = Array.prototype.slice.call(arguments); + + var str = args.map(function(arg) { + // Use weak equality check so we can colorize null/undefined in safe mode + if (arg != null && arg.constructor === String) { + return arg; + } else { + return util.inspect(arg); + } + }).join(' '); + + if (!colors.enabled || !str) { + return str; + } + + var newLinesPresent = str.indexOf('\n') != -1; + + var nestedStyles = this._styles; + + var i = nestedStyles.length; + while (i--) { + var code = ansiStyles[nestedStyles[i]]; + str = code.open + str.replace(code.closeRe, code.open) + code.close; + if (newLinesPresent) { + str = str.replace(newLineRegex, function(match) { + return code.close + match + code.open; + }); + } + } + + return str; +} + +colors.setTheme = function(theme) { + if (typeof theme === 'string') { + console.log('colors.setTheme now only accepts an object, not a string. ' + + 'If you are trying to set a theme from a file, it is now your (the ' + + 'caller\'s) responsibility to require the file. The old syntax ' + + 'looked like colors.setTheme(__dirname + ' + + '\'/../themes/generic-logging.js\'); The new syntax looks like '+ + 'colors.setTheme(require(__dirname + ' + + '\'/../themes/generic-logging.js\'));'); + return; + } + for (var style in theme) { + (function(style) { + colors[style] = function(str) { + if (typeof theme[style] === 'object') { + var out = str; + for (var i in theme[style]) { + out = colors[theme[style][i]](out); + } + return out; + } + return colors[theme[style]](str); + }; + })(style); + } +}; + +function init() { + var ret = {}; + Object.keys(styles).forEach(function(name) { + ret[name] = { + get: function() { + return build([name]); + }, + }; + }); + return ret; +} + +var sequencer = function sequencer(map, str) { + var exploded = str.split(''); + exploded = exploded.map(map); + return exploded.join(''); +}; + +// custom formatter methods +colors.trap = require('./custom/trap'); +colors.zalgo = require('./custom/zalgo'); + +// maps +colors.maps = {}; +colors.maps.america = require('./maps/america')(colors); +colors.maps.zebra = require('./maps/zebra')(colors); +colors.maps.rainbow = require('./maps/rainbow')(colors); +colors.maps.random = require('./maps/random')(colors); + +for (var map in colors.maps) { + (function(map) { + colors[map] = function(str) { + return sequencer(colors.maps[map], str); + }; + })(map); +} + +defineProps(colors, init()); diff --git a/node_modules/@colors/colors/lib/custom/trap.js b/node_modules/@colors/colors/lib/custom/trap.js new file mode 100644 index 00000000..fbccf88d --- /dev/null +++ b/node_modules/@colors/colors/lib/custom/trap.js @@ -0,0 +1,46 @@ +module['exports'] = function runTheTrap(text, options) { + var result = ''; + text = text || 'Run the trap, drop the bass'; + text = text.split(''); + var trap = { + a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'], + b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'], + c: ['\u00a9', '\u023b', '\u03fe'], + d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'], + e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc', + '\u0a6c'], + f: ['\u04fa'], + g: ['\u0262'], + h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'], + i: ['\u0f0f'], + j: ['\u0134'], + k: ['\u0138', '\u04a0', '\u04c3', '\u051e'], + l: ['\u0139'], + m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'], + n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'], + o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd', + '\u06dd', '\u0e4f'], + p: ['\u01f7', '\u048e'], + q: ['\u09cd'], + r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'], + s: ['\u00a7', '\u03de', '\u03df', '\u03e8'], + t: ['\u0141', '\u0166', '\u0373'], + u: ['\u01b1', '\u054d'], + v: ['\u05d8'], + w: ['\u0428', '\u0460', '\u047c', '\u0d70'], + x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'], + y: ['\u00a5', '\u04b0', '\u04cb'], + z: ['\u01b5', '\u0240'], + }; + text.forEach(function(c) { + c = c.toLowerCase(); + var chars = trap[c] || [' ']; + var rand = Math.floor(Math.random() * chars.length); + if (typeof trap[c] !== 'undefined') { + result += trap[c][rand]; + } else { + result += c; + } + }); + return result; +}; diff --git a/node_modules/@colors/colors/lib/custom/zalgo.js b/node_modules/@colors/colors/lib/custom/zalgo.js new file mode 100644 index 00000000..0ef2b011 --- /dev/null +++ b/node_modules/@colors/colors/lib/custom/zalgo.js @@ -0,0 +1,110 @@ +// please no +module['exports'] = function zalgo(text, options) { + text = text || ' he is here '; + var soul = { + 'up': [ + '̍', '̎', '̄', '̅', + '̿', '̑', '̆', '̐', + '͒', '͗', '͑', '̇', + '̈', '̊', '͂', '̓', + '̈', '͊', '͋', '͌', + '̃', '̂', '̌', '͐', + '̀', '́', '̋', '̏', + '̒', '̓', '̔', '̽', + '̉', 'ͣ', 'ͤ', 'ͥ', + 'ͦ', 'ͧ', 'ͨ', 'ͩ', + 'ͪ', 'ͫ', 'ͬ', 'ͭ', + 'ͮ', 'ͯ', '̾', '͛', + '͆', '̚', + ], + 'down': [ + '̖', '̗', '̘', '̙', + '̜', '̝', '̞', '̟', + '̠', '̤', '̥', '̦', + '̩', '̪', '̫', '̬', + '̭', '̮', '̯', '̰', + '̱', '̲', '̳', '̹', + '̺', '̻', '̼', 'ͅ', + '͇', '͈', '͉', '͍', + '͎', '͓', '͔', '͕', + '͖', '͙', '͚', '̣', + ], + 'mid': [ + '̕', '̛', '̀', '́', + '͘', '̡', '̢', '̧', + '̨', '̴', '̵', '̶', + '͜', '͝', '͞', + '͟', '͠', '͢', '̸', + '̷', '͡', ' ҉', + ], + }; + var all = [].concat(soul.up, soul.down, soul.mid); + + function randomNumber(range) { + var r = Math.floor(Math.random() * range); + return r; + } + + function isChar(character) { + var bool = false; + all.filter(function(i) { + bool = (i === character); + }); + return bool; + } + + + function heComes(text, options) { + var result = ''; + var counts; + var l; + options = options || {}; + options['up'] = + typeof options['up'] !== 'undefined' ? options['up'] : true; + options['mid'] = + typeof options['mid'] !== 'undefined' ? options['mid'] : true; + options['down'] = + typeof options['down'] !== 'undefined' ? options['down'] : true; + options['size'] = + typeof options['size'] !== 'undefined' ? options['size'] : 'maxi'; + text = text.split(''); + for (l in text) { + if (isChar(l)) { + continue; + } + result = result + text[l]; + counts = {'up': 0, 'down': 0, 'mid': 0}; + switch (options.size) { + case 'mini': + counts.up = randomNumber(8); + counts.mid = randomNumber(2); + counts.down = randomNumber(8); + break; + case 'maxi': + counts.up = randomNumber(16) + 3; + counts.mid = randomNumber(4) + 1; + counts.down = randomNumber(64) + 3; + break; + default: + counts.up = randomNumber(8) + 1; + counts.mid = randomNumber(6) / 2; + counts.down = randomNumber(8) + 1; + break; + } + + var arr = ['up', 'mid', 'down']; + for (var d in arr) { + var index = arr[d]; + for (var i = 0; i <= counts[index]; i++) { + if (options[index]) { + result = result + soul[index][randomNumber(soul[index].length)]; + } + } + } + } + return result; + } + // don't summon him + return heComes(text, options); +}; + diff --git a/node_modules/@colors/colors/lib/extendStringPrototype.js b/node_modules/@colors/colors/lib/extendStringPrototype.js new file mode 100644 index 00000000..46fd386a --- /dev/null +++ b/node_modules/@colors/colors/lib/extendStringPrototype.js @@ -0,0 +1,110 @@ +var colors = require('./colors'); + +module['exports'] = function() { + // + // Extends prototype of native string object to allow for "foo".red syntax + // + var addProperty = function(color, func) { + String.prototype.__defineGetter__(color, func); + }; + + addProperty('strip', function() { + return colors.strip(this); + }); + + addProperty('stripColors', function() { + return colors.strip(this); + }); + + addProperty('trap', function() { + return colors.trap(this); + }); + + addProperty('zalgo', function() { + return colors.zalgo(this); + }); + + addProperty('zebra', function() { + return colors.zebra(this); + }); + + addProperty('rainbow', function() { + return colors.rainbow(this); + }); + + addProperty('random', function() { + return colors.random(this); + }); + + addProperty('america', function() { + return colors.america(this); + }); + + // + // Iterate through all default styles and colors + // + var x = Object.keys(colors.styles); + x.forEach(function(style) { + addProperty(style, function() { + return colors.stylize(this, style); + }); + }); + + function applyTheme(theme) { + // + // Remark: This is a list of methods that exist + // on String that you should not overwrite. + // + var stringPrototypeBlacklist = [ + '__defineGetter__', '__defineSetter__', '__lookupGetter__', + '__lookupSetter__', 'charAt', 'constructor', 'hasOwnProperty', + 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', + 'valueOf', 'charCodeAt', 'indexOf', 'lastIndexOf', 'length', + 'localeCompare', 'match', 'repeat', 'replace', 'search', 'slice', + 'split', 'substring', 'toLocaleLowerCase', 'toLocaleUpperCase', + 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight', + ]; + + Object.keys(theme).forEach(function(prop) { + if (stringPrototypeBlacklist.indexOf(prop) !== -1) { + console.log('warn: '.red + ('String.prototype' + prop).magenta + + ' is probably something you don\'t want to override. ' + + 'Ignoring style name'); + } else { + if (typeof(theme[prop]) === 'string') { + colors[prop] = colors[theme[prop]]; + addProperty(prop, function() { + return colors[prop](this); + }); + } else { + var themePropApplicator = function(str) { + var ret = str || this; + for (var t = 0; t < theme[prop].length; t++) { + ret = colors[theme[prop][t]](ret); + } + return ret; + }; + addProperty(prop, themePropApplicator); + colors[prop] = function(str) { + return themePropApplicator(str); + }; + } + } + }); + } + + colors.setTheme = function(theme) { + if (typeof theme === 'string') { + console.log('colors.setTheme now only accepts an object, not a string. ' + + 'If you are trying to set a theme from a file, it is now your (the ' + + 'caller\'s) responsibility to require the file. The old syntax ' + + 'looked like colors.setTheme(__dirname + ' + + '\'/../themes/generic-logging.js\'); The new syntax looks like '+ + 'colors.setTheme(require(__dirname + ' + + '\'/../themes/generic-logging.js\'));'); + return; + } else { + applyTheme(theme); + } + }; +}; diff --git a/node_modules/@colors/colors/lib/index.js b/node_modules/@colors/colors/lib/index.js new file mode 100644 index 00000000..9df5ab7d --- /dev/null +++ b/node_modules/@colors/colors/lib/index.js @@ -0,0 +1,13 @@ +var colors = require('./colors'); +module['exports'] = colors; + +// Remark: By default, colors will add style properties to String.prototype. +// +// If you don't wish to extend String.prototype, you can do this instead and +// native String will not be touched: +// +// var colors = require('colors/safe); +// colors.red("foo") +// +// +require('./extendStringPrototype')(); diff --git a/node_modules/@colors/colors/lib/maps/america.js b/node_modules/@colors/colors/lib/maps/america.js new file mode 100644 index 00000000..dc969033 --- /dev/null +++ b/node_modules/@colors/colors/lib/maps/america.js @@ -0,0 +1,10 @@ +module['exports'] = function(colors) { + return function(letter, i, exploded) { + if (letter === ' ') return letter; + switch (i%3) { + case 0: return colors.red(letter); + case 1: return colors.white(letter); + case 2: return colors.blue(letter); + } + }; +}; diff --git a/node_modules/@colors/colors/lib/maps/rainbow.js b/node_modules/@colors/colors/lib/maps/rainbow.js new file mode 100644 index 00000000..2b00ac0a --- /dev/null +++ b/node_modules/@colors/colors/lib/maps/rainbow.js @@ -0,0 +1,12 @@ +module['exports'] = function(colors) { + // RoY G BiV + var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; + return function(letter, i, exploded) { + if (letter === ' ') { + return letter; + } else { + return colors[rainbowColors[i++ % rainbowColors.length]](letter); + } + }; +}; + diff --git a/node_modules/@colors/colors/lib/maps/random.js b/node_modules/@colors/colors/lib/maps/random.js new file mode 100644 index 00000000..3d82a39e --- /dev/null +++ b/node_modules/@colors/colors/lib/maps/random.js @@ -0,0 +1,11 @@ +module['exports'] = function(colors) { + var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green', + 'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed', + 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta']; + return function(letter, i, exploded) { + return letter === ' ' ? letter : + colors[ + available[Math.round(Math.random() * (available.length - 2))] + ](letter); + }; +}; diff --git a/node_modules/@colors/colors/lib/maps/zebra.js b/node_modules/@colors/colors/lib/maps/zebra.js new file mode 100644 index 00000000..fa736235 --- /dev/null +++ b/node_modules/@colors/colors/lib/maps/zebra.js @@ -0,0 +1,5 @@ +module['exports'] = function(colors) { + return function(letter, i, exploded) { + return i % 2 === 0 ? letter : colors.inverse(letter); + }; +}; diff --git a/node_modules/@colors/colors/lib/styles.js b/node_modules/@colors/colors/lib/styles.js new file mode 100644 index 00000000..011dafd8 --- /dev/null +++ b/node_modules/@colors/colors/lib/styles.js @@ -0,0 +1,95 @@ +/* +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +var styles = {}; +module['exports'] = styles; + +var codes = { + reset: [0, 0], + + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29], + + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + grey: [90, 39], + + brightRed: [91, 39], + brightGreen: [92, 39], + brightYellow: [93, 39], + brightBlue: [94, 39], + brightMagenta: [95, 39], + brightCyan: [96, 39], + brightWhite: [97, 39], + + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + bgGray: [100, 49], + bgGrey: [100, 49], + + bgBrightRed: [101, 49], + bgBrightGreen: [102, 49], + bgBrightYellow: [103, 49], + bgBrightBlue: [104, 49], + bgBrightMagenta: [105, 49], + bgBrightCyan: [106, 49], + bgBrightWhite: [107, 49], + + // legacy styles for colors pre v1.0.0 + blackBG: [40, 49], + redBG: [41, 49], + greenBG: [42, 49], + yellowBG: [43, 49], + blueBG: [44, 49], + magentaBG: [45, 49], + cyanBG: [46, 49], + whiteBG: [47, 49], + +}; + +Object.keys(codes).forEach(function(key) { + var val = codes[key]; + var style = styles[key] = []; + style.open = '\u001b[' + val[0] + 'm'; + style.close = '\u001b[' + val[1] + 'm'; +}); diff --git a/node_modules/@colors/colors/lib/system/has-flag.js b/node_modules/@colors/colors/lib/system/has-flag.js new file mode 100644 index 00000000..a347dd4d --- /dev/null +++ b/node_modules/@colors/colors/lib/system/has-flag.js @@ -0,0 +1,35 @@ +/* +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +'use strict'; + +module.exports = function(flag, argv) { + argv = argv || process.argv; + + var terminatorPos = argv.indexOf('--'); + var prefix = /^-{1,2}/.test(flag) ? '' : '--'; + var pos = argv.indexOf(prefix + flag); + + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); +}; diff --git a/node_modules/@colors/colors/lib/system/supports-colors.js b/node_modules/@colors/colors/lib/system/supports-colors.js new file mode 100644 index 00000000..f1f9c8ff --- /dev/null +++ b/node_modules/@colors/colors/lib/system/supports-colors.js @@ -0,0 +1,151 @@ +/* +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +'use strict'; + +var os = require('os'); +var hasFlag = require('./has-flag.js'); + +var env = process.env; + +var forceColor = void 0; +if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { + forceColor = false; +} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') + || hasFlag('color=always')) { + forceColor = true; +} +if ('FORCE_COLOR' in env) { + forceColor = env.FORCE_COLOR.length === 0 + || parseInt(env.FORCE_COLOR, 10) !== 0; +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level: level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3, + }; +} + +function supportsColor(stream) { + if (forceColor === false) { + return 0; + } + + if (hasFlag('color=16m') || hasFlag('color=full') + || hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (stream && !stream.isTTY && forceColor !== true) { + return 0; + } + + var min = forceColor ? 1 : 0; + + if (process.platform === 'win32') { + // Node.js 7.5.0 is the first version of Node.js to include a patch to + // libuv that enables 256 color output on Windows. Anything earlier and it + // won't work. However, here we target Node.js 8 at minimum as it is an LTS + // release, and Node.js 7 is not. Windows 10 build 10586 is the first + // Windows release that supports 256 colors. Windows 10 build 14931 is the + // first release that supports 16m/TrueColor. + var osRelease = os.release().split('.'); + if (Number(process.versions.node.split('.')[0]) >= 8 + && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) { + return sign in env; + }) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0 + ); + } + + if ('TERM_PROGRAM' in env) { + var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Hyper': + return 3; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + if (env.TERM === 'dumb') { + return min; + } + + return min; +} + +function getSupportLevel(stream) { + var level = supportsColor(stream); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr), +}; diff --git a/node_modules/@colors/colors/package.json b/node_modules/@colors/colors/package.json new file mode 100644 index 00000000..cb87f209 --- /dev/null +++ b/node_modules/@colors/colors/package.json @@ -0,0 +1,45 @@ +{ + "name": "@colors/colors", + "description": "get colors in your node.js console", + "version": "1.5.0", + "author": "DABH", + "contributors": [ + { + "name": "DABH", + "url": "https://github.com/DABH" + } + ], + "homepage": "https://github.com/DABH/colors.js", + "bugs": "https://github.com/DABH/colors.js/issues", + "keywords": [ + "ansi", + "terminal", + "colors" + ], + "repository": { + "type": "git", + "url": "http://github.com/DABH/colors.js.git" + }, + "license": "MIT", + "scripts": { + "lint": "eslint . --fix", + "test": "export FORCE_COLOR=1 && node tests/basic-test.js && node tests/safe-test.js" + }, + "engines": { + "node": ">=0.1.90" + }, + "main": "lib/index.js", + "files": [ + "examples", + "lib", + "LICENSE", + "safe.js", + "themes", + "index.d.ts", + "safe.d.ts" + ], + "devDependencies": { + "eslint": "^5.2.0", + "eslint-config-google": "^0.11.0" + } +} diff --git a/node_modules/@colors/colors/safe.d.ts b/node_modules/@colors/colors/safe.d.ts new file mode 100644 index 00000000..2bafc279 --- /dev/null +++ b/node_modules/@colors/colors/safe.d.ts @@ -0,0 +1,48 @@ +// Type definitions for Colors.js 1.2 +// Project: https://github.com/Marak/colors.js +// Definitions by: Bart van der Schoor , Staffan Eketorp +// Definitions: https://github.com/Marak/colors.js + +export const enabled: boolean; +export function enable(): void; +export function disable(): void; +export function setTheme(theme: any): void; + +export function strip(str: string): string; +export function stripColors(str: string): string; + +export function black(str: string): string; +export function red(str: string): string; +export function green(str: string): string; +export function yellow(str: string): string; +export function blue(str: string): string; +export function magenta(str: string): string; +export function cyan(str: string): string; +export function white(str: string): string; +export function gray(str: string): string; +export function grey(str: string): string; + +export function bgBlack(str: string): string; +export function bgRed(str: string): string; +export function bgGreen(str: string): string; +export function bgYellow(str: string): string; +export function bgBlue(str: string): string; +export function bgMagenta(str: string): string; +export function bgCyan(str: string): string; +export function bgWhite(str: string): string; + +export function reset(str: string): string; +export function bold(str: string): string; +export function dim(str: string): string; +export function italic(str: string): string; +export function underline(str: string): string; +export function inverse(str: string): string; +export function hidden(str: string): string; +export function strikethrough(str: string): string; + +export function rainbow(str: string): string; +export function zebra(str: string): string; +export function america(str: string): string; +export function trap(str: string): string; +export function random(str: string): string; +export function zalgo(str: string): string; diff --git a/node_modules/@colors/colors/safe.js b/node_modules/@colors/colors/safe.js new file mode 100644 index 00000000..a013d542 --- /dev/null +++ b/node_modules/@colors/colors/safe.js @@ -0,0 +1,10 @@ +// +// Remark: Requiring this file will use the "safe" colors API, +// which will not touch String.prototype. +// +// var colors = require('colors/safe'); +// colors.red("foo") +// +// +var colors = require('./lib/colors'); +module['exports'] = colors; diff --git a/node_modules/@colors/colors/themes/generic-logging.js b/node_modules/@colors/colors/themes/generic-logging.js new file mode 100644 index 00000000..63adfe4a --- /dev/null +++ b/node_modules/@colors/colors/themes/generic-logging.js @@ -0,0 +1,12 @@ +module['exports'] = { + silly: 'rainbow', + input: 'grey', + verbose: 'cyan', + prompt: 'grey', + info: 'green', + data: 'grey', + help: 'cyan', + warn: 'yellow', + debug: 'blue', + error: 'red', +}; diff --git a/node_modules/@cucumber/ci-environment/LICENSE b/node_modules/@cucumber/ci-environment/LICENSE new file mode 100644 index 00000000..d23a133d --- /dev/null +++ b/node_modules/@cucumber/ci-environment/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Cucumber Ltd and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/package.json b/node_modules/@cucumber/ci-environment/dist/cjs/package.json new file mode 100644 index 00000000..b731bd61 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/package.json @@ -0,0 +1 @@ +{"type": "commonjs"} diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.d.ts b/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.d.ts new file mode 100644 index 00000000..0dd3c516 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.d.ts @@ -0,0 +1,3 @@ +import { CiEnvironment } from './types.js'; +export declare const CiEnvironments: readonly CiEnvironment[]; +//# sourceMappingURL=CiEnvironments.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.d.ts.map b/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.d.ts.map new file mode 100644 index 00000000..8315e4ab --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CiEnvironments.d.ts","sourceRoot":"","sources":["../../../src/CiEnvironments.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAgKlD,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.js b/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.js new file mode 100644 index 00000000..054507cc --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.js @@ -0,0 +1,166 @@ +"use strict"; +/* This file is auto-generated using npm run build-ci-environments */ +/* eslint-disable no-useless-escape */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CiEnvironments = void 0; +exports.CiEnvironments = [ + { + name: 'Azure Pipelines', + url: '${BUILD_BUILDURI}', + buildNumber: '${BUILD_BUILDNUMBER}', + git: { + remote: '${BUILD_REPOSITORY_URI}', + revision: '${BUILD_SOURCEVERSION}', + branch: '${BUILD_SOURCEBRANCH/refs\/heads\/(.*)/\\1}', + tag: '${BUILD_SOURCEBRANCH/refs\/tags\/(.*)/\\1}', + }, + }, + { + name: 'Bamboo', + url: '${bamboo_buildResultsUrl}', + buildNumber: '${bamboo_buildNumber}', + git: { + remote: '${bamboo_planRepository_repositoryUrl}', + revision: '${bamboo_planRepository_revision}', + branch: '${bamboo_planRepository_branch}', + }, + }, + { + name: 'Buddy', + url: '${BUDDY_EXECUTION_URL}', + buildNumber: '${BUDDY_EXECUTION_ID}', + git: { + remote: '${BUDDY_SCM_URL}', + revision: '${BUDDY_EXECUTION_REVISION}', + branch: '${BUDDY_EXECUTION_BRANCH}', + tag: '${BUDDY_EXECUTION_TAG}', + }, + }, + { + name: 'Bitrise', + url: '${BITRISE_BUILD_URL}', + buildNumber: '${BITRISE_BUILD_NUMBER}', + git: { + remote: '${GIT_REPOSITORY_URL}', + revision: '${BITRISE_GIT_COMMIT}', + branch: '${BITRISE_GIT_BRANCH}', + tag: '${BITRISE_GIT_TAG}', + }, + }, + { + name: 'CircleCI', + url: '${CIRCLE_BUILD_URL}', + buildNumber: '${CIRCLE_BUILD_NUM}', + git: { + remote: '${CIRCLE_REPOSITORY_URL}', + revision: '${CIRCLE_SHA1}', + branch: '${CIRCLE_BRANCH}', + tag: '${CIRCLE_TAG}', + }, + }, + { + name: 'CodeFresh', + url: '${CF_BUILD_URL}', + buildNumber: '${CF_BUILD_ID}', + git: { + remote: '${CF_COMMIT_URL/(.*)\\/commit.+$/\\1}.git', + revision: '${CF_REVISION}', + branch: '${CF_BRANCH}', + }, + }, + { + name: 'CodeShip', + url: '${CI_BUILD_URL}', + buildNumber: '${CI_BUILD_NUMBER}', + git: { + remote: '${CI_PULL_REQUEST/(.*)\\/pull\\/\\d+/\\1.git}', + revision: '${CI_COMMIT_ID}', + branch: '${CI_BRANCH}', + }, + }, + { + name: 'GitHub Actions', + url: '${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}', + buildNumber: '${GITHUB_RUN_ID}', + git: { + remote: '${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git', + revision: '${GITHUB_SHA}', + branch: '${GITHUB_HEAD_REF}', + tag: '${GITHUB_REF/refs\/tags\/(.*)/\\1}', + }, + }, + { + name: 'GitLab', + url: '${CI_JOB_URL}', + buildNumber: '${CI_JOB_ID}', + git: { + remote: '${CI_REPOSITORY_URL}', + revision: '${CI_COMMIT_SHA}', + branch: '${CI_COMMIT_BRANCH}', + tag: '${CI_COMMIT_TAG}', + }, + }, + { + name: 'GoCD', + url: '${GO_SERVER_URL}/pipelines/${GO_PIPELINE_NAME}/${GO_PIPELINE_COUNTER}/${GO_STAGE_NAME}/${GO_STAGE_COUNTER}', + buildNumber: '${GO_PIPELINE_NAME}/${GO_PIPELINE_COUNTER}/${GO_STAGE_NAME}/${GO_STAGE_COUNTER}', + git: { + remote: '${GO_SCM_*_PR_URL/(.*)\\/pull\\/\\d+/\\1.git}', + revision: '${GO_REVISION}', + branch: '${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}', + }, + }, + { + name: 'Jenkins', + url: '${BUILD_URL}', + buildNumber: '${BUILD_NUMBER}', + git: { + remote: '${GIT_URL}', + revision: '${GIT_COMMIT}', + branch: '${GIT_LOCAL_BRANCH}', + }, + }, + { + name: 'JetBrains Space', + url: '${JB_SPACE_EXECUTION_URL}', + buildNumber: '${JB_SPACE_EXECUTION_NUMBER}', + git: { + remote: 'https://${JB_SPACE_API_URL}/p/${JB_SPACE_PROJECT_KEY}/repositories/${JB_SPACE_GIT_REPOSITORY_NAME}', + revision: '${JB_SPACE_GIT_REVISION}', + branch: '${JB_SPACE_GIT_BRANCH}', + }, + }, + { + name: 'Semaphore', + url: '${SEMAPHORE_ORGANIZATION_URL}/jobs/${SEMAPHORE_JOB_ID}', + buildNumber: '${SEMAPHORE_JOB_ID}', + git: { + remote: '${SEMAPHORE_GIT_URL}', + revision: '${SEMAPHORE_GIT_SHA}', + branch: '${SEMAPHORE_GIT_BRANCH}', + tag: '${SEMAPHORE_GIT_TAG_NAME}', + }, + }, + { + name: 'Travis CI', + url: '${TRAVIS_BUILD_WEB_URL}', + buildNumber: '${TRAVIS_JOB_NUMBER}', + git: { + remote: 'https://github.com/${TRAVIS_REPO_SLUG}.git', + revision: '${TRAVIS_COMMIT}', + branch: '${TRAVIS_BRANCH}', + tag: '${TRAVIS_TAG}', + }, + }, + { + name: 'Wercker', + url: '${WERCKER_RUN_URL}', + buildNumber: '${WERCKER_RUN_URL/.*\\/([^\\/]+)$/\\1}', + git: { + remote: 'https://${WERCKER_GIT_DOMAIN}/${WERCKER_GIT_OWNER}/${WERCKER_GIT_REPOSITORY}.git', + revision: '${WERCKER_GIT_COMMIT}', + branch: '${WERCKER_GIT_BRANCH}', + }, + }, +]; +//# sourceMappingURL=CiEnvironments.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.js.map b/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.js.map new file mode 100644 index 00000000..b3517138 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/CiEnvironments.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CiEnvironments.js","sourceRoot":"","sources":["../../../src/CiEnvironments.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAIzB,QAAA,cAAc,GAA6B;IACtD;QACE,IAAI,EAAE,iBAAiB;QACvB,GAAG,EAAE,mBAAmB;QACxB,WAAW,EAAE,sBAAsB;QACnC,GAAG,EAAE;YACH,MAAM,EAAE,yBAAyB;YACjC,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,6CAA6C;YACrD,GAAG,EAAE,4CAA4C;SAClD;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,2BAA2B;QAChC,WAAW,EAAE,uBAAuB;QACpC,GAAG,EAAE;YACH,MAAM,EAAE,wCAAwC;YAChD,QAAQ,EAAE,mCAAmC;YAC7C,MAAM,EAAE,iCAAiC;SAC1C;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,wBAAwB;QAC7B,WAAW,EAAE,uBAAuB;QACpC,GAAG,EAAE;YACH,MAAM,EAAE,kBAAkB;YAC1B,QAAQ,EAAE,6BAA6B;YACvC,MAAM,EAAE,2BAA2B;YACnC,GAAG,EAAE,wBAAwB;SAC9B;KACF;IACD;QACE,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,sBAAsB;QAC3B,WAAW,EAAE,yBAAyB;QACtC,GAAG,EAA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QAC9F,GAAG,EAAE;YACH,MAAM,EAAE,+CAA+C;YACvD,QAAQ,EAAE,gBAAgB;YAC1B,MAAM,EAAE,mCAAmC;SAC5C;KACF;IACD;QACE,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,cAAc;QACnB,WAAW,EAAE,iBAAiB;QAC9B,GAAG,EAAE;YACH,MAAM,EAAE,YAAY;YACpB,QAAQ,EAAE,eAAe;YACzB,MAAM,EAAE,qBAAqB;SAC9B;KACF;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,GAAG,EAAE,2BAA2B;QAChC,WAAW,EAAE,8BAA8B;QAC3C,GAAG,EAAE;YACH,MAAM,EACJ,oGAAoG;YACtG,QAAQ,EAAE,0BAA0B;YACpC,MAAM,EAAE,wBAAwB;SACjC;KACF;IACD;QACE,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,wDAAwD;QAC7D,WAAW,EAAE,qBAAqB;QAClC,GAAG,EAAE;YACH,MAAM,EAAE,sBAAsB;YAC9B,QAAQ,EAAE,sBAAsB;YAChC,MAAM,EAAE,yBAAyB;YACjC,GAAG,EAAE,2BAA2B;SACjC;KACF;IACD;QACE,IAAI,EAAE,WAAW;QACjB,GAAG,EAAE,yBAAyB;QAC9B,WAAW,EAAE,sBAAsB;QACnC,GAAG,EAAE;YACH,MAAM,EAAE,4CAA4C;YACpD,QAAQ,EAAE,kBAAkB;YAC5B,MAAM,EAAE,kBAAkB;YAC1B,GAAG,EAAE,eAAe;SACrB;KACF;IACD;QACE,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,oBAAoB;QACzB,WAAW,EAAE,wCAAwC;QACrD,GAAG,EAAE;YACH,MAAM,EAAE,kFAAkF;YAC1F,QAAQ,EAAE,uBAAuB;YACjC,MAAM,EAAE,uBAAuB;SAChC;KACF;CACF,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.d.ts b/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.d.ts new file mode 100644 index 00000000..1ca9a50b --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.d.ts @@ -0,0 +1,4 @@ +import { CiEnvironment, Env } from './types.js'; +export default function detectCiEnvironment(env: Env): CiEnvironment | undefined; +export declare function removeUserInfoFromUrl(value: string): string; +//# sourceMappingURL=detectCiEnvironment.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.d.ts.map b/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.d.ts.map new file mode 100644 index 00000000..989bad7b --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"detectCiEnvironment.d.ts","sourceRoot":"","sources":["../../../src/detectCiEnvironment.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAO,MAAM,YAAY,CAAA;AAEpD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,GAAG,SAAS,CAO/E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU3D"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.js b/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.js new file mode 100644 index 00000000..e7dde9dd --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.js @@ -0,0 +1,105 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = detectCiEnvironment; +exports.removeUserInfoFromUrl = removeUserInfoFromUrl; +var fs_1 = require("fs"); +var CiEnvironments_js_1 = require("./CiEnvironments.js"); +var evaluateVariableExpression_js_1 = __importDefault(require("./evaluateVariableExpression.js")); +function detectCiEnvironment(env) { + var e_1, _a; + try { + for (var CiEnvironments_1 = __values(CiEnvironments_js_1.CiEnvironments), CiEnvironments_1_1 = CiEnvironments_1.next(); !CiEnvironments_1_1.done; CiEnvironments_1_1 = CiEnvironments_1.next()) { + var ciEnvironment = CiEnvironments_1_1.value; + var detected = detect(ciEnvironment, env); + if (detected) { + return detected; + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (CiEnvironments_1_1 && !CiEnvironments_1_1.done && (_a = CiEnvironments_1.return)) _a.call(CiEnvironments_1); + } + finally { if (e_1) throw e_1.error; } + } +} +function removeUserInfoFromUrl(value) { + if (!value) + return value; + try { + var url = new URL(value); + url.password = ''; + url.username = ''; + return url.toString(); + } + catch (_) { + return value; + } +} +function detectGit(ciEnvironment, env) { + var _a, _b, _c; + var revision = detectRevision(ciEnvironment, env); + if (!revision) { + return undefined; + } + var remote = (0, evaluateVariableExpression_js_1.default)((_a = ciEnvironment.git) === null || _a === void 0 ? void 0 : _a.remote, env); + if (!remote) { + return undefined; + } + var tag = (0, evaluateVariableExpression_js_1.default)((_b = ciEnvironment.git) === null || _b === void 0 ? void 0 : _b.tag, env); + var branch = (0, evaluateVariableExpression_js_1.default)((_c = ciEnvironment.git) === null || _c === void 0 ? void 0 : _c.branch, env); + return __assign(__assign({ revision: revision, remote: removeUserInfoFromUrl(remote) }, (tag && { tag: tag })), (branch && { branch: branch })); +} +function detectRevision(ciEnvironment, env) { + var _a, _b, _c; + if (env.GITHUB_EVENT_NAME === 'pull_request') { + if (!env.GITHUB_EVENT_PATH) + throw new Error('GITHUB_EVENT_PATH not set'); + var json = (0, fs_1.readFileSync)(env.GITHUB_EVENT_PATH, 'utf-8'); + var event_1 = JSON.parse(json); + var revision = (_b = (_a = event_1.pull_request) === null || _a === void 0 ? void 0 : _a.head) === null || _b === void 0 ? void 0 : _b.sha; + if (!revision) { + throw new Error("Could not find .pull_request.head.sha in ".concat(env.GITHUB_EVENT_PATH, ":\n").concat(JSON.stringify(event_1, null, 2))); + } + return revision; + } + return (0, evaluateVariableExpression_js_1.default)((_c = ciEnvironment.git) === null || _c === void 0 ? void 0 : _c.revision, env); +} +function detect(ciEnvironment, env) { + var url = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.url, env); + if (url === undefined) { + // The url is what consumers will use as the primary key for a build + // If this cannot be determined, we return nothing. + return undefined; + } + var buildNumber = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.buildNumber, env); + var git = detectGit(ciEnvironment, env); + return __assign({ name: ciEnvironment.name, url: url, buildNumber: buildNumber }, (git && { git: git })); +} +//# sourceMappingURL=detectCiEnvironment.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.js.map b/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.js.map new file mode 100644 index 00000000..96de07a6 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/detectCiEnvironment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"detectCiEnvironment.js","sourceRoot":"","sources":["../../../src/detectCiEnvironment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,sCAOC;AAED,sDAUC;AAzBD,yBAAiC;AAEjC,yDAAoD;AACpD,kGAAwE;AAGxE,SAAwB,mBAAmB,CAAC,GAAQ;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C,WAAW,EAAE,GAAG,CAAC,CAAA;IAC9E,IAAM,GAAG,GAAG,SAAS,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;IAEzC,kBACE,IAAI,EAAE,aAAa,CAAC,IAAI,EACxB,GAAG,KAAA,EACH,WAAW,aAAA,IACR,CAAC,GAAG,IAAI,EAAE,GAAG,KAAA,EAAE,CAAC,EACpB;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.d.ts b/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.d.ts new file mode 100644 index 00000000..d0faefb6 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.d.ts @@ -0,0 +1,3 @@ +import { Env } from './types.js'; +export default function evaluateVariableExpression(expression: string | undefined, env: Env): string | undefined; +//# sourceMappingURL=evaluateVariableExpression.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.d.ts.map b/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.d.ts.map new file mode 100644 index 00000000..15f17eab --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluateVariableExpression.d.ts","sourceRoot":"","sources":["../../../src/evaluateVariableExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAEhC,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAChD,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,GAAG,EAAE,GAAG,GACP,MAAM,GAAG,SAAS,CAgCpB"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.js b/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.js new file mode 100644 index 00000000..427943d8 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/evaluateVariableExpression.js @@ -0,0 +1,102 @@ +"use strict"; +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = evaluateVariableExpression; +function evaluateVariableExpression(expression, env) { + if (expression === undefined) { + return undefined; + } + try { + var re = new RegExp('\\${(.*?)(?:(?; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/types.d.ts.map b/node_modules/@cucumber/ci-environment/dist/cjs/src/types.d.ts.map new file mode 100644 index 00000000..a78aa282 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,GAAG,CAAC,EAAE,GAAG,CAAA;CACV,CAAA;AAED,MAAM,MAAM,GAAG,GAAG;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,EAAE,SAAS,aAAa,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/types.js b/node_modules/@cucumber/ci-environment/dist/cjs/src/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/src/types.js.map b/node_modules/@cucumber/ci-environment/dist/cjs/src/types.js.map new file mode 100644 index 00000000..70453b7a --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/src/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.d.ts b/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.d.ts new file mode 100644 index 00000000..d74d9980 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=acceptanceTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.d.ts.map b/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.d.ts.map new file mode 100644 index 00000000..2fe39e4a --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"acceptanceTest.d.ts","sourceRoot":"","sources":["../../../test/acceptanceTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.js b/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.js new file mode 100644 index 00000000..c19a618e --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.js @@ -0,0 +1,50 @@ +"use strict"; +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var fs_1 = __importDefault(require("fs")); +var glob_1 = require("glob"); +var path_1 = __importDefault(require("path")); +var index_js_1 = __importDefault(require("../src/index.js")); +describe('detectCiEnvironment', function () { + var e_1, _a; + var _loop_1 = function (txt) { + it("detects ".concat(path_1.default.basename(txt, '.txt')), function () { + var envData = fs_1.default.readFileSync(txt, { encoding: 'utf8' }); + var entries = envData.split(/\n/).map(function (line) { return line.split(/=/); }); + var env = Object.fromEntries(entries); + var ciEnvironment = (0, index_js_1.default)(env); + var expectedJson = fs_1.default.readFileSync("".concat(txt, ".json"), { + encoding: 'utf8', + }); + assert_1.default.deepStrictEqual(ciEnvironment, JSON.parse(expectedJson)); + }); + }; + try { + for (var _b = __values((0, glob_1.sync)("../testdata/src/*.txt")), _c = _b.next(); !_c.done; _c = _b.next()) { + var txt = _c.value; + _loop_1(txt); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } +}); +//# sourceMappingURL=acceptanceTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.js.map b/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.js.map new file mode 100644 index 00000000..f62c4753 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/acceptanceTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"acceptanceTest.js","sourceRoot":"","sources":["../../../test/acceptanceTest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA2B;AAC3B,0CAAmB;AACnB,6BAA2B;AAC3B,8CAAuB;AAEvB,6DAA+D;AAE/D,QAAQ,CAAC,qBAAqB,EAAE;;4BACnB,GAAG;QACZ,EAAE,CAAC,kBAAW,cAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAE,EAAE;YAC1C,IAAM,OAAO,GAAG,YAAE,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;YAC1D,IAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAf,CAAe,CAAC,CAAA;YAClE,IAAM,GAAG,GAAQ,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YAC5C,IAAM,aAAa,GAAG,IAAA,kBAAmB,EAAC,GAAG,CAAC,CAAA;YAE9C,IAAM,YAAY,GAAG,YAAE,CAAC,YAAY,CAAC,UAAG,GAAG,UAAO,EAAE;gBAClD,QAAQ,EAAE,MAAM;aACjB,CAAC,CAAA;YACF,gBAAM,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAA;QACjE,CAAC,CAAC,CAAA;;;QAXJ,KAAkB,IAAA,KAAA,SAAA,IAAA,WAAI,EAAC,uBAAuB,CAAC,CAAA,gBAAA;YAA1C,IAAM,GAAG,WAAA;oBAAH,GAAG;SAYb;;;;;;;;;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.d.ts b/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.d.ts new file mode 100644 index 00000000..2f18d359 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=evaluateVariableExpressionTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.d.ts.map b/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.d.ts.map new file mode 100644 index 00000000..0b9c4b5e --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluateVariableExpressionTest.d.ts","sourceRoot":"","sources":["../../../test/evaluateVariableExpressionTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.js b/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.js new file mode 100644 index 00000000..34fdb9b9 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.js @@ -0,0 +1,40 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var evaluateVariableExpression_js_1 = __importDefault(require("../src/evaluateVariableExpression.js")); +describe('createMeta', function () { + it('returns undefined when a variable is undefined', function () { + var expression = 'hello-${SOME_VAR}'; + var result = (0, evaluateVariableExpression_js_1.default)(expression, {}); + assert_1.default.strictEqual(result, undefined); + }); + it('gets a value without replacement', function () { + var expression = '${SOME_VAR}'; + var result = (0, evaluateVariableExpression_js_1.default)(expression, { SOME_VAR: 'some_value' }); + assert_1.default.strictEqual(result, 'some_value'); + }); + it('captures a group', function () { + var expression = '${SOME_REF/refs\\/heads\\/(.*)/\\1}'; + var result = (0, evaluateVariableExpression_js_1.default)(expression, { SOME_REF: 'refs/heads/main' }); + assert_1.default.strictEqual(result, 'main'); + }); + it('works with star wildcard in var', function () { + var expression = '${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}'; + var result = (0, evaluateVariableExpression_js_1.default)(expression, { + GO_SCM_MY_MATERIAL_PR_BRANCH: 'ashwankthkumar:feature-1', + }); + assert_1.default.strictEqual(result, 'feature-1'); + }); + it('evaluates a complex expression', function () { + var expression = 'hello-${VAR1}-${VAR2/(.*) (.*)/\\2-\\1}-world'; + var result = (0, evaluateVariableExpression_js_1.default)(expression, { + VAR1: 'amazing', + VAR2: 'gorgeous beautiful', + }); + assert_1.default.strictEqual(result, 'hello-amazing-beautiful-gorgeous-world'); + }); +}); +//# sourceMappingURL=evaluateVariableExpressionTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.js.map b/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.js.map new file mode 100644 index 00000000..be1e6e26 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/evaluateVariableExpressionTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluateVariableExpressionTest.js","sourceRoot":"","sources":["../../../test/evaluateVariableExpressionTest.ts"],"names":[],"mappings":";;;;;AAAA,kDAA2B;AAE3B,uGAA6E;AAE7E,QAAQ,CAAC,YAAY,EAAE;IACrB,EAAE,CAAC,gDAAgD,EAAE;QACnD,IAAM,UAAU,GAAG,mBAAmB,CAAA;QACtC,IAAM,MAAM,GAAG,IAAA,uCAA0B,EAAC,UAAU,EAAE,EAAE,CAAC,CAAA;QACzD,gBAAM,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACvC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kCAAkC,EAAE;QACrC,IAAM,UAAU,GAAG,aAAa,CAAA;QAChC,IAAM,MAAM,GAAG,IAAA,uCAA0B,EAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAA;QACjF,gBAAM,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kBAAkB,EAAE;QACrB,IAAM,UAAU,GAAG,qCAAqC,CAAA;QACxD,IAAM,MAAM,GAAG,IAAA,uCAA0B,EAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAA;QACtF,gBAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iCAAiC,EAAE;QACpC,IAAM,UAAU,GAAG,mCAAmC,CAAA;QACtD,IAAM,MAAM,GAAG,IAAA,uCAA0B,EAAC,UAAU,EAAE;YACpD,4BAA4B,EAAE,0BAA0B;SACzD,CAAC,CAAA;QACF,gBAAM,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gCAAgC,EAAE;QACnC,IAAM,UAAU,GAAG,+CAA+C,CAAA;QAClE,IAAM,MAAM,GAAG,IAAA,uCAA0B,EAAC,UAAU,EAAE;YACpD,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,oBAAoB;SAC3B,CAAC,CAAA;QACF,gBAAM,CAAC,WAAW,CAAC,MAAM,EAAE,wCAAwC,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.d.ts b/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.d.ts new file mode 100644 index 00000000..c2fcb4c7 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=gitHubPullRequestIntegrationTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.d.ts.map b/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.d.ts.map new file mode 100644 index 00000000..695ecca3 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gitHubPullRequestIntegrationTest.d.ts","sourceRoot":"","sources":["../../../test/gitHubPullRequestIntegrationTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.js b/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.js new file mode 100644 index 00000000..578eca46 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.js @@ -0,0 +1,18 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var index_js_1 = __importDefault(require("../src/index.js")); +describe('GitHub', function () { + if (process.env.GITHUB_EVENT_NAME === 'pull_request') { + it('detects the correct revision for pull requests', function () { + var ciEnvironment = (0, index_js_1.default)(process.env); + (0, assert_1.default)(ciEnvironment); + console.log('Manually verify that the revision is correct'); + console.log(JSON.stringify(ciEnvironment, null, 2)); + }); + } +}); +//# sourceMappingURL=gitHubPullRequestIntegrationTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.js.map b/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.js.map new file mode 100644 index 00000000..910b493c --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/gitHubPullRequestIntegrationTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gitHubPullRequestIntegrationTest.js","sourceRoot":"","sources":["../../../test/gitHubPullRequestIntegrationTest.ts"],"names":[],"mappings":";;;;;AAAA,kDAA2B;AAE3B,6DAAiD;AAEjD,QAAQ,CAAC,QAAQ,EAAE;IACjB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,cAAc,EAAE,CAAC;QACrD,EAAE,CAAC,gDAAgD,EAAE;YACnD,IAAM,aAAa,GAAG,IAAA,kBAAmB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YACtD,IAAA,gBAAM,EAAC,aAAa,CAAC,CAAA;YACrB,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAA;YAC3D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QACrD,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.d.ts b/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.d.ts new file mode 100644 index 00000000..e0ae5847 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=removeUserInfoFromUrlTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.d.ts.map b/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.d.ts.map new file mode 100644 index 00000000..7e1331b1 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"removeUserInfoFromUrlTest.d.ts","sourceRoot":"","sources":["../../../test/removeUserInfoFromUrlTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.js b/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.js new file mode 100644 index 00000000..4fef2322 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.js @@ -0,0 +1,27 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var detectCiEnvironment_js_1 = require("../src/detectCiEnvironment.js"); +describe('removeUserInfoFromUrl', function () { + it('returns empty string for empty string', function () { + assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)(''), ''); + }); + it('leaves the data intact when no sensitive information is detected', function () { + assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)('pretty safe'), 'pretty safe'); + }); + context('with URLs', function () { + it('leaves intact when no password is found', function () { + assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)('https://example.com/git/repo.git'), 'https://example.com/git/repo.git'); + }); + it('removes credentials when found', function () { + assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)('http://aslak@example.com/git/repo.git'), 'http://example.com/git/repo.git'); + }); + it('removes credentials and passwords when found', function () { + assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)('ssh://login:password@example.com/git/repo.git'), 'ssh://example.com/git/repo.git'); + }); + }); +}); +//# sourceMappingURL=removeUserInfoFromUrlTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.js.map b/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.js.map new file mode 100644 index 00000000..ee4f102d --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/test/removeUserInfoFromUrlTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"removeUserInfoFromUrlTest.js","sourceRoot":"","sources":["../../../test/removeUserInfoFromUrlTest.ts"],"names":[],"mappings":";;;;;AAAA,kDAA2B;AAE3B,wEAAqE;AAErE,QAAQ,CAAC,uBAAuB,EAAE;IAChC,EAAE,CAAC,uCAAuC,EAAE;QAC1C,gBAAM,CAAC,WAAW,CAAC,IAAA,8CAAqB,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kEAAkE,EAAE;QACrE,gBAAM,CAAC,WAAW,CAAC,IAAA,8CAAqB,EAAC,aAAa,CAAC,EAAE,aAAa,CAAC,CAAA;IACzE,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,WAAW,EAAE;QACnB,EAAE,CAAC,yCAAyC,EAAE;YAC5C,gBAAM,CAAC,WAAW,CAChB,IAAA,8CAAqB,EAAC,kCAAkC,CAAC,EACzD,kCAAkC,CACnC,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,gCAAgC,EAAE;YACnC,gBAAM,CAAC,WAAW,CAChB,IAAA,8CAAqB,EAAC,uCAAuC,CAAC,EAC9D,iCAAiC,CAClC,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,8CAA8C,EAAE;YACjD,gBAAM,CAAC,WAAW,CAChB,IAAA,8CAAqB,EAAC,+CAA+C,CAAC,EACtE,gCAAgC,CACjC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/cjs/tsconfig.build-cjs.tsbuildinfo b/node_modules/@cucumber/ci-environment/dist/cjs/tsconfig.build-cjs.tsbuildinfo new file mode 100644 index 00000000..f5d315fc --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/cjs/tsconfig.build-cjs.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/types.ts","../../src/CiEnvironments.ts","../../src/evaluateVariableExpression.ts","../../src/detectCiEnvironment.ts","../../src/index.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/@types/node/web-globals/events.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/inspector.generated.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/sqlite.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/index.d.ts","../../node_modules/minipass/dist/commonjs/index.d.ts","../../node_modules/lru-cache/dist/commonjs/index.d.ts","../../node_modules/path-scurry/dist/commonjs/index.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts","../../node_modules/glob/dist/commonjs/pattern.d.ts","../../node_modules/glob/dist/commonjs/processor.d.ts","../../node_modules/glob/dist/commonjs/walker.d.ts","../../node_modules/glob/dist/commonjs/ignore.d.ts","../../node_modules/glob/dist/commonjs/glob.d.ts","../../node_modules/glob/dist/commonjs/has-magic.d.ts","../../node_modules/glob/dist/commonjs/index.d.ts","../../test/acceptanceTest.ts","../../test/evaluateVariableExpressionTest.ts","../../test/gitHubPullRequestIntegrationTest.ts","../../test/removeUserInfoFromUrlTest.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/json5/index.d.ts","../../node_modules/@types/mocha/index.d.ts"],"fileIdsList":[[57,105,122,123],[57,102,103,105,122,123],[57,104,105,122,123],[105,122,123],[57,105,110,122,123,140],[57,105,106,111,116,122,123,125,137,148],[57,105,106,107,116,122,123,125],[52,53,54,57,105,122,123],[57,105,108,122,123,149],[57,105,109,110,117,122,123,126],[57,105,110,122,123,137,145],[57,105,111,113,116,122,123,125],[57,104,105,112,122,123],[57,105,113,114,122,123],[57,105,115,116,122,123],[57,104,105,116,122,123],[57,105,116,117,118,122,123,137,148],[57,105,116,117,118,122,123,132,137,140],[57,98,105,113,116,119,122,123,125,137,148],[57,105,116,117,119,120,122,123,125,137,145,148],[57,105,119,121,122,123,137,145,148],[55,56,57,58,59,60,61,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154],[57,105,116,122,123],[57,105,122,123,124,148],[57,105,113,116,122,123,125,137],[57,105,122,123,126],[57,105,122,123,127],[57,104,105,122,123,128],[57,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154],[57,105,122,123,130],[57,105,122,123,131],[57,105,116,122,123,132,133],[57,105,122,123,132,134,149,151],[57,105,117,122,123],[57,105,116,122,123,137,138,140],[57,105,122,123,139,140],[57,105,122,123,137,138],[57,105,122,123,140],[57,105,122,123,141],[57,102,105,122,123,137,142],[57,105,116,122,123,143,144],[57,105,122,123,143,144],[57,105,110,122,123,125,137,145],[57,105,122,123,146],[57,105,122,123,125,147],[57,105,119,122,123,131,148],[57,105,110,122,123,149],[57,105,122,123,137,150],[57,105,122,123,124,151],[57,105,122,123,152],[57,98,105,122,123],[57,98,105,116,118,122,123,128,137,140,148,150,151,153],[57,105,122,123,137,154],[57,105,122,123,156,158,162,163,166],[57,105,122,123,167],[57,105,122,123,158,162,165],[57,105,122,123,156,158,162,165,166,167,168],[57,105,122,123,162],[57,105,122,123,158,162,163,165],[57,105,122,123,156,158,163,164,166],[57,105,122,123,159,160,161],[57,105,116,122,123,141,155],[57,105,117,122,123,127,156,157],[57,70,74,105,122,123,148],[57,70,105,122,123,137,148],[57,65,105,122,123],[57,67,70,105,122,123,145,148],[57,105,122,123,125,145],[57,105,122,123,155],[57,65,105,122,123,155],[57,67,70,105,122,123,125,148],[57,62,63,66,69,105,116,122,123,137,148],[57,70,77,105,122,123],[57,62,68,105,122,123],[57,70,91,92,105,122,123],[57,66,70,105,122,123,140,148,155],[57,91,105,122,123,155],[57,64,65,105,122,123,155],[57,70,105,122,123],[57,64,65,66,67,68,69,70,71,72,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,92,93,94,95,96,97,105,122,123],[57,70,85,105,122,123],[57,70,77,78,105,122,123],[57,68,70,78,79,105,122,123],[57,69,105,122,123],[57,62,65,70,105,122,123],[57,70,74,78,79,105,122,123],[57,74,105,122,123],[57,68,70,73,105,122,123,148],[57,62,67,70,77,105,122,123],[57,105,122,123,137],[57,65,70,91,105,122,123,153,155],[47,57,105,122,123],[47,48,49,57,105,117,122,123],[47,50,57,105,122,123],[51,57,102,105,117,122,123,127,169],[49,57,102,105,122,123],[51,57,102,105,122,123],[50,57,102,105,122,123]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"9584227b611f65058fdf9d04b648f35b6d05441582b8586d96a356ac19448c0a","signature":"8be2a46b61cf1681e570b70c8a9c6ab5b4beef825836b02e33da0d1de98fcf83"},{"version":"be2d886af4020bb2146c78876c2846769b7d52afe668005644c0bdc5a554453d","signature":"afa45ce668f64ede390cdc539249afa1f79a80550e79a12cee545ac05a0ddd20"},{"version":"74c947a817aa4d532ca74bc47f913a44591f47ac52c95a704670c89ba9b94211","signature":"ddf341c36cecf3851b23139d9cbecba36388984de004e786bd19fb6ed62ea1d2"},{"version":"4262c45efb4852f9f59f5ca4d2fd6795860f60bd325d5d66487f37bd74b4e2f7","signature":"9177d9f96314c05220cd62c56196487853d3678605d745e78a7407072a8cf7d8"},{"version":"09b50c5632abc08b7c1ffaade3d118602a3b8d20564dd659cd6e28b54c88f083","signature":"6deeb17028e6d068f9018204cdf2f4bc465b20f44b7dd2b9cdad41e43bef2237"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"bb45cd435da536500f1d9692a9b49d0c570b763ccbf00473248b777f5c1f353b","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bc7425ef40526650d6db7e072c1ff4a51101c3ac2cc4b666623b19496a6e27","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c959a391a75be9789b43c8468f71e3fa06488b4d691d5729dde1416dcd38225b","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"0dba70b3fb0dcd713fda33c2df64fa6751fff6460e536971cee917260fb17882","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"041597c12abeaa2ef07766775955fc87cfc65c43e0fe86c836071bea787e967c","impliedFormat":1},{"version":"0838507efff4f479c6f603ec812810ddfe14ab32abf8f4a8def140be970fe439","impliedFormat":1},{"version":"072f583571d6e3d30cd9760ee3485d29484fb7b54ba772ac135c747a380096a1","impliedFormat":1},{"version":"7212c2d58855b8df35275180e97903a4b6093d4fbaefea863d8d028da63938c6","impliedFormat":1},{"version":"d8a6b3f899917210f00ddf13b564a2a4fdcf1e50c5a22e8d3abcfd4f1c4f9ae1","impliedFormat":1},{"version":"fd5eab954b31e761a72234031dadc3aab768763942a9637e380aed441cc94f59","impliedFormat":1},{"version":"c7aaac3119acf27e03190cc4224f1d81c7498cf6b36fa72d10d99f2c41d1bbc0","impliedFormat":1},{"version":"dd9faff42b456b5f03b85d8fbd64838eb92f6f7b03b36322cbc59c005b7033d3","impliedFormat":1},{"version":"6ff702721d87c0ba8e7f8950e7b0a3b009dfd912fab3997e0b63fab8d83919c3","impliedFormat":1},{"version":"9dce9fc12e9a79d1135699d525aa6b44b71a45e32e3fa0cf331060b980b16317","impliedFormat":1},{"version":"586b2fd8a7d582329658aaceec22f8a5399e05013deb49bcfde28f95f093c8ee","impliedFormat":1},{"version":"59c44b081724d4ab8039988aba34ee6b3bd41c30fc2d8686f4ed06588397b2f7","impliedFormat":1},{"version":"ef1f3eadd7bed282de45bafd7c2c00105cf1db93e22f6cd763bec8a9c2cf6df1","impliedFormat":1},{"version":"2b90463c902dbe4f5bbb9eae084c05de37477c17a5de1e342eb7cbc9410dc6a1","impliedFormat":1},{"version":"7f85e915e642bfc7f4fcaf10c174b12d4156e330e8377dfacd094bde441fe96c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"f625adde8864834f8467ca8c51a91ebb7104f53b16cf8ebd8130b0279f55a9e3","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e1cc9b7856fba8e77b161e3f9369830b76798139db320cdf92cc35f67e4006d6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"dda4432f51c9958410acdf1b09a2d3cb898222d318ba188e8754234533a3e39d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1}],"root":[[47,51],[170,173]],"options":{"allowJs":false,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitAny":true,"outDir":"./","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":1},"referencedMap":[[174,1],[175,1],[176,1],[177,1],[102,2],[103,2],[104,3],[57,4],[105,5],[106,6],[107,7],[52,1],[55,8],[53,1],[54,1],[108,9],[109,10],[110,11],[111,12],[112,13],[113,14],[114,14],[115,15],[116,16],[117,17],[118,18],[58,1],[56,1],[119,19],[120,20],[121,21],[155,22],[122,23],[123,1],[124,24],[125,25],[126,26],[127,27],[128,28],[129,29],[130,30],[131,31],[132,32],[133,32],[134,33],[135,1],[136,34],[137,35],[139,36],[138,37],[140,38],[141,39],[142,40],[143,41],[144,42],[145,43],[146,44],[147,45],[148,46],[149,47],[150,48],[151,49],[152,50],[59,1],[60,1],[61,1],[99,51],[100,1],[101,1],[153,52],[154,53],[167,54],[168,55],[166,56],[169,57],[163,58],[164,59],[165,60],[159,58],[160,58],[162,61],[161,58],[157,1],[156,62],[158,63],[45,1],[46,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[19,1],[20,1],[4,1],[21,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[77,64],[87,65],[76,64],[97,66],[68,67],[67,68],[96,69],[90,70],[95,71],[70,72],[84,73],[69,74],[93,75],[65,76],[64,69],[94,77],[66,78],[71,79],[72,1],[75,79],[62,1],[98,80],[88,81],[79,82],[80,83],[82,84],[78,85],[81,86],[91,69],[73,87],[74,88],[83,89],[63,90],[86,81],[85,79],[89,1],[92,91],[48,92],[50,93],[49,92],[51,94],[47,1],[170,95],[171,96],[172,97],[173,98]],"latestChangedDtsFile":"./test/removeUserInfoFromUrlTest.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.d.ts new file mode 100644 index 00000000..0dd3c516 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.d.ts @@ -0,0 +1,3 @@ +import { CiEnvironment } from './types.js'; +export declare const CiEnvironments: readonly CiEnvironment[]; +//# sourceMappingURL=CiEnvironments.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.d.ts.map new file mode 100644 index 00000000..8315e4ab --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CiEnvironments.d.ts","sourceRoot":"","sources":["../../../src/CiEnvironments.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EAgKlD,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.js b/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.js new file mode 100644 index 00000000..aaa5c87a --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.js @@ -0,0 +1,163 @@ +/* This file is auto-generated using npm run build-ci-environments */ +/* eslint-disable no-useless-escape */ +export const CiEnvironments = [ + { + name: 'Azure Pipelines', + url: '${BUILD_BUILDURI}', + buildNumber: '${BUILD_BUILDNUMBER}', + git: { + remote: '${BUILD_REPOSITORY_URI}', + revision: '${BUILD_SOURCEVERSION}', + branch: '${BUILD_SOURCEBRANCH/refs\/heads\/(.*)/\\1}', + tag: '${BUILD_SOURCEBRANCH/refs\/tags\/(.*)/\\1}', + }, + }, + { + name: 'Bamboo', + url: '${bamboo_buildResultsUrl}', + buildNumber: '${bamboo_buildNumber}', + git: { + remote: '${bamboo_planRepository_repositoryUrl}', + revision: '${bamboo_planRepository_revision}', + branch: '${bamboo_planRepository_branch}', + }, + }, + { + name: 'Buddy', + url: '${BUDDY_EXECUTION_URL}', + buildNumber: '${BUDDY_EXECUTION_ID}', + git: { + remote: '${BUDDY_SCM_URL}', + revision: '${BUDDY_EXECUTION_REVISION}', + branch: '${BUDDY_EXECUTION_BRANCH}', + tag: '${BUDDY_EXECUTION_TAG}', + }, + }, + { + name: 'Bitrise', + url: '${BITRISE_BUILD_URL}', + buildNumber: '${BITRISE_BUILD_NUMBER}', + git: { + remote: '${GIT_REPOSITORY_URL}', + revision: '${BITRISE_GIT_COMMIT}', + branch: '${BITRISE_GIT_BRANCH}', + tag: '${BITRISE_GIT_TAG}', + }, + }, + { + name: 'CircleCI', + url: '${CIRCLE_BUILD_URL}', + buildNumber: '${CIRCLE_BUILD_NUM}', + git: { + remote: '${CIRCLE_REPOSITORY_URL}', + revision: '${CIRCLE_SHA1}', + branch: '${CIRCLE_BRANCH}', + tag: '${CIRCLE_TAG}', + }, + }, + { + name: 'CodeFresh', + url: '${CF_BUILD_URL}', + buildNumber: '${CF_BUILD_ID}', + git: { + remote: '${CF_COMMIT_URL/(.*)\\/commit.+$/\\1}.git', + revision: '${CF_REVISION}', + branch: '${CF_BRANCH}', + }, + }, + { + name: 'CodeShip', + url: '${CI_BUILD_URL}', + buildNumber: '${CI_BUILD_NUMBER}', + git: { + remote: '${CI_PULL_REQUEST/(.*)\\/pull\\/\\d+/\\1.git}', + revision: '${CI_COMMIT_ID}', + branch: '${CI_BRANCH}', + }, + }, + { + name: 'GitHub Actions', + url: '${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}', + buildNumber: '${GITHUB_RUN_ID}', + git: { + remote: '${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git', + revision: '${GITHUB_SHA}', + branch: '${GITHUB_HEAD_REF}', + tag: '${GITHUB_REF/refs\/tags\/(.*)/\\1}', + }, + }, + { + name: 'GitLab', + url: '${CI_JOB_URL}', + buildNumber: '${CI_JOB_ID}', + git: { + remote: '${CI_REPOSITORY_URL}', + revision: '${CI_COMMIT_SHA}', + branch: '${CI_COMMIT_BRANCH}', + tag: '${CI_COMMIT_TAG}', + }, + }, + { + name: 'GoCD', + url: '${GO_SERVER_URL}/pipelines/${GO_PIPELINE_NAME}/${GO_PIPELINE_COUNTER}/${GO_STAGE_NAME}/${GO_STAGE_COUNTER}', + buildNumber: '${GO_PIPELINE_NAME}/${GO_PIPELINE_COUNTER}/${GO_STAGE_NAME}/${GO_STAGE_COUNTER}', + git: { + remote: '${GO_SCM_*_PR_URL/(.*)\\/pull\\/\\d+/\\1.git}', + revision: '${GO_REVISION}', + branch: '${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}', + }, + }, + { + name: 'Jenkins', + url: '${BUILD_URL}', + buildNumber: '${BUILD_NUMBER}', + git: { + remote: '${GIT_URL}', + revision: '${GIT_COMMIT}', + branch: '${GIT_LOCAL_BRANCH}', + }, + }, + { + name: 'JetBrains Space', + url: '${JB_SPACE_EXECUTION_URL}', + buildNumber: '${JB_SPACE_EXECUTION_NUMBER}', + git: { + remote: 'https://${JB_SPACE_API_URL}/p/${JB_SPACE_PROJECT_KEY}/repositories/${JB_SPACE_GIT_REPOSITORY_NAME}', + revision: '${JB_SPACE_GIT_REVISION}', + branch: '${JB_SPACE_GIT_BRANCH}', + }, + }, + { + name: 'Semaphore', + url: '${SEMAPHORE_ORGANIZATION_URL}/jobs/${SEMAPHORE_JOB_ID}', + buildNumber: '${SEMAPHORE_JOB_ID}', + git: { + remote: '${SEMAPHORE_GIT_URL}', + revision: '${SEMAPHORE_GIT_SHA}', + branch: '${SEMAPHORE_GIT_BRANCH}', + tag: '${SEMAPHORE_GIT_TAG_NAME}', + }, + }, + { + name: 'Travis CI', + url: '${TRAVIS_BUILD_WEB_URL}', + buildNumber: '${TRAVIS_JOB_NUMBER}', + git: { + remote: 'https://github.com/${TRAVIS_REPO_SLUG}.git', + revision: '${TRAVIS_COMMIT}', + branch: '${TRAVIS_BRANCH}', + tag: '${TRAVIS_TAG}', + }, + }, + { + name: 'Wercker', + url: '${WERCKER_RUN_URL}', + buildNumber: '${WERCKER_RUN_URL/.*\\/([^\\/]+)$/\\1}', + git: { + remote: 'https://${WERCKER_GIT_DOMAIN}/${WERCKER_GIT_OWNER}/${WERCKER_GIT_REPOSITORY}.git', + revision: '${WERCKER_GIT_COMMIT}', + branch: '${WERCKER_GIT_BRANCH}', + }, + }, +]; +//# sourceMappingURL=CiEnvironments.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.js.map b/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.js.map new file mode 100644 index 00000000..b01443b0 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/CiEnvironments.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CiEnvironments.js","sourceRoot":"","sources":["../../../src/CiEnvironments.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,MAAM,CAAC,MAAM,cAAc,GAA6B;IACtD;QACE,IAAI,EAAE,iBAAiB;QACvB,GAAG,EAAE,mBAAmB;QACxB,WAAW,EAAE,sBAAsB;QACnC,GAAG,EAAE;YACH,MAAM,EAAE,yBAAyB;YACjC,QAAQ,EAAE,wBAAwB;YAClC,MAAM,EAAE,6CAA6C;YACrD,GAAG,EAAE,4CAA4C;SAClD;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,2BAA2B;QAChC,WAAW,EAAE,uBAAuB;QACpC,GAAG,EAAE;YACH,MAAM,EAAE,wCAAwC;YAChD,QAAQ,EAAE,mCAAmC;YAC7C,MAAM,EAAE,iCAAiC;SAC1C;KACF;IACD;QACE,IAAI,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AI,EAAE,SAAS;QACf,GAAG,EAAE,oBAAoB;QACzB,WAAW,EAAE,wCAAwC;QACrD,GAAG,EAAE;YACH,MAAM,EAAE,kFAAkF;YAC1F,QAAQ,EAAE,uBAAuB;YACjC,MAAM,EAAE,uBAAuB;SAChC;KACF;CACF,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.d.ts new file mode 100644 index 00000000..1ca9a50b --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.d.ts @@ -0,0 +1,4 @@ +import { CiEnvironment, Env } from './types.js'; +export default function detectCiEnvironment(env: Env): CiEnvironment | undefined; +export declare function removeUserInfoFromUrl(value: string): string; +//# sourceMappingURL=detectCiEnvironment.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.d.ts.map new file mode 100644 index 00000000..989bad7b --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"detectCiEnvironment.d.ts","sourceRoot":"","sources":["../../../src/detectCiEnvironment.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAO,MAAM,YAAY,CAAA;AAEpD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,GAAG,SAAS,CAO/E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU3D"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.js b/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.js new file mode 100644 index 00000000..61d74f8c --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.js @@ -0,0 +1,66 @@ +import { readFileSync } from 'fs'; +import { CiEnvironments } from './CiEnvironments.js'; +import evaluateVariableExpression from './evaluateVariableExpression.js'; +export default function detectCiEnvironment(env) { + for (const ciEnvironment of CiEnvironments) { + const detected = detect(ciEnvironment, env); + if (detected) { + return detected; + } + } +} +export function removeUserInfoFromUrl(value) { + if (!value) + return value; + try { + const url = new URL(value); + url.password = ''; + url.username = ''; + return url.toString(); + } + catch (_) { + return value; + } +} +function detectGit(ciEnvironment, env) { + var _a, _b, _c; + const revision = detectRevision(ciEnvironment, env); + if (!revision) { + return undefined; + } + const remote = evaluateVariableExpression((_a = ciEnvironment.git) === null || _a === void 0 ? void 0 : _a.remote, env); + if (!remote) { + return undefined; + } + const tag = evaluateVariableExpression((_b = ciEnvironment.git) === null || _b === void 0 ? void 0 : _b.tag, env); + const branch = evaluateVariableExpression((_c = ciEnvironment.git) === null || _c === void 0 ? void 0 : _c.branch, env); + return Object.assign(Object.assign({ revision, remote: removeUserInfoFromUrl(remote) }, (tag && { tag })), (branch && { branch })); +} +function detectRevision(ciEnvironment, env) { + var _a, _b, _c; + if (env.GITHUB_EVENT_NAME === 'pull_request') { + if (!env.GITHUB_EVENT_PATH) + throw new Error('GITHUB_EVENT_PATH not set'); + const json = readFileSync(env.GITHUB_EVENT_PATH, 'utf-8'); + const event = JSON.parse(json); + const revision = (_b = (_a = event.pull_request) === null || _a === void 0 ? void 0 : _a.head) === null || _b === void 0 ? void 0 : _b.sha; + if (!revision) { + throw new Error(`Could not find .pull_request.head.sha in ${env.GITHUB_EVENT_PATH}:\n${JSON.stringify(event, null, 2)}`); + } + return revision; + } + return evaluateVariableExpression((_c = ciEnvironment.git) === null || _c === void 0 ? void 0 : _c.revision, env); +} +function detect(ciEnvironment, env) { + const url = evaluateVariableExpression(ciEnvironment.url, env); + if (url === undefined) { + // The url is what consumers will use as the primary key for a build + // If this cannot be determined, we return nothing. + return undefined; + } + const buildNumber = evaluateVariableExpression(ciEnvironment.buildNumber, env); + const git = detectGit(ciEnvironment, env); + return Object.assign({ name: ciEnvironment.name, url, + buildNumber }, (git && { git })); +} +//# sourceMappingURL=detectCiEnvironment.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.js.map b/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.js.map new file mode 100644 index 00000000..c402a5ac --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/detectCiEnvironment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"detectCiEnvironment.js","sourceRoot":"","sources":["../../../src/detectCiEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,0BAA0B,MAAM,iCAAiC,CAAA;AAGxE,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,GAAQ;IAClD,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;QAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;QAC3C,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAA;QACjB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1B,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAA;QACjB,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAA;QACjB,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAA;IACvB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,aAA4B,EAAE,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AAC,SAAS,CACnF,KAAK,EACL,IAAI,EACJ,CAAC,CACF,EAAE,CACJ,CAAA;QACH,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;IACD,OAAO,0BAA0B,CAAC,MAAA,aAAa,CAAC,GAAG,0CAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;AACrE,CAAC;AAED,SAAS,MAAM,CAAC,aAA4B,EAAE,GAAQ;IACpD,MAAM,GAAG,GAAG,0BAA0B,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC9D,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,oEAAoE;QACpE,mDAAmD;QACnD,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,MAAM,WAAW,GAAG,0BAA0B,CAAC,aAAa,CAAC,WAAW,EAAE,GAAG,CAAC,CAAA;IAC9E,MAAM,GAAG,GAAG,SAAS,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;IAEzC,uBACE,IAAI,EAAE,aAAa,CAAC,IAAI,EACxB,GAAG;QACH,WAAW,IACR,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,EACpB;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.d.ts new file mode 100644 index 00000000..d0faefb6 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.d.ts @@ -0,0 +1,3 @@ +import { Env } from './types.js'; +export default function evaluateVariableExpression(expression: string | undefined, env: Env): string | undefined; +//# sourceMappingURL=evaluateVariableExpression.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.d.ts.map new file mode 100644 index 00000000..15f17eab --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluateVariableExpression.d.ts","sourceRoot":"","sources":["../../../src/evaluateVariableExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAEhC,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAChD,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,GAAG,EAAE,GAAG,GACP,MAAM,GAAG,SAAS,CAgCpB"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.js b/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.js new file mode 100644 index 00000000..abc2d652 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.js @@ -0,0 +1,46 @@ +export default function evaluateVariableExpression(expression, env) { + if (expression === undefined) { + return undefined; + } + try { + const re = new RegExp('\\${(.*?)(?:(? { + const variable = args[0]; + const value = getValue(env, variable); + if (value === undefined) { + throw new Error(`Undefined variable: ${variable}`); + } + const pattern = args[1]; + if (!pattern) { + return value; + } + const regExp = new RegExp(pattern.replace('/', '/')); + const match = regExp.exec(value); + if (!match) { + throw new Error(`No match for: ${variable}`); + } + let replacement = args[2]; + let ref = 1; + for (const group of match.slice(1)) { + replacement = replacement.replace(`\\${ref++}`, group); + } + return replacement; + }); + } + catch (_) { + // There was an undefined variable + return undefined; + } +} +function getValue(env, variable) { + if (variable.includes('*')) { + const regexp = new RegExp(variable.replace('*', '.*')); + for (const [name, value] of Object.entries(env)) { + if (regexp.exec(name)) { + return value; + } + } + } + return env[variable]; +} +//# sourceMappingURL=evaluateVariableExpression.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.js.map b/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.js.map new file mode 100644 index 00000000..afb96782 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/evaluateVariableExpression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluateVariableExpression.js","sourceRoot":"","sources":["../../../src/evaluateVariableExpression.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAChD,UAA8B,EAC9B,GAAQ;IAER,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAA;QAChE,OAAO,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,SAAS,EAAE,GAAG,IAAI,EAAU,EAAE;YAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACxB,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YACrC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,EAAE,CAAC,CAAA;YACpD,CAAC;YACD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACvB,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,KAAK,CAAA;YACd,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;YACpD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAChC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,KAAK,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAA;YAC9C,CAAC;YACD,IAAI,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACzB,IAAI,GAAG,GAAG,CAAC,CAAA;YACX,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnC,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;YACxD,CAAC;YACD,OAAO,WAAW,CAAA;QACpB,CAAC,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,kCAAkC;QAClC,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,GAAQ,EAAE,QAAgB;IAC1C,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;QACtD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACtB,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAA;AACtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/index.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/src/index.d.ts new file mode 100644 index 00000000..3c2b8b37 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/index.d.ts @@ -0,0 +1,4 @@ +import detectCiEnvironment from './detectCiEnvironment.js'; +export * from './types.js'; +export default detectCiEnvironment; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/index.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/src/index.d.ts.map new file mode 100644 index 00000000..bbd53591 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAE1D,cAAc,YAAY,CAAA;AAC1B,eAAe,mBAAmB,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/index.js b/node_modules/@cucumber/ci-environment/dist/esm/src/index.js new file mode 100644 index 00000000..e85cea61 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/index.js @@ -0,0 +1,4 @@ +import detectCiEnvironment from './detectCiEnvironment.js'; +export * from './types.js'; +export default detectCiEnvironment; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/index.js.map b/node_modules/@cucumber/ci-environment/dist/esm/src/index.js.map new file mode 100644 index 00000000..f9648dc7 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAE1D,cAAc,YAAY,CAAA;AAC1B,eAAe,mBAAmB,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/types.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/src/types.d.ts new file mode 100644 index 00000000..a653b27c --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/types.d.ts @@ -0,0 +1,17 @@ +export type CiEnvironment = { + name: string; + url: string; + buildNumber?: string; + git?: Git; +}; +export type Git = { + remote: string; + revision: string; + branch?: string; + tag?: string; +}; +export type CiEnvironments = { + ciEnvironments: readonly CiEnvironment[]; +}; +export type Env = Record; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/types.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/src/types.d.ts.map new file mode 100644 index 00000000..a78aa282 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,GAAG,CAAC,EAAE,GAAG,CAAA;CACV,CAAA;AAED,MAAM,MAAM,GAAG,GAAG;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,EAAE,SAAS,aAAa,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/types.js b/node_modules/@cucumber/ci-environment/dist/esm/src/types.js new file mode 100644 index 00000000..718fd38a --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/src/types.js.map b/node_modules/@cucumber/ci-environment/dist/esm/src/types.js.map new file mode 100644 index 00000000..70453b7a --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/src/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.d.ts new file mode 100644 index 00000000..d74d9980 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=acceptanceTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.d.ts.map new file mode 100644 index 00000000..2fe39e4a --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"acceptanceTest.d.ts","sourceRoot":"","sources":["../../../test/acceptanceTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.js b/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.js new file mode 100644 index 00000000..71687923 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.js @@ -0,0 +1,20 @@ +import assert from 'assert'; +import fs from 'fs'; +import { sync } from 'glob'; +import path from 'path'; +import detectCiEnvironment from '../src/index.js'; +describe('detectCiEnvironment', () => { + for (const txt of sync(`../testdata/src/*.txt`)) { + it(`detects ${path.basename(txt, '.txt')}`, () => { + const envData = fs.readFileSync(txt, { encoding: 'utf8' }); + const entries = envData.split(/\n/).map((line) => line.split(/=/)); + const env = Object.fromEntries(entries); + const ciEnvironment = detectCiEnvironment(env); + const expectedJson = fs.readFileSync(`${txt}.json`, { + encoding: 'utf8', + }); + assert.deepStrictEqual(ciEnvironment, JSON.parse(expectedJson)); + }); + } +}); +//# sourceMappingURL=acceptanceTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.js.map b/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.js.map new file mode 100644 index 00000000..7b811234 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/acceptanceTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"acceptanceTest.js","sourceRoot":"","sources":["../../../test/acceptanceTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,mBAAiC,MAAM,iBAAiB,CAAA;AAE/D,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC;QAChD,EAAE,CAAC,WAAW,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE;YAC/C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;YAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;YAClE,MAAM,GAAG,GAAQ,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YAC5C,MAAM,aAAa,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAA;YAE9C,MAAM,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,GAAG,OAAO,EAAE;gBAClD,QAAQ,EAAE,MAAM;aACjB,CAAC,CAAA;YACF,MAAM,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAA;QACjE,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.d.ts new file mode 100644 index 00000000..2f18d359 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=evaluateVariableExpressionTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.d.ts.map new file mode 100644 index 00000000..0b9c4b5e --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluateVariableExpressionTest.d.ts","sourceRoot":"","sources":["../../../test/evaluateVariableExpressionTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.js b/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.js new file mode 100644 index 00000000..ee511c18 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.js @@ -0,0 +1,35 @@ +import assert from 'assert'; +import evaluateVariableExpression from '../src/evaluateVariableExpression.js'; +describe('createMeta', () => { + it('returns undefined when a variable is undefined', () => { + const expression = 'hello-${SOME_VAR}'; + const result = evaluateVariableExpression(expression, {}); + assert.strictEqual(result, undefined); + }); + it('gets a value without replacement', () => { + const expression = '${SOME_VAR}'; + const result = evaluateVariableExpression(expression, { SOME_VAR: 'some_value' }); + assert.strictEqual(result, 'some_value'); + }); + it('captures a group', () => { + const expression = '${SOME_REF/refs\\/heads\\/(.*)/\\1}'; + const result = evaluateVariableExpression(expression, { SOME_REF: 'refs/heads/main' }); + assert.strictEqual(result, 'main'); + }); + it('works with star wildcard in var', () => { + const expression = '${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}'; + const result = evaluateVariableExpression(expression, { + GO_SCM_MY_MATERIAL_PR_BRANCH: 'ashwankthkumar:feature-1', + }); + assert.strictEqual(result, 'feature-1'); + }); + it('evaluates a complex expression', () => { + const expression = 'hello-${VAR1}-${VAR2/(.*) (.*)/\\2-\\1}-world'; + const result = evaluateVariableExpression(expression, { + VAR1: 'amazing', + VAR2: 'gorgeous beautiful', + }); + assert.strictEqual(result, 'hello-amazing-beautiful-gorgeous-world'); + }); +}); +//# sourceMappingURL=evaluateVariableExpressionTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.js.map b/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.js.map new file mode 100644 index 00000000..4fe03d45 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/evaluateVariableExpressionTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluateVariableExpressionTest.js","sourceRoot":"","sources":["../../../test/evaluateVariableExpressionTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,0BAA0B,MAAM,sCAAsC,CAAA;AAE7E,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,UAAU,GAAG,mBAAmB,CAAA;QACtC,MAAM,MAAM,GAAG,0BAA0B,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;QACzD,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACvC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,UAAU,GAAG,aAAa,CAAA;QAChC,MAAM,MAAM,GAAG,0BAA0B,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAA;QACjF,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC1B,MAAM,UAAU,GAAG,qCAAqC,CAAA;QACxD,MAAM,MAAM,GAAG,0BAA0B,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAA;QACtF,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,UAAU,GAAG,mCAAmC,CAAA;QACtD,MAAM,MAAM,GAAG,0BAA0B,CAAC,UAAU,EAAE;YACpD,4BAA4B,EAAE,0BAA0B;SACzD,CAAC,CAAA;QACF,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,UAAU,GAAG,+CAA+C,CAAA;QAClE,MAAM,MAAM,GAAG,0BAA0B,CAAC,UAAU,EAAE;YACpD,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,oBAAoB;SAC3B,CAAC,CAAA;QACF,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,wCAAwC,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.d.ts new file mode 100644 index 00000000..c2fcb4c7 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=gitHubPullRequestIntegrationTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.d.ts.map new file mode 100644 index 00000000..695ecca3 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gitHubPullRequestIntegrationTest.d.ts","sourceRoot":"","sources":["../../../test/gitHubPullRequestIntegrationTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.js b/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.js new file mode 100644 index 00000000..adae2fe4 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.js @@ -0,0 +1,13 @@ +import assert from 'assert'; +import detectCiEnvironment from '../src/index.js'; +describe('GitHub', () => { + if (process.env.GITHUB_EVENT_NAME === 'pull_request') { + it('detects the correct revision for pull requests', () => { + const ciEnvironment = detectCiEnvironment(process.env); + assert(ciEnvironment); + console.log('Manually verify that the revision is correct'); + console.log(JSON.stringify(ciEnvironment, null, 2)); + }); + } +}); +//# sourceMappingURL=gitHubPullRequestIntegrationTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.js.map b/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.js.map new file mode 100644 index 00000000..3aeff37c --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/gitHubPullRequestIntegrationTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gitHubPullRequestIntegrationTest.js","sourceRoot":"","sources":["../../../test/gitHubPullRequestIntegrationTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,mBAAmB,MAAM,iBAAiB,CAAA;AAEjD,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,cAAc,EAAE,CAAC;QACrD,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACxD,MAAM,aAAa,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YACtD,MAAM,CAAC,aAAa,CAAC,CAAA;YACrB,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAA;YAC3D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;QACrD,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.d.ts b/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.d.ts new file mode 100644 index 00000000..e0ae5847 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=removeUserInfoFromUrlTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.d.ts.map b/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.d.ts.map new file mode 100644 index 00000000..7e1331b1 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"removeUserInfoFromUrlTest.d.ts","sourceRoot":"","sources":["../../../test/removeUserInfoFromUrlTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.js b/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.js new file mode 100644 index 00000000..6cba8aa7 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.js @@ -0,0 +1,22 @@ +import assert from 'assert'; +import { removeUserInfoFromUrl } from '../src/detectCiEnvironment.js'; +describe('removeUserInfoFromUrl', () => { + it('returns empty string for empty string', () => { + assert.strictEqual(removeUserInfoFromUrl(''), ''); + }); + it('leaves the data intact when no sensitive information is detected', () => { + assert.strictEqual(removeUserInfoFromUrl('pretty safe'), 'pretty safe'); + }); + context('with URLs', () => { + it('leaves intact when no password is found', () => { + assert.strictEqual(removeUserInfoFromUrl('https://example.com/git/repo.git'), 'https://example.com/git/repo.git'); + }); + it('removes credentials when found', () => { + assert.strictEqual(removeUserInfoFromUrl('http://aslak@example.com/git/repo.git'), 'http://example.com/git/repo.git'); + }); + it('removes credentials and passwords when found', () => { + assert.strictEqual(removeUserInfoFromUrl('ssh://login:password@example.com/git/repo.git'), 'ssh://example.com/git/repo.git'); + }); + }); +}); +//# sourceMappingURL=removeUserInfoFromUrlTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.js.map b/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.js.map new file mode 100644 index 00000000..3754aa3a --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/test/removeUserInfoFromUrlTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"removeUserInfoFromUrlTest.js","sourceRoot":"","sources":["../../../test/removeUserInfoFromUrlTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAErE,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QAC1E,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC,CAAA;IACzE,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,WAAW,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;YACjD,MAAM,CAAC,WAAW,CAChB,qBAAqB,CAAC,kCAAkC,CAAC,EACzD,kCAAkC,CACnC,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;YACxC,MAAM,CAAC,WAAW,CAChB,qBAAqB,CAAC,uCAAuC,CAAC,EAC9D,iCAAiC,CAClC,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;YACtD,MAAM,CAAC,WAAW,CAChB,qBAAqB,CAAC,+CAA+C,CAAC,EACtE,gCAAgC,CACjC,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/dist/esm/tsconfig.build-esm.tsbuildinfo b/node_modules/@cucumber/ci-environment/dist/esm/tsconfig.build-esm.tsbuildinfo new file mode 100644 index 00000000..4fcaa8ba --- /dev/null +++ b/node_modules/@cucumber/ci-environment/dist/esm/tsconfig.build-esm.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/types.ts","../../src/CiEnvironments.ts","../../src/evaluateVariableExpression.ts","../../src/detectCiEnvironment.ts","../../src/index.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/@types/node/web-globals/events.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/inspector.generated.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/sqlite.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/index.d.ts","../../node_modules/minipass/dist/commonjs/index.d.ts","../../node_modules/lru-cache/dist/commonjs/index.d.ts","../../node_modules/path-scurry/dist/commonjs/index.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts","../../node_modules/glob/dist/commonjs/pattern.d.ts","../../node_modules/glob/dist/commonjs/processor.d.ts","../../node_modules/glob/dist/commonjs/walker.d.ts","../../node_modules/glob/dist/commonjs/ignore.d.ts","../../node_modules/glob/dist/commonjs/glob.d.ts","../../node_modules/glob/dist/commonjs/has-magic.d.ts","../../node_modules/glob/dist/commonjs/index.d.ts","../../test/acceptanceTest.ts","../../test/evaluateVariableExpressionTest.ts","../../test/gitHubPullRequestIntegrationTest.ts","../../test/removeUserInfoFromUrlTest.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/json5/index.d.ts","../../node_modules/@types/mocha/index.d.ts"],"fileIdsList":[[57,105,122,123],[57,102,103,105,122,123],[57,104,105,122,123],[105,122,123],[57,105,110,122,123,140],[57,105,106,111,116,122,123,125,137,148],[57,105,106,107,116,122,123,125],[52,53,54,57,105,122,123],[57,105,108,122,123,149],[57,105,109,110,117,122,123,126],[57,105,110,122,123,137,145],[57,105,111,113,116,122,123,125],[57,104,105,112,122,123],[57,105,113,114,122,123],[57,105,115,116,122,123],[57,104,105,116,122,123],[57,105,116,117,118,122,123,137,148],[57,105,116,117,118,122,123,132,137,140],[57,98,105,113,116,119,122,123,125,137,148],[57,105,116,117,119,120,122,123,125,137,145,148],[57,105,119,121,122,123,137,145,148],[55,56,57,58,59,60,61,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154],[57,105,116,122,123],[57,105,122,123,124,148],[57,105,113,116,122,123,125,137],[57,105,122,123,126],[57,105,122,123,127],[57,104,105,122,123,128],[57,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154],[57,105,122,123,130],[57,105,122,123,131],[57,105,116,122,123,132,133],[57,105,122,123,132,134,149,151],[57,105,117,122,123],[57,105,116,122,123,137,138,140],[57,105,122,123,139,140],[57,105,122,123,137,138],[57,105,122,123,140],[57,105,122,123,141],[57,102,105,122,123,137,142],[57,105,116,122,123,143,144],[57,105,122,123,143,144],[57,105,110,122,123,125,137,145],[57,105,122,123,146],[57,105,122,123,125,147],[57,105,119,122,123,131,148],[57,105,110,122,123,149],[57,105,122,123,137,150],[57,105,122,123,124,151],[57,105,122,123,152],[57,98,105,122,123],[57,98,105,116,118,122,123,128,137,140,148,150,151,153],[57,105,122,123,137,154],[57,105,122,123,156,158,162,163,166],[57,105,122,123,167],[57,105,122,123,158,162,165],[57,105,122,123,156,158,162,165,166,167,168],[57,105,122,123,162],[57,105,122,123,158,162,163,165],[57,105,122,123,156,158,163,164,166],[57,105,122,123,159,160,161],[57,105,116,122,123,141,155],[57,105,117,122,123,127,156,157],[57,70,74,105,122,123,148],[57,70,105,122,123,137,148],[57,65,105,122,123],[57,67,70,105,122,123,145,148],[57,105,122,123,125,145],[57,105,122,123,155],[57,65,105,122,123,155],[57,67,70,105,122,123,125,148],[57,62,63,66,69,105,116,122,123,137,148],[57,70,77,105,122,123],[57,62,68,105,122,123],[57,70,91,92,105,122,123],[57,66,70,105,122,123,140,148,155],[57,91,105,122,123,155],[57,64,65,105,122,123,155],[57,70,105,122,123],[57,64,65,66,67,68,69,70,71,72,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,92,93,94,95,96,97,105,122,123],[57,70,85,105,122,123],[57,70,77,78,105,122,123],[57,68,70,78,79,105,122,123],[57,69,105,122,123],[57,62,65,70,105,122,123],[57,70,74,78,79,105,122,123],[57,74,105,122,123],[57,68,70,73,105,122,123,148],[57,62,67,70,77,105,122,123],[57,105,122,123,137],[57,65,70,91,105,122,123,153,155],[47,57,105,122,123],[47,48,49,57,105,117,122,123],[47,50,57,105,122,123],[51,57,102,105,117,122,123,127,169],[49,57,102,105,122,123],[51,57,102,105,122,123],[50,57,102,105,122,123]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"9584227b611f65058fdf9d04b648f35b6d05441582b8586d96a356ac19448c0a","signature":"8be2a46b61cf1681e570b70c8a9c6ab5b4beef825836b02e33da0d1de98fcf83"},{"version":"be2d886af4020bb2146c78876c2846769b7d52afe668005644c0bdc5a554453d","signature":"afa45ce668f64ede390cdc539249afa1f79a80550e79a12cee545ac05a0ddd20"},{"version":"74c947a817aa4d532ca74bc47f913a44591f47ac52c95a704670c89ba9b94211","signature":"ddf341c36cecf3851b23139d9cbecba36388984de004e786bd19fb6ed62ea1d2"},{"version":"4262c45efb4852f9f59f5ca4d2fd6795860f60bd325d5d66487f37bd74b4e2f7","signature":"9177d9f96314c05220cd62c56196487853d3678605d745e78a7407072a8cf7d8"},{"version":"09b50c5632abc08b7c1ffaade3d118602a3b8d20564dd659cd6e28b54c88f083","signature":"6deeb17028e6d068f9018204cdf2f4bc465b20f44b7dd2b9cdad41e43bef2237"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"bb45cd435da536500f1d9692a9b49d0c570b763ccbf00473248b777f5c1f353b","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bc7425ef40526650d6db7e072c1ff4a51101c3ac2cc4b666623b19496a6e27","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c959a391a75be9789b43c8468f71e3fa06488b4d691d5729dde1416dcd38225b","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"0dba70b3fb0dcd713fda33c2df64fa6751fff6460e536971cee917260fb17882","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"041597c12abeaa2ef07766775955fc87cfc65c43e0fe86c836071bea787e967c","impliedFormat":1},{"version":"0838507efff4f479c6f603ec812810ddfe14ab32abf8f4a8def140be970fe439","impliedFormat":1},{"version":"072f583571d6e3d30cd9760ee3485d29484fb7b54ba772ac135c747a380096a1","impliedFormat":1},{"version":"7212c2d58855b8df35275180e97903a4b6093d4fbaefea863d8d028da63938c6","impliedFormat":1},{"version":"d8a6b3f899917210f00ddf13b564a2a4fdcf1e50c5a22e8d3abcfd4f1c4f9ae1","impliedFormat":1},{"version":"fd5eab954b31e761a72234031dadc3aab768763942a9637e380aed441cc94f59","impliedFormat":1},{"version":"c7aaac3119acf27e03190cc4224f1d81c7498cf6b36fa72d10d99f2c41d1bbc0","impliedFormat":1},{"version":"dd9faff42b456b5f03b85d8fbd64838eb92f6f7b03b36322cbc59c005b7033d3","impliedFormat":1},{"version":"6ff702721d87c0ba8e7f8950e7b0a3b009dfd912fab3997e0b63fab8d83919c3","impliedFormat":1},{"version":"9dce9fc12e9a79d1135699d525aa6b44b71a45e32e3fa0cf331060b980b16317","impliedFormat":1},{"version":"586b2fd8a7d582329658aaceec22f8a5399e05013deb49bcfde28f95f093c8ee","impliedFormat":1},{"version":"59c44b081724d4ab8039988aba34ee6b3bd41c30fc2d8686f4ed06588397b2f7","impliedFormat":1},{"version":"ef1f3eadd7bed282de45bafd7c2c00105cf1db93e22f6cd763bec8a9c2cf6df1","impliedFormat":1},{"version":"2b90463c902dbe4f5bbb9eae084c05de37477c17a5de1e342eb7cbc9410dc6a1","impliedFormat":1},{"version":"7f85e915e642bfc7f4fcaf10c174b12d4156e330e8377dfacd094bde441fe96c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"f625adde8864834f8467ca8c51a91ebb7104f53b16cf8ebd8130b0279f55a9e3","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"e1cc9b7856fba8e77b161e3f9369830b76798139db320cdf92cc35f67e4006d6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"dda4432f51c9958410acdf1b09a2d3cb898222d318ba188e8754234533a3e39d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1}],"root":[[47,51],[170,173]],"options":{"allowJs":false,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":5,"noImplicitAny":true,"outDir":"./","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":2},"referencedMap":[[174,1],[175,1],[176,1],[177,1],[102,2],[103,2],[104,3],[57,4],[105,5],[106,6],[107,7],[52,1],[55,8],[53,1],[54,1],[108,9],[109,10],[110,11],[111,12],[112,13],[113,14],[114,14],[115,15],[116,16],[117,17],[118,18],[58,1],[56,1],[119,19],[120,20],[121,21],[155,22],[122,23],[123,1],[124,24],[125,25],[126,26],[127,27],[128,28],[129,29],[130,30],[131,31],[132,32],[133,32],[134,33],[135,1],[136,34],[137,35],[139,36],[138,37],[140,38],[141,39],[142,40],[143,41],[144,42],[145,43],[146,44],[147,45],[148,46],[149,47],[150,48],[151,49],[152,50],[59,1],[60,1],[61,1],[99,51],[100,1],[101,1],[153,52],[154,53],[167,54],[168,55],[166,56],[169,57],[163,58],[164,59],[165,60],[159,58],[160,58],[162,61],[161,58],[157,1],[156,62],[158,63],[45,1],[46,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[19,1],[20,1],[4,1],[21,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[77,64],[87,65],[76,64],[97,66],[68,67],[67,68],[96,69],[90,70],[95,71],[70,72],[84,73],[69,74],[93,75],[65,76],[64,69],[94,77],[66,78],[71,79],[72,1],[75,79],[62,1],[98,80],[88,81],[79,82],[80,83],[82,84],[78,85],[81,86],[91,69],[73,87],[74,88],[83,89],[63,90],[86,81],[85,79],[89,1],[92,91],[48,92],[50,93],[49,92],[51,94],[47,1],[170,95],[171,96],[172,97],[173,98]],"latestChangedDtsFile":"./test/removeUserInfoFromUrlTest.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/ci-environment/package.json b/node_modules/@cucumber/ci-environment/package.json new file mode 100644 index 00000000..84d820c6 --- /dev/null +++ b/node_modules/@cucumber/ci-environment/package.json @@ -0,0 +1,69 @@ +{ + "name": "@cucumber/ci-environment", + "version": "13.0.0", + "description": "Detect CI Environment from environment variables", + "type": "module", + "main": "dist/cjs/src/index.js", + "types": "dist/cjs/src/index.d.ts", + "files": [ + "dist/cjs", + "dist/esm" + ], + "module": "dist/esm/src/index.js", + "jsnext:main": "dist/esm/src/index.js", + "exports": { + ".": { + "import": "./dist/esm/src/index.js", + "require": "./dist/cjs/src/index.js" + } + }, + "scripts": { + "build:cjs": "tsc --build tsconfig.build-cjs.json && shx cp package.cjs.json dist/cjs/package.json", + "build:esm": "tsc --build tsconfig.build-esm.json", + "build": "npm run build:cjs && npm run build:esm", + "pretest": "npm run generate-ci-environments-ts", + "test": "mocha && npm run test:cjs", + "test:cjs": "npm run build:cjs && mocha --no-config dist/cjs/test", + "prepublishOnly": "npm run build", + "fix": "eslint --max-warnings 0 --fix src test && prettier --write src test", + "lint": "eslint --max-warnings 0 src test && prettier --check src test", + "generate-ci-environments-ts": "shx cat CiEnvironments.ts.header ../CiEnvironments.json > src/CiEnvironments.ts && eslint --fix src/CiEnvironments.ts && prettier --write src/CiEnvironments.ts" + }, + "repository": { + "type": "git", + "url": "git://github.com/cucumber/ci-environment.git" + }, + "keywords": [ + "cucumber" + ], + "author": "Cucumber Limited ", + "license": "MIT", + "bugs": { + "url": "https://github.com/cucumber/ci-environment/issues" + }, + "homepage": "https://github.com/cucumber/ci-environment", + "devDependencies": { + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "^9.21.0", + "@types/glob": "9.0.0", + "@types/mocha": "10.0.10", + "@types/node": "22.19.7", + "@typescript-eslint/eslint-plugin": "^8.43.0", + "@typescript-eslint/parser": "^8.43.0", + "eslint": "^9.21.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-simple-import-sort": "^12.1.1", + "glob": "^13.0.0", + "globals": "^17.0.0", + "mocha": "11.7.5", + "prettier": "^3.5.2", + "shx": "0.4.0", + "ts-node": "10.9.2", + "typescript": "5.9.3" + }, + "directories": { + "test": "test" + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/LICENSE b/node_modules/@cucumber/cucumber-expressions/LICENSE new file mode 100644 index 00000000..a5e1512d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Cucumber Ltd and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/package.json b/node_modules/@cucumber/cucumber-expressions/dist/cjs/package.json new file mode 100644 index 00000000..b589b71f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/package.json @@ -0,0 +1,4 @@ +{ + "name": "@cucumber/cucumber-expressions", + "type": "commonjs" +} diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.d.ts new file mode 100644 index 00000000..a18f65d2 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.d.ts @@ -0,0 +1,16 @@ +import Group from './Group.js'; +import ParameterType from './ParameterType.js'; +export default class Argument { + readonly group: Group; + readonly parameterType: ParameterType; + static build(group: Group, parameterTypes: readonly ParameterType[]): readonly Argument[]; + constructor(group: Group, parameterType: ParameterType); + /** + * Get the value returned by the parameter type's transformer function. + * + * @param thisObj the object in which the transformer function is applied. + */ + getValue(thisObj: unknown): T | null; + getParameterType(): ParameterType; +} +//# sourceMappingURL=Argument.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.d.ts.map new file mode 100644 index 00000000..a7280d54 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Argument.d.ts","sourceRoot":"","sources":["../../../src/Argument.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,MAAM,CAAC,OAAO,OAAO,QAAQ;aAqBT,KAAK,EAAE,KAAK;aACZ,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC;WArBzC,KAAK,CACjB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE,GAChD,SAAS,QAAQ,EAAE;gBAiBJ,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC;IAMvD;;;;OAIG;IACI,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,GAAG,IAAI;IAKvC,gBAAgB;CAGxB"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.js new file mode 100644 index 00000000..8769cc66 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.js @@ -0,0 +1,37 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const CucumberExpressionError_js_1 = __importDefault(require("./CucumberExpressionError.js")); +class Argument { + group; + parameterType; + static build(group, parameterTypes) { + const argGroups = group.children || []; + if (argGroups.length !== parameterTypes.length) { + throw new CucumberExpressionError_js_1.default(`Group has ${argGroups.length} capture groups (${argGroups.map((g) => g.value)}), but there were ${parameterTypes.length} parameter types (${parameterTypes.map((p) => p.name)})`); + } + return parameterTypes.map((parameterType, i) => new Argument(argGroups[i], parameterType)); + } + constructor(group, parameterType) { + this.group = group; + this.parameterType = parameterType; + this.group = group; + this.parameterType = parameterType; + } + /** + * Get the value returned by the parameter type's transformer function. + * + * @param thisObj the object in which the transformer function is applied. + */ + getValue(thisObj) { + const groupValues = this.group ? this.group.values : null; + return this.parameterType.transform(thisObj, groupValues); + } + getParameterType() { + return this.parameterType; + } +} +exports.default = Argument; +//# sourceMappingURL=Argument.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.js.map new file mode 100644 index 00000000..7b1707f7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Argument.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Argument.js","sourceRoot":"","sources":["../../../src/Argument.ts"],"names":[],"mappings":";;;;;AAAA,8FAAkE;AAIlE,MAAqB,QAAQ;IAqBT;IACA;IArBX,MAAM,CAAC,KAAK,CACjB,KAAY,EACZ,cAAiD;QAEjD,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAA;QAEtC,IAAI,SAAS,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,EAAE,CAAC;YAC/C,MAAM,IAAI,oCAAuB,CAC/B,aAAa,SAAS,CAAC,MAAM,oBAAoB,SAAS,CAAC,GAAG,CAC5D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CACf,qBAAqB,cAAc,CAAC,MAAM,qBAAqB,cAAc,CAAC,GAAG,CAChF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CACd,GAAG,CACL,CAAA;QACH,CAAC;QAED,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAA;IAC5F,CAAC;IAED,YACkB,KAAY,EACZ,aAAqC;QADrC,UAAK,GAAL,KAAK,CAAO;QACZ,kBAAa,GAAb,aAAa,CAAwB;QAErD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAI,OAAgB;QACjC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;QACzD,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;IAC3D,CAAC;IAEM,gBAAgB;QACrB,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;CACF;AAzCD,2BAyCC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.d.ts new file mode 100644 index 00000000..ced45a69 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.d.ts @@ -0,0 +1,45 @@ +export declare function symbolOf(token: TokenType): string; +export declare function purposeOf(token: TokenType): string; +export interface Located { + readonly start: number; + readonly end: number; +} +export declare class Node implements Located { + readonly type: NodeType; + readonly nodes: readonly Node[] | undefined; + private readonly token; + readonly start: number; + readonly end: number; + constructor(type: NodeType, nodes: readonly Node[] | undefined, token: string | undefined, start: number, end: number); + text(): string; +} +export declare enum NodeType { + text = "TEXT_NODE", + optional = "OPTIONAL_NODE", + alternation = "ALTERNATION_NODE", + alternative = "ALTERNATIVE_NODE", + parameter = "PARAMETER_NODE", + expression = "EXPRESSION_NODE" +} +export declare class Token implements Located { + readonly type: TokenType; + readonly text: string; + readonly start: number; + readonly end: number; + constructor(type: TokenType, text: string, start: number, end: number); + static isEscapeCharacter(codePoint: string): boolean; + static canEscape(codePoint: string): boolean; + static typeOf(codePoint: string): TokenType; +} +export declare enum TokenType { + startOfLine = "START_OF_LINE", + endOfLine = "END_OF_LINE", + whiteSpace = "WHITE_SPACE", + beginOptional = "BEGIN_OPTIONAL", + endOptional = "END_OPTIONAL", + beginParameter = "BEGIN_PARAMETER", + endParameter = "END_PARAMETER", + alternation = "ALTERNATION", + text = "TEXT" +} +//# sourceMappingURL=Ast.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.d.ts.map new file mode 100644 index 00000000..5f18d7a9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Ast.d.ts","sourceRoot":"","sources":["../../../src/Ast.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAcjD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAYlD;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACrB;AAED,qBAAa,IAAK,YAAW,OAAO;aAEhB,IAAI,EAAE,QAAQ;aACd,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS;IAClD,OAAO,CAAC,QAAQ,CAAC,KAAK;aACN,KAAK,EAAE,MAAM;aACb,GAAG,EAAE,MAAM;gBAJX,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM;IAO7B,IAAI,IAAI,MAAM;CAMf;AAED,oBAAY,QAAQ;IAClB,IAAI,cAAc;IAClB,QAAQ,kBAAkB;IAC1B,WAAW,qBAAqB;IAChC,WAAW,qBAAqB;IAChC,SAAS,mBAAmB;IAC5B,UAAU,oBAAoB;CAC/B;AAED,qBAAa,KAAM,YAAW,OAAO;IACnC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;gBAER,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAOrE,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIpD,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAsB5C,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;CAmB5C;AAED,oBAAY,SAAS;IACnB,WAAW,kBAAkB;IAC7B,SAAS,gBAAgB;IACzB,UAAU,gBAAgB;IAC1B,aAAa,mBAAmB;IAChC,WAAW,iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;IAC9B,WAAW,gBAAgB;IAC3B,IAAI,SAAS;CACd"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.js new file mode 100644 index 00000000..a87eabad --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.js @@ -0,0 +1,141 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TokenType = exports.Token = exports.NodeType = exports.Node = void 0; +exports.symbolOf = symbolOf; +exports.purposeOf = purposeOf; +const escapeCharacter = '\\'; +const alternationCharacter = '/'; +const beginParameterCharacter = '{'; +const endParameterCharacter = '}'; +const beginOptionalCharacter = '('; +const endOptionalCharacter = ')'; +function symbolOf(token) { + switch (token) { + case TokenType.beginOptional: + return beginOptionalCharacter; + case TokenType.endOptional: + return endOptionalCharacter; + case TokenType.beginParameter: + return beginParameterCharacter; + case TokenType.endParameter: + return endParameterCharacter; + case TokenType.alternation: + return alternationCharacter; + } + return ''; +} +function purposeOf(token) { + switch (token) { + case TokenType.beginOptional: + case TokenType.endOptional: + return 'optional text'; + case TokenType.beginParameter: + case TokenType.endParameter: + return 'a parameter'; + case TokenType.alternation: + return 'alternation'; + } + return ''; +} +class Node { + type; + nodes; + token; + start; + end; + constructor(type, nodes, token, start, end) { + this.type = type; + this.nodes = nodes; + this.token = token; + this.start = start; + this.end = end; + if (nodes === undefined && token === undefined) { + throw new Error('Either nodes or token must be defined'); + } + } + text() { + if (this.nodes && this.nodes.length > 0) { + return this.nodes.map((value) => value.text()).join(''); + } + return this.token || ''; + } +} +exports.Node = Node; +var NodeType; +(function (NodeType) { + NodeType["text"] = "TEXT_NODE"; + NodeType["optional"] = "OPTIONAL_NODE"; + NodeType["alternation"] = "ALTERNATION_NODE"; + NodeType["alternative"] = "ALTERNATIVE_NODE"; + NodeType["parameter"] = "PARAMETER_NODE"; + NodeType["expression"] = "EXPRESSION_NODE"; +})(NodeType || (exports.NodeType = NodeType = {})); +class Token { + type; + text; + start; + end; + constructor(type, text, start, end) { + this.type = type; + this.text = text; + this.start = start; + this.end = end; + } + static isEscapeCharacter(codePoint) { + return codePoint == escapeCharacter; + } + static canEscape(codePoint) { + if (codePoint == ' ') { + // TODO: Unicode whitespace? + return true; + } + switch (codePoint) { + case escapeCharacter: + return true; + case alternationCharacter: + return true; + case beginParameterCharacter: + return true; + case endParameterCharacter: + return true; + case beginOptionalCharacter: + return true; + case endOptionalCharacter: + return true; + } + return false; + } + static typeOf(codePoint) { + if (codePoint == ' ') { + // TODO: Unicode whitespace? + return TokenType.whiteSpace; + } + switch (codePoint) { + case alternationCharacter: + return TokenType.alternation; + case beginParameterCharacter: + return TokenType.beginParameter; + case endParameterCharacter: + return TokenType.endParameter; + case beginOptionalCharacter: + return TokenType.beginOptional; + case endOptionalCharacter: + return TokenType.endOptional; + } + return TokenType.text; + } +} +exports.Token = Token; +var TokenType; +(function (TokenType) { + TokenType["startOfLine"] = "START_OF_LINE"; + TokenType["endOfLine"] = "END_OF_LINE"; + TokenType["whiteSpace"] = "WHITE_SPACE"; + TokenType["beginOptional"] = "BEGIN_OPTIONAL"; + TokenType["endOptional"] = "END_OPTIONAL"; + TokenType["beginParameter"] = "BEGIN_PARAMETER"; + TokenType["endParameter"] = "END_PARAMETER"; + TokenType["alternation"] = "ALTERNATION"; + TokenType["text"] = "TEXT"; +})(TokenType || (exports.TokenType = TokenType = {})); +//# sourceMappingURL=Ast.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.js.map new file mode 100644 index 00000000..1adfb674 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Ast.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Ast.js","sourceRoot":"","sources":["../../../src/Ast.ts"],"names":[],"mappings":";;;AAOA,4BAcC;AAED,8BAYC;AAnCD,MAAM,eAAe,GAAG,IAAI,CAAA;AAC5B,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAChC,MAAM,uBAAuB,GAAG,GAAG,CAAA;AACnC,MAAM,qBAAqB,GAAG,GAAG,CAAA;AACjC,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAClC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAEhC,SAAgB,QAAQ,CAAC,KAAgB;IACvC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,SAAS,CAAC,aAAa;YAC1B,OAAO,sBAAsB,CAAA;QAC/B,KAAK,SAAS,CAAC,WAAW;YACxB,OAAO,oBAAoB,CAAA;QAC7B,KAAK,SAAS,CAAC,cAAc;YAC3B,OAAO,uB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,CAAC,UAAU,CAAA;QAC7B,CAAC;QACD,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,oBAAoB;gBACvB,OAAO,SAAS,CAAC,WAAW,CAAA;YAC9B,KAAK,uBAAuB;gBAC1B,OAAO,SAAS,CAAC,cAAc,CAAA;YACjC,KAAK,qBAAqB;gBACxB,OAAO,SAAS,CAAC,YAAY,CAAA;YAC/B,KAAK,sBAAsB;gBACzB,OAAO,SAAS,CAAC,aAAa,CAAA;YAChC,KAAK,oBAAoB;gBACvB,OAAO,SAAS,CAAC,WAAW,CAAA;QAChC,CAAC;QACD,OAAO,SAAS,CAAC,IAAI,CAAA;IACvB,CAAC;CACF;AA1DD,sBA0DC;AAED,IAAY,SAUX;AAVD,WAAY,SAAS;IACnB,0CAA6B,CAAA;IAC7B,sCAAyB,CAAA;IACzB,uCAA0B,CAAA;IAC1B,6CAAgC,CAAA;IAChC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,2CAA8B,CAAA;IAC9B,wCAA2B,CAAA;IAC3B,0BAAa,CAAA;AACf,CAAC,EAVW,SAAS,yBAAT,SAAS,QAUpB"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.d.ts new file mode 100644 index 00000000..249f995f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.d.ts @@ -0,0 +1,10 @@ +import GeneratedExpression from './GeneratedExpression.js'; +import ParameterType from './ParameterType.js'; +export default class CombinatorialGeneratedExpressionFactory { + private readonly expressionTemplate; + private readonly parameterTypeCombinations; + constructor(expressionTemplate: string, parameterTypeCombinations: Array>>); + generateExpressions(): readonly GeneratedExpression[]; + private generatePermutations; +} +//# sourceMappingURL=CombinatorialGeneratedExpressionFactory.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.d.ts.map new file mode 100644 index 00000000..85ea904c --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CombinatorialGeneratedExpressionFactory.d.ts","sourceRoot":"","sources":["../../../src/CombinatorialGeneratedExpressionFactory.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAK9C,MAAM,CAAC,OAAO,OAAO,uCAAuC;IAExD,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBADzB,kBAAkB,EAAE,MAAM,EAC1B,yBAAyB,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAK3E,mBAAmB,IAAI,SAAS,mBAAmB,EAAE;IAM5D,OAAO,CAAC,oBAAoB;CA4B7B"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.js new file mode 100644 index 00000000..9fafe005 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.js @@ -0,0 +1,43 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const GeneratedExpression_js_1 = __importDefault(require("./GeneratedExpression.js")); +// 256 generated expressions ought to be enough for anybody +const MAX_EXPRESSIONS = 256; +class CombinatorialGeneratedExpressionFactory { + expressionTemplate; + parameterTypeCombinations; + constructor(expressionTemplate, parameterTypeCombinations) { + this.expressionTemplate = expressionTemplate; + this.parameterTypeCombinations = parameterTypeCombinations; + this.expressionTemplate = expressionTemplate; + } + generateExpressions() { + const generatedExpressions = []; + this.generatePermutations(generatedExpressions, 0, []); + return generatedExpressions; + } + generatePermutations(generatedExpressions, depth, currentParameterTypes) { + if (generatedExpressions.length >= MAX_EXPRESSIONS) { + return; + } + if (depth === this.parameterTypeCombinations.length) { + generatedExpressions.push(new GeneratedExpression_js_1.default(this.expressionTemplate, currentParameterTypes)); + return; + } + // tslint:disable-next-line:prefer-for-of + for (let i = 0; i < this.parameterTypeCombinations[depth].length; ++i) { + // Avoid recursion if no elements can be added. + if (generatedExpressions.length >= MAX_EXPRESSIONS) { + return; + } + const newCurrentParameterTypes = currentParameterTypes.slice(); // clone + newCurrentParameterTypes.push(this.parameterTypeCombinations[depth][i]); + this.generatePermutations(generatedExpressions, depth + 1, newCurrentParameterTypes); + } + } +} +exports.default = CombinatorialGeneratedExpressionFactory; +//# sourceMappingURL=CombinatorialGeneratedExpressionFactory.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.js.map new file mode 100644 index 00000000..d36908cc --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CombinatorialGeneratedExpressionFactory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CombinatorialGeneratedExpressionFactory.js","sourceRoot":"","sources":["../../../src/CombinatorialGeneratedExpressionFactory.ts"],"names":[],"mappings":";;;;;AAAA,sFAA0D;AAG1D,2DAA2D;AAC3D,MAAM,eAAe,GAAG,GAAG,CAAA;AAE3B,MAAqB,uCAAuC;IAEvC;IACA;IAFnB,YACmB,kBAA0B,EAC1B,yBAA+D;QAD/D,uBAAkB,GAAlB,kBAAkB,CAAQ;QAC1B,8BAAyB,GAAzB,yBAAyB,CAAsC;QAEhF,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;IAC9C,CAAC;IAEM,mBAAmB;QACxB,MAAM,oBAAoB,GAA0B,EAAE,CAAA;QACtD,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;QACtD,OAAO,oBAAoB,CAAA;IAC7B,CAAC;IAEO,oBAAoB,CAC1B,oBAA2C,EAC3C,KAAa,EACb,qBAAoD;QAEpD,IAAI,oBAAoB,CAAC,MAAM,IAAI,eAAe,EAAE,CAAC;YACnD,OAAM;QACR,CAAC;QAED,IAAI,KAAK,KAAK,IAAI,CAAC,yBAAyB,CAAC,MAAM,EAAE,CAAC;YACpD,oBAAoB,CAAC,IAAI,CACvB,IAAI,gCAAmB,CAAC,IAAI,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CACxE,CAAA;YACD,OAAM;QACR,CAAC;QAED,yCAAyC;QACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YACtE,+CAA+C;YAC/C,IAAI,oBAAoB,CAAC,MAAM,IAAI,eAAe,EAAE,CAAC;gBACnD,OAAM;YACR,CAAC;YAED,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,KAAK,EAAE,CAAA,CAAC,QAAQ;YACvE,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACvE,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,KAAK,GAAG,CAAC,EAAE,wBAAwB,CAAC,CAAA;QACtF,CAAC;IACH,CAAC;CACF;AA1CD,0DA0CC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.d.ts new file mode 100644 index 00000000..28ff23fa --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.d.ts @@ -0,0 +1,30 @@ +import Argument from './Argument.js'; +import { Node } from './Ast.js'; +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import { Expression } from './types.js'; +export default class CucumberExpression implements Expression { + private readonly expression; + private readonly parameterTypeRegistry; + private readonly parameterTypes; + private readonly treeRegexp; + readonly ast: Node; + /** + * @param expression + * @param parameterTypeRegistry + */ + constructor(expression: string, parameterTypeRegistry: ParameterTypeRegistry); + private rewriteToRegex; + private static escapeRegex; + private rewriteOptional; + private rewriteAlternation; + private rewriteAlternative; + private rewriteParameter; + private rewriteExpression; + private assertNotEmpty; + private assertNoParameters; + private assertNoOptionals; + match(text: string): readonly Argument[] | null; + get regexp(): RegExp; + get source(): string; +} +//# sourceMappingURL=CucumberExpression.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.d.ts.map new file mode 100644 index 00000000..a3c229ec --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpression.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpression.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,IAAI,EAAY,MAAM,UAAU,CAAA;AAYzC,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAIvC,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,UAAU;IAUzD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IAVxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAoC;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,SAAgB,GAAG,EAAE,IAAI,CAAA;IAEzB;;;OAGG;gBAEgB,UAAU,EAAE,MAAM,EAClB,qBAAqB,EAAE,qBAAqB;IAQ/D,OAAO,CAAC,cAAc;IAoBtB,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,iBAAiB;IAUlB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE,GAAG,IAAI;IAQtD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.js new file mode 100644 index 00000000..5917c250 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.js @@ -0,0 +1,123 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Argument_js_1 = __importDefault(require("./Argument.js")); +const Ast_js_1 = require("./Ast.js"); +const CucumberExpressionParser_js_1 = __importDefault(require("./CucumberExpressionParser.js")); +const Errors_js_1 = require("./Errors.js"); +const TreeRegexp_js_1 = __importDefault(require("./TreeRegexp.js")); +const ESCAPE_PATTERN = () => /([\\^[({$.|?*+})\]])/g; +class CucumberExpression { + expression; + parameterTypeRegistry; + parameterTypes = []; + treeRegexp; + ast; + /** + * @param expression + * @param parameterTypeRegistry + */ + constructor(expression, parameterTypeRegistry) { + this.expression = expression; + this.parameterTypeRegistry = parameterTypeRegistry; + const parser = new CucumberExpressionParser_js_1.default(); + this.ast = parser.parse(expression); + const pattern = this.rewriteToRegex(this.ast); + this.treeRegexp = new TreeRegexp_js_1.default(pattern); + } + rewriteToRegex(node) { + switch (node.type) { + case Ast_js_1.NodeType.text: + return CucumberExpression.escapeRegex(node.text()); + case Ast_js_1.NodeType.optional: + return this.rewriteOptional(node); + case Ast_js_1.NodeType.alternation: + return this.rewriteAlternation(node); + case Ast_js_1.NodeType.alternative: + return this.rewriteAlternative(node); + case Ast_js_1.NodeType.parameter: + return this.rewriteParameter(node); + case Ast_js_1.NodeType.expression: + return this.rewriteExpression(node); + default: + // Can't happen as long as the switch case is exhaustive + throw new Error(node.type); + } + } + static escapeRegex(expression) { + return expression.replace(ESCAPE_PATTERN(), '\\$1'); + } + rewriteOptional(node) { + this.assertNoParameters(node, (astNode) => (0, Errors_js_1.createParameterIsNotAllowedInOptional)(astNode, this.expression)); + this.assertNoOptionals(node, (astNode) => (0, Errors_js_1.createOptionalIsNotAllowedInOptional)(astNode, this.expression)); + this.assertNotEmpty(node, (astNode) => (0, Errors_js_1.createOptionalMayNotBeEmpty)(astNode, this.expression)); + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join(''); + return `(?:${regex})?`; + } + rewriteAlternation(node) { + // Make sure the alternative parts aren't empty and don't contain parameter types + for (const alternative of node.nodes || []) { + if (!alternative.nodes || alternative.nodes.length == 0) { + throw (0, Errors_js_1.createAlternativeMayNotBeEmpty)(alternative, this.expression); + } + this.assertNotEmpty(alternative, (astNode) => (0, Errors_js_1.createAlternativeMayNotExclusivelyContainOptionals)(astNode, this.expression)); + } + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join('|'); + return `(?:${regex})`; + } + rewriteAlternative(node) { + return (node.nodes || []).map((lastNode) => this.rewriteToRegex(lastNode)).join(''); + } + rewriteParameter(node) { + const name = node.text(); + const parameterType = this.parameterTypeRegistry.lookupByTypeName(name); + if (!parameterType) { + throw (0, Errors_js_1.createUndefinedParameterType)(node, this.expression, name); + } + this.parameterTypes.push(parameterType); + const regexps = parameterType.regexpStrings; + if (regexps.length == 1) { + return `(${regexps[0]})`; + } + return `((?:${regexps.join(')|(?:')}))`; + } + rewriteExpression(node) { + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join(''); + return `^${regex}$`; + } + assertNotEmpty(node, createNodeWasNotEmptyException) { + const textNodes = (node.nodes || []).filter((astNode) => Ast_js_1.NodeType.text == astNode.type); + if (textNodes.length == 0) { + throw createNodeWasNotEmptyException(node); + } + } + assertNoParameters(node, createNodeContainedAParameterError) { + const parameterNodes = (node.nodes || []).filter((astNode) => Ast_js_1.NodeType.parameter == astNode.type); + if (parameterNodes.length > 0) { + throw createNodeContainedAParameterError(parameterNodes[0]); + } + } + assertNoOptionals(node, createNodeContainedAnOptionalError) { + const parameterNodes = (node.nodes || []).filter((astNode) => Ast_js_1.NodeType.optional == astNode.type); + if (parameterNodes.length > 0) { + throw createNodeContainedAnOptionalError(parameterNodes[0]); + } + } + match(text) { + const group = this.treeRegexp.match(text); + if (!group) { + return null; + } + return Argument_js_1.default.build(group, this.parameterTypes); + } + get regexp() { + return this.treeRegexp.regexp; + } + get source() { + return this.expression; + } +} +exports.default = CucumberExpression; +//# sourceMappingURL=CucumberExpression.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.js.map new file mode 100644 index 00000000..dd924ec3 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpression.js","sourceRoot":"","sources":["../../../src/CucumberExpression.ts"],"names":[],"mappings":";;;;;AAAA,gEAAoC;AACpC,qCAAyC;AAEzC,gGAAoE;AACpE,2CAOoB;AAGpB,oEAAwC;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H,CAAC;IAEM,KAAK,CAAC,IAAY;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,qBAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IACnD,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAA;IAC/B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,UAAU,CAAA;IACxB,CAAC;CACF;AA5ID,qCA4IC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.d.ts new file mode 100644 index 00000000..aab86932 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.d.ts @@ -0,0 +1,3 @@ +export default class CucumberExpressionError extends Error { +} +//# sourceMappingURL=CucumberExpressionError.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.d.ts.map new file mode 100644 index 00000000..94200c43 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionError.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpressionError.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,KAAK;CAAG"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.js new file mode 100644 index 00000000..8e059878 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class CucumberExpressionError extends Error { +} +exports.default = CucumberExpressionError; +//# sourceMappingURL=CucumberExpressionError.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.js.map new file mode 100644 index 00000000..1e0b638f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionError.js","sourceRoot":"","sources":["../../../src/CucumberExpressionError.ts"],"names":[],"mappings":";;AAAA,MAAqB,uBAAwB,SAAQ,KAAK;CAAG;AAA7D,0CAA6D"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.d.ts new file mode 100644 index 00000000..980dce66 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.d.ts @@ -0,0 +1,10 @@ +import GeneratedExpression from './GeneratedExpression.js'; +import ParameterType from './ParameterType.js'; +export default class CucumberExpressionGenerator { + private readonly parameterTypes; + constructor(parameterTypes: () => Iterable>); + generateExpressions(text: string): readonly GeneratedExpression[]; + private createParameterTypeMatchers; + private static createParameterTypeMatchers2; +} +//# sourceMappingURL=CucumberExpressionGenerator.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.d.ts.map new file mode 100644 index 00000000..9d2d10ff --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionGenerator.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpressionGenerator.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAG9C,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,MAAM,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAE5E,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,mBAAmB,EAAE;IAgExE,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,MAAM,CAAC,4BAA4B;CAQ5C"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.js new file mode 100644 index 00000000..5b4e783e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.js @@ -0,0 +1,78 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const CombinatorialGeneratedExpressionFactory_js_1 = __importDefault(require("./CombinatorialGeneratedExpressionFactory.js")); +const ParameterType_js_1 = __importDefault(require("./ParameterType.js")); +const ParameterTypeMatcher_js_1 = __importDefault(require("./ParameterTypeMatcher.js")); +class CucumberExpressionGenerator { + parameterTypes; + constructor(parameterTypes) { + this.parameterTypes = parameterTypes; + } + generateExpressions(text) { + const parameterTypeCombinations = []; + const parameterTypeMatchers = this.createParameterTypeMatchers(text); + let expressionTemplate = ''; + let pos = 0; + let counter = 0; + while (true) { + let matchingParameterTypeMatchers = []; + for (const parameterTypeMatcher of parameterTypeMatchers) { + const advancedParameterTypeMatcher = parameterTypeMatcher.advanceTo(pos); + if (advancedParameterTypeMatcher.find) { + matchingParameterTypeMatchers.push(advancedParameterTypeMatcher); + } + } + if (matchingParameterTypeMatchers.length > 0) { + matchingParameterTypeMatchers = matchingParameterTypeMatchers.sort(ParameterTypeMatcher_js_1.default.compare); + // Find all the best parameter type matchers, they are all candidates. + const bestParameterTypeMatcher = matchingParameterTypeMatchers[0]; + const bestParameterTypeMatchers = matchingParameterTypeMatchers.filter((m) => ParameterTypeMatcher_js_1.default.compare(m, bestParameterTypeMatcher) === 0); + // Build a list of parameter types without duplicates. The reason there + // might be duplicates is that some parameter types have more than one regexp, + // which means multiple ParameterTypeMatcher objects will have a reference to the + // same ParameterType. + // We're sorting the list so preferential parameter types are listed first. + // Users are most likely to want these, so they should be listed at the top. + let parameterTypes = []; + for (const parameterTypeMatcher of bestParameterTypeMatchers) { + if (parameterTypes.indexOf(parameterTypeMatcher.parameterType) === -1) { + parameterTypes.push(parameterTypeMatcher.parameterType); + } + } + parameterTypes = parameterTypes.sort(ParameterType_js_1.default.compare); + parameterTypeCombinations.push(parameterTypes); + expressionTemplate += escape(text.slice(pos, bestParameterTypeMatcher.start)); + expressionTemplate += `{{${counter++}}}`; + pos = bestParameterTypeMatcher.start + bestParameterTypeMatcher.group.length; + } + else { + break; + } + if (pos >= text.length) { + break; + } + } + expressionTemplate += escape(text.slice(pos)); + return new CombinatorialGeneratedExpressionFactory_js_1.default(expressionTemplate, parameterTypeCombinations).generateExpressions(); + } + createParameterTypeMatchers(text) { + let parameterMatchers = []; + for (const parameterType of this.parameterTypes()) { + if (parameterType.useForSnippets) { + parameterMatchers = parameterMatchers.concat(CucumberExpressionGenerator.createParameterTypeMatchers2(parameterType, text)); + } + } + return parameterMatchers; + } + static createParameterTypeMatchers2(parameterType, text) { + return parameterType.regexpStrings.map((regexp) => new ParameterTypeMatcher_js_1.default(parameterType, regexp, text)); + } +} +exports.default = CucumberExpressionGenerator; +function escape(s) { + return s.replace(/\(/g, '\\(').replace(/{/g, '\\{').replace(/\//g, '\\/'); +} +//# sourceMappingURL=CucumberExpressionGenerator.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.js.map new file mode 100644 index 00000000..ef57c804 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionGenerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionGenerator.js","sourceRoot":"","sources":["../../../src/CucumberExpressionGenerator.ts"],"names":[],"mappings":";;;;;AAAA,8HAAkG;AAElG,0EAA8C;AAC9C,wFAA4D;AAE5D,MAAqB,2BAA2B;IACjB;IAA7B,YAA6B,cAAsD;QAAtD,mBAAc,GAAd,cAAc,CAAwC;IAAG,CAAC;IAEhF,mBAAmB,CAAC,IAAY;QACrC,MAAM,yBAAyB,GAAyC,EAAE,CAAA;QAC1E,MAAM,qBAAqB,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAA;QACpE,IAAI,kBAAkB,GAAG,EAAE,CAAA;QAC3B,IAAI,GAAG,GAAG,CAAC,CAAA;QACX,IAAI,OAAO,GAAG,CAAC,CAAA;QAEf,OAAO,IAAI,EAAE,CAAC;YACZ,IAAI,6BAA6B,GAAG,EAAE,CAAA;YAEtC,KAAK,MAAM,oBAAoB,IAAI,qBAAqB,EAAE,CAAC;gBACzD,MAAM,4BAA4B,GAAG,oBAAoB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;gBACxE,IAAI,4BAA4B,CAAC,IAAI,EAAE,CAAC;oBACtC,6BAA6B,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA;gBAClE,CAAC;YACH,CAAC;YAED,IAAI,6BAA6B,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC7C,6BAA6B,GAAG,6BAA6B,CAAC,IAAI,CAChE,iCAA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,OAAO,IAAI,oDAAuC,CAChD,kBAAkB,EAClB,yBAAyB,CAC1B,CAAC,mBAAmB,EAAE,CAAA;IACzB,CAAC;IAEO,2BAA2B,CAAC,IAAY;QAC9C,IAAI,iBAAiB,GAA2B,EAAE,CAAA;QAClD,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;YAClD,IAAI,aAAa,CAAC,cAAc,EAAE,CAAC;gBACjC,iBAAiB,GAAG,iBAAiB,CAAC,MAAM,CAC1C,2BAA2B,CAAC,4BAA4B,CAAC,aAAa,EAAE,IAAI,CAAC,CAC9E,CAAA;YACH,CAAC;QACH,CAAC;QACD,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IAEO,MAAM,CAAC,4BAA4B,CACzC,aAAqC,EACrC,IAAY;QAEZ,OAAO,aAAa,CAAC,aAAa,CAAC,GAAG,CACpC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,iCAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,CAClE,CAAA;IACH,CAAC;CACF;AAvFD,8CAuFC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC3E,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.d.ts new file mode 100644 index 00000000..07e3527b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.d.ts @@ -0,0 +1,5 @@ +import { Node } from './Ast.js'; +export default class CucumberExpressionParser { + parse(expression: string): Node; +} +//# sourceMappingURL=CucumberExpressionParser.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.d.ts.map new file mode 100644 index 00000000..dcdedb74 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionParser.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpressionParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA8B,MAAM,UAAU,CAAA;AAmK3D,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAC3C,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;CAMhC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.js new file mode 100644 index 00000000..71b70df8 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.js @@ -0,0 +1,240 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Ast_js_1 = require("./Ast.js"); +const CucumberExpressionTokenizer_js_1 = __importDefault(require("./CucumberExpressionTokenizer.js")); +const Errors_js_1 = require("./Errors.js"); +/* + * text := whitespace | ')' | '}' | . + */ +function parseText(expression, tokens, current) { + const token = tokens[current]; + switch (token.type) { + case Ast_js_1.TokenType.whiteSpace: + case Ast_js_1.TokenType.text: + case Ast_js_1.TokenType.endParameter: + case Ast_js_1.TokenType.endOptional: + return { + consumed: 1, + ast: [new Ast_js_1.Node(Ast_js_1.NodeType.text, undefined, token.text, token.start, token.end)], + }; + case Ast_js_1.TokenType.alternation: + throw (0, Errors_js_1.createAlternationNotAllowedInOptional)(expression, token); + case Ast_js_1.TokenType.startOfLine: + case Ast_js_1.TokenType.endOfLine: + case Ast_js_1.TokenType.beginOptional: + case Ast_js_1.TokenType.beginParameter: + default: + // If configured correctly this will never happen + return { consumed: 0, ast: [] }; + } +} +/* + * parameter := '{' + name* + '}' + */ +function parseName(expression, tokens, current) { + const token = tokens[current]; + switch (token.type) { + case Ast_js_1.TokenType.whiteSpace: + case Ast_js_1.TokenType.text: + return { + consumed: 1, + ast: [new Ast_js_1.Node(Ast_js_1.NodeType.text, undefined, token.text, token.start, token.end)], + }; + case Ast_js_1.TokenType.beginOptional: + case Ast_js_1.TokenType.endOptional: + case Ast_js_1.TokenType.beginParameter: + case Ast_js_1.TokenType.endParameter: + case Ast_js_1.TokenType.alternation: + throw (0, Errors_js_1.createInvalidParameterTypeNameInNode)(token, expression); + case Ast_js_1.TokenType.startOfLine: + case Ast_js_1.TokenType.endOfLine: + default: + // If configured correctly this will never happen + return { consumed: 0, ast: [] }; + } +} +/* + * parameter := '{' + text* + '}' + */ +const parseParameter = parseBetween(Ast_js_1.NodeType.parameter, Ast_js_1.TokenType.beginParameter, Ast_js_1.TokenType.endParameter, [parseName]); +/* + * optional := '(' + option* + ')' + * option := optional | parameter | text + */ +const optionalSubParsers = []; +const parseOptional = parseBetween(Ast_js_1.NodeType.optional, Ast_js_1.TokenType.beginOptional, Ast_js_1.TokenType.endOptional, optionalSubParsers); +optionalSubParsers.push(parseOptional, parseParameter, parseText); +/* + * alternation := alternative* + ( '/' + alternative* )+ + */ +function parseAlternativeSeparator(expression, tokens, current) { + if (!lookingAt(tokens, current, Ast_js_1.TokenType.alternation)) { + return { consumed: 0, ast: [] }; + } + const token = tokens[current]; + return { + consumed: 1, + ast: [new Ast_js_1.Node(Ast_js_1.NodeType.alternative, undefined, token.text, token.start, token.end)], + }; +} +const alternativeParsers = [ + parseAlternativeSeparator, + parseOptional, + parseParameter, + parseText, +]; +/* + * alternation := (?<=left-boundary) + alternative* + ( '/' + alternative* )+ + (?=right-boundary) + * left-boundary := whitespace | } | ^ + * right-boundary := whitespace | { | $ + * alternative: = optional | parameter | text + */ +const parseAlternation = (expression, tokens, current) => { + const previous = current - 1; + if (!lookingAtAny(tokens, previous, [ + Ast_js_1.TokenType.startOfLine, + Ast_js_1.TokenType.whiteSpace, + Ast_js_1.TokenType.endParameter, + ])) { + return { consumed: 0, ast: [] }; + } + const result = parseTokensUntil(expression, alternativeParsers, tokens, current, [ + Ast_js_1.TokenType.whiteSpace, + Ast_js_1.TokenType.endOfLine, + Ast_js_1.TokenType.beginParameter, + ]); + const subCurrent = current + result.consumed; + if (!result.ast.some((astNode) => astNode.type == Ast_js_1.NodeType.alternative)) { + return { consumed: 0, ast: [] }; + } + const start = tokens[current].start; + const end = tokens[subCurrent].start; + // Does not consume right hand boundary token + return { + consumed: result.consumed, + ast: [ + new Ast_js_1.Node(Ast_js_1.NodeType.alternation, splitAlternatives(start, end, result.ast), undefined, start, end), + ], + }; +}; +/* + * cucumber-expression := ( alternation | optional | parameter | text )* + */ +const parseCucumberExpression = parseBetween(Ast_js_1.NodeType.expression, Ast_js_1.TokenType.startOfLine, Ast_js_1.TokenType.endOfLine, [parseAlternation, parseOptional, parseParameter, parseText]); +class CucumberExpressionParser { + parse(expression) { + const tokenizer = new CucumberExpressionTokenizer_js_1.default(); + const tokens = tokenizer.tokenize(expression); + const result = parseCucumberExpression(expression, tokens, 0); + return result.ast[0]; + } +} +exports.default = CucumberExpressionParser; +function parseBetween(type, beginToken, endToken, parsers) { + return (expression, tokens, current) => { + if (!lookingAt(tokens, current, beginToken)) { + return { consumed: 0, ast: [] }; + } + let subCurrent = current + 1; + const result = parseTokensUntil(expression, parsers, tokens, subCurrent, [ + endToken, + Ast_js_1.TokenType.endOfLine, + ]); + subCurrent += result.consumed; + // endToken not found + if (!lookingAt(tokens, subCurrent, endToken)) { + throw (0, Errors_js_1.createMissingEndToken)(expression, beginToken, endToken, tokens[current]); + } + // consumes endToken + const start = tokens[current].start; + const end = tokens[subCurrent].end; + const consumed = subCurrent + 1 - current; + const ast = [new Ast_js_1.Node(type, result.ast, undefined, start, end)]; + return { consumed, ast }; + }; +} +function parseToken(expression, parsers, tokens, startAt) { + for (let i = 0; i < parsers.length; i++) { + const parse = parsers[i]; + const result = parse(expression, tokens, startAt); + if (result.consumed != 0) { + return result; + } + } + // If configured correctly this will never happen + throw new Error('No eligible parsers for ' + tokens); +} +function parseTokensUntil(expression, parsers, tokens, startAt, endTokens) { + let current = startAt; + const size = tokens.length; + const ast = []; + while (current < size) { + if (lookingAtAny(tokens, current, endTokens)) { + break; + } + const result = parseToken(expression, parsers, tokens, current); + if (result.consumed == 0) { + // If configured correctly this will never happen + // Keep to avoid infinite loops + throw new Error('No eligible parsers for ' + tokens); + } + current += result.consumed; + ast.push(...result.ast); + } + return { consumed: current - startAt, ast }; +} +function lookingAtAny(tokens, at, tokenTypes) { + return tokenTypes.some((tokenType) => lookingAt(tokens, at, tokenType)); +} +function lookingAt(tokens, at, token) { + if (at < 0) { + // If configured correctly this will never happen + // Keep for completeness + return token == Ast_js_1.TokenType.startOfLine; + } + if (at >= tokens.length) { + return token == Ast_js_1.TokenType.endOfLine; + } + return tokens[at].type == token; +} +function splitAlternatives(start, end, alternation) { + const separators = []; + const alternatives = []; + let alternative = []; + alternation.forEach((n) => { + if (Ast_js_1.NodeType.alternative == n.type) { + separators.push(n); + alternatives.push(alternative); + alternative = []; + } + else { + alternative.push(n); + } + }); + alternatives.push(alternative); + return createAlternativeNodes(start, end, separators, alternatives); +} +function createAlternativeNodes(start, end, separators, alternatives) { + const nodes = []; + for (let i = 0; i < alternatives.length; i++) { + const n = alternatives[i]; + if (i == 0) { + const rightSeparator = separators[i]; + nodes.push(new Ast_js_1.Node(Ast_js_1.NodeType.alternative, n, undefined, start, rightSeparator.start)); + } + else if (i == alternatives.length - 1) { + const leftSeparator = separators[i - 1]; + nodes.push(new Ast_js_1.Node(Ast_js_1.NodeType.alternative, n, undefined, leftSeparator.end, end)); + } + else { + const leftSeparator = separators[i - 1]; + const rightSeparator = separators[i]; + nodes.push(new Ast_js_1.Node(Ast_js_1.NodeType.alternative, n, undefined, leftSeparator.end, rightSeparator.start)); + } + } + return nodes; +} +//# sourceMappingURL=CucumberExpressionParser.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.js.map new file mode 100644 index 00000000..8a304be9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionParser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionParser.js","sourceRoot":"","sources":["../../../src/CucumberExpressionParser.ts"],"names":[],"mappings":";;;;;AAAA,qCAA2D;AAC3D,sGAA0E;AAC1E,2CAIoB;AAEpB;;GAEG;AACH,SAAS,SAAS,CAAC,UAAkB,EAAE,MAAwB,EAAE,OAAe;IAC9E,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAC7B,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,kBAAS,CAAC,UAAU,CAAC;QAC1B,KAAK,kBAAS,CAAC,IAAI,CAAC;QACpB,KAAK,kBAAS,CAAC,YAAY,CAAC;QAC5B,KAAK,kBAAS,CAAC,WAAW;YACxB,OAAO;gBACL,QAAQ,EAAE,CAAC;gBACX,GAAG,EAAE,CAAC,IAAI,aAAI,CAAC,iBAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;aAC9E,CAAA;QACH,KAAK,kBAAS,CAAC,WAAW;YACxB,MAAM,IAAA,iDAAqC,EAAC,UAAU,EAAE,KAAK,CAAC,CAAA;QAChE,KAAK,kBAAS,CAAC,WAAW,CAAC;QAC3B,KAAK,kBAAS,CAAC,SAAS,CAAC;QACzB,KAAK,kBAAS,CAAC,aAAa,CAAC;QAC7B,KAAK,kBAAS,CAAC,cAAc,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ACD,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.d.ts new file mode 100644 index 00000000..f58b05de --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.d.ts @@ -0,0 +1,5 @@ +import { Token } from './Ast.js'; +export default class CucumberExpressionTokenizer { + tokenize(expression: string): readonly Token[]; +} +//# sourceMappingURL=CucumberExpressionTokenizer.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.d.ts.map new file mode 100644 index 00000000..7e76f67a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTokenizer.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpressionTokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,UAAU,CAAA;AAG3C,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAC9C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,KAAK,EAAE;CA4E/C"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.js new file mode 100644 index 00000000..afc6c2c9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const Ast_js_1 = require("./Ast.js"); +const Errors_js_1 = require("./Errors.js"); +class CucumberExpressionTokenizer { + tokenize(expression) { + const codePoints = Array.from(expression); + const tokens = []; + let buffer = []; + let previousTokenType = Ast_js_1.TokenType.startOfLine; + let treatAsText = false; + let escaped = 0; + let bufferStartIndex = 0; + function convertBufferToToken(tokenType) { + let escapeTokens = 0; + if (tokenType == Ast_js_1.TokenType.text) { + escapeTokens = escaped; + escaped = 0; + } + const consumedIndex = bufferStartIndex + buffer.length + escapeTokens; + const t = new Ast_js_1.Token(tokenType, buffer.join(''), bufferStartIndex, consumedIndex); + buffer = []; + bufferStartIndex = consumedIndex; + return t; + } + function tokenTypeOf(codePoint, treatAsText) { + if (!treatAsText) { + return Ast_js_1.Token.typeOf(codePoint); + } + if (Ast_js_1.Token.canEscape(codePoint)) { + return Ast_js_1.TokenType.text; + } + throw (0, Errors_js_1.createCantEscaped)(expression, bufferStartIndex + buffer.length + escaped); + } + function shouldCreateNewToken(previousTokenType, currentTokenType) { + if (currentTokenType != previousTokenType) { + return true; + } + return currentTokenType != Ast_js_1.TokenType.whiteSpace && currentTokenType != Ast_js_1.TokenType.text; + } + if (codePoints.length == 0) { + tokens.push(new Ast_js_1.Token(Ast_js_1.TokenType.startOfLine, '', 0, 0)); + } + codePoints.forEach((codePoint) => { + if (!treatAsText && Ast_js_1.Token.isEscapeCharacter(codePoint)) { + escaped++; + treatAsText = true; + return; + } + const currentTokenType = tokenTypeOf(codePoint, treatAsText); + treatAsText = false; + if (shouldCreateNewToken(previousTokenType, currentTokenType)) { + const token = convertBufferToToken(previousTokenType); + previousTokenType = currentTokenType; + buffer.push(codePoint); + tokens.push(token); + } + else { + previousTokenType = currentTokenType; + buffer.push(codePoint); + } + }); + if (buffer.length > 0) { + const token = convertBufferToToken(previousTokenType); + tokens.push(token); + } + if (treatAsText) { + throw (0, Errors_js_1.createTheEndOfLIneCanNotBeEscaped)(expression); + } + tokens.push(new Ast_js_1.Token(Ast_js_1.TokenType.endOfLine, '', codePoints.length, codePoints.length)); + return tokens; + } +} +exports.default = CucumberExpressionTokenizer; +//# sourceMappingURL=CucumberExpressionTokenizer.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.js.map new file mode 100644 index 00000000..3f1d94c0 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/CucumberExpressionTokenizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTokenizer.js","sourceRoot":"","sources":["../../../src/CucumberExpressionTokenizer.ts"],"names":[],"mappings":";;AAAA,qCAA2C;AAC3C,2CAAkF;AAElF,MAAqB,2BAA2B;IAC9C,QAAQ,CAAC,UAAkB;QACzB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACzC,MAAM,MAAM,GAAiB,EAAE,CAAA;QAC/B,IAAI,MAAM,GAAkB,EAAE,CAAA;QAC9B,IAAI,iBAAiB,GAAG,kBAAS,CAAC,WAAW,CAAA;QAC7C,IAAI,WAAW,GAAG,KAAK,CAAA;QACvB,IAAI,OAAO,GAAG,CAAC,CAAA;QACf,IAAI,gBAAgB,GAAG,CAAC,CAAA;QAExB,SAAS,oBAAoB,CAAC,SAAoB;YAChD,IAAI,YAAY,GAAG,CAAC,CAAA;YACpB,IAAI,SAAS,IAAI,kBAAS,CAAC,IAAI,EAAE,CAAC;gBAChC,YAAY,GAAG,OAAO,CAAA;gBACtB,OAAO,GAAG,CAAC,CAAA;YACb,CAAC;YAED,MAAM,aAAa,GAAG,gBAAgB,GAAG,MAAM,CAAC,MAAM,GAAG,YAAY,CAAA;YACrE,MAAM,CAAC,GAAG,IAAI,cAAK,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAA;YAChF,MAAM,GAAG,EAAE,CAAA;YACX,gBAAgB,GAAG,aAAa,CAAA;YAChC,OAAO,CAAC,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iBAAiB,CAAC,CAAA;gBACrD,iBAAiB,GAAG,gBAAgB,CAAA;gBACpC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBACtB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACpB,CAAC;iBAAM,CAAC;gBACN,iBAAiB,GAAG,gBAAgB,CAAA;gBACpC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACxB,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;YACrD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpB,CAAC;QAED,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,IAAA,6CAAiC,EAAC,UAAU,CAAC,CAAA;QACrD,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,IAAI,cAAK,CAAC,kBAAS,CAAC,SAAS,EAAE,EAAE,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;QACrF,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AA7ED,8CA6EC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.d.ts new file mode 100644 index 00000000..3ec2128d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.d.ts @@ -0,0 +1,25 @@ +import { Node, Token, TokenType } from './Ast.js'; +import CucumberExpressionError from './CucumberExpressionError.js'; +import GeneratedExpression from './GeneratedExpression.js'; +import ParameterType from './ParameterType.js'; +export declare function createAlternativeMayNotExclusivelyContainOptionals(node: Node, expression: string): CucumberExpressionError; +export declare function createAlternativeMayNotBeEmpty(node: Node, expression: string): CucumberExpressionError; +export declare function createOptionalMayNotBeEmpty(node: Node, expression: string): CucumberExpressionError; +export declare function createParameterIsNotAllowedInOptional(node: Node, expression: string): CucumberExpressionError; +export declare function createOptionalIsNotAllowedInOptional(node: Node, expression: string): CucumberExpressionError; +export declare function createTheEndOfLIneCanNotBeEscaped(expression: string): CucumberExpressionError; +export declare function createMissingEndToken(expression: string, beginToken: TokenType, endToken: TokenType, current: Token): CucumberExpressionError; +export declare function createAlternationNotAllowedInOptional(expression: string, current: Token): CucumberExpressionError; +export declare function createCantEscaped(expression: string, index: number): CucumberExpressionError; +export declare function createInvalidParameterTypeNameInNode(token: Token, expression: string): CucumberExpressionError; +export declare class AmbiguousParameterTypeError extends CucumberExpressionError { + static forRegExp(parameterTypeRegexp: string, expressionRegexp: RegExp, parameterTypes: readonly ParameterType[], generatedExpressions: readonly GeneratedExpression[]): AmbiguousParameterTypeError; + static _parameterTypeNames(parameterTypes: readonly ParameterType[]): string; + static _expressions(generatedExpressions: readonly GeneratedExpression[]): string; +} +export declare class UndefinedParameterTypeError extends CucumberExpressionError { + readonly undefinedParameterTypeName: string; + constructor(undefinedParameterTypeName: string, message: string); +} +export declare function createUndefinedParameterType(node: Node, expression: string, undefinedParameterTypeName: string): UndefinedParameterTypeError; +//# sourceMappingURL=Errors.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.d.ts.map new file mode 100644 index 00000000..3e9a8b30 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,IAAI,EAAuB,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAA;AAClE,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,aAAa,MAAM,o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,qBAAa,2BAA4B,SAAQ,uBAAuB;aAEpD,0BAA0B,EAAE,MAAM;gBAAlC,0BAA0B,EAAE,MAAM,EAClD,OAAO,EAAE,MAAM;CAIlB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,0BAA0B,EAAE,MAAM,+BAYnC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.js new file mode 100644 index 00000000..7b298039 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.js @@ -0,0 +1,113 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UndefinedParameterTypeError = exports.AmbiguousParameterTypeError = void 0; +exports.createAlternativeMayNotExclusivelyContainOptionals = createAlternativeMayNotExclusivelyContainOptionals; +exports.createAlternativeMayNotBeEmpty = createAlternativeMayNotBeEmpty; +exports.createOptionalMayNotBeEmpty = createOptionalMayNotBeEmpty; +exports.createParameterIsNotAllowedInOptional = createParameterIsNotAllowedInOptional; +exports.createOptionalIsNotAllowedInOptional = createOptionalIsNotAllowedInOptional; +exports.createTheEndOfLIneCanNotBeEscaped = createTheEndOfLIneCanNotBeEscaped; +exports.createMissingEndToken = createMissingEndToken; +exports.createAlternationNotAllowedInOptional = createAlternationNotAllowedInOptional; +exports.createCantEscaped = createCantEscaped; +exports.createInvalidParameterTypeNameInNode = createInvalidParameterTypeNameInNode; +exports.createUndefinedParameterType = createUndefinedParameterType; +const Ast_js_1 = require("./Ast.js"); +const CucumberExpressionError_js_1 = __importDefault(require("./CucumberExpressionError.js")); +function createAlternativeMayNotExclusivelyContainOptionals(node, expression) { + return new CucumberExpressionError_js_1.default(message(node.start, expression, pointAtLocated(node), 'An alternative may not exclusively contain optionals', "If you did not mean to use an optional you can use '\\(' to escape the '('")); +} +function createAlternativeMayNotBeEmpty(node, expression) { + return new CucumberExpressionError_js_1.default(message(node.start, expression, pointAtLocated(node), 'Alternative may not be empty', "If you did not mean to use an alternative you can use '\\/' to escape the '/'")); +} +function createOptionalMayNotBeEmpty(node, expression) { + return new CucumberExpressionError_js_1.default(message(node.start, expression, pointAtLocated(node), 'An optional must contain some text', "If you did not mean to use an optional you can use '\\(' to escape the '('")); +} +function createParameterIsNotAllowedInOptional(node, expression) { + return new CucumberExpressionError_js_1.default(message(node.start, expression, pointAtLocated(node), 'An optional may not contain a parameter type', "If you did not mean to use an parameter type you can use '\\{' to escape the '{'")); +} +function createOptionalIsNotAllowedInOptional(node, expression) { + return new CucumberExpressionError_js_1.default(message(node.start, expression, pointAtLocated(node), 'An optional may not contain an other optional', "If you did not mean to use an optional type you can use '\\(' to escape the '('. For more complicated expressions consider using a regular expression instead.")); +} +function createTheEndOfLIneCanNotBeEscaped(expression) { + const index = Array.from(expression).length - 1; + return new CucumberExpressionError_js_1.default(message(index, expression, pointAt(index), 'The end of line can not be escaped', "You can use '\\\\' to escape the '\\'")); +} +function createMissingEndToken(expression, beginToken, endToken, current) { + const beginSymbol = (0, Ast_js_1.symbolOf)(beginToken); + const endSymbol = (0, Ast_js_1.symbolOf)(endToken); + const purpose = (0, Ast_js_1.purposeOf)(beginToken); + return new CucumberExpressionError_js_1.default(message(current.start, expression, pointAtLocated(current), `The '${beginSymbol}' does not have a matching '${endSymbol}'`, `If you did not intend to use ${purpose} you can use '\\${beginSymbol}' to escape the ${purpose}`)); +} +function createAlternationNotAllowedInOptional(expression, current) { + return new CucumberExpressionError_js_1.default(message(current.start, expression, pointAtLocated(current), 'An alternation can not be used inside an optional', "If you did not mean to use an alternation you can use '\\/' to escape the '/'. Otherwise rephrase your expression or consider using a regular expression instead.")); +} +function createCantEscaped(expression, index) { + return new CucumberExpressionError_js_1.default(message(index, expression, pointAt(index), "Only the characters '{', '}', '(', ')', '\\', '/' and whitespace can be escaped", "If you did mean to use an '\\' you can use '\\\\' to escape it")); +} +function createInvalidParameterTypeNameInNode(token, expression) { + return new CucumberExpressionError_js_1.default(message(token.start, expression, pointAtLocated(token), "Parameter names may not contain '{', '}', '(', ')', '\\' or '/'", 'Did you mean to use a regular expression?')); +} +function message(index, expression, pointer, problem, solution) { + return `This Cucumber Expression has a problem at column ${index + 1}: + +${expression} +${pointer} +${problem}. +${solution}`; +} +function pointAt(index) { + const pointer = []; + for (let i = 0; i < index; i++) { + pointer.push(' '); + } + pointer.push('^'); + return pointer.join(''); +} +function pointAtLocated(node) { + const pointer = [pointAt(node.start)]; + if (node.start + 1 < node.end) { + for (let i = node.start + 1; i < node.end - 1; i++) { + pointer.push('-'); + } + pointer.push('^'); + } + return pointer.join(''); +} +class AmbiguousParameterTypeError extends CucumberExpressionError_js_1.default { + static forRegExp(parameterTypeRegexp, expressionRegexp, parameterTypes, generatedExpressions) { + return new this(`Your Regular Expression ${expressionRegexp} +matches multiple parameter types with regexp ${parameterTypeRegexp}: + ${this._parameterTypeNames(parameterTypes)} + +I couldn't decide which one to use. You have two options: + +1) Use a Cucumber Expression instead of a Regular Expression. Try one of these: + ${this._expressions(generatedExpressions)} + +2) Make one of the parameter types preferential and continue to use a Regular Expression. +`); + } + static _parameterTypeNames(parameterTypes) { + return parameterTypes.map((p) => `{${p.name}}`).join('\n '); + } + static _expressions(generatedExpressions) { + return generatedExpressions.map((e) => e.source).join('\n '); + } +} +exports.AmbiguousParameterTypeError = AmbiguousParameterTypeError; +class UndefinedParameterTypeError extends CucumberExpressionError_js_1.default { + undefinedParameterTypeName; + constructor(undefinedParameterTypeName, message) { + super(message); + this.undefinedParameterTypeName = undefinedParameterTypeName; + } +} +exports.UndefinedParameterTypeError = UndefinedParameterTypeError; +function createUndefinedParameterType(node, expression, undefinedParameterTypeName) { + return new UndefinedParameterTypeError(undefinedParameterTypeName, message(node.start, expression, pointAtLocated(node), `Undefined parameter type '${undefinedParameterTypeName}'`, `Please register a ParameterType for '${undefinedParameterTypeName}'`)); +} +//# sourceMappingURL=Errors.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.js.map new file mode 100644 index 00000000..573bbd0a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../../src/Errors.ts"],"names":[],"mappings":";;;;;;AAKA,gHAaC;AACD,wEAaC;AACD,kEAaC;AACD,sFAaC;AAED,oFAaC;AAED,8EAWC;AAED,sDAkBC;AAED,sFAUC;AAED,8CAUC;AAED,oFAUC;AA6ED,oEAeC;AA5OD,qCAA+E;AAC/E,8FAAkE;AAIlE,SAAgB,kDAAkD,CAChE,IAAU,EACV,UAAkB;IAElB,OAAO,IAAI,oCAAuB,CAChC,OAAO,CACL,IAAI,CAAC,KAAK,EACV,UAAU,EACV,cAAc,CAAC,IAAI,CAAC,EACpB,sDAAsD,EACtD,4EAA4E,CAC7E,CACF,CAAA;AACH,CAAC;AACD,SAAgB,8BAA8B,CAC5C,IAAU,EACV,UAAkB;IAElB,OAAO,IAAI,oCAAuB,CAChC,OAAO,CACL,IAAI,CAAC,KAAK,EACV,UAAU,EACV,cAAc,CAAC,IAAI,CAAC,EACpB,8BAA8B,EAC9B,+EAA+E,CAChF,CACF,CAAA;AACH,CAAC;AACD,SAAgB,2BAA2B,CACzC,IAAU,EACV,UAAkB;IAElB,OAAO,IAAI,oCAAuB,CAChC,OAAO,CACL,IAAI,CAAC,KAAK,EACV,UAAU,EACV,cAAc,CAAC,IAAI,CAAC,EACpB,oCAAoC,EACpC,4EAA4E,CAC7E,CACF,CAAA;AACH,CAAC;AACD,SAAgB,qCAAqC,CACnD,IAAU,EACV,UAAkB;IAElB,OAAO,IAAI,oCAAuB,CAChC,OAAO,CACL,IAAI,CAAC,KAAK,EACV,UAAU,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EACV,cAAc,CAAC,IAAI,CAAC,EACpB,6BAA6B,0BAA0B,GAAG,EAC1D,wCAAwC,0BAA0B,GAAG,CACtE,CACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.d.ts new file mode 100644 index 00000000..ae75fd08 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.d.ts @@ -0,0 +1,8 @@ +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import { Expression } from './types.js'; +export default class ExpressionFactory { + private readonly parameterTypeRegistry; + constructor(parameterTypeRegistry: ParameterTypeRegistry); + createExpression(expression: string | RegExp): Expression; +} +//# sourceMappingURL=ExpressionFactory.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.d.ts.map new file mode 100644 index 00000000..01f33472 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpressionFactory.d.ts","sourceRoot":"","sources":["../../../src/ExpressionFactory.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACjB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAEzE,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU;CAKjE"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.js new file mode 100644 index 00000000..55e37699 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.js @@ -0,0 +1,20 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const CucumberExpression_js_1 = __importDefault(require("./CucumberExpression.js")); +const RegularExpression_js_1 = __importDefault(require("./RegularExpression.js")); +class ExpressionFactory { + parameterTypeRegistry; + constructor(parameterTypeRegistry) { + this.parameterTypeRegistry = parameterTypeRegistry; + } + createExpression(expression) { + return typeof expression === 'string' + ? new CucumberExpression_js_1.default(expression, this.parameterTypeRegistry) + : new RegularExpression_js_1.default(expression, this.parameterTypeRegistry); + } +} +exports.default = ExpressionFactory; +//# sourceMappingURL=ExpressionFactory.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.js.map new file mode 100644 index 00000000..1609342b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ExpressionFactory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpressionFactory.js","sourceRoot":"","sources":["../../../src/ExpressionFactory.ts"],"names":[],"mappings":";;;;;AAAA,oFAAwD;AAExD,kFAAsD;AAGtD,MAAqB,iBAAiB;IACA;IAApC,YAAoC,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAG,CAAC;IAE7E,gBAAgB,CAAC,UAA2B;QACjD,OAAO,OAAO,UAAU,KAAK,QAAQ;YACnC,CAAC,CAAC,IAAI,+BAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,qBAAqB,CAAC;YAChE,CAAC,CAAC,IAAI,8BAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;IACnE,CAAC;CACF;AARD,oCAQC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.d.ts new file mode 100644 index 00000000..da55600b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.d.ts @@ -0,0 +1,19 @@ +import ParameterType from './ParameterType.js'; +import { ParameterInfo } from './types.js'; +export default class GeneratedExpression { + private readonly expressionTemplate; + readonly parameterTypes: readonly ParameterType[]; + constructor(expressionTemplate: string, parameterTypes: readonly ParameterType[]); + get source(): string; + /** + * Returns an array of parameter names to use in generated function/method signatures + * + * @returns {ReadonlyArray.} + */ + get parameterNames(): readonly string[]; + /** + * Returns an array of ParameterInfo to use in generated function/method signatures + */ + get parameterInfos(): readonly ParameterInfo[]; +} +//# sourceMappingURL=GeneratedExpression.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.d.ts.map new file mode 100644 index 00000000..4fdd5888 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeneratedExpression.d.ts","sourceRoot":"","sources":["../../../src/GeneratedExpression.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAEpC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;aACnB,cAAc,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE;gBADhD,kBAAkB,EAAE,MAAM,EAC3B,cAAc,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE;IAGnE,IAAI,MAAM,WAET;IAED;;;;OAIG;IACH,IAAI,cAAc,IAAI,SAAS,MAAM,EAAE,CAEtC;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,SAAS,aAAa,EAAE,CAG7C;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.js new file mode 100644 index 00000000..3bf945c1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class GeneratedExpression { + expressionTemplate; + parameterTypes; + constructor(expressionTemplate, parameterTypes) { + this.expressionTemplate = expressionTemplate; + this.parameterTypes = parameterTypes; + } + get source() { + return format(this.expressionTemplate, ...this.parameterTypes.map((t) => t.name || '')); + } + /** + * Returns an array of parameter names to use in generated function/method signatures + * + * @returns {ReadonlyArray.} + */ + get parameterNames() { + return this.parameterInfos.map((i) => `${i.name}${i.count === 1 ? '' : i.count.toString()}`); + } + /** + * Returns an array of ParameterInfo to use in generated function/method signatures + */ + get parameterInfos() { + const usageByTypeName = {}; + return this.parameterTypes.map((t) => getParameterInfo(t, usageByTypeName)); + } +} +exports.default = GeneratedExpression; +function getParameterInfo(parameterType, usageByName) { + const name = parameterType.name || ''; + let counter = usageByName[name]; + counter = counter ? counter + 1 : 1; + usageByName[name] = counter; + let type; + if (parameterType.type) { + if (typeof parameterType.type === 'string') { + type = parameterType.type; + } + else if ('name' in parameterType.type) { + type = parameterType.type.name; + } + else { + type = null; + } + } + else { + type = null; + } + return { + type, + name, + count: counter, + }; +} +function format(pattern, ...args) { + return pattern.replace(/{(\d+)}/g, (match, number) => args[number]); +} +//# sourceMappingURL=GeneratedExpression.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.js.map new file mode 100644 index 00000000..baccb610 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GeneratedExpression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GeneratedExpression.js","sourceRoot":"","sources":["../../../src/GeneratedExpression.ts"],"names":[],"mappings":";;AAGA,MAAqB,mBAAmB;IAEnB;IACD;IAFlB,YACmB,kBAA0B,EAC3B,cAAiD;QADhD,uBAAkB,GAAlB,kBAAkB,CAAQ;QAC3B,mBAAc,GAAd,cAAc,CAAmC;IAChE,CAAC;IAEJ,IAAI,MAAM;QACR,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAA;IACzF,CAAC;IAED;;;;OAIG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IAC9F,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QAChB,MAAM,eAAe,GAA8B,EAAE,CAAA;QACrD,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAA;IAC7E,CAAC;CACF;AA1BD,sCA0BC;AAED,SAAS,gBAAgB,CACvB,aAAqC,EACrC,WAAsC;IAEtC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,IAAI,EAAE,CAAA;IACrC,IAAI,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IAC/B,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACnC,WAAW,CAAC,IAAI,CAAC,GAAG,OAAO,CAAA;IAC3B,IAAI,IAAmB,CAAA;IACvB,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC;QACvB,IAAI,OAAO,aAAa,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC3C,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;QAC3B,CAAC;aAAM,IAAI,MAAM,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC;YACxC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAA;QAChC,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,IAAI,CAAA;QACb,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,IAAI,CAAA;IACb,CAAC;IACD,OAAO;QACL,IAAI;QACJ,IAAI;QACJ,KAAK,EAAE,OAAO;KACf,CAAA;AACH,CAAC;AAED,SAAS,MAAM,CAAC,OAAe,EAAE,GAAG,IAAuB;IACzD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AACrE,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.d.ts new file mode 100644 index 00000000..f4f4bbfc --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.d.ts @@ -0,0 +1,20 @@ +export default class Group { + readonly value: string; + readonly start: number | undefined; + readonly end: number | undefined; + /** + * A groups children. + * + * There are either one or more children or the attribute is undefined. + */ + readonly children: readonly Group[] | undefined; + constructor(value: string, start: number | undefined, end: number | undefined, + /** + * A groups children. + * + * There are either one or more children or the attribute is undefined. + */ + children: readonly Group[] | undefined); + get values(): string[] | null; +} +//# sourceMappingURL=Group.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.d.ts.map new file mode 100644 index 00000000..e735b88e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../src/Group.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,KAAK;aAEN,KAAK,EAAE,MAAM;aACb,KAAK,EAAE,MAAM,GAAG,SAAS;aACzB,GAAG,EAAE,MAAM,GAAG,SAAS;IACvC;;;;OAIG;aACa,QAAQ,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS;gBARtC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,GAAG,EAAE,MAAM,GAAG,SAAS;IACvC;;;;OAIG;IACa,QAAQ,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS;IAGxD,IAAI,MAAM,IAAI,MAAM,EAAE,GAAG,IAAI,CAE5B;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.js new file mode 100644 index 00000000..14148bae --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Group { + value; + start; + end; + children; + constructor(value, start, end, + /** + * A groups children. + * + * There are either one or more children or the attribute is undefined. + */ + children) { + this.value = value; + this.start = start; + this.end = end; + this.children = children; + } + get values() { + return (this.children === undefined ? [this] : this.children).map((g) => g.value); + } +} +exports.default = Group; +//# sourceMappingURL=Group.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.js.map new file mode 100644 index 00000000..1fc69f77 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/Group.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../src/Group.ts"],"names":[],"mappings":";;AAAA,MAAqB,KAAK;IAEN;IACA;IACA;IAMA;IATlB,YACkB,KAAa,EACb,KAAyB,EACzB,GAAuB;IACvC;;;;OAIG;IACa,QAAsC;QARtC,UAAK,GAAL,KAAK,CAAQ;QACb,UAAK,GAAL,KAAK,CAAoB;QACzB,QAAG,GAAH,GAAG,CAAoB;QAMvB,aAAQ,GAAR,QAAQ,CAA8B;IACrD,CAAC;IAEJ,IAAI,MAAM;QACR,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACnF,CAAC;CACF;AAhBD,wBAgBC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.d.ts new file mode 100644 index 00000000..d929deb1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.d.ts @@ -0,0 +1,13 @@ +import { RegExpExecArray } from 'regexp-match-indices'; +import Group from './Group.js'; +export default class GroupBuilder { + source: string; + capturing: boolean; + private readonly groupBuilders; + add(groupBuilder: GroupBuilder): void; + build(match: RegExpExecArray, nextGroupIndex: () => number): Group; + setNonCapturing(): void; + get children(): GroupBuilder[]; + moveChildrenTo(groupBuilder: GroupBuilder): void; +} +//# sourceMappingURL=GroupBuilder.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.d.ts.map new file mode 100644 index 00000000..2fd69d03 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupBuilder.d.ts","sourceRoot":"","sources":["../../../src/GroupBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,MAAM,YAAY,CAAA;AAE9B,MAAM,CAAC,OAAO,OAAO,YAAY;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,UAAO;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;IAE5C,GAAG,CAAC,YAAY,EAAE,YAAY;IAI9B,KAAK,CAAC,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,GAAG,KAAK;IAUlE,eAAe;IAItB,IAAI,QAAQ,mBAEX;IAEM,cAAc,CAAC,YAAY,EAAE,YAAY;CAGjD"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.js new file mode 100644 index 00000000..95a3f0b9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.js @@ -0,0 +1,34 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Group_js_1 = __importDefault(require("./Group.js")); +class GroupBuilder { + source; + capturing = true; + groupBuilders = []; + add(groupBuilder) { + this.groupBuilders.push(groupBuilder); + } + build(match, nextGroupIndex) { + const groupIndex = nextGroupIndex(); + const children = this.groupBuilders.map((gb) => gb.build(match, nextGroupIndex)); + const value = match[groupIndex]; + const index = match.indices[groupIndex]; + const start = index ? index[0] : undefined; + const end = index ? index[1] : undefined; + return new Group_js_1.default(value, start, end, children.length === 0 ? undefined : children); + } + setNonCapturing() { + this.capturing = false; + } + get children() { + return this.groupBuilders; + } + moveChildrenTo(groupBuilder) { + this.groupBuilders.forEach((child) => groupBuilder.add(child)); + } +} +exports.default = GroupBuilder; +//# sourceMappingURL=GroupBuilder.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.js.map new file mode 100644 index 00000000..5dc9ee1b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/GroupBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupBuilder.js","sourceRoot":"","sources":["../../../src/GroupBuilder.ts"],"names":[],"mappings":";;;;;AAEA,0DAA8B;AAE9B,MAAqB,YAAY;IACxB,MAAM,CAAQ;IACd,SAAS,GAAG,IAAI,CAAA;IACN,aAAa,GAAmB,EAAE,CAAA;IAE5C,GAAG,CAAC,YAA0B;QACnC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACvC,CAAC;IAEM,KAAK,CAAC,KAAsB,EAAE,cAA4B;QAC/D,MAAM,UAAU,GAAG,cAAc,EAAE,CAAA;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAA;QAChF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAA;QAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACvC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAC1C,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACxC,OAAO,IAAI,kBAAK,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IACnF,CAAC;IAEM,eAAe;QACpB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;IAEM,cAAc,CAAC,YAA0B;QAC9C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;IAChE,CAAC;CACF;AA9BD,+BA8BC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.d.ts new file mode 100644 index 00000000..e11660f1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.d.ts @@ -0,0 +1,32 @@ +interface Constructor { + new (...args: unknown[]): T; + prototype: T; +} +type Factory = (...args: unknown[]) => T; +export type RegExps = StringOrRegExp | readonly StringOrRegExp[]; +export type StringOrRegExp = string | RegExp; +export default class ParameterType { + readonly name: string | undefined; + readonly type: Constructor | Factory | null; + readonly useForSnippets?: boolean | undefined; + readonly preferForRegexpMatch?: boolean | undefined; + readonly builtin?: boolean | undefined; + private transformFn; + static compare(pt1: ParameterType, pt2: ParameterType): number; + static checkParameterTypeName(typeName: string): void; + static isValidParameterTypeName(typeName: string): boolean; + regexpStrings: readonly string[]; + /** + * @param name {String} the name of the type + * @param regexps {Array.,RegExp,String} that matche the type + * @param type {Function} the prototype (constructor) of the type. May be null. + * @param transform {Function} function transforming string to another type. May be null. + * @param useForSnippets {boolean} true if this should be used for snippets. Defaults to true. + * @param preferForRegexpMatch {boolean} true if this is a preferential type. Defaults to false. + * @param builtin whether or not this is a built-in type + */ + constructor(name: string | undefined, regexps: RegExps, type: Constructor | Factory | null, transform?: (...match: string[]) => T | PromiseLike, useForSnippets?: boolean | undefined, preferForRegexpMatch?: boolean | undefined, builtin?: boolean | undefined); + transform(thisObj: unknown, groupValues: string[] | null): any; +} +export {}; +//# sourceMappingURL=ParameterType.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.d.ts.map new file mode 100644 index 00000000..131dba66 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterType.d.ts","sourceRoot":"","sources":["../../../src/ParameterType.ts"],"names":[],"mappings":"AAKA,UAAU,WAAW,CAAC,CAAC;IACrB,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC3B,SAAS,EAAE,CAAC,CAAA;CACb;AAED,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;AAE3C,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,cAAc,EAAE,CAAA;AAEhE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5C,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,CAAC;aAsChB,IAAI,EAAE,MAAM,GAAG,SAAS;aAExB,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;aAExC,cAAc,CAAC,EAAE,OAAO;aACxB,oBAAoB,CAAC,EAAE,OAAO;aAC9B,OAAO,CAAC,EAAE,OAAO;IA3CnC,OAAO,CAAC,WAAW,CAAqD;WAE1D,OAAO,CAAC,GAAG,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,OAAO,CAAC;WAUhE,sBAAsB,CAAC,QAAQ,EAAE,MAAM;WAQvC,wBAAwB,CAAC,QAAQ,EAAE,MAAM;IAKhD,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;IAEvC;;;;;;;;OAQG;gBAEe,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,OAAO,EACA,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,EACxD,SAAS,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EACtC,cAAc,CAAC,EAAE,OAAO,YAAA,EACxB,oBAAoB,CAAC,EAAE,OAAO,YAAA,EAC9B,OAAO,CAAC,EAAE,OAAO,YAAA;IAoB5B,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI;CAGhE"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.js new file mode 100644 index 00000000..fb8b7eb1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.js @@ -0,0 +1,101 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const CucumberExpressionError_js_1 = __importDefault(require("./CucumberExpressionError.js")); +const ILLEGAL_PARAMETER_NAME_PATTERN = /([[\]()$.|?*+])/; +const UNESCAPE_PATTERN = () => /(\\([[$.|?*+\]]))/g; +class ParameterType { + name; + type; + useForSnippets; + preferForRegexpMatch; + builtin; + transformFn; + static compare(pt1, pt2) { + if (pt1.preferForRegexpMatch && !pt2.preferForRegexpMatch) { + return -1; + } + if (pt2.preferForRegexpMatch && !pt1.preferForRegexpMatch) { + return 1; + } + return (pt1.name || '').localeCompare(pt2.name || ''); + } + static checkParameterTypeName(typeName) { + if (!this.isValidParameterTypeName(typeName)) { + throw new CucumberExpressionError_js_1.default(`Illegal character in parameter name {${typeName}}. Parameter names may not contain '{', '}', '(', ')', '\\' or '/'`); + } + } + static isValidParameterTypeName(typeName) { + const unescapedTypeName = typeName.replace(UNESCAPE_PATTERN(), '$2'); + return !unescapedTypeName.match(ILLEGAL_PARAMETER_NAME_PATTERN); + } + regexpStrings; + /** + * @param name {String} the name of the type + * @param regexps {Array.,RegExp,String} that matche the type + * @param type {Function} the prototype (constructor) of the type. May be null. + * @param transform {Function} function transforming string to another type. May be null. + * @param useForSnippets {boolean} true if this should be used for snippets. Defaults to true. + * @param preferForRegexpMatch {boolean} true if this is a preferential type. Defaults to false. + * @param builtin whether or not this is a built-in type + */ + constructor(name, regexps, type, transform, useForSnippets, preferForRegexpMatch, builtin) { + this.name = name; + this.type = type; + this.useForSnippets = useForSnippets; + this.preferForRegexpMatch = preferForRegexpMatch; + this.builtin = builtin; + if (transform === undefined) { + transform = (s) => s; + } + if (useForSnippets === undefined) { + this.useForSnippets = true; + } + if (preferForRegexpMatch === undefined) { + this.preferForRegexpMatch = false; + } + if (name) { + ParameterType.checkParameterTypeName(name); + } + this.regexpStrings = stringArray(regexps); + this.transformFn = transform; + } + transform(thisObj, groupValues) { + return this.transformFn.apply(thisObj, groupValues); + } +} +exports.default = ParameterType; +function stringArray(regexps) { + const array = Array.isArray(regexps) ? regexps : [regexps]; + return array.map((r) => (r instanceof RegExp ? regexpSource(r) : r)); +} +function regexpSource(regexp) { + const flags = regexpFlags(regexp); + for (const flag of ['g', 'i', 'm', 'y']) { + if (flags.indexOf(flag) !== -1) { + throw new CucumberExpressionError_js_1.default(`ParameterType Regexps can't use flag '${flag}'`); + } + } + return regexp.source; +} +// Backport RegExp.flags for Node 4.x +// https://github.com/nodejs/node/issues/8390 +function regexpFlags(regexp) { + let flags = regexp.flags; + if (flags === undefined) { + flags = ''; + if (regexp.ignoreCase) { + flags += 'i'; + } + if (regexp.global) { + flags += 'g'; + } + if (regexp.multiline) { + flags += 'm'; + } + } + return flags; +} +//# sourceMappingURL=ParameterType.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.js.map new file mode 100644 index 00000000..790af88a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterType.js","sourceRoot":"","sources":["../../../src/ParameterType.ts"],"names":[],"mappings":";;;;;AAAA,8FAAkE;AAElE,MAAM,8BAA8B,GAAG,iBAAiB,CAAA;AACxD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,oBAAoB,CAAA;AAanD,MAAqB,aAAa;IAsCd;IAEA;IAEA;IACA;IACA;IA3CV,WAAW,CAAqD;IAEjE,MAAM,CAAC,OAAO,CAAC,GAA2B,EAAE,GAA2B;QAC5E,IAAI,GAAG,CAAC,oBAAoB,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;YAC1D,OAAO,CAAC,CAAC,CAAA;QACX,CAAC;QACD,IAAI,GAAG,CAAC,oBAAoB,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;YAC1D,OAAO,CAAC,CAAA;QACV,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;IACvD,CAAC;IAEM,MAAM,CAAC,sBAAsB,CAAC,QAAgB;QACnD,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7C,MAAM,IAAI,oCAAuB,CAC/B,wCAAwC,QAAQ,oEAAoE,CACrH,CAAA;QACH,CAAC;IACH,CAAC;IAEM,M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ucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.d.ts new file mode 100644 index 00000000..67de4fca --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.d.ts @@ -0,0 +1,18 @@ +import ParameterType from './ParameterType.js'; +export default class ParameterTypeMatcher { + readonly parameterType: ParameterType; + private readonly regexpString; + private readonly text; + private matchPosition; + private readonly match; + constructor(parameterType: ParameterType, regexpString: string, text: string, matchPosition?: number); + advanceTo(newMatchPosition: number): ParameterTypeMatcher; + get find(): boolean | RegExpMatchArray | null; + get start(): number; + get fullWord(): true | RegExpMatchArray | null; + get matchStartWord(): true | RegExpMatchArray | null; + get matchEndWord(): true | RegExpMatchArray | null; + get group(): string; + static compare(a: ParameterTypeMatcher, b: ParameterTypeMatcher): number; +} +//# sourceMappingURL=ParameterTypeMatcher.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.d.ts.map new file mode 100644 index 00000000..6801207f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeMatcher.d.ts","sourceRoot":"","sources":["../../../src/ParameterTypeMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,MAAM,CAAC,OAAO,OAAO,oBAAoB;aAIrB,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC;IACrD,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,aAAa;IANvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;gBAG5B,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,EACpC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACrB,aAAa,GAAE,MAAU;IAM5B,SAAS,CAAC,gBAAgB,EAAE,MAAM;IAsBzC,IAAI,IAAI,sCAEP;IAED,IAAI,KAAK,WAGR;IAED,IAAI,QAAQ,mCAEX;IAED,IAAI,cAAc,mCAEjB;IAED,IAAI,YAAY,mCAMf;IAED,IAAI,KAAK,WAGR;WAEa,OAAO,CAAC,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,oBAAoB;CAWvE"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.js new file mode 100644 index 00000000..e97e39bd --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ParameterTypeMatcher { + parameterType; + regexpString; + text; + matchPosition; + match; + constructor(parameterType, regexpString, text, matchPosition = 0) { + this.parameterType = parameterType; + this.regexpString = regexpString; + this.text = text; + this.matchPosition = matchPosition; + const captureGroupRegexp = new RegExp(`(${regexpString})`); + this.match = captureGroupRegexp.exec(text.slice(this.matchPosition)); + } + advanceTo(newMatchPosition) { + for (let advancedPos = newMatchPosition; advancedPos < this.text.length; advancedPos++) { + const matcher = new ParameterTypeMatcher(this.parameterType, this.regexpString, this.text, advancedPos); + if (matcher.find) { + return matcher; + } + } + return new ParameterTypeMatcher(this.parameterType, this.regexpString, this.text, this.text.length); + } + get find() { + return this.match && this.group !== '' && this.fullWord; + } + get start() { + if (!this.match) + throw new Error('No match'); + return this.matchPosition + this.match.index; + } + get fullWord() { + return this.matchStartWord && this.matchEndWord; + } + get matchStartWord() { + return this.start === 0 || this.text[this.start - 1].match(/\p{Z}|\p{P}|\p{S}/u); + } + get matchEndWord() { + const nextCharacterIndex = this.start + this.group.length; + return (nextCharacterIndex === this.text.length || + this.text[nextCharacterIndex].match(/\p{Z}|\p{P}|\p{S}/u)); + } + get group() { + if (!this.match) + throw new Error('No match'); + return this.match[0]; + } + static compare(a, b) { + const posComparison = a.start - b.start; + if (posComparison !== 0) { + return posComparison; + } + const lengthComparison = b.group.length - a.group.length; + if (lengthComparison !== 0) { + return lengthComparison; + } + return 0; + } +} +exports.default = ParameterTypeMatcher; +//# sourceMappingURL=ParameterTypeMatcher.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.js.map new file mode 100644 index 00000000..06276849 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeMatcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeMatcher.js","sourceRoot":"","sources":["../../../src/ParameterTypeMatcher.ts"],"names":[],"mappings":";;AAEA,MAAqB,oBAAoB;IAIrB;IACC;IACA;IACT;IANO,KAAK,CAAwB;IAE9C,YACkB,aAAqC,EACpC,YAAoB,EACpB,IAAY,EACrB,gBAAwB,CAAC;QAHjB,kBAAa,GAAb,aAAa,CAAwB;QACpC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,SAAI,GAAJ,IAAI,CAAQ;QACrB,kBAAa,GAAb,aAAa,CAAY;QAEjC,MAAM,kBAAkB,GAAG,IAAI,MAAM,CAAC,IAAI,YAAY,GAAG,CAAC,CAAA;QAC1D,IAAI,CAAC,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAA;IACtE,CAAC;IAEM,SAAS,CAAC,gBAAwB;QACvC,KAAK,IAAI,WAAW,GAAG,gBAAgB,EAAE,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC;YACvF,MAAM,OAAO,GAAG,IAAI,oBAAoB,CACtC,IAAI,CAAC,aAAa,EACl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AC,UAAU,CAAC,CAAA;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IAEM,MAAM,CAAC,OAAO,CAAC,CAAuB,EAAE,CAAuB;QACpE,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAA;QACvC,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,aAAa,CAAA;QACtB,CAAC;QACD,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAA;QACxD,IAAI,gBAAgB,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,gBAAgB,CAAA;QACzB,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;CACF;AA5ED,uCA4EC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.d.ts new file mode 100644 index 00000000..e0d4a6c2 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.d.ts @@ -0,0 +1,12 @@ +import ParameterType from './ParameterType.js'; +import { DefinesParameterType } from './types.js'; +export default class ParameterTypeRegistry implements DefinesParameterType { + private readonly parameterTypeByName; + private readonly parameterTypesByRegexp; + constructor(); + get parameterTypes(): IterableIterator>; + lookupByTypeName(typeName: string): ParameterType | undefined; + lookupByRegexp(parameterTypeRegexp: string, expressionRegexp: RegExp, text: string): ParameterType | undefined; + defineParameterType(parameterType: ParameterType): void; +} +//# sourceMappingURL=ParameterTypeRegistry.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.d.ts.map new file mode 100644 index 00000000..2d43a6d3 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeRegistry.d.ts","sourceRoot":"","sources":["../../../src/ParameterTypeRegistry.ts"],"names":[],"mappings":"AAIA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,oBAAoB;IACxE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA4C;IAChF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAmD;;IAM1F,IAAI,cAAc,IAAI,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAE7D;IAEM,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAIjC,cAAc,CACnB,mBAAmB,EAAE,MAAM,EAC3B,gBAAgB,EAAE,MAAM,EACxB,IAAI,EAAE,MAAM,GACX,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS;IAsB9B,mBAAmB,CAAC,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC;CAwCjE"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.js new file mode 100644 index 00000000..78f8d9f6 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.js @@ -0,0 +1,70 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const CucumberExpressionError_js_1 = __importDefault(require("./CucumberExpressionError.js")); +const CucumberExpressionGenerator_js_1 = __importDefault(require("./CucumberExpressionGenerator.js")); +const defineDefaultParameterTypes_js_1 = __importDefault(require("./defineDefaultParameterTypes.js")); +const Errors_js_1 = require("./Errors.js"); +const ParameterType_js_1 = __importDefault(require("./ParameterType.js")); +class ParameterTypeRegistry { + parameterTypeByName = new Map(); + parameterTypesByRegexp = new Map(); + constructor() { + (0, defineDefaultParameterTypes_js_1.default)(this); + } + get parameterTypes() { + return this.parameterTypeByName.values(); + } + lookupByTypeName(typeName) { + return this.parameterTypeByName.get(typeName); + } + lookupByRegexp(parameterTypeRegexp, expressionRegexp, text) { + const parameterTypes = this.parameterTypesByRegexp.get(parameterTypeRegexp); + if (!parameterTypes) { + return undefined; + } + if (parameterTypes.length > 1 && !parameterTypes[0].preferForRegexpMatch) { + // We don't do this check on insertion because we only want to restrict + // ambiguity when we look up by Regexp. Users of CucumberExpression should + // not be restricted. + const generatedExpressions = new CucumberExpressionGenerator_js_1.default(() => this.parameterTypes).generateExpressions(text); + throw Errors_js_1.AmbiguousParameterTypeError.forRegExp(parameterTypeRegexp, expressionRegexp, parameterTypes, generatedExpressions); + } + return parameterTypes[0]; + } + defineParameterType(parameterType) { + if (parameterType.name !== undefined) { + if (this.parameterTypeByName.has(parameterType.name)) { + if (parameterType.name.length === 0) { + throw new CucumberExpressionError_js_1.default(`The anonymous parameter type has already been defined`); + } + else { + throw new CucumberExpressionError_js_1.default(`There is already a parameter type with name ${parameterType.name}`); + } + } + this.parameterTypeByName.set(parameterType.name, parameterType); + } + for (const parameterTypeRegexp of parameterType.regexpStrings) { + if (!this.parameterTypesByRegexp.has(parameterTypeRegexp)) { + this.parameterTypesByRegexp.set(parameterTypeRegexp, []); + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const parameterTypes = this.parameterTypesByRegexp.get(parameterTypeRegexp); + const existingParameterType = parameterTypes[0]; + if (parameterTypes.length > 0 && + existingParameterType.preferForRegexpMatch && + parameterType.preferForRegexpMatch) { + throw new CucumberExpressionError_js_1.default('There can only be one preferential parameter type per regexp. ' + + `The regexp /${parameterTypeRegexp}/ is used for two preferential parameter types, {${existingParameterType.name}} and {${parameterType.name}}`); + } + if (parameterTypes.indexOf(parameterType) === -1) { + parameterTypes.push(parameterType); + this.parameterTypesByRegexp.set(parameterTypeRegexp, parameterTypes.sort(ParameterType_js_1.default.compare)); + } + } + } +} +exports.default = ParameterTypeRegistry; +//# sourceMappingURL=ParameterTypeRegistry.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.js.map new file mode 100644 index 00000000..2ceeca57 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/ParameterTypeRegistry.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeRegistry.js","sourceRoot":"","sources":["../../../src/ParameterTypeRegistry.ts"],"names":[],"mappings":";;;;;AAAA,8FAAkE;AAClE,sGAA0E;AAC1E,sGAA0E;AAC1E,2CAAyD;AACzD,0EAA8C;AAG9C,MAAqB,qBAAqB;IACvB,mBAAmB,GAAG,IAAI,GAAG,EAAkC,CAAA;IAC/D,sBAAsB,GAAG,IAAI,GAAG,EAAyC,CAAA;IAE1F;QACE,IAAA,wCAA2B,EAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAA;IAC1C,CAAC;IAEM,gBAAgB,CAAC,QAAgB;QACtC,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC/C,CAAC;IAEM,cAAc,CACnB,mBAA2B,EAC3B,gBAAwB,EACxB,IAAY;QAEZ,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QAC3E,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CA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M,qBAAqB,GAAG,cAAc,CAAC,CAAC,CAAC,CAAA;YAC/C,IACE,cAAc,CAAC,MAAM,GAAG,CAAC;gBACzB,qBAAqB,CAAC,oBAAoB;gBAC1C,aAAa,CAAC,oBAAoB,EAClC,CAAC;gBACD,MAAM,IAAI,oCAAuB,CAC/B,gEAAgE;oBAC9D,eAAe,mBAAmB,oDAAoD,qBAAqB,CAAC,IAAI,UAAU,aAAa,CAAC,IAAI,GAAG,CAClJ,CAAA;YACH,CAAC;YACD,IAAI,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBACjD,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;gBAClC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAC7B,mBAAmB,EACnB,cAAc,CAAC,IAAI,CAAC,0BAAa,CAAC,OAAO,CAAC,CAC3C,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAlFD,wCAkFC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.d.ts new file mode 100644 index 00000000..84ced213 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.d.ts @@ -0,0 +1,12 @@ +import Argument from './Argument.js'; +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import { Expression } from './types.js'; +export default class RegularExpression implements Expression { + readonly regexp: RegExp; + private readonly parameterTypeRegistry; + private readonly treeRegexp; + constructor(regexp: RegExp, parameterTypeRegistry: ParameterTypeRegistry); + match(text: string): readonly Argument[] | null; + get source(): string; +} +//# sourceMappingURL=RegularExpression.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.d.ts.map new file mode 100644 index 00000000..8d317137 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpression.d.ts","sourceRoot":"","sources":["../../../src/RegularExpression.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AAEpC,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,UAAU;aAIxC,MAAM,EAAE,MAAM;IAC9B,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IAJxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;gBAGrB,MAAM,EAAE,MAAM,EACb,qBAAqB,EAAE,qBAAqB;IAKxD,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE,GAAG,IAAI;IA8BtD,IAAI,MAAM,IAAI,MAAM,CAEnB;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.js new file mode 100644 index 00000000..6c9f02dd --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.js @@ -0,0 +1,36 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const Argument_js_1 = __importDefault(require("./Argument.js")); +const ParameterType_js_1 = __importDefault(require("./ParameterType.js")); +const TreeRegexp_js_1 = __importDefault(require("./TreeRegexp.js")); +class RegularExpression { + regexp; + parameterTypeRegistry; + treeRegexp; + constructor(regexp, parameterTypeRegistry) { + this.regexp = regexp; + this.parameterTypeRegistry = parameterTypeRegistry; + this.treeRegexp = new TreeRegexp_js_1.default(regexp); + } + match(text) { + const group = this.treeRegexp.match(text); + if (!group) { + return null; + } + const parameterTypes = this.treeRegexp.groupBuilder.children.map((groupBuilder) => { + const parameterTypeRegexp = groupBuilder.source; + const parameterType = this.parameterTypeRegistry.lookupByRegexp(parameterTypeRegexp, this.regexp, text); + return (parameterType || + new ParameterType_js_1.default(undefined, parameterTypeRegexp, String, (s) => (s === undefined ? null : s), false, false)); + }); + return Argument_js_1.default.build(group, parameterTypes); + } + get source() { + return this.regexp.source; + } +} +exports.default = RegularExpression; +//# sourceMappingURL=RegularExpression.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.js.map new file mode 100644 index 00000000..718185b5 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/RegularExpression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpression.js","sourceRoot":"","sources":["../../../src/RegularExpression.ts"],"names":[],"mappings":";;;;;AAAA,gEAAoC;AACpC,0EAA8C;AAE9C,oEAAwC;AAGxC,MAAqB,iBAAiB;IAIlB;IACC;IAJF,UAAU,CAAY;IAEvC,YACkB,MAAc,EACb,qBAA4C;QAD7C,WAAM,GAAN,MAAM,CAAQ;QACb,0BAAqB,GAArB,qBAAqB,CAAuB;QAE7D,IAAI,CAAC,UAAU,GAAG,IAAI,uBAAU,CAAC,MAAM,CAAC,CAAA;IAC1C,CAAC;IAEM,KAAK,CAAC,IAAY;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;YAChF,MAAM,mBAAmB,GAAG,YAAY,CAAC,MAAM,CAAA;YAE/C,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAC7D,mBAAmB,EACnB,IAAI,CAAC,MAAM,EACX,IAAI,CACL,CAAA;YACD,OAAO,CACL,aAAa;gBACb,IAAI,0BAAa,CACf,SAAS,EACT,mBAAmB,EACnB,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EACnC,KAAK,EACL,KAAK,CACN,CACF,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,qBAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;IAC9C,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAA;IAC3B,CAAC;CACF;AA3CD,oCA2CC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.d.ts new file mode 100644 index 00000000..ca190cd0 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.d.ts @@ -0,0 +1,11 @@ +import Group from './Group.js'; +import GroupBuilder from './GroupBuilder.js'; +export default class TreeRegexp { + readonly regexp: RegExp; + readonly groupBuilder: GroupBuilder; + constructor(regexp: RegExp | string); + private static createGroupBuilder; + private static isNonCapturing; + match(s: string): Group | null; +} +//# sourceMappingURL=TreeRegexp.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.d.ts.map new file mode 100644 index 00000000..f38c2f39 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeRegexp.d.ts","sourceRoot":"","sources":["../../../src/TreeRegexp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAE5C,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,SAAgB,MAAM,EAAE,MAAM,CAAA;IAC9B,SAAgB,YAAY,EAAE,YAAY,CAAA;gBAE9B,MAAM,EAAE,MAAM,GAAG,MAAM;IASnC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAuCjC,OAAO,CAAC,MAAM,CAAC,cAAc;IAgBtB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI;CAStC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.js new file mode 100644 index 00000000..d4472d5c --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.js @@ -0,0 +1,89 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const regexp_match_indices_1 = __importDefault(require("regexp-match-indices")); +const GroupBuilder_js_1 = __importDefault(require("./GroupBuilder.js")); +class TreeRegexp { + regexp; + groupBuilder; + constructor(regexp) { + if (regexp instanceof RegExp) { + this.regexp = regexp; + } + else { + this.regexp = new RegExp(regexp); + } + this.groupBuilder = TreeRegexp.createGroupBuilder(this.regexp); + } + static createGroupBuilder(regexp) { + const source = regexp.source; + const stack = [new GroupBuilder_js_1.default()]; + const groupStartStack = []; + let escaping = false; + let charClass = false; + for (let i = 0; i < source.length; i++) { + const c = source[i]; + if (c === '[' && !escaping) { + charClass = true; + } + else if (c === ']' && !escaping) { + charClass = false; + } + else if (c === '(' && !escaping && !charClass) { + groupStartStack.push(i); + const nonCapturing = TreeRegexp.isNonCapturing(source, i); + const groupBuilder = new GroupBuilder_js_1.default(); + if (nonCapturing) { + groupBuilder.setNonCapturing(); + } + stack.push(groupBuilder); + } + else if (c === ')' && !escaping && !charClass) { + const gb = stack.pop(); + if (!gb) + throw new Error('Empty stack'); + const groupStart = groupStartStack.pop(); + if (gb.capturing) { + gb.source = source.substring((groupStart || 0) + 1, i); + stack[stack.length - 1].add(gb); + } + else { + gb.moveChildrenTo(stack[stack.length - 1]); + } + } + escaping = c === '\\' && !escaping; + } + const result = stack.pop(); + if (!result) + throw new Error('Empty stack'); + return result; + } + static isNonCapturing(source, i) { + // Regex is valid. Bounds check not required. + if (source[i + 1] !== '?') { + // (X) + return false; + } + if (source[i + 2] !== '<') { + // (?:X) + // (?=X) + // (?!X) + return true; + } + // (?<=X) or (?X) + return source[i + 3] === '=' || source[i + 3] === '!'; + } + match(s) { + const match = (0, regexp_match_indices_1.default)(this.regexp, s); + if (!match) { + return null; + } + let groupIndex = 0; + const nextGroupIndex = () => groupIndex++; + return this.groupBuilder.build(match, nextGroupIndex); + } +} +exports.default = TreeRegexp; +//# sourceMappingURL=TreeRegexp.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.js.map new file mode 100644 index 00000000..764aa409 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/TreeRegexp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeRegexp.js","sourceRoot":"","sources":["../../../src/TreeRegexp.ts"],"names":[],"mappings":";;;;;AAAA,gFAAkD;AAGlD,wEAA4C;AAE5C,MAAqB,UAAU;IACb,MAAM,CAAQ;IACd,YAAY,CAAc;IAE1C,YAAY,MAAuB;QACjC,IAAI,MAAM,YAAY,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAA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AC,GAAG,CAAC,CAAC,KAAK,GAAG,CAAA;IACvD,CAAC;IAEM,KAAK,CAAC,CAAS;QACpB,MAAM,KAAK,GAAG,IAAA,8BAAe,EAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QAC7C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,UAAU,GAAG,CAAC,CAAA;QAClB,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,UAAU,EAAE,CAAA;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;IACvD,CAAC;CACF;AA7ED,6BA6EC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.d.ts new file mode 100644 index 00000000..3d7a27cb --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.d.ts @@ -0,0 +1,3 @@ +import { DefinesParameterType } from './types.js'; +export default function defineDefaultParameterTypes(registry: DefinesParameterType): void; +//# sourceMappingURL=defineDefaultParameterTypes.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.d.ts.map new file mode 100644 index 00000000..8f8dde56 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"defineDefaultParameterTypes.d.ts","sourceRoot":"","sources":["../../../src/defineDefaultParameterTypes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAQjD,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAAQ,EAAE,oBAAoB,QAgHjF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.js new file mode 100644 index 00000000..dc8a78a9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.js @@ -0,0 +1,26 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = defineDefaultParameterTypes; +const ParameterType_js_1 = __importDefault(require("./ParameterType.js")); +const INTEGER_REGEXPS = [/-?\d+/, /\d+/]; +const FLOAT_REGEXP = /(?=.*\d.*)[-+]?\d*(?:\.(?=\d.*))?\d*(?:\d+[E][+-]?\d+)?/; +const WORD_REGEXP = /[^\s]+/; +const STRING_REGEXP = /"([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'/; +const ANONYMOUS_REGEXP = /.*/; +function defineDefaultParameterTypes(registry) { + registry.defineParameterType(new ParameterType_js_1.default('int', INTEGER_REGEXPS, Number, (s) => (s === undefined ? null : Number(s)), true, true, true)); + registry.defineParameterType(new ParameterType_js_1.default('float', FLOAT_REGEXP, Number, (s) => (s === undefined ? null : parseFloat(s)), true, false, true)); + registry.defineParameterType(new ParameterType_js_1.default('word', WORD_REGEXP, String, (s) => s, false, false, true)); + registry.defineParameterType(new ParameterType_js_1.default('string', STRING_REGEXP, String, (s1, s2) => (s1 || s2 || '').replace(/\\"/g, '"').replace(/\\'/g, "'"), true, false, true)); + registry.defineParameterType(new ParameterType_js_1.default('', ANONYMOUS_REGEXP, String, (s) => s, false, true, true)); + registry.defineParameterType(new ParameterType_js_1.default('double', FLOAT_REGEXP, Number, (s) => (s === undefined ? null : parseFloat(s)), false, false, true)); + registry.defineParameterType(new ParameterType_js_1.default('bigdecimal', FLOAT_REGEXP, String, (s) => (s === undefined ? null : s), false, false, true)); + registry.defineParameterType(new ParameterType_js_1.default('byte', INTEGER_REGEXPS, Number, (s) => (s === undefined ? null : Number(s)), false, false, true)); + registry.defineParameterType(new ParameterType_js_1.default('short', INTEGER_REGEXPS, Number, (s) => (s === undefined ? null : Number(s)), false, false, true)); + registry.defineParameterType(new ParameterType_js_1.default('long', INTEGER_REGEXPS, Number, (s) => (s === undefined ? null : Number(s)), false, false, true)); + registry.defineParameterType(new ParameterType_js_1.default('biginteger', INTEGER_REGEXPS, BigInt, (s) => (s === undefined ? null : BigInt(s)), false, false, true)); +} +//# sourceMappingURL=defineDefaultParameterTypes.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.js.map new file mode 100644 index 00000000..757082e6 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/defineDefaultParameterTypes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defineDefaultParameterTypes.js","sourceRoot":"","sources":["../../../src/defineDefaultParameterTypes.ts"],"names":[],"mappings":";;;;;AASA,8CAgHC;AAzHD,0EAA8C;AAG9C,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;AACxC,MAAM,YAAY,GAAG,yDAAyD,CAAA;AAC9E,MAAM,WAAW,GAAG,QAAQ,CAAA;AAC5B,MAAM,aAAa,GAAG,mDAAmD,CAAA;AACzE,MAAM,gBAAgB,GAAG,IAAI,CAAA;AAE7B,SAAwB,2BAA2B,CAAC,QAA8B;IAChF,QAAQ,CAAC,mBAAmB,CAC1B,IAAI,0BAAa,CACf,KAAK,EACL,eAAe,EACf,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EA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C,CAAC,CAAC,CAAC,EAC3C,KAAK,EACL,KAAK,EACL,IAAI,CACL,CACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.d.ts new file mode 100644 index 00000000..73496764 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.d.ts @@ -0,0 +1,13 @@ +import Argument from './Argument.js'; +import { Located, Node, NodeType, Token, TokenType } from './Ast.js'; +import CucumberExpression from './CucumberExpression.js'; +import CucumberExpressionGenerator from './CucumberExpressionGenerator.js'; +import ExpressionFactory from './ExpressionFactory.js'; +import GeneratedExpression from './GeneratedExpression.js'; +import Group from './Group.js'; +import ParameterType, { RegExps, StringOrRegExp } from './ParameterType.js'; +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import RegularExpression from './RegularExpression.js'; +import { Expression } from './types.js'; +export { Argument, CucumberExpression, CucumberExpressionGenerator, Expression, ExpressionFactory, GeneratedExpression, Group, Located, Node, NodeType, ParameterType, ParameterTypeRegistry, RegExps, RegularExpression, StringOrRegExp, Token, TokenType, }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.d.ts.map new file mode 100644 index 00000000..3faf31a4 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,kBAAkB,MAAM,yBAAyB,CAAA;AACxD,OAAO,2BAA2B,MAAM,kCAAkC,CAAA;AAC1E,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,aAAa,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAC9D,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,2BAA2B,EAC3B,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,SAAS,GACV,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.js new file mode 100644 index 00000000..343e9167 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.js @@ -0,0 +1,30 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TokenType = exports.Token = exports.RegularExpression = exports.ParameterTypeRegistry = exports.ParameterType = exports.NodeType = exports.Node = exports.Group = exports.GeneratedExpression = exports.ExpressionFactory = exports.CucumberExpressionGenerator = exports.CucumberExpression = exports.Argument = void 0; +const Argument_js_1 = __importDefault(require("./Argument.js")); +exports.Argument = Argument_js_1.default; +const Ast_js_1 = require("./Ast.js"); +Object.defineProperty(exports, "Node", { enumerable: true, get: function () { return Ast_js_1.Node; } }); +Object.defineProperty(exports, "NodeType", { enumerable: true, get: function () { return Ast_js_1.NodeType; } }); +Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return Ast_js_1.Token; } }); +Object.defineProperty(exports, "TokenType", { enumerable: true, get: function () { return Ast_js_1.TokenType; } }); +const CucumberExpression_js_1 = __importDefault(require("./CucumberExpression.js")); +exports.CucumberExpression = CucumberExpression_js_1.default; +const CucumberExpressionGenerator_js_1 = __importDefault(require("./CucumberExpressionGenerator.js")); +exports.CucumberExpressionGenerator = CucumberExpressionGenerator_js_1.default; +const ExpressionFactory_js_1 = __importDefault(require("./ExpressionFactory.js")); +exports.ExpressionFactory = ExpressionFactory_js_1.default; +const GeneratedExpression_js_1 = __importDefault(require("./GeneratedExpression.js")); +exports.GeneratedExpression = GeneratedExpression_js_1.default; +const Group_js_1 = __importDefault(require("./Group.js")); +exports.Group = Group_js_1.default; +const ParameterType_js_1 = __importDefault(require("./ParameterType.js")); +exports.ParameterType = ParameterType_js_1.default; +const ParameterTypeRegistry_js_1 = __importDefault(require("./ParameterTypeRegistry.js")); +exports.ParameterTypeRegistry = ParameterTypeRegistry_js_1.default; +const RegularExpression_js_1 = __importDefault(require("./RegularExpression.js")); +exports.RegularExpression = RegularExpression_js_1.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.js.map new file mode 100644 index 00000000..3f5fe93c --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAoC;AAalC,mBAbK,qBAAQ,CAaL;AAZV,qCAAoE;AAoBlE,qFApBgB,aAAI,OAoBhB;AACJ,yFArBsB,iBAAQ,OAqBtB;AAMR,sFA3BgC,cAAK,OA2BhC;AACL,0FA5BuC,kBAAS,OA4BvC;AA3BX,oFAAwD;AAYtD,6BAZK,+BAAkB,CAYL;AAXpB,sGAA0E;AAYxE,sCAZK,wCAA2B,CAYL;AAX7B,kFAAsD;AAapD,4BAbK,8BAAiB,CAaL;AAZnB,sFAA0D;AAaxD,8BAbK,gCAAmB,CAaL;AAZrB,0DAA8B;AAa5B,gBAbK,kBAAK,CAaL;AAZP,0EAA2E;AAgBzE,wBAhBK,0BAAa,CAgBL;AAff,0FAA8D;AAgB5D,gCAhBK,kCAAqB,CAgBL;AAfvB,kFAAsD;AAiBpD,4BAjBK,8BAAiB,CAiBL"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.d.ts new file mode 100644 index 00000000..cfcd803d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.d.ts @@ -0,0 +1,24 @@ +import Argument from './Argument.js'; +import ParameterType from './ParameterType.js'; +export interface DefinesParameterType { + defineParameterType(parameterType: ParameterType): void; +} +export interface Expression { + readonly source: string; + match(text: string): readonly Argument[] | null; +} +export type ParameterInfo = { + /** + * The string representation of the original ParameterType#type property + */ + type: string | null; + /** + * The parameter type name + */ + name: string; + /** + * The number of times this name has been used so far + */ + count: number; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.d.ts.map new file mode 100644 index 00000000..fd76cf2e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,CAAC,CAAC,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;CAC9D;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAA;CAChD;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.js.map new file mode 100644 index 00000000..70453b7a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/src/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.d.ts new file mode 100644 index 00000000..713608c4 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ArgumentTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.d.ts.map new file mode 100644 index 00000000..9d10004b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArgumentTest.d.ts","sourceRoot":"","sources":["../../../test/ArgumentTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.js new file mode 100644 index 00000000..4179275e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.js @@ -0,0 +1,53 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert = __importStar(require("assert")); +const Argument_js_1 = __importDefault(require("../src/Argument.js")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +const TreeRegexp_js_1 = __importDefault(require("../src/TreeRegexp.js")); +describe('Argument', () => { + it('exposes getParameterTypeName()', () => { + const treeRegexp = new TreeRegexp_js_1.default('three (.*) mice'); + const parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + const group = treeRegexp.match('three blind mice'); + const args = Argument_js_1.default.build(group, [parameterTypeRegistry.lookupByTypeName('string')]); + const argument = args[0]; + assert.strictEqual(argument.getParameterType().name, 'string'); + }); +}); +//# sourceMappingURL=ArgumentTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.js.map new file mode 100644 index 00000000..f19607ed --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ArgumentTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ArgumentTest.js","sourceRoot":"","sources":["../../../test/ArgumentTest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAEhC,qEAAyC;AACzC,+FAAmE;AACnE,yEAA6C;AAE7C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,iBAAiB,CAAC,CAAA;QACpD,MAAM,qBAAqB,GAAG,IAAI,kCAAqB,EAAE,CAAA;QACzD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,kBAAkB,CAAE,CAAA;QACnD,MAAM,IAAI,GAAG,qBAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,QAAQ,CAAE,CAAC,CAAC,CAAA;QACvF,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACxB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.d.ts new file mode 100644 index 00000000..a9066926 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CombinatorialGeneratedExpressionFactoryTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.d.ts.map new file mode 100644 index 00000000..768e8461 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CombinatorialGeneratedExpressionFactoryTest.d.ts","sourceRoot":"","sources":["../../../test/CombinatorialGeneratedExpressionFactoryTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.js new file mode 100644 index 00000000..21050e28 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.js @@ -0,0 +1,34 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const CombinatorialGeneratedExpressionFactory_js_1 = __importDefault(require("../src/CombinatorialGeneratedExpressionFactory.js")); +const ParameterType_js_1 = __importDefault(require("../src/ParameterType.js")); +describe('CucumberExpressionGenerator', () => { + it('generates multiple expressions', () => { + const parameterTypeCombinations = [ + [ + new ParameterType_js_1.default('color', /red|blue|yellow/, null, (s) => s, false, true), + new ParameterType_js_1.default('csscolor', /red|blue|yellow/, null, (s) => s, false, true), + ], + [ + new ParameterType_js_1.default('date', /\d{4}-\d{2}-\d{2}/, null, (s) => s, false, true), + new ParameterType_js_1.default('datetime', /\d{4}-\d{2}-\d{2}/, null, (s) => s, false, true), + new ParameterType_js_1.default('timestamp', /\d{4}-\d{2}-\d{2}/, null, (s) => s, false, true), + ], + ]; + const factory = new CombinatorialGeneratedExpressionFactory_js_1.default('I bought a {{0}} ball on {{1}}', parameterTypeCombinations); + const expressions = factory.generateExpressions().map((ge) => ge.source); + assert_1.default.deepStrictEqual(expressions, [ + 'I bought a {color} ball on {date}', + 'I bought a {color} ball on {datetime}', + 'I bought a {color} ball on {timestamp}', + 'I bought a {csscolor} ball on {date}', + 'I bought a {csscolor} ball on {datetime}', + 'I bought a {csscolor} ball on {timestamp}', + ]); + }); +}); +//# sourceMappingURL=CombinatorialGeneratedExpressionFactoryTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.js.map new file mode 100644 index 00000000..641c38c1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CombinatorialGeneratedExpressionFactoryTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CombinatorialGeneratedExpressionFactoryTest.js","sourceRoot":"","sources":["../../../test/CombinatorialGeneratedExpressionFactoryTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAE3B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C,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.d.ts new file mode 100644 index 00000000..f959dbd8 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionGeneratorTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.d.ts.map new file mode 100644 index 00000000..034e0052 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionGeneratorTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionGeneratorTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.js new file mode 100644 index 00000000..fe216ad1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.js @@ -0,0 +1,232 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const CucumberExpression_js_1 = __importDefault(require("../src/CucumberExpression.js")); +const CucumberExpressionGenerator_js_1 = __importDefault(require("../src/CucumberExpressionGenerator.js")); +const ParameterType_js_1 = __importDefault(require("../src/ParameterType.js")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +class Currency { + s; + constructor(s) { + this.s = s; + } +} +describe('CucumberExpressionGenerator', () => { + let parameterTypeRegistry; + let generator; + function assertExpression(expectedExpression, expectedParameterInfo, text) { + const generatedExpression = generator.generateExpressions(text)[0]; + assert_1.default.deepStrictEqual(generatedExpression.parameterInfos, expectedParameterInfo); + assert_1.default.strictEqual(generatedExpression.source, expectedExpression); + const cucumberExpression = new CucumberExpression_js_1.default(generatedExpression.source, parameterTypeRegistry); + const match = cucumberExpression.match(text); + if (match === null) { + assert_1.default.fail(`Expected text '${text}' to match generated expression '${generatedExpression.source}'`); + } + assert_1.default.strictEqual(match.length, expectedParameterInfo.length); + } + beforeEach(() => { + parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + generator = new CucumberExpressionGenerator_js_1.default(() => parameterTypeRegistry.parameterTypes); + }); + it('documents expression generation', () => { + parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + generator = new CucumberExpressionGenerator_js_1.default(() => parameterTypeRegistry.parameterTypes); + const undefinedStepText = 'I have 2 cucumbers and 1.5 tomato'; + const generatedExpression = generator.generateExpressions(undefinedStepText)[0]; + assert_1.default.strictEqual(generatedExpression.source, 'I have {int} cucumbers and {float} tomato'); + assert_1.default.strictEqual(generatedExpression.parameterNames[0], 'int'); + assert_1.default.strictEqual(generatedExpression.parameterTypes[1].name, 'float'); + }); + it('generates expression for no args', () => { + assertExpression('hello', [], 'hello'); + }); + it('generates expression with escaped left parenthesis', () => { + assertExpression('\\(iii)', [], '(iii)'); + }); + it('generates expression with escaped left curly brace', () => { + assertExpression('\\{iii}', [], '{iii}'); + }); + it('generates expression with escaped slashes', () => { + assertExpression('The {int}\\/{int}\\/{int} hey', [ + { + type: 'Number', + name: 'int', + count: 1, + }, + { + type: 'Number', + name: 'int', + count: 2, + }, + { + type: 'Number', + name: 'int', + count: 3, + }, + ], 'The 1814/05/17 hey'); + }); + it('generates expression for int float arg', () => { + assertExpression('I have {int} cukes and {float} euro', [ + { + type: 'Number', + name: 'int', + count: 1, + }, + { + type: 'Number', + name: 'float', + count: 1, + }, + ], 'I have 2 cukes and 1.5 euro'); + }); + it('generates expression for strings', () => { + assertExpression('I like {string} and {string}', [ + { + type: 'String', + name: 'string', + count: 1, + }, + { + type: 'String', + name: 'string', + count: 2, + }, + ], 'I like "bangers" and \'mash\''); + }); + it('generates expression with % sign', () => { + assertExpression('I am {int}%% foobar', [ + { + type: 'Number', + name: 'int', + count: 1, + }, + ], 'I am 20%% foobar'); + }); + it('generates expression for just int', () => { + assertExpression('{int}', [ + { + type: 'Number', + name: 'int', + count: 1, + }, + ], '99999'); + }); + it('numbers only second argument when builtin type is not reserved keyword', () => { + assertExpression('I have {float} cukes and {float} euro', [ + { + type: 'Number', + name: 'float', + count: 1, + }, + { + type: 'Number', + name: 'float', + count: 2, + }, + ], 'I have 2.5 cukes and 1.5 euro'); + }); + it('generates expression for custom type', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('currency', /[A-Z]{3}/, Currency, (s) => new Currency(s), true, false)); + assertExpression('I have a {currency} account', [ + { + type: 'Currency', + name: 'currency', + count: 1, + }, + ], 'I have a EUR account'); + }); + it('prefers leftmost match when there is overlap', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('currency', /c d/, Currency, (s) => new Currency(s), true, false)); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('date', /b c/, Date, (s) => new Date(s), true, false)); + assertExpression('a {date} d e f g', [ + { + type: 'Date', + name: 'date', + count: 1, + }, + ], 'a b c d e f g'); + }); + // TODO: prefers widest match + it('generates all combinations of expressions when several parameter types match', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('currency', /x/, null, (s) => new Currency(s), true, false)); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('date', /x/, null, (s) => new Date(s), true, false)); + const generatedExpressions = generator.generateExpressions('I have x and x and another x'); + const expressions = generatedExpressions.map((e) => e.source); + assert_1.default.deepStrictEqual(expressions, [ + 'I have {currency} and {currency} and another {currency}', + 'I have {currency} and {currency} and another {date}', + 'I have {currency} and {date} and another {currency}', + 'I have {currency} and {date} and another {date}', + 'I have {date} and {currency} and another {currency}', + 'I have {date} and {currency} and another {date}', + 'I have {date} and {date} and another {currency}', + 'I have {date} and {date} and another {date}', + ]); + }); + it('exposes parameter type names in generated expression', () => { + const expression = generator.generateExpressions('I have 2 cukes and 1.5 euro')[0]; + const typeNames = expression.parameterTypes.map((parameter) => parameter.name); + assert_1.default.deepStrictEqual(typeNames, ['int', 'float']); + }); + it('matches parameter types with optional capture groups', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('optional-flight', /(1st flight)?/, null, (s) => s, true, false)); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('optional-hotel', /(1 hotel)?/, null, (s) => s, true, false)); + const expression = generator.generateExpressions('I reach Stage 4: 1st flight -1 hotel')[0]; + // While you would expect this to be `I reach Stage {int}: {optional-flight} -{optional-hotel}` the `-1` causes + // {int} to match just before {optional-hotel}. + assert_1.default.strictEqual(expression.source, 'I reach Stage {int}: {optional-flight} {int} hotel'); + }); + it('generates at most 256 expressions', () => { + for (let i = 0; i < 4; i++) { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('my-type-' + i, /([a-z] )*?[a-z]/, null, (s) => s, true, false)); + } + // This would otherwise generate 4^11=419430 expressions and consume just shy of 1.5GB. + const expressions = generator.generateExpressions('a s i m p l e s t e p'); + assert_1.default.strictEqual(expressions.length, 256); + }); + it('prefers expression with longest non empty match', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('zero-or-more', /[a-z]*/, null, (s) => s, true, false)); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('exactly-one', /[a-z]/, null, (s) => s, true, false)); + const expressions = generator.generateExpressions('a simple step'); + assert_1.default.strictEqual(expressions.length, 2); + assert_1.default.strictEqual(expressions[0].source, '{exactly-one} {zero-or-more} {zero-or-more}'); + assert_1.default.strictEqual(expressions[1].source, '{zero-or-more} {zero-or-more} {zero-or-more}'); + }); + it('does not suggest parameter included at the beginning of a word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('direction', /(up|down)/, null, (s) => s, true, false)); + const expressions = generator.generateExpressions('I download a picture'); + assert_1.default.strictEqual(expressions.length, 1); + assert_1.default.notStrictEqual(expressions[0].source, 'I {direction}load a picture'); + assert_1.default.strictEqual(expressions[0].source, 'I download a picture'); + }); + it('does not suggest parameter included inside a word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('direction', /(up|down)/, null, (s) => s, true, false)); + const expressions = generator.generateExpressions('I watch the muppet show'); + assert_1.default.strictEqual(expressions.length, 1); + assert_1.default.notStrictEqual(expressions[0].source, 'I watch the m{direction}pet show'); + assert_1.default.strictEqual(expressions[0].source, 'I watch the muppet show'); + }); + it('does not suggest parameter at the end of a word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('direction', /(up|down)/, null, (s) => s, true, false)); + const expressions = generator.generateExpressions('I create a group'); + assert_1.default.strictEqual(expressions.length, 1); + assert_1.default.notStrictEqual(expressions[0].source, 'I create a gro{direction}'); + assert_1.default.strictEqual(expressions[0].source, 'I create a group'); + }); + it('does suggest parameter that are a full word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('direction', /(up|down)/, null, (s) => s, true, false)); + assert_1.default.strictEqual(generator.generateExpressions('When I go down the road')[0].source, 'When I go {direction} the road'); + assert_1.default.strictEqual(generator.generateExpressions('When I walk up the hill')[0].source, 'When I walk {direction} the hill'); + assert_1.default.strictEqual(generator.generateExpressions('up the hill, the road goes down')[0].source, '{direction} the hill, the road goes {direction}'); + }); + it('does not consider punctuation as being part of a word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('direction', /(up|down)/, null, (s) => s, true, false)); + assert_1.default.strictEqual(generator.generateExpressions('direction is:down')[0].source, 'direction is:{direction}'); + assert_1.default.strictEqual(generator.generateExpressions('direction is down.')[0].source, 'direction is {direction}.'); + }); +}); +//# sourceMappingURL=CucumberExpressionGeneratorTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.js.map new file mode 100644 index 00000000..cd3a2f4a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionGeneratorTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionGeneratorTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionGeneratorTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAE3B,yFAA6D;AAC7D,2GAA+E;AAC/E,+EAAmD;AACnD,+FAAmE;AAGnE,MAAM,QAAQ;IACgB;IAA5B,YAA4B,CAAS;QAAT,MAAC,GAAD,CAAC,CAAQ;IAAG,CAAC;CAC1C;AAED,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,IAAI,qBAA4C,CAAA;IAChD,IAAI,SAAsC,CAAA;IAE1C,SAAS,gBAAgB,CACvB,kBAA0B,EAC1B,qBAAsC,EACtC,IAAY;QAEZ,MAAM,mBAAmB,GAAG,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QAClE,gBAAM,CAAC,eAAe,CAAC,mBAAmB,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAA;QACjF,gBAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;QAElE,MAAM,kBAAkB,GAAG,IAAI,+BAAkB,CAC/C,mBAAmB,CAAC,MAAM,EAC1B,qBAAqB,CACtB,CAAA;QACD,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC5C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,gBAAM,CAAC,IAAI,CACT,kBAAkB,IAAI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CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAC7D,2BAA2B,CAC5B,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.d.ts new file mode 100644 index 00000000..7d0e84e1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionParserTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.d.ts.map new file mode 100644 index 00000000..e454179b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionParserTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionParserTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.js new file mode 100644 index 00000000..e28c5ef5 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.js @@ -0,0 +1,34 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const fs_1 = __importDefault(require("fs")); +const glob_1 = require("glob"); +const js_yaml_1 = __importDefault(require("js-yaml")); +const CucumberExpressionError_js_1 = __importDefault(require("../src/CucumberExpressionError.js")); +const CucumberExpressionParser_js_1 = __importDefault(require("../src/CucumberExpressionParser.js")); +const testDataDir_js_1 = require("./testDataDir.js"); +describe('CucumberExpressionParser', () => { + for (const path of glob_1.glob.sync(`${testDataDir_js_1.testDataDir}/cucumber-expression/parser/*.yaml`)) { + const expectation = js_yaml_1.default.load(fs_1.default.readFileSync(path, 'utf-8')); + it(`parses ${path}`, () => { + const parser = new CucumberExpressionParser_js_1.default(); + if (expectation.expected_ast !== undefined) { + const node = parser.parse(expectation.expression); + assert_1.default.deepStrictEqual(JSON.parse(JSON.stringify(node)), // Removes type information. + expectation.expected_ast); + } + else if (expectation.exception !== undefined) { + assert_1.default.throws(() => { + parser.parse(expectation.expression); + }, new CucumberExpressionError_js_1.default(expectation.exception)); + } + else { + throw new Error(`Expectation must have expected or exception: ${JSON.stringify(expectation)}`); + } + }); + } +}); +//# sourceMappingURL=CucumberExpressionParserTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.js.map new file mode 100644 index 00000000..6806c0bd --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionParserTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionParserTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionParserTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAC3B,4CAAmB;AACnB,+BAA2B;AAC3B,sDAA0B;AAE1B,mGAAuE;AACvE,qGAAyE;AACzE,qDAA8C;AAQ9C,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,KAAK,MAAM,IAAI,IAAI,WAAI,CAAC,IAAI,CAAC,GAAG,4BAAW,oCAAoC,CAAC,EAAE,CAAC;QACjF,MAAM,WAAW,GAAG,iBAAI,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAgB,CAAA;QAC5E,EAAE,CAAC,UAAU,IAAI,EAAE,EAAE,GAAG,EAAE;YACxB,MAAM,MAAM,GAAG,IAAI,qCAAwB,EAAE,CAAA;YAC7C,IAAI,WAAW,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;gBACjD,gBAAM,CAAC,eAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,4BAA4B;gBAC9D,WAAW,CAAC,YAAY,CACzB,CAAA;YACH,CAAC;iBAAM,IAAI,WAAW,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC/C,gBAAM,CAAC,MAAM,CAAC,GAAG,EAAE;oBACjB,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;gBACtC,CAAC,EAAE,IAAI,oCAAuB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAA;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,gDAAgD,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAC9E,CAAA;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.d.ts new file mode 100644 index 00000000..ed6984c8 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.d.ts.map new file mode 100644 index 00000000..e1689a5a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.js new file mode 100644 index 00000000..afb7dec7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.js @@ -0,0 +1,112 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const fs_1 = __importDefault(require("fs")); +const glob_1 = require("glob"); +const js_yaml_1 = __importDefault(require("js-yaml")); +const CucumberExpression_js_1 = __importDefault(require("../src/CucumberExpression.js")); +const CucumberExpressionError_js_1 = __importDefault(require("../src/CucumberExpressionError.js")); +const ParameterType_js_1 = __importDefault(require("../src/ParameterType.js")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +const testDataDir_js_1 = require("./testDataDir.js"); +describe('CucumberExpression', () => { + for (const path of glob_1.glob.sync(`${testDataDir_js_1.testDataDir}/cucumber-expression/matching/*.yaml`)) { + const expectation = js_yaml_1.default.load(fs_1.default.readFileSync(path, 'utf-8')); + it(`matches ${path}`, () => { + const parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + if (expectation.expected_args !== undefined) { + const expression = new CucumberExpression_js_1.default(expectation.expression, parameterTypeRegistry); + const matches = expression.match(expectation.text); + assert_1.default.deepStrictEqual(JSON.parse(JSON.stringify(matches ? matches.map((value) => value.getValue(null)) : null, (key, value) => { + return typeof value === 'bigint' ? value.toString() : value; + })), // Removes type information. + expectation.expected_args); + } + else if (expectation.exception !== undefined) { + assert_1.default.throws(() => { + const expression = new CucumberExpression_js_1.default(expectation.expression, parameterTypeRegistry); + expression.match(expectation.text); + }, new CucumberExpressionError_js_1.default(expectation.exception)); + } + else { + throw new Error(`Expectation must have expected or exception: ${JSON.stringify(expectation)}`); + } + }); + } + it('matches float', () => { + assert_1.default.deepStrictEqual(match('{float}', ''), null); + assert_1.default.deepStrictEqual(match('{float}', '.'), null); + assert_1.default.deepStrictEqual(match('{float}', ','), null); + assert_1.default.deepStrictEqual(match('{float}', '-'), null); + assert_1.default.deepStrictEqual(match('{float}', 'E'), null); + assert_1.default.deepStrictEqual(match('{float}', '1,'), null); + assert_1.default.deepStrictEqual(match('{float}', ',1'), null); + assert_1.default.deepStrictEqual(match('{float}', '1.'), null); + assert_1.default.deepStrictEqual(match('{float}', '1'), [1]); + assert_1.default.deepStrictEqual(match('{float}', '-1'), [-1]); + assert_1.default.deepStrictEqual(match('{float}', '1.1'), [1.1]); + assert_1.default.deepStrictEqual(match('{float}', '1,000'), null); + assert_1.default.deepStrictEqual(match('{float}', '1,000,0'), null); + assert_1.default.deepStrictEqual(match('{float}', '1,000.1'), null); + assert_1.default.deepStrictEqual(match('{float}', '1,000,10'), null); + assert_1.default.deepStrictEqual(match('{float}', '1,0.1'), null); + assert_1.default.deepStrictEqual(match('{float}', '1,000,000.1'), null); + assert_1.default.deepStrictEqual(match('{float}', '-1.1'), [-1.1]); + assert_1.default.deepStrictEqual(match('{float}', '.1'), [0.1]); + assert_1.default.deepStrictEqual(match('{float}', '-.1'), [-0.1]); + assert_1.default.deepStrictEqual(match('{float}', '-.10000001'), [-0.10000001]); + assert_1.default.deepStrictEqual(match('{float}', '1E1'), [1e1]); // precision 1 with scale -1, can not be expressed as a decimal + assert_1.default.deepStrictEqual(match('{float}', '.1E1'), [1]); + assert_1.default.deepStrictEqual(match('{float}', 'E1'), null); + assert_1.default.deepStrictEqual(match('{float}', '-.1E-1'), [-0.01]); + assert_1.default.deepStrictEqual(match('{float}', '-.1E-2'), [-0.001]); + assert_1.default.deepStrictEqual(match('{float}', '-.1E+1'), [-1]); + assert_1.default.deepStrictEqual(match('{float}', '-.1E+2'), [-10]); + assert_1.default.deepStrictEqual(match('{float}', '-.1E1'), [-1]); + assert_1.default.deepStrictEqual(match('{float}', '-.10E2'), [-10]); + }); + it('matches float with zero', () => { + assert_1.default.deepEqual(match('{float}', '0'), [0]); + }); + it('exposes source', () => { + const expr = 'I have {int} cuke(s)'; + assert_1.default.strictEqual(new CucumberExpression_js_1.default(expr, new ParameterTypeRegistry_js_1.default()).source, expr); + }); + it('unmatched optional groups have undefined values', () => { + const parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('textAndOrNumber', /([A-Z]+)?(?: )?([0-9]+)?/, null, function (s1, s2) { + return [s1, s2]; + }, false, true)); + const expression = new CucumberExpression_js_1.default('{textAndOrNumber}', parameterTypeRegistry); + const world = {}; + assert_1.default.deepStrictEqual(expression.match(`TLA`)[0].getValue(world), ['TLA', undefined]); + assert_1.default.deepStrictEqual(expression.match(`123`)[0].getValue(world), [undefined, '123']); + }); + // JavaScript-specific + it('delegates transform to custom object', () => { + const parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('widget', /\w+/, null, function (s) { + return this.createWidget(s); + }, false, true)); + const expression = new CucumberExpression_js_1.default('I have a {widget}', parameterTypeRegistry); + const world = { + createWidget(s) { + return `widget:${s}`; + }, + }; + const args = expression.match(`I have a bolt`); + assert_1.default.strictEqual(args[0].getValue(world), 'widget:bolt'); + }); +}); +const match = (expression, text) => { + const cucumberExpression = new CucumberExpression_js_1.default(expression, new ParameterTypeRegistry_js_1.default()); + const args = cucumberExpression.match(text); + if (!args) { + return null; + } + return args.map((arg) => arg.getValue(null)); +}; +//# sourceMappingURL=CucumberExpressionTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.js.map new file mode 100644 index 00000000..96c6540e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAC3B,4CAAmB;AACnB,+BAA2B;AAC3B,sDAA0B;AAE1B,yFAA6D;AAC7D,mGAAuE;AACvE,+EAAmD;AACnD,+FAAmE;AACnE,qDAA8C;AAS9C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,KAAK,MAAM,IAAI,IAAI,WAAI,CAAC,IAAI,CAAC,GAAG,4BAAW,sCAAsC,CAAC,EAAE,CAAC;QACnF,MAAM,WAAW,GAAG,iBAAI,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAgB,CAAA;QAC5E,EAAE,CAAC,WAAW,IAAI,EAAE,EAAE,GAAG,EAAE;YACzB,MAAM,qBAAqB,GAAG,IAAI,kCAAqB,EAAE,CAAA;YACzD,IAAI,WAAW,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;gBAC5C,MAAM,UAAU,GAAG,IAAI,+BAAkB,CAAC,WAAW,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAA;gBACxF,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;gBAClD,gBAAM,CAAC,eAAe,CACpB,IAAI,CAAC,KAAK,CACR,IAAI,CAAC,SAAS,CACZ,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CA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C,IAAI,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.d.ts new file mode 100644 index 00000000..6df46a1e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionTokenizerTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.d.ts.map new file mode 100644 index 00000000..883ddf20 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTokenizerTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionTokenizerTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.js new file mode 100644 index 00000000..bbdf8104 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.js @@ -0,0 +1,34 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const fs_1 = __importDefault(require("fs")); +const glob_1 = require("glob"); +const js_yaml_1 = __importDefault(require("js-yaml")); +const CucumberExpressionError_js_1 = __importDefault(require("../src/CucumberExpressionError.js")); +const CucumberExpressionTokenizer_js_1 = __importDefault(require("../src/CucumberExpressionTokenizer.js")); +const testDataDir_js_1 = require("./testDataDir.js"); +describe('CucumberExpressionTokenizer', () => { + for (const path of glob_1.glob.sync(`${testDataDir_js_1.testDataDir}/cucumber-expression/tokenizer/*.yaml`)) { + const expectation = js_yaml_1.default.load(fs_1.default.readFileSync(path, 'utf-8')); + it(`tokenizes ${path}`, () => { + const tokenizer = new CucumberExpressionTokenizer_js_1.default(); + if (expectation.expected_tokens !== undefined) { + const tokens = tokenizer.tokenize(expectation.expression); + assert_1.default.deepStrictEqual(JSON.parse(JSON.stringify(tokens)), // Removes type information. + expectation.expected_tokens); + } + else if (expectation.exception !== undefined) { + assert_1.default.throws(() => { + tokenizer.tokenize(expectation.expression); + }, new CucumberExpressionError_js_1.default(expectation.exception)); + } + else { + throw new Error(`Expectation must have expected_tokens or exception: ${JSON.stringify(expectation)}`); + } + }); + } +}); +//# sourceMappingURL=CucumberExpressionTokenizerTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.js.map new file mode 100644 index 00000000..34496010 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTokenizerTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTokenizerTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionTokenizerTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAC3B,4CAAmB;AACnB,+BAA2B;AAC3B,sDAA0B;AAE1B,mGAAuE;AACvE,2GAA+E;AAC/E,qDAA8C;AAQ9C,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,KAAK,MAAM,IAAI,IAAI,WAAI,CAAC,IAAI,CAAC,GAAG,4BAAW,uCAAuC,CAAC,EAAE,CAAC;QACpF,MAAM,WAAW,GAAG,iBAAI,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAgB,CAAA;QAC5E,EAAE,CAAC,aAAa,IAAI,EAAE,EAAE,GAAG,EAAE;YAC3B,MAAM,SAAS,GAAG,IAAI,wCAA2B,EAAE,CAAA;YACnD,IAAI,WAAW,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;gBAC9C,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;gBACzD,gBAAM,CAAC,eAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,4BAA4B;gBAChE,WAAW,CAAC,eAAe,CAC5B,CAAA;YACH,CAAC;iBAAM,IAAI,WAAW,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC/C,gBAAM,CAAC,MAAM,CAAC,GAAG,EAAE;oBACjB,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;gBAC5C,CAAC,EAAE,IAAI,oCAAuB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAA;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,uDAAuD,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CACrF,CAAA;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.d.ts new file mode 100644 index 00000000..6919a5a0 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionTransformationTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.d.ts.map new file mode 100644 index 00000000..152ad37a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTransformationTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionTransformationTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.js new file mode 100644 index 00000000..d0c1a2e7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.js @@ -0,0 +1,23 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const fs_1 = __importDefault(require("fs")); +const glob_1 = require("glob"); +const js_yaml_1 = __importDefault(require("js-yaml")); +const CucumberExpression_js_1 = __importDefault(require("../src/CucumberExpression.js")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +const testDataDir_js_1 = require("./testDataDir.js"); +describe('CucumberExpression', () => { + for (const path of glob_1.glob.sync(`${testDataDir_js_1.testDataDir}/cucumber-expression/transformation/*.yaml`)) { + const expectation = js_yaml_1.default.load(fs_1.default.readFileSync(path, 'utf-8')); + it(`transforms ${path}`, () => { + const parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + const expression = new CucumberExpression_js_1.default(expectation.expression, parameterTypeRegistry); + assert_1.default.deepStrictEqual(expression.regexp.source, expectation.expected_regex); + }); + } +}); +//# sourceMappingURL=CucumberExpressionTransformationTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.js.map new file mode 100644 index 00000000..02452944 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CucumberExpressionTransformationTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTransformationTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionTransformationTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAC3B,4CAAmB;AACnB,+BAA2B;AAC3B,sDAA0B;AAE1B,yFAA6D;AAC7D,+FAAmE;AACnE,qDAA8C;AAO9C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,KAAK,MAAM,IAAI,IAAI,WAAI,CAAC,IAAI,CAAC,GAAG,4BAAW,4CAA4C,CAAC,EAAE,CAAC;QACzF,MAAM,WAAW,GAAG,iBAAI,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAgB,CAAA;QAC5E,EAAE,CAAC,cAAc,IAAI,EAAE,EAAE,GAAG,EAAE;YAC5B,MAAM,qBAAqB,GAAG,IAAI,kCAAqB,EAAE,CAAA;YACzD,MAAM,UAAU,GAAG,IAAI,+BAAkB,CAAC,WAAW,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAA;YACxF,gBAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,CAAA;QAC9E,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.d.ts new file mode 100644 index 00000000..f68fbc26 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CustomParameterTypeTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.d.ts.map new file mode 100644 index 00000000..33ae8a62 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CustomParameterTypeTest.d.ts","sourceRoot":"","sources":["../../../test/CustomParameterTypeTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.js new file mode 100644 index 00000000..a9378a6e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.js @@ -0,0 +1,124 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const CucumberExpression_js_1 = __importDefault(require("../src/CucumberExpression.js")); +const ParameterType_js_1 = __importDefault(require("../src/ParameterType.js")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +const RegularExpression_js_1 = __importDefault(require("../src/RegularExpression.js")); +class Color { + name; + constructor(name) { + this.name = name; + } +} +class CssColor { + name; + constructor(name) { + this.name = name; + } +} +describe('Custom parameter type', () => { + let parameterTypeRegistry; + beforeEach(() => { + parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('color', /red|blue|yellow/, Color, (s) => new Color(s), false, true)); + }); + describe('CucumberExpression', () => { + it('throws exception for illegal character in parameter name', () => { + assert_1.default.throws(() => new ParameterType_js_1.default('[string]', /.*/, String, (s) => s, false, true), { + message: "Illegal character in parameter name {[string]}. Parameter names may not contain '{', '}', '(', ')', '\\' or '/'", + }); + }); + it('matches parameters with custom parameter type', () => { + const expression = new CucumberExpression_js_1.default('I have a {color} ball', parameterTypeRegistry); + const value = expression.match('I have a red ball')?.[0].getValue(null); + assert_1.default.strictEqual(value?.name, 'red'); + }); + it('matches parameters with multiple capture groups', () => { + class Coordinate { + x; + y; + z; + constructor(x, y, z) { + this.x = x; + this.y = y; + this.z = z; + } + } + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('coordinate', /(\d+),\s*(\d+),\s*(\d+)/, Coordinate, (x, y, z) => new Coordinate(Number(x), Number(y), Number(z)), true, true)); + const expression = new CucumberExpression_js_1.default('A {int} thick line from {coordinate} to {coordinate}', parameterTypeRegistry); + const args = expression.match('A 5 thick line from 10,20,30 to 40,50,60'); + const thick = args?.[0].getValue(null); + assert_1.default.strictEqual(thick, 5); + const from = args?.[1].getValue(null); + assert_1.default.strictEqual(from?.x, 10); + assert_1.default.strictEqual(from?.y, 20); + assert_1.default.strictEqual(from?.z, 30); + const to = args?.[2].getValue(null); + assert_1.default.strictEqual(to?.x, 40); + assert_1.default.strictEqual(to?.y, 50); + assert_1.default.strictEqual(to?.z, 60); + }); + it('matches parameters with custom parameter type using optional capture group', () => { + parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('color', [/red|blue|yellow/, /(?:dark|light) (?:red|blue|yellow)/], Color, (s) => new Color(s), false, true)); + const expression = new CucumberExpression_js_1.default('I have a {color} ball', parameterTypeRegistry); + const value = expression.match('I have a dark red ball')?.[0].getValue(null); + assert_1.default.strictEqual(value?.name, 'dark red'); + }); + it('defers transformation until queried from argument', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('throwing', /bad/, null, (s) => { + throw new Error(`Can't transform [${s}]`); + }, false, true)); + const expression = new CucumberExpression_js_1.default('I have a {throwing} parameter', parameterTypeRegistry); + const args = expression.match('I have a bad parameter'); + assert_1.default.throws(() => args[0].getValue(null), { + message: "Can't transform [bad]", + }); + }); + describe('conflicting parameter type', () => { + it('is detected for type name', () => { + assert_1.default.throws(() => parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('color', /.*/, CssColor, (s) => new CssColor(s), false, true)), { message: 'There is already a parameter type with name color' }); + }); + it('is not detected for type', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('whatever', /.*/, Color, (s) => new Color(s), false, false)); + }); + it('is not detected for regexp', () => { + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('css-color', /red|blue|yellow/, CssColor, (s) => new CssColor(s), true, false)); + assert_1.default.strictEqual(new CucumberExpression_js_1.default('I have a {css-color} ball', parameterTypeRegistry) + .match('I have a blue ball')?.[0] + .getValue(null)?.constructor, CssColor); + assert_1.default.strictEqual(new CucumberExpression_js_1.default('I have a {css-color} ball', parameterTypeRegistry) + .match('I have a blue ball')?.[0] + .getValue(null)?.name, 'blue'); + assert_1.default.strictEqual(new CucumberExpression_js_1.default('I have a {color} ball', parameterTypeRegistry) + .match('I have a blue ball')?.[0] + .getValue(null)?.constructor, Color); + assert_1.default.strictEqual(new CucumberExpression_js_1.default('I have a {color} ball', parameterTypeRegistry) + .match('I have a blue ball')?.[0] + .getValue(null)?.name, 'blue'); + }); + }); + // JavaScript-specific + it('creates arguments using async transform', async () => { + parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + parameterTypeRegistry.defineParameterType(new ParameterType_js_1.default('asyncColor', /red|blue|yellow/, Color, async (s) => new Color(s), false, true)); + const expression = new CucumberExpression_js_1.default('I have a {asyncColor} ball', parameterTypeRegistry); + const args = expression.match('I have a red ball'); + const value = await args?.[0].getValue(null); + assert_1.default.strictEqual(value?.name, 'red'); + }); + }); + describe('RegularExpression', () => { + it('matches arguments with custom parameter type', () => { + const expression = new RegularExpression_js_1.default(/I have a (red|blue|yellow) ball/, parameterTypeRegistry); + const value = expression.match('I have a red ball')?.[0].getValue(null); + assert_1.default.strictEqual(value?.constructor, Color); + assert_1.default.strictEqual(value?.name, 'red'); + }); + }); +}); +//# sourceMappingURL=CustomParameterTypeTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.js.map new file mode 100644 index 00000000..5e5b0be1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/CustomParameterTypeTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CustomParameterTypeTest.js","sourceRoot":"","sources":["../../../test/CustomParameterTypeTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAE3B,yFAA6D;AAC7D,+EAAmD;AACnD,+FAAmE;AACnE,uFAA2D;AAE3D,MAAM,KAAK;IACmB;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AAED,MAAM,QAAQ;IACgB;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AAED,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,IAAI,qBAA4C,CAAA;IAEhD,UAAU,CAAC,GAAG,EAAE;QACd,qBAAqB,GAAG,IAAI,kCAAqB,EAAE,CAAA;QACnD,qBAAqB,CAAC,mBAAmB,CACvC,IAAI,0BAAa,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CACvF,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAClE,gBAAM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;QACxC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.d.ts new file mode 100644 index 00000000..e96f5c0f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ExpressionFactoryTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.d.ts.map new file mode 100644 index 00000000..31895988 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpressionFactoryTest.d.ts","sourceRoot":"","sources":["../../../test/ExpressionFactoryTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.js new file mode 100644 index 00000000..53a62c80 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.js @@ -0,0 +1,56 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert = __importStar(require("assert")); +const CucumberExpression_js_1 = __importDefault(require("../src/CucumberExpression.js")); +const ExpressionFactory_js_1 = __importDefault(require("../src/ExpressionFactory.js")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +const RegularExpression_js_1 = __importDefault(require("../src/RegularExpression.js")); +describe('ExpressionFactory', () => { + let expressionFactory; + beforeEach(() => { + expressionFactory = new ExpressionFactory_js_1.default(new ParameterTypeRegistry_js_1.default()); + }); + it('creates a RegularExpression', () => { + assert.strictEqual(expressionFactory.createExpression(/x/).constructor, RegularExpression_js_1.default); + }); + it('creates a CucumberExpression', () => { + assert.strictEqual(expressionFactory.createExpression('x').constructor, CucumberExpression_js_1.default); + }); +}); +//# sourceMappingURL=ExpressionFactoryTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.js.map new file mode 100644 index 00000000..66d90ed8 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ExpressionFactoryTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpressionFactoryTest.js","sourceRoot":"","sources":["../../../test/ExpressionFactoryTest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAEhC,yFAA6D;AAC7D,uFAA2D;AAC3D,+FAAmE;AACnE,uFAA2D;AAE3D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,iBAAoC,CAAA;IACxC,UAAU,CAAC,GAAG,EAAE;QACd,iBAAiB,GAAG,IAAI,8BAAiB,CAAC,IAAI,kCAAqB,EAAE,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,8BAAiB,CAAC,CAAA;IAC5F,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,+BAAkB,CAAC,CAAA;IAC7F,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.d.ts new file mode 100644 index 00000000..5cd0c9cc --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ParameterTypeRegistryTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.d.ts.map new file mode 100644 index 00000000..c1402f0b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeRegistryTest.d.ts","sourceRoot":"","sources":["../../../test/ParameterTypeRegistryTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.js new file mode 100644 index 00000000..3fed70cf --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.js @@ -0,0 +1,54 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const ParameterType_js_1 = __importDefault(require("../src/ParameterType.js")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +class Name { + name; + constructor(name) { + this.name = name; + } +} +class Person { + name; + constructor(name) { + this.name = name; + } +} +class Place { + name; + constructor(name) { + this.name = name; + } +} +const CAPITALISED_WORD = /[A-Z]+\w+/; +describe('ParameterTypeRegistry', () => { + let registry; + beforeEach(() => { + registry = new ParameterTypeRegistry_js_1.default(); + }); + it('does not allow more than one preferential parameter type for each regexp', () => { + registry.defineParameterType(new ParameterType_js_1.default('name', CAPITALISED_WORD, Name, (s) => new Name(s), true, true)); + registry.defineParameterType(new ParameterType_js_1.default('person', CAPITALISED_WORD, Person, (s) => new Person(s), true, false)); + try { + registry.defineParameterType(new ParameterType_js_1.default('place', CAPITALISED_WORD, Place, (s) => new Place(s), true, true)); + throw new Error('Should have failed'); + } + catch (err) { + assert_1.default.strictEqual(err.message, `There can only be one preferential parameter type per regexp. The regexp ${CAPITALISED_WORD} is used for two preferential parameter types, {name} and {place}`); + } + }); + it('looks up preferential parameter type by regexp', () => { + const name = new ParameterType_js_1.default('name', /[A-Z]+\w+/, null, (s) => new Name(s), true, false); + const person = new ParameterType_js_1.default('person', /[A-Z]+\w+/, null, (s) => new Person(s), true, true); + const place = new ParameterType_js_1.default('place', /[A-Z]+\w+/, null, (s) => new Place(s), true, false); + registry.defineParameterType(name); + registry.defineParameterType(person); + registry.defineParameterType(place); + assert_1.default.strictEqual(registry.lookupByRegexp('[A-Z]+\\w+', /([A-Z]+\w+) and ([A-Z]+\w+)/, 'Lisa and Bob'), person); + }); +}); +//# sourceMappingURL=ParameterTypeRegistryTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.js.map new file mode 100644 index 00000000..500224ec --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeRegistryTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeRegistryTest.js","sourceRoot":"","sources":["../../../test/ParameterTypeRegistryTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAE3B,+EAAmD;AACnD,+FAAmE;AAEnE,MAAM,IAAI;IACoB;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AACD,MAAM,MAAM;IACkB;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AACD,MAAM,KAAK;IACmB;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AAED,MAAM,gBAAgB,GAAG,WAAW,CAAA;AAEpC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,IAAI,QAA+B,CAAA;IACnC,UAAU,CAAC,GAAG,EAAE;QACd,QAAQ,GAAG,IAAI,kCAAqB,EAAE,CAAA;IACxC,CAAC,CAAC,CAAA;IAEF,EAAE,CA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CAAC,CAAA;QAC/F,MAAM,KAAK,GAAG,IAAI,0BAAa,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;QAE7F,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QAClC,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAA;QACpC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;QAEnC,gBAAM,CAAC,WAAW,CAChB,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,6BAA6B,EAAE,cAAc,CAAC,EACpF,MAAM,CACP,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.d.ts new file mode 100644 index 00000000..1d9d221f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ParameterTypeTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.d.ts.map new file mode 100644 index 00000000..745f4bd9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeTest.d.ts","sourceRoot":"","sources":["../../../test/ParameterTypeTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.js new file mode 100644 index 00000000..1f6870ec --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.js @@ -0,0 +1,65 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert = __importStar(require("assert")); +const ParameterType_js_1 = __importDefault(require("../src/ParameterType.js")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +describe('ParameterType', () => { + it('does not allow ignore flag on regexp', () => { + assert.throws(() => new ParameterType_js_1.default('case-insensitive', /[a-z]+/i, String, (s) => s, true, true), { message: "ParameterType Regexps can't use flag 'i'" }); + }); + it('has a type name for {int}', () => { + const r = new ParameterTypeRegistry_js_1.default(); + const t = r.lookupByTypeName('int'); + // @ts-ignore + assert.strictEqual(t.type.name, 'Number'); + }); + it('has a type name for {bigint}', () => { + const r = new ParameterTypeRegistry_js_1.default(); + const t = r.lookupByTypeName('biginteger'); + // @ts-ignore + assert.strictEqual(t.type.name, 'BigInt'); + }); + it('has a type name for {word}', () => { + const r = new ParameterTypeRegistry_js_1.default(); + const t = r.lookupByTypeName('word'); + // @ts-ignore + assert.strictEqual(t.type.name, 'String'); + }); +}); +//# sourceMappingURL=ParameterTypeTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.js.map new file mode 100644 index 00000000..d9de4697 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/ParameterTypeTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeTest.js","sourceRoot":"","sources":["../../../test/ParameterTypeTest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgC;AAEhC,+EAAmD;AACnD,+FAAmE;AAEnE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,CAAC,MAAM,CACX,GAAG,EAAE,CAAC,IAAI,0BAAa,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EACpF,EAAE,OAAO,EAAE,0CAA0C,EAAE,CACxD,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,CAAC,GAAG,IAAI,kCAAqB,EAAE,CAAA;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAE,CAAA;QACpC,aAAa;QACb,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,GAAG,IAAI,kCAAqB,EAAE,CAAA;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAE,CAAA;QAC3C,aAAa;QACb,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,GAAG,IAAI,kCAAqB,EAAE,CAAA;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAE,CAAA;QACrC,aAAa;QACb,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.d.ts new file mode 100644 index 00000000..92e9ce8f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=RegularExpressionTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.d.ts.map new file mode 100644 index 00000000..f3a8391e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpressionTest.d.ts","sourceRoot":"","sources":["../../../test/RegularExpressionTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.js new file mode 100644 index 00000000..c950c249 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.js @@ -0,0 +1,86 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const fs_1 = __importDefault(require("fs")); +const glob_1 = require("glob"); +const js_yaml_1 = __importDefault(require("js-yaml")); +const ParameterTypeRegistry_js_1 = __importDefault(require("../src/ParameterTypeRegistry.js")); +const RegularExpression_js_1 = __importDefault(require("../src/RegularExpression.js")); +const testDataDir_js_1 = require("./testDataDir.js"); +describe('RegularExpression', () => { + for (const path of glob_1.glob.sync(`${testDataDir_js_1.testDataDir}/regular-expression/matching/*.yaml`)) { + const expectation = js_yaml_1.default.load(fs_1.default.readFileSync(path, 'utf-8')); + it(`matches ${path}`, () => { + const parameterTypeRegistry = new ParameterTypeRegistry_js_1.default(); + const expression = new RegularExpression_js_1.default(new RegExp(expectation.expression), parameterTypeRegistry); + const matches = expression.match(expectation.text); + assert_1.default.deepStrictEqual(JSON.parse(JSON.stringify(matches ? matches.map((value) => value.getValue(null)) : null)), // Removes type information. + expectation.expected_args); + }); + } + it('does no transform by default', () => { + assert_1.default.deepStrictEqual(match(/(\d\d)/, '22'), ['22']); + }); + it('does not transform anonymous', () => { + assert_1.default.deepStrictEqual(match(/(.*)/, '22'), ['22']); + }); + it('transforms negative int', () => { + assert_1.default.deepStrictEqual(match(/(-?\d+)/, '-22'), [-22]); + }); + it('transforms positive int', () => { + assert_1.default.deepStrictEqual(match(/(\d+)/, '22'), [22]); + }); + it('returns null when there is no match', () => { + assert_1.default.strictEqual(match(/hello/, 'world'), null); + }); + it('matches empty string', () => { + assert_1.default.deepStrictEqual(match(/^The value equals "([^"]*)"$/, 'The value equals ""'), ['']); + }); + it('matches nested capture group without match', () => { + assert_1.default.deepStrictEqual(match(/^a user( named "([^"]*)")?$/, 'a user'), [null]); + }); + it('matches nested capture group with match', () => { + assert_1.default.deepStrictEqual(match(/^a user( named "([^"]*)")?$/, 'a user named "Charlie"'), [ + 'Charlie', + ]); + }); + it('matches capture group nested in optional one', () => { + const regexp = /^a (pre-commercial transaction |pre buyer fee model )?purchase(?: for \$(\d+))?$/; + assert_1.default.deepStrictEqual(match(regexp, 'a purchase'), [null, null]); + assert_1.default.deepStrictEqual(match(regexp, 'a purchase for $33'), [null, 33]); + assert_1.default.deepStrictEqual(match(regexp, 'a pre buyer fee model purchase'), [ + 'pre buyer fee model ', + null, + ]); + }); + it('ignores non capturing groups', () => { + assert_1.default.deepStrictEqual(match(/(\S+) ?(can|cannot)? (?:delete|cancel) the (\d+)(?:st|nd|rd|th) (attachment|slide) ?(?:upload)?/, 'I can cancel the 1st slide upload'), ['I', 'can', 1, 'slide']); + }); + it('works with escaped parenthesis', () => { + assert_1.default.deepStrictEqual(match(/Across the line\(s\)/, 'Across the line(s)'), []); + }); + it('exposes regexp and source', () => { + const regexp = /I have (\d+) cukes? in my (.+) now/; + const expression = new RegularExpression_js_1.default(regexp, new ParameterTypeRegistry_js_1.default()); + assert_1.default.deepStrictEqual(expression.regexp, regexp); + assert_1.default.deepStrictEqual(expression.source, regexp.source); + }); + it('does not take consider parenthesis in character class as group', function () { + const expression = new RegularExpression_js_1.default(/^drawings: ([A-Z_, ()]+)$/, new ParameterTypeRegistry_js_1.default()); + const args = expression.match('drawings: ONE, TWO(ABC)'); + assert_1.default.strictEqual(args[0].getValue(this), 'ONE, TWO(ABC)'); + }); +}); +const match = (regexp, text) => { + const parameterRegistry = new ParameterTypeRegistry_js_1.default(); + const regularExpression = new RegularExpression_js_1.default(regexp, parameterRegistry); + const args = regularExpression.match(text); + if (!args) { + return null; + } + return args.map((arg) => arg.getValue(null)); +}; +//# sourceMappingURL=RegularExpressionTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.js.map new file mode 100644 index 00000000..9a2796a9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/RegularExpressionTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpressionTest.js","sourceRoot":"","sources":["../../../test/RegularExpressionTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAC3B,4CAAmB;AACnB,+BAA2B;AAC3B,sDAA0B;AAE1B,+FAAmE;AACnE,uFAA2D;AAC3D,qDAA8C;AAQ9C,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,KAAK,MAAM,IAAI,IAAI,WAAI,CAAC,IAAI,CAAC,GAAG,4BAAW,qCAAqC,CAAC,EAAE,CAAC;QAClF,MAAM,WAAW,GAAG,iBAAI,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAgB,CAAA;QAC5E,EAAE,CAAC,WAAW,IAAI,EAAE,EAAE,GAAG,EAAE;YACzB,MAAM,qBAAqB,GAAG,IAAI,kCAAqB,EAAE,CAAA;YACzD,MAAM,UAAU,GAAG,IAAI,8BAAiB,CACtC,IAAI,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,EAClC,qBAAqB,CACtB,CAAA;YACD,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;YAClD,gBAAM,CAAC,eAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CA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C,MAAM,EAAE,IAAI,kCAAqB,EAAE,CAAC,CAAA;QAC7E,gBAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACjD,gBAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gEAAgE,EAAE;QACnE,MAAM,UAAU,GAAG,IAAI,8BAAiB,CACtC,2BAA2B,EAC3B,IAAI,kCAAqB,EAAE,CAC5B,CAAA;QACD,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,yBAAyB,CAAE,CAAA;QAEzD,gBAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,MAAM,KAAK,GAAG,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;IAC7C,MAAM,iBAAiB,GAAG,IAAI,kCAAqB,EAAE,CAAA;IACrD,MAAM,iBAAiB,GAAG,IAAI,8BAAiB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC1E,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC1C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.d.ts new file mode 100644 index 00000000..396124aa --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=TreeRegexpTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.d.ts.map new file mode 100644 index 00000000..240c5f41 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeRegexpTest.d.ts","sourceRoot":"","sources":["../../../test/TreeRegexpTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.js new file mode 100644 index 00000000..bb474cb0 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.js @@ -0,0 +1,131 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert_1 = __importDefault(require("assert")); +const TreeRegexp_js_1 = __importDefault(require("../src/TreeRegexp.js")); +describe('TreeRegexp', () => { + it('exposes group source', () => { + const tr = new TreeRegexp_js_1.default(/(a(?:b)?)(c)/); + assert_1.default.deepStrictEqual(tr.groupBuilder.children.map((gb) => gb.source), ['a(?:b)?', 'c']); + }); + it('builds tree', () => { + const tr = new TreeRegexp_js_1.default(/(a(?:b)?)(c)/); + const group = tr.match('ac'); + assert_1.default.strictEqual(group.value, 'ac'); + assert_1.default.strictEqual(group.children?.[0].value, 'a'); + assert_1.default.deepStrictEqual(group.children[0].children, undefined); + assert_1.default.strictEqual(group.children[1].value, 'c'); + }); + it('ignores `?:` as a non-capturing group', () => { + const tr = new TreeRegexp_js_1.default(/a(?:b)(c)/); + const group = tr.match('abc'); + assert_1.default.strictEqual(group.value, 'abc'); + assert_1.default.strictEqual(group.children?.length, 1); + }); + it('ignores `?!` as a non-capturing group', () => { + const tr = new TreeRegexp_js_1.default(/a(?!b)(.+)/); + const group = tr.match('aBc'); + assert_1.default.strictEqual(group.value, 'aBc'); + assert_1.default.strictEqual(group.children?.length, 1); + }); + it('ignores `?=` as a non-capturing group', () => { + const tr = new TreeRegexp_js_1.default(/a(?=[b])(.+)/); + const group = tr.match('abc'); + assert_1.default.strictEqual(group.value, 'abc'); + assert_1.default.strictEqual(group.children?.length, 1); + assert_1.default.strictEqual(group.children[0].value, 'bc'); + }); + it('ignores `?<=` as a non-capturing group', () => { + const tr = new TreeRegexp_js_1.default(/a(.+)(?<=c)$/); + const group = tr.match('abc'); + assert_1.default.strictEqual(group.value, 'abc'); + assert_1.default.strictEqual(group.children?.length, 1); + assert_1.default.strictEqual(group.children[0].value, 'bc'); + }); + it('ignores `? { + const tr = new TreeRegexp_js_1.default(/a(.+?)(? { + const tr = new TreeRegexp_js_1.default(/a(?b)c/); + const group = tr.match('abc'); + assert_1.default.strictEqual(group.value, 'abc'); + assert_1.default.strictEqual(group.children?.length, 1); + assert_1.default.strictEqual(group.children[0].value, 'b'); + }); + it('matches optional group', () => { + const tr = new TreeRegexp_js_1.default(/^Something( with an optional argument)?/); + const group = tr.match('Something'); + assert_1.default.strictEqual(group.children?.[0].value, undefined); + }); + it('matches nested groups', () => { + const tr = new TreeRegexp_js_1.default(/^A (\d+) thick line from ((\d+),\s*(\d+),\s*(\d+)) to ((\d+),\s*(\d+),\s*(\d+))/); + const group = tr.match('A 5 thick line from 10,20,30 to 40,50,60'); + assert_1.default.strictEqual(group.children?.[0].value, '5'); + assert_1.default.strictEqual(group.children?.[1].value, '10,20,30'); + assert_1.default.strictEqual(group.children?.[1].children?.[0].value, '10'); + assert_1.default.strictEqual(group.children?.[1].children?.[1].value, '20'); + assert_1.default.strictEqual(group.children?.[1].children?.[2].value, '30'); + assert_1.default.strictEqual(group.children?.[2].value, '40,50,60'); + assert_1.default.strictEqual(group.children?.[2].children?.[0].value, '40'); + assert_1.default.strictEqual(group.children?.[2].children?.[1].value, '50'); + assert_1.default.strictEqual(group.children?.[2].children?.[2].value, '60'); + }); + it('detects multiple non capturing groups', () => { + const tr = new TreeRegexp_js_1.default(/(?:a)(:b)(\?c)(d)/); + const group = tr.match('a:b?cd'); + assert_1.default.strictEqual(group.children?.length, 3); + }); + it('works with escaped backslash', () => { + const tr = new TreeRegexp_js_1.default(/foo\\(bar|baz)/); + const group = tr.match('foo\\bar'); + assert_1.default.strictEqual(group.children?.length, 1); + }); + it('works with escaped slash', () => { + const tr = new TreeRegexp_js_1.default(/^I go to '\/(.+)'$/); + const group = tr.match("I go to '/hello'"); + assert_1.default.strictEqual(group.children?.length, 1); + }); + it('works with digit and word', () => { + const tr = new TreeRegexp_js_1.default(/^(\d) (\w+)$/); + const group = tr.match('2 you'); + assert_1.default.strictEqual(group.children?.length, 2); + }); + it('captures non capturing groups with capturing groups inside', () => { + const tr = new TreeRegexp_js_1.default('the stdout(?: from "(.*?)")?'); + const group = tr.match('the stdout'); + assert_1.default.strictEqual(group.value, 'the stdout'); + assert_1.default.strictEqual(group.children?.[0].value, undefined); + assert_1.default.strictEqual(group.children?.length, 1); + }); + it('works with case insensitive flag', () => { + const tr = new TreeRegexp_js_1.default(/HELLO/i); + const group = tr.match('hello'); + assert_1.default.strictEqual(group.value, 'hello'); + }); + it('empty capturing group', () => { + const tr = new TreeRegexp_js_1.default(/()/); + const group = tr.match(''); + assert_1.default.strictEqual(group.value, ''); + assert_1.default.strictEqual(group.children?.length, 1); + }); + it('empty look ahead', () => { + const tr = new TreeRegexp_js_1.default(/(?<=)/); + const group = tr.match(''); + assert_1.default.strictEqual(group.value, ''); + assert_1.default.strictEqual(group.children, undefined); + }); + it('does not consider parenthesis in character class as group', () => { + const tr = new TreeRegexp_js_1.default(/^drawings: ([A-Z, ()]+)$/); + const group = tr.match('drawings: ONE(TWO)'); + assert_1.default.strictEqual(group.value, 'drawings: ONE(TWO)'); + assert_1.default.strictEqual(group.children?.length, 1); + assert_1.default.strictEqual(group.children[0].value, 'ONE(TWO)'); + }); +}); +//# sourceMappingURL=TreeRegexpTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.js.map new file mode 100644 index 00000000..7ac9c58d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/TreeRegexpTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeRegexpTest.js","sourceRoot":"","sources":["../../../test/TreeRegexpTest.ts"],"names":[],"mappings":";;;;;AAAA,oDAA2B;AAE3B,yEAA6C;AAE7C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAC9B,MAAM,EAAE,GAAG,IAAI,uBAAU,CAAC,cAAc,CAAC,CAAA;QACzC,gBAAM,CAAC,eAAe,CACpB,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAC/C,CAAC,SAAS,EAAE,GAAG,CAAC,CACjB,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;QACrB,MAAM,EAAE,GAAG,IAAI,uBAAU,CAAC,cAAc,CAAC,CAAA;QACzC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAE,CAAA;QAC7B,gBAAM,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QACrC,gBAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAClD,gBAAM,CAA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gBAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;QAC7C,gBAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.d.ts new file mode 100644 index 00000000..d1ff6beb --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.d.ts @@ -0,0 +1,2 @@ +export declare const testDataDir: string; +//# sourceMappingURL=testDataDir.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.d.ts.map new file mode 100644 index 00000000..8e3eda32 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"testDataDir.d.ts","sourceRoot":"","sources":["../../../test/testDataDir.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAkE,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.js b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.js new file mode 100644 index 00000000..05ee5b84 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.testDataDir = void 0; +exports.testDataDir = process.env.CUCUMBER_EXPRESSIONS_TEST_DATA_DIR || '../testdata'; +//# sourceMappingURL=testDataDir.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.js.map b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.js.map new file mode 100644 index 00000000..2c00500a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/test/testDataDir.js.map @@ -0,0 +1 @@ +{"version":3,"file":"testDataDir.js","sourceRoot":"","sources":["../../../test/testDataDir.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/cjs/tsconfig.build-cjs.tsbuildinfo b/node_modules/@cucumber/cucumber-expressions/dist/cjs/tsconfig.build-cjs.tsbuildinfo new file mode 100644 index 00000000..eabb21a5 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/cjs/tsconfig.build-cjs.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/CucumberExpressionError.ts","../../src/Group.ts","../../src/ParameterType.ts","../../src/Argument.ts","../../src/Ast.ts","../../src/types.ts","../../src/GeneratedExpression.ts","../../src/CombinatorialGeneratedExpressionFactory.ts","../../src/Errors.ts","../../src/CucumberExpressionTokenizer.ts","../../src/CucumberExpressionParser.ts","../../src/ParameterTypeMatcher.ts","../../src/CucumberExpressionGenerator.ts","../../src/defineDefaultParameterTypes.ts","../../src/ParameterTypeRegistry.ts","../../node_modules/regexp-match-indices/types.d.ts","../../node_modules/regexp-match-indices/index.d.ts","../../src/GroupBuilder.ts","../../src/TreeRegexp.ts","../../src/CucumberExpression.ts","../../src/RegularExpression.ts","../../src/ExpressionFactory.ts","../../src/index.ts","../../test/ArgumentTest.ts","../../test/CombinatorialGeneratedExpressionFactoryTest.ts","../../test/CucumberExpressionGeneratorTest.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/@types/node/web-globals/events.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/inspector.generated.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/sqlite.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/index.d.ts","../../node_modules/minipass/dist/commonjs/index.d.ts","../../node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts","../../node_modules/path-scurry/dist/commonjs/index.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts","../../node_modules/glob/dist/commonjs/pattern.d.ts","../../node_modules/glob/dist/commonjs/processor.d.ts","../../node_modules/glob/dist/commonjs/walker.d.ts","../../node_modules/glob/dist/commonjs/ignore.d.ts","../../node_modules/glob/dist/commonjs/glob.d.ts","../../node_modules/glob/dist/commonjs/has-magic.d.ts","../../node_modules/glob/dist/commonjs/index.d.ts","../../node_modules/@types/js-yaml/index.d.ts","../../test/testDataDir.ts","../../test/CucumberExpressionParserTest.ts","../../test/CucumberExpressionTest.ts","../../test/CucumberExpressionTokenizerTest.ts","../../test/CucumberExpressionTransformationTest.ts","../../test/CustomParameterTypeTest.ts","../../test/ExpressionFactoryTest.ts","../../test/ParameterTypeRegistryTest.ts","../../test/ParameterTypeTest.ts","../../test/RegularExpressionTest.ts","../../test/TreeRegexpTest.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/json5/index.d.ts","../../node_modules/@types/mocha/index.d.ts"],"fileIdsList":[[89,137,154,155],[89,134,135,137,154,155],[89,136,137,154,155],[137,154,155],[89,137,142,154,155,172],[89,137,138,143,148,154,155,157,169,180],[89,137,138,139,148,154,155,157],[84,85,86,89,137,154,155],[89,137,140,154,155,181],[89,137,141,142,149,154,155,158],[89,137,142,154,155,169,177],[89,137,143,145,148,154,155,157],[89,136,137,144,154,155],[89,137,145,146,154,155],[89,137,147,148,154,155],[89,136,137,148,154,155],[89,137,148,149,150,154,155,169,180],[89,137,148,149,150,154,155,164,169,172],[89,130,137,145,148,151,154,155,157,169,180],[89,137,148,149,151,152,154,155,157,169,177,180],[89,137,151,153,154,155,169,177,180],[87,88,89,90,91,92,93,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186],[89,137,148,154,155],[89,137,154,155,156,180],[89,137,145,148,154,155,157,169],[89,137,154,155,158],[89,137,154,155,159],[89,136,137,154,155,160],[89,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186],[89,137,154,155,162],[89,137,154,155,163],[89,137,148,154,155,164,165],[89,137,154,155,164,166,181,183],[89,137,149,154,155],[89,137,148,154,155,169,170,172],[89,137,154,155,171,172],[89,137,154,155,169,170],[89,137,154,155,172],[89,137,154,155,173],[89,134,137,154,155,169,174],[89,137,148,154,155,175,176],[89,137,154,155,175,176],[89,137,142,154,155,157,169,177],[89,137,154,155,178],[89,137,154,155,157,179],[89,137,151,154,155,163,180],[89,137,142,154,155,181],[89,137,154,155,169,182],[89,137,154,155,156,183],[89,137,154,155,184],[89,130,137,154,155],[89,130,137,148,150,154,155,160,169,172,180,182,183,185],[89,137,154,155,169,186],[89,137,154,155,188,190,194,195,198],[89,137,154,155,199],[89,137,154,155,190,194,197],[89,137,154,155,188,190,194,197,198,199,200],[89,137,154,155,194],[89,137,154,155,190,194,195,197],[89,137,154,155,188,190,195,196,198],[89,137,154,155,191,192,193],[89,137,148,154,155,173,187],[89,137,149,154,155,159,188,189],[73,89,137,154,155],[89,102,106,137,154,155,180],[89,102,137,154,155,169,180],[89,97,137,154,155],[89,99,102,137,154,155,177,180],[89,137,154,155,157,177],[89,137,154,155,187],[89,97,137,154,155,187],[89,99,102,137,154,155,157,180],[89,94,95,98,101,137,148,154,155,169,180],[89,102,109,137,154,155],[89,94,100,137,154,155],[89,102,123,124,137,154,155],[89,98,102,137,154,155,172,180,187],[89,123,137,154,155,187],[89,96,97,137,154,155,187],[89,102,137,154,155],[89,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,124,125,126,127,128,129,137,154,155],[89,102,117,137,154,155],[89,102,109,110,137,154,155],[89,100,102,110,111,137,154,155],[89,101,137,154,155],[89,94,97,102,137,154,155],[89,102,106,110,111,137,154,155],[89,106,137,154,155],[89,100,102,105,137,154,155,180],[89,94,99,102,109,137,154,155],[89,137,154,155,169],[89,97,102,123,137,154,155,185,187],[58,59,60,89,137,154,155],[60,64,89,137,154,155],[58,60,61,62,63,66,68,72,76,89,137,154,155],[60,64,65,69,89,137,154,155],[62,66,67,89,137,154,155],[62,66,89,137,154,155],[58,60,62,64,89,137,154,155],[63,72,77,78,89,137,154,155],[60,63,89,137,154,155],[59,74,89,137,154,155],[58,89,137,154,155],[60,89,137,154,155],[58,60,63,66,70,71,89,137,154,155],[60,61,63,72,76,89,137,154,155],[59,74,75,89,137,154,155],[59,60,61,62,63,64,70,72,77,78,79,89,137,154,155],[60,61,89,137,154,155],[61,72,76,89,134,137,154,155],[60,65,89,134,137,154,155],[60,63,70,72,77,89,134,137,154,155],[58,68,89,134,137,149,154,155,201,202,203],[58,60,72,77,89,134,137,149,154,155,201,202,203],[58,67,89,134,137,149,154,155,201,202,203],[72,77,89,134,137,149,154,155,201,202,203],[60,72,77,78,89,134,137,154,155],[72,77,78,79,89,134,137,154,155],[60,72,89,134,137,154,155],[72,78,89,134,137,149,154,155,201,202,203],[76,89,134,137,154,155]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"06da0313a696d2e58f6a6addb168a1faa1407045975ff672d492b233e0d03d18","signature":"e19e037d802f1c50c9342228dd2efc1588da9c715c091b7eadc0162c8503d967"},{"version":"9ede140de3bd446edc8f0504efc8dd890233bff149e3e391d9bc4d9aa9d90b26","signature":"24ef89d81df156d80bde512dd17090b7d27d09020287f28760ac078be9bebf4c"},{"version":"c7df0f4ab2534847f922c0ebf91a9e4ee33e4bd4164027ccbd5e27175e35519d","signature":"57490d02476c72fe9cae1b34584e123676a0348dea80e4812a4e250c52c38468"},{"version":"48b35c8418e69a7860c9de016a31d6182a4ea0e6d8b7a76eecb147c35800385f","signature":"b95293f52864ea44926cb1d1e32b48b68b8b332458da73c58b1e987571158974"},{"version":"a39b2332d4b3b34a0bc15ede317e26df01db21ca91ed5b65d46d01959d1c5b96","signature":"dd82562bcc9bed49db1280d7df870c4b820b5a5919298dc1e3f1eb1d739224ba"},{"version":"3ff166ec4e9b528423ee62aac60c9ac8be821e7bf4518ce90a4700c9b21258e7","signature":"6726ccf9600c6d389280f6ea05c73aee451921d77cb5a3bb49bbbaf86b0a38fa"},{"version":"6f1bd6cf08275bee0efc51828ba69467f323b9d50fb452b3a16d4efd9db60921","signature":"c1dd30504a69bd635e607aaf09b8fda675d27695b625968e13abbbe48917481f"},{"version":"4e7ac7085ebf893ed30952e9d2f2b4d5c377bf23f27d3a13b592e81e501a7a15","signature":"0eb46bea5c59364676679c8c4a83284a9fefecb1b77dcef37063001e6635ddd2"},{"version":"15050d75e57b9c0c7af24607306345edc2a754d13226ff0660c6f27e9513877b","signature":"5bdd2ecd3a23eb6ea616dbde6af2f8ce53e6a475d71702be34c3507373e482ab"},{"version":"02ceec18f2977ea36bec3811ce368fc98e06fff7cb0b11d7c9643209353990d2","signature":"2138c76a0f136863b80ffe260c911617b4005089249d69c73852c125bc8d9ab4"},{"version":"92c2ef0cae2f23efbfe8297128ad0e7afb966180a190e45ebc235971e5095166","signature":"ee114ff5f88e7ee60e64b3161a1ee0579a7d04e0558c82af84788f38996f3f81"},{"version":"3f1f10e6e19a5b539236e29ef5d8318d23d2a67af3223dd0d9ca946da46aef6f","signature":"c5ad640bad7e50aad9f2557b75f64343104edf224ec3ceda26bb12c8a4a84afe"},{"version":"3216975032fc1c8bfbb5cec14b889253b161f9d07be73656cb04b4bff823d2a7","signature":"82d252437544aa799caa000db1444f0b7c98db797c2afaab02942e0a073a47d5"},{"version":"be7b6e29bef5c9d2f26580920f5cb7aeee545797ef3e46dc2e566c9459141c6c","signature":"4398e3d5a86dbe1dc3402c571726c7628955c6300fc653cdf0746780c961c957"},{"version":"690a8b7244f18c8eba19571af5c7be77515b7d751cfedebafc68dc017f06655e","signature":"8cff33b8ea70c630b18f450058ef452f0f0e1a90729cb370c41caab99e498af4"},{"version":"9aa137f97595ff06582fdb09968f1e5fb52f95cb908c6698f462898f82a0bba6","impliedFormat":1},{"version":"b3f65f9c303e875847a2fbe493a34cffdb670370f9d4fd45454f4d80f8077e92","impliedFormat":1},{"version":"cacf93178175c185d8029588737861735bc326aaefb9a5a41f16f117475d8c57","signature":"28e640b5eec581a031f5ae17928fd1bfcaabd3a724b720ee9f8a92af8c351001"},{"version":"f63cb2e3ab889485ee76b4c582af1e1dc68141def643c863072bcc3ce474e598","signature":"50427d3f68d0d5587ce95805b1a305cb644eabd24581b7b5174290bbbe99275a"},{"version":"929e9d63cbd3f3ffd9dc5b5cb42584eeba8d74213ae2c73db2593b1f1cd3204f","signature":"b69216b9607b65105ec37d75b761a66b89302243f6ff8973cb3a04cb44f10919"},{"version":"ee3cfcd57f3fd496857657db2cba3fe23b44a33208be1da2fefeae1737b59566","signature":"c917934380703484415937e8b21b1d797c413728825d2091ddfbd6df615a6e1e"},{"version":"251936125619b35babf300d0fca313df31be9f4ffb5d08ec9f79e11f5f318175","signature":"4bc26751aef71adea01a2c9cc13edf25f0c49d4c8840f4923b31eb34141d2f99"},{"version":"b7472159e705d18142777b49b2cb366fd47ff02f1eec67c1ca348a3823eb7dd5","signature":"73a104ea71e78302bb48a144e71aaef7df820cdbfa3446ffe12ad8315df8c1f3"},{"version":"4ab1230aa0c2d915e82587964b57b233a9eb1445c833550f5d55c62840f92069","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"66d910a4c1cdc79314fdeecf414e2b28527d1ff83191a1afce484b5d2c75e082","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"7bd1d50838e19b47cdf378b8925153d89d66cc9294a84162e79b48d94ca59d83","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"bb45cd435da536500f1d9692a9b49d0c570b763ccbf00473248b777f5c1f353b","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bc7425ef40526650d6db7e072c1ff4a51101c3ac2cc4b666623b19496a6e27","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c959a391a75be9789b43c8468f71e3fa06488b4d691d5729dde1416dcd38225b","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"0dba70b3fb0dcd713fda33c2df64fa6751fff6460e536971cee917260fb17882","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"041597c12abeaa2ef07766775955fc87cfc65c43e0fe86c836071bea787e967c","impliedFormat":1},{"version":"0838507efff4f479c6f603ec812810ddfe14ab32abf8f4a8def140be970fe439","impliedFormat":1},{"version":"072f583571d6e3d30cd9760ee3485d29484fb7b54ba772ac135c747a380096a1","impliedFormat":1},{"version":"7212c2d58855b8df35275180e97903a4b6093d4fbaefea863d8d028da63938c6","impliedFormat":1},{"version":"d8a6b3f899917210f00ddf13b564a2a4fdcf1e50c5a22e8d3abcfd4f1c4f9ae1","impliedFormat":1},{"version":"fd5eab954b31e761a72234031dadc3aab768763942a9637e380aed441cc94f59","impliedFormat":1},{"version":"c7aaac3119acf27e03190cc4224f1d81c7498cf6b36fa72d10d99f2c41d1bbc0","impliedFormat":1},{"version":"dd9faff42b456b5f03b85d8fbd64838eb92f6f7b03b36322cbc59c005b7033d3","impliedFormat":1},{"version":"6ff702721d87c0ba8e7f8950e7b0a3b009dfd912fab3997e0b63fab8d83919c3","impliedFormat":1},{"version":"9dce9fc12e9a79d1135699d525aa6b44b71a45e32e3fa0cf331060b980b16317","impliedFormat":1},{"version":"586b2fd8a7d582329658aaceec22f8a5399e05013deb49bcfde28f95f093c8ee","impliedFormat":1},{"version":"59c44b081724d4ab8039988aba34ee6b3bd41c30fc2d8686f4ed06588397b2f7","impliedFormat":1},{"version":"ef1f3eadd7bed282de45bafd7c2c00105cf1db93e22f6cd763bec8a9c2cf6df1","impliedFormat":1},{"version":"2b90463c902dbe4f5bbb9eae084c05de37477c17a5de1e342eb7cbc9410dc6a1","impliedFormat":1},{"version":"7a1dd1e9c8bf5e23129495b10718b280340c7500570e0cfe5cffcdee51e13e48","impliedFormat":1},{"version":"70eb87bf376ae18494fb327896dc04d556a65c41340a2f5b35d6e10cc7075afa","signature":"bd6640feffbb44ade7ce92bd1353f4ca41107af7bc1a05b290e1344854e60fcf"},{"version":"78c612ac6dd0b1ca0e84909ce3d1911b7d80770dfa8aa34958d2d649055b8f3c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"546f00a65afbab43856de4ce377a216b46eb4a0561b92c1c1c045bc61664a14d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"c9df1727c08e547a6868f4926623ed20ab46fe8d6785a1de752ea2893e521a48","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3103fa8e4fc36db909e5d60d457c852ecffbfda0a59844fcaf5f4ad154259733","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"ff9e3afda6d0a0c4194f07192f026e04916ec75da062daf75507774e06554ec6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"afc239b67160dbb808d7dbd7bb29ad575b5fbf1b89b95622a7eaef332f07c8c4","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3b0142c0b79b03f4d0b2e585b1f1885313e6a736a70e8fde352acf2554220ca4","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"dcb32fa9db22b6581af2a8ea72302a7d9282bd09138069d875d88dc874abf506","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a96d1dcfe2725b2438877eefe2be8e310aa56c387f6ba974f3e222e6a5f67254","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"9ad8981ef9c1e9c275f6a6e703761243664f43921d71ed6c5fb89ca50b0cc5bf","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1}],"root":[[58,72],[75,83],[203,213]],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"noImplicitAny":true,"outDir":"./","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":9},"referencedMap":[[214,1],[202,1],[215,1],[216,1],[217,1],[134,2],[135,2],[136,3],[89,4],[137,5],[138,6],[139,7],[84,1],[87,8],[85,1],[86,1],[140,9],[141,10],[142,11],[143,12],[144,13],[145,14],[146,14],[147,15],[148,16],[149,17],[150,18],[90,1],[88,1],[151,19],[152,20],[153,21],[187,22],[154,23],[155,1],[156,24],[157,25],[158,26],[159,27],[160,28],[161,29],[162,30],[163,31],[164,32],[165,32],[166,33],[167,1],[168,34],[169,35],[171,36],[170,37],[172,38],[173,39],[174,40],[175,41],[176,42],[177,43],[178,44],[179,45],[180,46],[181,47],[182,48],[183,49],[184,50],[91,1],[92,1],[93,1],[131,51],[132,1],[133,1],[185,52],[186,53],[199,54],[200,55],[198,56],[201,57],[195,58],[196,59],[197,60],[191,58],[192,58],[194,61],[193,58],[188,62],[190,63],[189,1],[74,64],[73,1],[56,1],[57,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[20,1],[21,1],[4,1],[22,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[8,1],[49,1],[46,1],[47,1],[48,1],[50,1],[9,1],[51,1],[52,1],[53,1],[55,1],[54,1],[1,1],[109,65],[119,66],[108,65],[129,67],[100,68],[99,69],[128,70],[122,71],[127,72],[102,73],[116,74],[101,75],[125,76],[97,77],[96,70],[126,78],[98,79],[103,80],[104,1],[107,80],[94,1],[130,81],[120,82],[111,83],[112,84],[114,85],[110,86],[113,87],[123,70],[105,88],[106,89],[115,90],[95,91],[118,82],[117,80],[121,1],[124,92],[61,93],[62,1],[65,94],[77,95],[58,1],[70,96],[68,97],[67,98],[66,99],[79,100],[64,101],[59,1],[75,102],[60,103],[69,104],[72,105],[78,106],[76,107],[71,101],[80,108],[63,109],[81,110],[82,111],[83,112],[204,113],[205,114],[206,115],[207,116],[208,117],[209,118],[210,119],[211,119],[212,120],[213,121],[203,1]],"latestChangedDtsFile":"./test/TreeRegexpTest.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.d.ts new file mode 100644 index 00000000..a18f65d2 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.d.ts @@ -0,0 +1,16 @@ +import Group from './Group.js'; +import ParameterType from './ParameterType.js'; +export default class Argument { + readonly group: Group; + readonly parameterType: ParameterType; + static build(group: Group, parameterTypes: readonly ParameterType[]): readonly Argument[]; + constructor(group: Group, parameterType: ParameterType); + /** + * Get the value returned by the parameter type's transformer function. + * + * @param thisObj the object in which the transformer function is applied. + */ + getValue(thisObj: unknown): T | null; + getParameterType(): ParameterType; +} +//# sourceMappingURL=Argument.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.d.ts.map new file mode 100644 index 00000000..a7280d54 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Argument.d.ts","sourceRoot":"","sources":["../../../src/Argument.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,MAAM,CAAC,OAAO,OAAO,QAAQ;aAqBT,KAAK,EAAE,KAAK;aACZ,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC;WArBzC,KAAK,CACjB,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE,GAChD,SAAS,QAAQ,EAAE;gBAiBJ,KAAK,EAAE,KAAK,EACZ,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC;IAMvD;;;;OAIG;IACI,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,GAAG,IAAI;IAKvC,gBAAgB;CAGxB"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.js new file mode 100644 index 00000000..f7a2ea08 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.js @@ -0,0 +1,31 @@ +import CucumberExpressionError from './CucumberExpressionError.js'; +export default class Argument { + group; + parameterType; + static build(group, parameterTypes) { + const argGroups = group.children || []; + if (argGroups.length !== parameterTypes.length) { + throw new CucumberExpressionError(`Group has ${argGroups.length} capture groups (${argGroups.map((g) => g.value)}), but there were ${parameterTypes.length} parameter types (${parameterTypes.map((p) => p.name)})`); + } + return parameterTypes.map((parameterType, i) => new Argument(argGroups[i], parameterType)); + } + constructor(group, parameterType) { + this.group = group; + this.parameterType = parameterType; + this.group = group; + this.parameterType = parameterType; + } + /** + * Get the value returned by the parameter type's transformer function. + * + * @param thisObj the object in which the transformer function is applied. + */ + getValue(thisObj) { + const groupValues = this.group ? this.group.values : null; + return this.parameterType.transform(thisObj, groupValues); + } + getParameterType() { + return this.parameterType; + } +} +//# sourceMappingURL=Argument.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.js.map new file mode 100644 index 00000000..90459a65 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Argument.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Argument.js","sourceRoot":"","sources":["../../../src/Argument.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,8BAA8B,CAAA;AAIlE,MAAM,CAAC,OAAO,OAAO,QAAQ;IAqBT;IACA;IArBX,MAAM,CAAC,KAAK,CACjB,KAAY,EACZ,cAAiD;QAEjD,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAA;QAEtC,IAAI,SAAS,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,EAAE,CAAC;YAC/C,MAAM,IAAI,uBAAuB,CAC/B,aAAa,SAAS,CAAC,MAAM,oBAAoB,SAAS,CAAC,GAAG,CAC5D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CACf,qBAAqB,cAAc,CAAC,MAAM,qBAAqB,cAAc,CAAC,GAAG,CAChF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CACd,GAAG,CACL,CAAA;QACH,CAAC;QAED,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAA;IAC5F,CAAC;IAED,YACkB,KAAY,EACZ,aAAqC;QADrC,UAAK,GAAL,KAAK,CAAO;QACZ,kBAAa,GAAb,aAAa,CAAwB;QAErD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAI,OAAgB;QACjC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;QACzD,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;IAC3D,CAAC;IAEM,gBAAgB;QACrB,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.d.ts new file mode 100644 index 00000000..ced45a69 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.d.ts @@ -0,0 +1,45 @@ +export declare function symbolOf(token: TokenType): string; +export declare function purposeOf(token: TokenType): string; +export interface Located { + readonly start: number; + readonly end: number; +} +export declare class Node implements Located { + readonly type: NodeType; + readonly nodes: readonly Node[] | undefined; + private readonly token; + readonly start: number; + readonly end: number; + constructor(type: NodeType, nodes: readonly Node[] | undefined, token: string | undefined, start: number, end: number); + text(): string; +} +export declare enum NodeType { + text = "TEXT_NODE", + optional = "OPTIONAL_NODE", + alternation = "ALTERNATION_NODE", + alternative = "ALTERNATIVE_NODE", + parameter = "PARAMETER_NODE", + expression = "EXPRESSION_NODE" +} +export declare class Token implements Located { + readonly type: TokenType; + readonly text: string; + readonly start: number; + readonly end: number; + constructor(type: TokenType, text: string, start: number, end: number); + static isEscapeCharacter(codePoint: string): boolean; + static canEscape(codePoint: string): boolean; + static typeOf(codePoint: string): TokenType; +} +export declare enum TokenType { + startOfLine = "START_OF_LINE", + endOfLine = "END_OF_LINE", + whiteSpace = "WHITE_SPACE", + beginOptional = "BEGIN_OPTIONAL", + endOptional = "END_OPTIONAL", + beginParameter = "BEGIN_PARAMETER", + endParameter = "END_PARAMETER", + alternation = "ALTERNATION", + text = "TEXT" +} +//# sourceMappingURL=Ast.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.d.ts.map new file mode 100644 index 00000000..5f18d7a9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Ast.d.ts","sourceRoot":"","sources":["../../../src/Ast.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAcjD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAYlD;AAED,MAAM,WAAW,OA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iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;IAC9B,WAAW,gBAAgB;IAC3B,IAAI,SAAS;CACd"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.js new file mode 100644 index 00000000..b08cf699 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.js @@ -0,0 +1,134 @@ +const escapeCharacter = '\\'; +const alternationCharacter = '/'; +const beginParameterCharacter = '{'; +const endParameterCharacter = '}'; +const beginOptionalCharacter = '('; +const endOptionalCharacter = ')'; +export function symbolOf(token) { + switch (token) { + case TokenType.beginOptional: + return beginOptionalCharacter; + case TokenType.endOptional: + return endOptionalCharacter; + case TokenType.beginParameter: + return beginParameterCharacter; + case TokenType.endParameter: + return endParameterCharacter; + case TokenType.alternation: + return alternationCharacter; + } + return ''; +} +export function purposeOf(token) { + switch (token) { + case TokenType.beginOptional: + case TokenType.endOptional: + return 'optional text'; + case TokenType.beginParameter: + case TokenType.endParameter: + return 'a parameter'; + case TokenType.alternation: + return 'alternation'; + } + return ''; +} +export class Node { + type; + nodes; + token; + start; + end; + constructor(type, nodes, token, start, end) { + this.type = type; + this.nodes = nodes; + this.token = token; + this.start = start; + this.end = end; + if (nodes === undefined && token === undefined) { + throw new Error('Either nodes or token must be defined'); + } + } + text() { + if (this.nodes && this.nodes.length > 0) { + return this.nodes.map((value) => value.text()).join(''); + } + return this.token || ''; + } +} +export var NodeType; +(function (NodeType) { + NodeType["text"] = "TEXT_NODE"; + NodeType["optional"] = "OPTIONAL_NODE"; + NodeType["alternation"] = "ALTERNATION_NODE"; + NodeType["alternative"] = "ALTERNATIVE_NODE"; + NodeType["parameter"] = "PARAMETER_NODE"; + NodeType["expression"] = "EXPRESSION_NODE"; +})(NodeType || (NodeType = {})); +export class Token { + type; + text; + start; + end; + constructor(type, text, start, end) { + this.type = type; + this.text = text; + this.start = start; + this.end = end; + } + static isEscapeCharacter(codePoint) { + return codePoint == escapeCharacter; + } + static canEscape(codePoint) { + if (codePoint == ' ') { + // TODO: Unicode whitespace? + return true; + } + switch (codePoint) { + case escapeCharacter: + return true; + case alternationCharacter: + return true; + case beginParameterCharacter: + return true; + case endParameterCharacter: + return true; + case beginOptionalCharacter: + return true; + case endOptionalCharacter: + return true; + } + return false; + } + static typeOf(codePoint) { + if (codePoint == ' ') { + // TODO: Unicode whitespace? + return TokenType.whiteSpace; + } + switch (codePoint) { + case alternationCharacter: + return TokenType.alternation; + case beginParameterCharacter: + return TokenType.beginParameter; + case endParameterCharacter: + return TokenType.endParameter; + case beginOptionalCharacter: + return TokenType.beginOptional; + case endOptionalCharacter: + return TokenType.endOptional; + } + return TokenType.text; + } +} +export var TokenType; +(function (TokenType) { + TokenType["startOfLine"] = "START_OF_LINE"; + TokenType["endOfLine"] = "END_OF_LINE"; + TokenType["whiteSpace"] = "WHITE_SPACE"; + TokenType["beginOptional"] = "BEGIN_OPTIONAL"; + TokenType["endOptional"] = "END_OPTIONAL"; + TokenType["beginParameter"] = "BEGIN_PARAMETER"; + TokenType["endParameter"] = "END_PARAMETER"; + TokenType["alternation"] = "ALTERNATION"; + TokenType["text"] = "TEXT"; +})(TokenType || (TokenType = {})); +//# sourceMappingURL=Ast.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.js.map new file mode 100644 index 00000000..686943d2 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Ast.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Ast.js","sourceRoot":"","sources":["../../../src/Ast.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,IAAI,CAAA;AAC5B,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAChC,MAAM,uBAAuB,GAAG,GAAG,CAAA;AACnC,MAAM,qBAAqB,GAAG,GAAG,CA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uBAAuB;gBAC1B,OAAO,IAAI,CAAA;YACb,KAAK,qBAAqB;gBACxB,OAAO,IAAI,CAAA;YACb,KAAK,sBAAsB;gBACzB,OAAO,IAAI,CAAA;YACb,KAAK,oBAAoB;gBACvB,OAAO,IAAI,CAAA;QACf,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,SAAiB;QAC7B,IAAI,SAAS,IAAI,GAAG,EAAE,CAAC;YACrB,4BAA4B;YAC5B,OAAO,SAAS,CAAC,UAAU,CAAA;QAC7B,CAAC;QACD,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,oBAAoB;gBACvB,OAAO,SAAS,CAAC,WAAW,CAAA;YAC9B,KAAK,uBAAuB;gBAC1B,OAAO,SAAS,CAAC,cAAc,CAAA;YACjC,KAAK,qBAAqB;gBACxB,OAAO,SAAS,CAAC,YAAY,CAAA;YAC/B,KAAK,sBAAsB;gBACzB,OAAO,SAAS,CAAC,aAAa,CAAA;YAChC,KAAK,oBAAoB;gBACvB,OAAO,SAAS,CAAC,WAAW,CAAA;QAChC,CAAC;QACD,OAAO,SAAS,CAAC,IAAI,CAAA;IACvB,CAAC;CACF;AAED,MAAM,CAAN,IAAY,SAUX;AAVD,WAAY,SAAS;IACnB,0CAA6B,CAAA;IAC7B,sCAAyB,CAAA;IACzB,uCAA0B,CAAA;IAC1B,6CAAgC,CAAA;IAChC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,2CAA8B,CAAA;IAC9B,wCAA2B,CAAA;IAC3B,0BAAa,CAAA;AACf,CAAC,EAVW,SAAS,KAAT,SAAS,QAUpB"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.d.ts new file mode 100644 index 00000000..249f995f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.d.ts @@ -0,0 +1,10 @@ +import GeneratedExpression from './GeneratedExpression.js'; +import ParameterType from './ParameterType.js'; +export default class CombinatorialGeneratedExpressionFactory { + private readonly expressionTemplate; + private readonly parameterTypeCombinations; + constructor(expressionTemplate: string, parameterTypeCombinations: Array>>); + generateExpressions(): readonly GeneratedExpression[]; + private generatePermutations; +} +//# sourceMappingURL=CombinatorialGeneratedExpressionFactory.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.d.ts.map new file mode 100644 index 00000000..85ea904c --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CombinatorialGeneratedExpressionFactory.d.ts","sourceRoot":"","sources":["../../../src/CombinatorialGeneratedExpressionFactory.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAK9C,MAAM,CAAC,OAAO,OAAO,uCAAuC;IAExD,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBADzB,kBAAkB,EAAE,MAAM,EAC1B,yBAAyB,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAK3E,mBAAmB,IAAI,SAAS,mBAAmB,EAAE;IAM5D,OAAO,CAAC,oBAAoB;CA4B7B"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.js new file mode 100644 index 00000000..20dfbee2 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.js @@ -0,0 +1,37 @@ +import GeneratedExpression from './GeneratedExpression.js'; +// 256 generated expressions ought to be enough for anybody +const MAX_EXPRESSIONS = 256; +export default class CombinatorialGeneratedExpressionFactory { + expressionTemplate; + parameterTypeCombinations; + constructor(expressionTemplate, parameterTypeCombinations) { + this.expressionTemplate = expressionTemplate; + this.parameterTypeCombinations = parameterTypeCombinations; + this.expressionTemplate = expressionTemplate; + } + generateExpressions() { + const generatedExpressions = []; + this.generatePermutations(generatedExpressions, 0, []); + return generatedExpressions; + } + generatePermutations(generatedExpressions, depth, currentParameterTypes) { + if (generatedExpressions.length >= MAX_EXPRESSIONS) { + return; + } + if (depth === this.parameterTypeCombinations.length) { + generatedExpressions.push(new GeneratedExpression(this.expressionTemplate, currentParameterTypes)); + return; + } + // tslint:disable-next-line:prefer-for-of + for (let i = 0; i < this.parameterTypeCombinations[depth].length; ++i) { + // Avoid recursion if no elements can be added. + if (generatedExpressions.length >= MAX_EXPRESSIONS) { + return; + } + const newCurrentParameterTypes = currentParameterTypes.slice(); // clone + newCurrentParameterTypes.push(this.parameterTypeCombinations[depth][i]); + this.generatePermutations(generatedExpressions, depth + 1, newCurrentParameterTypes); + } + } +} +//# sourceMappingURL=CombinatorialGeneratedExpressionFactory.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.js.map new file mode 100644 index 00000000..d8b28550 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CombinatorialGeneratedExpressionFactory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CombinatorialGeneratedExpressionFactory.js","sourceRoot":"","sources":["../../../src/CombinatorialGeneratedExpressionFactory.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAG1D,2DA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AE,KAAK,GAAG,CAAC,EAAE,wBAAwB,CAAC,CAAA;QACtF,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.d.ts new file mode 100644 index 00000000..28ff23fa --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.d.ts @@ -0,0 +1,30 @@ +import Argument from './Argument.js'; +import { Node } from './Ast.js'; +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import { Expression } from './types.js'; +export default class CucumberExpression implements Expression { + private readonly expression; + private readonly parameterTypeRegistry; + private readonly parameterTypes; + private readonly treeRegexp; + readonly ast: Node; + /** + * @param expression + * @param parameterTypeRegistry + */ + constructor(expression: string, parameterTypeRegistry: ParameterTypeRegistry); + private rewriteToRegex; + private static escapeRegex; + private rewriteOptional; + private rewriteAlternation; + private rewriteAlternative; + private rewriteParameter; + private rewriteExpression; + private assertNotEmpty; + private assertNoParameters; + private assertNoOptionals; + match(text: string): readonly Argument[] | null; + get regexp(): RegExp; + get source(): string; +} +//# sourceMappingURL=CucumberExpression.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.d.ts.map new file mode 100644 index 00000000..a3c229ec --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpression.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpression.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,IAAI,EAAY,MAAM,UAAU,CAAA;AAYzC,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAIvC,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,UAAU;IAUzD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IAVxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAoC;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,SAAgB,GAAG,EAAE,IAAI,CAAA;IAEzB;;;OAGG;gBAEgB,UAAU,EAAE,MAAM,EAClB,qBAAqB,EAAE,qBAAqB;IAQ/D,OAAO,CAAC,cAAc;IAoBtB,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,iBAAiB;IAUlB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE,GAAG,IAAI;IAQtD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.js new file mode 100644 index 00000000..ad487016 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.js @@ -0,0 +1,117 @@ +import Argument from './Argument.js'; +import { NodeType } from './Ast.js'; +import CucumberExpressionParser from './CucumberExpressionParser.js'; +import { createAlternativeMayNotBeEmpty, createAlternativeMayNotExclusivelyContainOptionals, createOptionalIsNotAllowedInOptional, createOptionalMayNotBeEmpty, createParameterIsNotAllowedInOptional, createUndefinedParameterType, } from './Errors.js'; +import TreeRegexp from './TreeRegexp.js'; +const ESCAPE_PATTERN = () => /([\\^[({$.|?*+})\]])/g; +export default class CucumberExpression { + expression; + parameterTypeRegistry; + parameterTypes = []; + treeRegexp; + ast; + /** + * @param expression + * @param parameterTypeRegistry + */ + constructor(expression, parameterTypeRegistry) { + this.expression = expression; + this.parameterTypeRegistry = parameterTypeRegistry; + const parser = new CucumberExpressionParser(); + this.ast = parser.parse(expression); + const pattern = this.rewriteToRegex(this.ast); + this.treeRegexp = new TreeRegexp(pattern); + } + rewriteToRegex(node) { + switch (node.type) { + case NodeType.text: + return CucumberExpression.escapeRegex(node.text()); + case NodeType.optional: + return this.rewriteOptional(node); + case NodeType.alternation: + return this.rewriteAlternation(node); + case NodeType.alternative: + return this.rewriteAlternative(node); + case NodeType.parameter: + return this.rewriteParameter(node); + case NodeType.expression: + return this.rewriteExpression(node); + default: + // Can't happen as long as the switch case is exhaustive + throw new Error(node.type); + } + } + static escapeRegex(expression) { + return expression.replace(ESCAPE_PATTERN(), '\\$1'); + } + rewriteOptional(node) { + this.assertNoParameters(node, (astNode) => createParameterIsNotAllowedInOptional(astNode, this.expression)); + this.assertNoOptionals(node, (astNode) => createOptionalIsNotAllowedInOptional(astNode, this.expression)); + this.assertNotEmpty(node, (astNode) => createOptionalMayNotBeEmpty(astNode, this.expression)); + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join(''); + return `(?:${regex})?`; + } + rewriteAlternation(node) { + // Make sure the alternative parts aren't empty and don't contain parameter types + for (const alternative of node.nodes || []) { + if (!alternative.nodes || alternative.nodes.length == 0) { + throw createAlternativeMayNotBeEmpty(alternative, this.expression); + } + this.assertNotEmpty(alternative, (astNode) => createAlternativeMayNotExclusivelyContainOptionals(astNode, this.expression)); + } + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join('|'); + return `(?:${regex})`; + } + rewriteAlternative(node) { + return (node.nodes || []).map((lastNode) => this.rewriteToRegex(lastNode)).join(''); + } + rewriteParameter(node) { + const name = node.text(); + const parameterType = this.parameterTypeRegistry.lookupByTypeName(name); + if (!parameterType) { + throw createUndefinedParameterType(node, this.expression, name); + } + this.parameterTypes.push(parameterType); + const regexps = parameterType.regexpStrings; + if (regexps.length == 1) { + return `(${regexps[0]})`; + } + return `((?:${regexps.join(')|(?:')}))`; + } + rewriteExpression(node) { + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join(''); + return `^${regex}$`; + } + assertNotEmpty(node, createNodeWasNotEmptyException) { + const textNodes = (node.nodes || []).filter((astNode) => NodeType.text == astNode.type); + if (textNodes.length == 0) { + throw createNodeWasNotEmptyException(node); + } + } + assertNoParameters(node, createNodeContainedAParameterError) { + const parameterNodes = (node.nodes || []).filter((astNode) => NodeType.parameter == astNode.type); + if (parameterNodes.length > 0) { + throw createNodeContainedAParameterError(parameterNodes[0]); + } + } + assertNoOptionals(node, createNodeContainedAnOptionalError) { + const parameterNodes = (node.nodes || []).filter((astNode) => NodeType.optional == astNode.type); + if (parameterNodes.length > 0) { + throw createNodeContainedAnOptionalError(parameterNodes[0]); + } + } + match(text) { + const group = this.treeRegexp.match(text); + if (!group) { + return null; + } + return Argument.build(group, this.parameterTypes); + } + get regexp() { + return this.treeRegexp.regexp; + } + get source() { + return this.expression; + } +} +//# sourceMappingURL=CucumberExpression.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.js.map new file mode 100644 index 00000000..4664f122 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpression.js","sourceRoot":"","sources":["../../../src/CucumberExpression.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,EAAQ,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEzC,OAAO,wBAAwB,MAAM,+BAA+B,CAAA;AACpE,OAAO,EACL,8BAA8B,EAC9B,kDAAkD,EAClD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E,CAAC;YAC9B,MAAM,kCAAkC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7D,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,IAAY;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IACnD,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAA;IAC/B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,UAAU,CAAA;IACxB,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.d.ts new file mode 100644 index 00000000..aab86932 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.d.ts @@ -0,0 +1,3 @@ +export default class CucumberExpressionError extends Error { +} +//# sourceMappingURL=CucumberExpressionError.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.d.ts.map new file mode 100644 index 00000000..94200c43 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionError.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpressionError.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,KAAK;CAAG"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.js new file mode 100644 index 00000000..d8c39c19 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.js @@ -0,0 +1,3 @@ +export default class CucumberExpressionError extends Error { +} +//# sourceMappingURL=CucumberExpressionError.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.js.map new file mode 100644 index 00000000..1a726d22 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionError.js","sourceRoot":"","sources":["../../../src/CucumberExpressionError.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,KAAK;CAAG"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.d.ts new file mode 100644 index 00000000..980dce66 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.d.ts @@ -0,0 +1,10 @@ +import GeneratedExpression from './GeneratedExpression.js'; +import ParameterType from './ParameterType.js'; +export default class CucumberExpressionGenerator { + private readonly parameterTypes; + constructor(parameterTypes: () => Iterable>); + generateExpressions(text: string): readonly GeneratedExpression[]; + private createParameterTypeMatchers; + private static createParameterTypeMatchers2; +} +//# sourceMappingURL=CucumberExpressionGenerator.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.d.ts.map new file mode 100644 index 00000000..9d2d10ff --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionGenerator.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpressionGenerator.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAG9C,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAClC,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,MAAM,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAE5E,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,mBAAmB,EAAE;IAgExE,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,MAAM,CAAC,4BAA4B;CAQ5C"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.js new file mode 100644 index 00000000..aa92e376 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.js @@ -0,0 +1,72 @@ +import CombinatorialGeneratedExpressionFactory from './CombinatorialGeneratedExpressionFactory.js'; +import ParameterType from './ParameterType.js'; +import ParameterTypeMatcher from './ParameterTypeMatcher.js'; +export default class CucumberExpressionGenerator { + parameterTypes; + constructor(parameterTypes) { + this.parameterTypes = parameterTypes; + } + generateExpressions(text) { + const parameterTypeCombinations = []; + const parameterTypeMatchers = this.createParameterTypeMatchers(text); + let expressionTemplate = ''; + let pos = 0; + let counter = 0; + while (true) { + let matchingParameterTypeMatchers = []; + for (const parameterTypeMatcher of parameterTypeMatchers) { + const advancedParameterTypeMatcher = parameterTypeMatcher.advanceTo(pos); + if (advancedParameterTypeMatcher.find) { + matchingParameterTypeMatchers.push(advancedParameterTypeMatcher); + } + } + if (matchingParameterTypeMatchers.length > 0) { + matchingParameterTypeMatchers = matchingParameterTypeMatchers.sort(ParameterTypeMatcher.compare); + // Find all the best parameter type matchers, they are all candidates. + const bestParameterTypeMatcher = matchingParameterTypeMatchers[0]; + const bestParameterTypeMatchers = matchingParameterTypeMatchers.filter((m) => ParameterTypeMatcher.compare(m, bestParameterTypeMatcher) === 0); + // Build a list of parameter types without duplicates. The reason there + // might be duplicates is that some parameter types have more than one regexp, + // which means multiple ParameterTypeMatcher objects will have a reference to the + // same ParameterType. + // We're sorting the list so preferential parameter types are listed first. + // Users are most likely to want these, so they should be listed at the top. + let parameterTypes = []; + for (const parameterTypeMatcher of bestParameterTypeMatchers) { + if (parameterTypes.indexOf(parameterTypeMatcher.parameterType) === -1) { + parameterTypes.push(parameterTypeMatcher.parameterType); + } + } + parameterTypes = parameterTypes.sort(ParameterType.compare); + parameterTypeCombinations.push(parameterTypes); + expressionTemplate += escape(text.slice(pos, bestParameterTypeMatcher.start)); + expressionTemplate += `{{${counter++}}}`; + pos = bestParameterTypeMatcher.start + bestParameterTypeMatcher.group.length; + } + else { + break; + } + if (pos >= text.length) { + break; + } + } + expressionTemplate += escape(text.slice(pos)); + return new CombinatorialGeneratedExpressionFactory(expressionTemplate, parameterTypeCombinations).generateExpressions(); + } + createParameterTypeMatchers(text) { + let parameterMatchers = []; + for (const parameterType of this.parameterTypes()) { + if (parameterType.useForSnippets) { + parameterMatchers = parameterMatchers.concat(CucumberExpressionGenerator.createParameterTypeMatchers2(parameterType, text)); + } + } + return parameterMatchers; + } + static createParameterTypeMatchers2(parameterType, text) { + return parameterType.regexpStrings.map((regexp) => new ParameterTypeMatcher(parameterType, regexp, text)); + } +} +function escape(s) { + return s.replace(/\(/g, '\\(').replace(/{/g, '\\{').replace(/\//g, '\\/'); +} +//# sourceMappingURL=CucumberExpressionGenerator.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.js.map new file mode 100644 index 00000000..f400d8d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionGenerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionGenerator.js","sourceRoot":"","sources":["../../../src/CucumberExpressionGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,MAAM,8CAA8C,CAAA;AAElG,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,oBAAoB,MAAM,2BAA2B,CAAA;AAE5D,MAAM,CAAC,OAAO,OAAO,2BAA2B;IACjB;IAA7B,YAA6B,cAAsD;QAAtD,mBAAc,GAAd,cAAc,CAAwC;IAAG,CAAC;IAEhF,mBAAmB,CAAC,IAAY;QACrC,MAAM,yBAAyB,GAAyC,EAAE,CAAA;QAC1E,MAAM,qBAAqB,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAA;QACpE,IAAI,kBAAkB,GAAG,EAAE,CAAA;QAC3B,IAAI,GAAG,GAAG,CAAC,CAAA;QACX,IAAI,OAAO,GAAG,CAAC,CAAA;QAEf,OAAO,IAAI,EAAE,CAAC;YACZ,IAAI,6BAA6B,GAAG,EAAE,CAAA;YAEtC,KAAK,MAAM,oBAAoB,IAAI,qBAAqB,EAAE,CAAC;gBACzD,MAAM,4BAA4B,GAAG,oBAAoB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;gBACxE,IAAI,4BAA4B,CAAC,IAAI,EAAE,CAAC;oBACtC,6BAA6B,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA;gBAClE,CAAC;YACH,CAAC;YAED,IAAI,6BAA6B,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC7C,6BAA6B,GAAG,6BAA6B,CAAC,IAAI,CAChE,oBAAoB,CAAC,OAAO,CAC7B,CAAA;gBAED,sEAAsE;gBACtE,MAAM,wBAAwB,GAAG,6BAA6B,CAAC,CAAC,CAAC,CAAA;gBACjE,MAAM,yBAAyB,GAAG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AAI,iBAAiB,GAA2B,EAAE,CAAA;QAClD,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;YAClD,IAAI,aAAa,CAAC,cAAc,EAAE,CAAC;gBACjC,iBAAiB,GAAG,iBAAiB,CAAC,MAAM,CAC1C,2BAA2B,CAAC,4BAA4B,CAAC,aAAa,EAAE,IAAI,CAAC,CAC9E,CAAA;YACH,CAAC;QACH,CAAC;QACD,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IAEO,MAAM,CAAC,4BAA4B,CACzC,aAAqC,EACrC,IAAY;QAEZ,OAAO,aAAa,CAAC,aAAa,CAAC,GAAG,CACpC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,CAClE,CAAA;IACH,CAAC;CACF;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC3E,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.d.ts new file mode 100644 index 00000000..07e3527b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.d.ts @@ -0,0 +1,5 @@ +import { Node } from './Ast.js'; +export default class CucumberExpressionParser { + parse(expression: string): Node; +} +//# sourceMappingURL=CucumberExpressionParser.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.d.ts.map new file mode 100644 index 00000000..dcdedb74 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionParser.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpressionParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA8B,MAAM,UAAU,CAAA;AAmK3D,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAC3C,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;CAMhC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.js new file mode 100644 index 00000000..66808b03 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.js @@ -0,0 +1,234 @@ +import { Node, NodeType, TokenType } from './Ast.js'; +import CucumberExpressionTokenizer from './CucumberExpressionTokenizer.js'; +import { createAlternationNotAllowedInOptional, createInvalidParameterTypeNameInNode, createMissingEndToken, } from './Errors.js'; +/* + * text := whitespace | ')' | '}' | . + */ +function parseText(expression, tokens, current) { + const token = tokens[current]; + switch (token.type) { + case TokenType.whiteSpace: + case TokenType.text: + case TokenType.endParameter: + case TokenType.endOptional: + return { + consumed: 1, + ast: [new Node(NodeType.text, undefined, token.text, token.start, token.end)], + }; + case TokenType.alternation: + throw createAlternationNotAllowedInOptional(expression, token); + case TokenType.startOfLine: + case TokenType.endOfLine: + case TokenType.beginOptional: + case TokenType.beginParameter: + default: + // If configured correctly this will never happen + return { consumed: 0, ast: [] }; + } +} +/* + * parameter := '{' + name* + '}' + */ +function parseName(expression, tokens, current) { + const token = tokens[current]; + switch (token.type) { + case TokenType.whiteSpace: + case TokenType.text: + return { + consumed: 1, + ast: [new Node(NodeType.text, undefined, token.text, token.start, token.end)], + }; + case TokenType.beginOptional: + case TokenType.endOptional: + case TokenType.beginParameter: + case TokenType.endParameter: + case TokenType.alternation: + throw createInvalidParameterTypeNameInNode(token, expression); + case TokenType.startOfLine: + case TokenType.endOfLine: + default: + // If configured correctly this will never happen + return { consumed: 0, ast: [] }; + } +} +/* + * parameter := '{' + text* + '}' + */ +const parseParameter = parseBetween(NodeType.parameter, TokenType.beginParameter, TokenType.endParameter, [parseName]); +/* + * optional := '(' + option* + ')' + * option := optional | parameter | text + */ +const optionalSubParsers = []; +const parseOptional = parseBetween(NodeType.optional, TokenType.beginOptional, TokenType.endOptional, optionalSubParsers); +optionalSubParsers.push(parseOptional, parseParameter, parseText); +/* + * alternation := alternative* + ( '/' + alternative* )+ + */ +function parseAlternativeSeparator(expression, tokens, current) { + if (!lookingAt(tokens, current, TokenType.alternation)) { + return { consumed: 0, ast: [] }; + } + const token = tokens[current]; + return { + consumed: 1, + ast: [new Node(NodeType.alternative, undefined, token.text, token.start, token.end)], + }; +} +const alternativeParsers = [ + parseAlternativeSeparator, + parseOptional, + parseParameter, + parseText, +]; +/* + * alternation := (?<=left-boundary) + alternative* + ( '/' + alternative* )+ + (?=right-boundary) + * left-boundary := whitespace | } | ^ + * right-boundary := whitespace | { | $ + * alternative: = optional | parameter | text + */ +const parseAlternation = (expression, tokens, current) => { + const previous = current - 1; + if (!lookingAtAny(tokens, previous, [ + TokenType.startOfLine, + TokenType.whiteSpace, + TokenType.endParameter, + ])) { + return { consumed: 0, ast: [] }; + } + const result = parseTokensUntil(expression, alternativeParsers, tokens, current, [ + TokenType.whiteSpace, + TokenType.endOfLine, + TokenType.beginParameter, + ]); + const subCurrent = current + result.consumed; + if (!result.ast.some((astNode) => astNode.type == NodeType.alternative)) { + return { consumed: 0, ast: [] }; + } + const start = tokens[current].start; + const end = tokens[subCurrent].start; + // Does not consume right hand boundary token + return { + consumed: result.consumed, + ast: [ + new Node(NodeType.alternation, splitAlternatives(start, end, result.ast), undefined, start, end), + ], + }; +}; +/* + * cucumber-expression := ( alternation | optional | parameter | text )* + */ +const parseCucumberExpression = parseBetween(NodeType.expression, TokenType.startOfLine, TokenType.endOfLine, [parseAlternation, parseOptional, parseParameter, parseText]); +export default class CucumberExpressionParser { + parse(expression) { + const tokenizer = new CucumberExpressionTokenizer(); + const tokens = tokenizer.tokenize(expression); + const result = parseCucumberExpression(expression, tokens, 0); + return result.ast[0]; + } +} +function parseBetween(type, beginToken, endToken, parsers) { + return (expression, tokens, current) => { + if (!lookingAt(tokens, current, beginToken)) { + return { consumed: 0, ast: [] }; + } + let subCurrent = current + 1; + const result = parseTokensUntil(expression, parsers, tokens, subCurrent, [ + endToken, + TokenType.endOfLine, + ]); + subCurrent += result.consumed; + // endToken not found + if (!lookingAt(tokens, subCurrent, endToken)) { + throw createMissingEndToken(expression, beginToken, endToken, tokens[current]); + } + // consumes endToken + const start = tokens[current].start; + const end = tokens[subCurrent].end; + const consumed = subCurrent + 1 - current; + const ast = [new Node(type, result.ast, undefined, start, end)]; + return { consumed, ast }; + }; +} +function parseToken(expression, parsers, tokens, startAt) { + for (let i = 0; i < parsers.length; i++) { + const parse = parsers[i]; + const result = parse(expression, tokens, startAt); + if (result.consumed != 0) { + return result; + } + } + // If configured correctly this will never happen + throw new Error('No eligible parsers for ' + tokens); +} +function parseTokensUntil(expression, parsers, tokens, startAt, endTokens) { + let current = startAt; + const size = tokens.length; + const ast = []; + while (current < size) { + if (lookingAtAny(tokens, current, endTokens)) { + break; + } + const result = parseToken(expression, parsers, tokens, current); + if (result.consumed == 0) { + // If configured correctly this will never happen + // Keep to avoid infinite loops + throw new Error('No eligible parsers for ' + tokens); + } + current += result.consumed; + ast.push(...result.ast); + } + return { consumed: current - startAt, ast }; +} +function lookingAtAny(tokens, at, tokenTypes) { + return tokenTypes.some((tokenType) => lookingAt(tokens, at, tokenType)); +} +function lookingAt(tokens, at, token) { + if (at < 0) { + // If configured correctly this will never happen + // Keep for completeness + return token == TokenType.startOfLine; + } + if (at >= tokens.length) { + return token == TokenType.endOfLine; + } + return tokens[at].type == token; +} +function splitAlternatives(start, end, alternation) { + const separators = []; + const alternatives = []; + let alternative = []; + alternation.forEach((n) => { + if (NodeType.alternative == n.type) { + separators.push(n); + alternatives.push(alternative); + alternative = []; + } + else { + alternative.push(n); + } + }); + alternatives.push(alternative); + return createAlternativeNodes(start, end, separators, alternatives); +} +function createAlternativeNodes(start, end, separators, alternatives) { + const nodes = []; + for (let i = 0; i < alternatives.length; i++) { + const n = alternatives[i]; + if (i == 0) { + const rightSeparator = separators[i]; + nodes.push(new Node(NodeType.alternative, n, undefined, start, rightSeparator.start)); + } + else if (i == alternatives.length - 1) { + const leftSeparator = separators[i - 1]; + nodes.push(new Node(NodeType.alternative, n, undefined, leftSeparator.end, end)); + } + else { + const leftSeparator = separators[i - 1]; + const rightSeparator = separators[i]; + nodes.push(new Node(NodeType.alternative, n, undefined, leftSeparator.end, rightSeparator.start)); + } + } + return nodes; +} +//# sourceMappingURL=CucumberExpressionParser.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.js.map new file mode 100644 index 00000000..fbce0c39 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionParser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionParser.js","sourceRoot":"","sources":["../../../src/CucumberExpressionParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAS,SAAS,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,2BAA2B,MAAM,kCAAkC,CAAA;AAC1E,OAAO,EACL,qCAAqC,EACrC,oCAAoC,EACpC,qBAAqB,GACtB,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,SAAS,SAAS,CAAC,UAAkB,EAAE,MAAwB,EAAE,OAAe;IAC9E,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;IAC7B,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,SAAS,CAAC,UAAU,CAAC;QAC1B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,CAAC,CAAA;YACvC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;QAClF,CAAC;aAAM,CAAC;YACN,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;YACvC,MAAM,cAAc,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;YACpC,KAAK,CAAC,IAAI,CACR,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,CACtF,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.d.ts new file mode 100644 index 00000000..f58b05de --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.d.ts @@ -0,0 +1,5 @@ +import { Token } from './Ast.js'; +export default class CucumberExpressionTokenizer { + tokenize(expression: string): readonly Token[]; +} +//# sourceMappingURL=CucumberExpressionTokenizer.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.d.ts.map new file mode 100644 index 00000000..7e76f67a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTokenizer.d.ts","sourceRoot":"","sources":["../../../src/CucumberExpressionTokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,UAAU,CAAA;AAG3C,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAC9C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,KAAK,EAAE;CA4E/C"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.js new file mode 100644 index 00000000..de10a573 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.js @@ -0,0 +1,72 @@ +import { Token, TokenType } from './Ast.js'; +import { createCantEscaped, createTheEndOfLIneCanNotBeEscaped } from './Errors.js'; +export default class CucumberExpressionTokenizer { + tokenize(expression) { + const codePoints = Array.from(expression); + const tokens = []; + let buffer = []; + let previousTokenType = TokenType.startOfLine; + let treatAsText = false; + let escaped = 0; + let bufferStartIndex = 0; + function convertBufferToToken(tokenType) { + let escapeTokens = 0; + if (tokenType == TokenType.text) { + escapeTokens = escaped; + escaped = 0; + } + const consumedIndex = bufferStartIndex + buffer.length + escapeTokens; + const t = new Token(tokenType, buffer.join(''), bufferStartIndex, consumedIndex); + buffer = []; + bufferStartIndex = consumedIndex; + return t; + } + function tokenTypeOf(codePoint, treatAsText) { + if (!treatAsText) { + return Token.typeOf(codePoint); + } + if (Token.canEscape(codePoint)) { + return TokenType.text; + } + throw createCantEscaped(expression, bufferStartIndex + buffer.length + escaped); + } + function shouldCreateNewToken(previousTokenType, currentTokenType) { + if (currentTokenType != previousTokenType) { + return true; + } + return currentTokenType != TokenType.whiteSpace && currentTokenType != TokenType.text; + } + if (codePoints.length == 0) { + tokens.push(new Token(TokenType.startOfLine, '', 0, 0)); + } + codePoints.forEach((codePoint) => { + if (!treatAsText && Token.isEscapeCharacter(codePoint)) { + escaped++; + treatAsText = true; + return; + } + const currentTokenType = tokenTypeOf(codePoint, treatAsText); + treatAsText = false; + if (shouldCreateNewToken(previousTokenType, currentTokenType)) { + const token = convertBufferToToken(previousTokenType); + previousTokenType = currentTokenType; + buffer.push(codePoint); + tokens.push(token); + } + else { + previousTokenType = currentTokenType; + buffer.push(codePoint); + } + }); + if (buffer.length > 0) { + const token = convertBufferToToken(previousTokenType); + tokens.push(token); + } + if (treatAsText) { + throw createTheEndOfLIneCanNotBeEscaped(expression); + } + tokens.push(new Token(TokenType.endOfLine, '', codePoints.length, codePoints.length)); + return tokens; + } +} +//# sourceMappingURL=CucumberExpressionTokenizer.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.js.map new file mode 100644 index 00000000..6d0101d7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/CucumberExpressionTokenizer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTokenizer.js","sourceRoot":"","sources":["../../../src/CucumberExpressionTokenizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAA;AAElF,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAC9C,QAAQ,CAAC,UAAkB;QACzB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACzC,MAAM,MAAM,GAAiB,EAAE,CAAA;QAC/B,IAAI,MAAM,GAAkB,EAAE,CAAA;QAC9B,IAAI,iBAAiB,GAAG,SAAS,CAAC,WAAW,CAAA;QAC7C,IAAI,WAAW,GAAG,KAAK,CAAA;QACvB,IAAI,OAAO,GAAG,CAAC,CAAA;QACf,IAAI,gBAAgB,GAAG,CAAC,CAAA;QAExB,SAAS,oBAAoB,CAAC,SAAoB;YAChD,IAAI,YAAY,GAAG,CAAC,CAAA;YACpB,IAAI,SAAS,IAAI,SAAS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YAC/B,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;gBACvD,OAAO,EAAE,CAAA;gBACT,WAAW,GAAG,IAAI,CAAA;gBAClB,OAAM;YACR,CAAC;YACD,MAAM,gBAAgB,GAAG,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;YAC5D,WAAW,GAAG,KAAK,CAAA;YAEnB,IAAI,oBAAoB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,EAAE,CAAC;gBAC9D,MAAM,KAAK,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;gBACrD,iBAAiB,GAAG,gBAAgB,CAAA;gBACpC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBACtB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACpB,CAAC;iBAAM,CAAC;gBACN,iBAAiB,GAAG,gBAAgB,CAAA;gBACpC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACxB,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;YACrD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpB,CAAC;QAED,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,iCAAiC,CAAC,UAAU,CAAC,CAAA;QACrD,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;QACrF,OAAO,MAAM,CAAA;IACf,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.d.ts new file mode 100644 index 00000000..3ec2128d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.d.ts @@ -0,0 +1,25 @@ +import { Node, Token, TokenType } from './Ast.js'; +import CucumberExpressionError from './CucumberExpressionError.js'; +import GeneratedExpression from './GeneratedExpression.js'; +import ParameterType from './ParameterType.js'; +export declare function createAlternativeMayNotExclusivelyContainOptionals(node: Node, expression: string): CucumberExpressionError; +export declare function createAlternativeMayNotBeEmpty(node: Node, expression: string): CucumberExpressionError; +export declare function createOptionalMayNotBeEmpty(node: Node, expression: string): CucumberExpressionError; +export declare function createParameterIsNotAllowedInOptional(node: Node, expression: string): CucumberExpressionError; +export declare function createOptionalIsNotAllowedInOptional(node: Node, expression: string): CucumberExpressionError; +export declare function createTheEndOfLIneCanNotBeEscaped(expression: string): CucumberExpressionError; +export declare function createMissingEndToken(expression: string, beginToken: TokenType, endToken: TokenType, current: Token): CucumberExpressionError; +export declare function createAlternationNotAllowedInOptional(expression: string, current: Token): CucumberExpressionError; +export declare function createCantEscaped(expression: string, index: number): CucumberExpressionError; +export declare function createInvalidParameterTypeNameInNode(token: Token, expression: string): CucumberExpressionError; +export declare class AmbiguousParameterTypeError extends CucumberExpressionError { + static forRegExp(parameterTypeRegexp: string, expressionRegexp: RegExp, parameterTypes: readonly ParameterType[], generatedExpressions: readonly GeneratedExpression[]): AmbiguousParameterTypeError; + static _parameterTypeNames(parameterTypes: readonly ParameterType[]): string; + static _expressions(generatedExpressions: readonly GeneratedExpression[]): string; +} +export declare class UndefinedParameterTypeError extends CucumberExpressionError { + readonly undefinedParameterTypeName: string; + constructor(undefinedParameterTypeName: string, message: string); +} +export declare function createUndefinedParameterType(node: Node, expression: string, undefinedParameterTypeName: string): UndefinedParameterTypeError; +//# sourceMappingURL=Errors.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.d.ts.map new file mode 100644 index 00000000..3e9a8b30 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,IAAI,EAAuB,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAA;AAClE,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,wBAAgB,kDAAkD,CAChE,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GACjB,uBAAuB,CAUzB;AACD,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GACjB,uBAAuB,CAUzB;AACD,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GACjB,uBAAuB,CAUzB;AACD,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GACjB,uBAAuB,CAUzB;AAED,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GACjB,uBAAuB,CAUzB;AAED,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,MAAM,GAAG,uBAAuB,CAW7F;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,SAAS,EACrB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,KAAK,2BAcf;AAED,wBAAgB,qCAAqC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,2BAUvF;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,2BAUlE;AAED,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,2BAUpF;AAqCD,qBAAa,2BAA4B,SAAQ,uBAAuB;WACxD,SAAS,CACrB,mBAAmB,EAAE,MAAM,EAC3B,gBAAgB,EAAE,MAAM,EACxB,cAAc,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE,EACjD,oBAAoB,EAAE,SAAS,mBAAmB,EAAE;WAiBxC,mBAAmB,CAAC,cAAc,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE;WAIrE,YAAY,CAAC,oBAAoB,EAAE,SAAS,mBAAmB,EAAE;CAGhF;AAED,qBAAa,2BAA4B,SAAQ,uBAAuB;aAEpD,0BAA0B,EAAE,MAAM;gBAAlC,0BAA0B,EAAE,MAAM,EAClD,OAAO,EAAE,MAAM;CAIlB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,0BAA0B,EAAE,MAAM,+BAYnC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.js new file mode 100644 index 00000000..1925a2af --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.js @@ -0,0 +1,94 @@ +import { purposeOf, symbolOf } from './Ast.js'; +import CucumberExpressionError from './CucumberExpressionError.js'; +export function createAlternativeMayNotExclusivelyContainOptionals(node, expression) { + return new CucumberExpressionError(message(node.start, expression, pointAtLocated(node), 'An alternative may not exclusively contain optionals', "If you did not mean to use an optional you can use '\\(' to escape the '('")); +} +export function createAlternativeMayNotBeEmpty(node, expression) { + return new CucumberExpressionError(message(node.start, expression, pointAtLocated(node), 'Alternative may not be empty', "If you did not mean to use an alternative you can use '\\/' to escape the '/'")); +} +export function createOptionalMayNotBeEmpty(node, expression) { + return new CucumberExpressionError(message(node.start, expression, pointAtLocated(node), 'An optional must contain some text', "If you did not mean to use an optional you can use '\\(' to escape the '('")); +} +export function createParameterIsNotAllowedInOptional(node, expression) { + return new CucumberExpressionError(message(node.start, expression, pointAtLocated(node), 'An optional may not contain a parameter type', "If you did not mean to use an parameter type you can use '\\{' to escape the '{'")); +} +export function createOptionalIsNotAllowedInOptional(node, expression) { + return new CucumberExpressionError(message(node.start, expression, pointAtLocated(node), 'An optional may not contain an other optional', "If you did not mean to use an optional type you can use '\\(' to escape the '('. For more complicated expressions consider using a regular expression instead.")); +} +export function createTheEndOfLIneCanNotBeEscaped(expression) { + const index = Array.from(expression).length - 1; + return new CucumberExpressionError(message(index, expression, pointAt(index), 'The end of line can not be escaped', "You can use '\\\\' to escape the '\\'")); +} +export function createMissingEndToken(expression, beginToken, endToken, current) { + const beginSymbol = symbolOf(beginToken); + const endSymbol = symbolOf(endToken); + const purpose = purposeOf(beginToken); + return new CucumberExpressionError(message(current.start, expression, pointAtLocated(current), `The '${beginSymbol}' does not have a matching '${endSymbol}'`, `If you did not intend to use ${purpose} you can use '\\${beginSymbol}' to escape the ${purpose}`)); +} +export function createAlternationNotAllowedInOptional(expression, current) { + return new CucumberExpressionError(message(current.start, expression, pointAtLocated(current), 'An alternation can not be used inside an optional', "If you did not mean to use an alternation you can use '\\/' to escape the '/'. Otherwise rephrase your expression or consider using a regular expression instead.")); +} +export function createCantEscaped(expression, index) { + return new CucumberExpressionError(message(index, expression, pointAt(index), "Only the characters '{', '}', '(', ')', '\\', '/' and whitespace can be escaped", "If you did mean to use an '\\' you can use '\\\\' to escape it")); +} +export function createInvalidParameterTypeNameInNode(token, expression) { + return new CucumberExpressionError(message(token.start, expression, pointAtLocated(token), "Parameter names may not contain '{', '}', '(', ')', '\\' or '/'", 'Did you mean to use a regular expression?')); +} +function message(index, expression, pointer, problem, solution) { + return `This Cucumber Expression has a problem at column ${index + 1}: + +${expression} +${pointer} +${problem}. +${solution}`; +} +function pointAt(index) { + const pointer = []; + for (let i = 0; i < index; i++) { + pointer.push(' '); + } + pointer.push('^'); + return pointer.join(''); +} +function pointAtLocated(node) { + const pointer = [pointAt(node.start)]; + if (node.start + 1 < node.end) { + for (let i = node.start + 1; i < node.end - 1; i++) { + pointer.push('-'); + } + pointer.push('^'); + } + return pointer.join(''); +} +export class AmbiguousParameterTypeError extends CucumberExpressionError { + static forRegExp(parameterTypeRegexp, expressionRegexp, parameterTypes, generatedExpressions) { + return new this(`Your Regular Expression ${expressionRegexp} +matches multiple parameter types with regexp ${parameterTypeRegexp}: + ${this._parameterTypeNames(parameterTypes)} + +I couldn't decide which one to use. You have two options: + +1) Use a Cucumber Expression instead of a Regular Expression. Try one of these: + ${this._expressions(generatedExpressions)} + +2) Make one of the parameter types preferential and continue to use a Regular Expression. +`); + } + static _parameterTypeNames(parameterTypes) { + return parameterTypes.map((p) => `{${p.name}}`).join('\n '); + } + static _expressions(generatedExpressions) { + return generatedExpressions.map((e) => e.source).join('\n '); + } +} +export class UndefinedParameterTypeError extends CucumberExpressionError { + undefinedParameterTypeName; + constructor(undefinedParameterTypeName, message) { + super(message); + this.undefinedParameterTypeName = undefinedParameterTypeName; + } +} +export function createUndefinedParameterType(node, expression, undefinedParameterTypeName) { + return new UndefinedParameterTypeError(undefinedParameterTypeName, message(node.start, expression, pointAtLocated(node), `Undefined parameter type '${undefinedParameterTypeName}'`, `Please register a ParameterType for '${undefinedParameterTypeName}'`)); +} +//# sourceMappingURL=Errors.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.js.map new file mode 100644 index 00000000..f642fa8f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAE,QAAQ,EAAoB,MAAM,UAAU,CAAA;AAC/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAA;AAIlE,MAAM,UAAU,kDAAkD,CAChE,IAAU,EACV,UAAkB;IAElB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AAC,mBAAmB,CAAC,cAAiD;QACjF,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/D,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,oBAAoD;QAC7E,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChE,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,uBAAuB;IAEpD;IADlB,YACkB,0BAAkC,EAClD,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAA;QAHE,+BAA0B,GAA1B,0BAA0B,CAAQ;IAIpD,CAAC;CACF;AAED,MAAM,UAAU,4BAA4B,CAC1C,IAAU,EACV,UAAkB,EAClB,0BAAkC;IAElC,OAAO,IAAI,2BAA2B,CACpC,0BAA0B,EAC1B,OAAO,CACL,IAAI,CAAC,KAAK,EACV,UAAU,EACV,cAAc,CAAC,IAAI,CAAC,EACpB,6BAA6B,0BAA0B,GAAG,EAC1D,wCAAwC,0BAA0B,GAAG,CACtE,CACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.d.ts new file mode 100644 index 00000000..ae75fd08 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.d.ts @@ -0,0 +1,8 @@ +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import { Expression } from './types.js'; +export default class ExpressionFactory { + private readonly parameterTypeRegistry; + constructor(parameterTypeRegistry: ParameterTypeRegistry); + createExpression(expression: string | RegExp): Expression; +} +//# sourceMappingURL=ExpressionFactory.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.d.ts.map new file mode 100644 index 00000000..01f33472 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpressionFactory.d.ts","sourceRoot":"","sources":["../../../src/ExpressionFactory.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACjB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAEzE,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU;CAKjE"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.js new file mode 100644 index 00000000..aa27cf07 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.js @@ -0,0 +1,14 @@ +import CucumberExpression from './CucumberExpression.js'; +import RegularExpression from './RegularExpression.js'; +export default class ExpressionFactory { + parameterTypeRegistry; + constructor(parameterTypeRegistry) { + this.parameterTypeRegistry = parameterTypeRegistry; + } + createExpression(expression) { + return typeof expression === 'string' + ? new CucumberExpression(expression, this.parameterTypeRegistry) + : new RegularExpression(expression, this.parameterTypeRegistry); + } +} +//# sourceMappingURL=ExpressionFactory.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.js.map new file mode 100644 index 00000000..9f72c88c --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ExpressionFactory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpressionFactory.js","sourceRoot":"","sources":["../../../src/ExpressionFactory.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,yBAAyB,CAAA;AAExD,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AAGtD,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACA;IAApC,YAAoC,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAG,CAAC;IAE7E,gBAAgB,CAAC,UAA2B;QACjD,OAAO,OAAO,UAAU,KAAK,QAAQ;YACnC,CAAC,CAAC,IAAI,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,qBAAqB,CAAC;YAChE,CAAC,CAAC,IAAI,iBAAiB,CAAC,UAAU,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;IACnE,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.d.ts new file mode 100644 index 00000000..da55600b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.d.ts @@ -0,0 +1,19 @@ +import ParameterType from './ParameterType.js'; +import { ParameterInfo } from './types.js'; +export default class GeneratedExpression { + private readonly expressionTemplate; + readonly parameterTypes: readonly ParameterType[]; + constructor(expressionTemplate: string, parameterTypes: readonly ParameterType[]); + get source(): string; + /** + * Returns an array of parameter names to use in generated function/method signatures + * + * @returns {ReadonlyArray.} + */ + get parameterNames(): readonly string[]; + /** + * Returns an array of ParameterInfo to use in generated function/method signatures + */ + get parameterInfos(): readonly ParameterInfo[]; +} +//# sourceMappingURL=GeneratedExpression.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.d.ts.map new file mode 100644 index 00000000..4fdd5888 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeneratedExpression.d.ts","sourceRoot":"","sources":["../../../src/GeneratedExpression.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAEpC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;aACnB,cAAc,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE;gBADhD,kBAAkB,EAAE,MAAM,EAC3B,cAAc,EAAE,SAAS,aAAa,CAAC,OAAO,CAAC,EAAE;IAGnE,IAAI,MAAM,WAET;IAED;;;;OAIG;IACH,IAAI,cAAc,IAAI,SAAS,MAAM,EAAE,CAEtC;IAED;;OAEG;IACH,IAAI,cAAc,IAAI,SAAS,aAAa,EAAE,CAG7C;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.js new file mode 100644 index 00000000..2c541dc5 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.js @@ -0,0 +1,56 @@ +export default class GeneratedExpression { + expressionTemplate; + parameterTypes; + constructor(expressionTemplate, parameterTypes) { + this.expressionTemplate = expressionTemplate; + this.parameterTypes = parameterTypes; + } + get source() { + return format(this.expressionTemplate, ...this.parameterTypes.map((t) => t.name || '')); + } + /** + * Returns an array of parameter names to use in generated function/method signatures + * + * @returns {ReadonlyArray.} + */ + get parameterNames() { + return this.parameterInfos.map((i) => `${i.name}${i.count === 1 ? '' : i.count.toString()}`); + } + /** + * Returns an array of ParameterInfo to use in generated function/method signatures + */ + get parameterInfos() { + const usageByTypeName = {}; + return this.parameterTypes.map((t) => getParameterInfo(t, usageByTypeName)); + } +} +function getParameterInfo(parameterType, usageByName) { + const name = parameterType.name || ''; + let counter = usageByName[name]; + counter = counter ? counter + 1 : 1; + usageByName[name] = counter; + let type; + if (parameterType.type) { + if (typeof parameterType.type === 'string') { + type = parameterType.type; + } + else if ('name' in parameterType.type) { + type = parameterType.type.name; + } + else { + type = null; + } + } + else { + type = null; + } + return { + type, + name, + count: counter, + }; +} +function format(pattern, ...args) { + return pattern.replace(/{(\d+)}/g, (match, number) => args[number]); +} +//# sourceMappingURL=GeneratedExpression.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.js.map new file mode 100644 index 00000000..f30b5763 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GeneratedExpression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GeneratedExpression.js","sourceRoot":"","sources":["../../../src/GeneratedExpression.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAEnB;IACD;IAFlB,YACmB,kBAA0B,EAC3B,cAAiD;QADhD,uBAAkB,GAAlB,kBAAkB,CAAQ;QAC3B,mBAAc,GAAd,cAAc,CAAmC;IAChE,CAAC;IAEJ,IAAI,MAAM;QACR,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAA;IACzF,CAAC;IAED;;;;OAIG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,C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CAAA;AACrE,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.d.ts new file mode 100644 index 00000000..f4f4bbfc --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.d.ts @@ -0,0 +1,20 @@ +export default class Group { + readonly value: string; + readonly start: number | undefined; + readonly end: number | undefined; + /** + * A groups children. + * + * There are either one or more children or the attribute is undefined. + */ + readonly children: readonly Group[] | undefined; + constructor(value: string, start: number | undefined, end: number | undefined, + /** + * A groups children. + * + * There are either one or more children or the attribute is undefined. + */ + children: readonly Group[] | undefined); + get values(): string[] | null; +} +//# sourceMappingURL=Group.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.d.ts.map new file mode 100644 index 00000000..e735b88e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../src/Group.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,KAAK;aAEN,KAAK,EAAE,MAAM;aACb,KAAK,EAAE,MAAM,GAAG,SAAS;aACzB,GAAG,EAAE,MAAM,GAAG,SAAS;IACvC;;;;OAIG;aACa,QAAQ,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS;gBARtC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,GAAG,EAAE,MAAM,GAAG,SAAS;IACvC;;;;OAIG;IACa,QAAQ,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS;IAGxD,IAAI,MAAM,IAAI,MAAM,EAAE,GAAG,IAAI,CAE5B;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.js new file mode 100644 index 00000000..fe8ca0e8 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.js @@ -0,0 +1,22 @@ +export default class Group { + value; + start; + end; + children; + constructor(value, start, end, + /** + * A groups children. + * + * There are either one or more children or the attribute is undefined. + */ + children) { + this.value = value; + this.start = start; + this.end = end; + this.children = children; + } + get values() { + return (this.children === undefined ? [this] : this.children).map((g) => g.value); + } +} +//# sourceMappingURL=Group.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.js.map new file mode 100644 index 00000000..eb6b23f9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/Group.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../src/Group.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,KAAK;IAEN;IACA;IACA;IAMA;IATlB,YACkB,KAAa,EACb,KAAyB,EACzB,GAAuB;IACvC;;;;OAIG;IACa,QAAsC;QARtC,UAAK,GAAL,KAAK,CAAQ;QACb,UAAK,GAAL,KAAK,CAAoB;QACzB,QAAG,GAAH,GAAG,CAAoB;QAMvB,aAAQ,GAAR,QAAQ,CAA8B;IACrD,CAAC;IAEJ,IAAI,MAAM;QACR,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IACnF,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.d.ts new file mode 100644 index 00000000..d929deb1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.d.ts @@ -0,0 +1,13 @@ +import { RegExpExecArray } from 'regexp-match-indices'; +import Group from './Group.js'; +export default class GroupBuilder { + source: string; + capturing: boolean; + private readonly groupBuilders; + add(groupBuilder: GroupBuilder): void; + build(match: RegExpExecArray, nextGroupIndex: () => number): Group; + setNonCapturing(): void; + get children(): GroupBuilder[]; + moveChildrenTo(groupBuilder: GroupBuilder): void; +} +//# sourceMappingURL=GroupBuilder.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.d.ts.map new file mode 100644 index 00000000..2fd69d03 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupBuilder.d.ts","sourceRoot":"","sources":["../../../src/GroupBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,MAAM,YAAY,CAAA;AAE9B,MAAM,CAAC,OAAO,OAAO,YAAY;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,UAAO;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;IAE5C,GAAG,CAAC,YAAY,EAAE,YAAY;IAI9B,KAAK,CAAC,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,GAAG,KAAK;IAUlE,eAAe;IAItB,IAAI,QAAQ,mBAEX;IAEM,cAAc,CAAC,YAAY,EAAE,YAAY;CAGjD"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.js new file mode 100644 index 00000000..99e450c5 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.js @@ -0,0 +1,28 @@ +import Group from './Group.js'; +export default class GroupBuilder { + source; + capturing = true; + groupBuilders = []; + add(groupBuilder) { + this.groupBuilders.push(groupBuilder); + } + build(match, nextGroupIndex) { + const groupIndex = nextGroupIndex(); + const children = this.groupBuilders.map((gb) => gb.build(match, nextGroupIndex)); + const value = match[groupIndex]; + const index = match.indices[groupIndex]; + const start = index ? index[0] : undefined; + const end = index ? index[1] : undefined; + return new Group(value, start, end, children.length === 0 ? undefined : children); + } + setNonCapturing() { + this.capturing = false; + } + get children() { + return this.groupBuilders; + } + moveChildrenTo(groupBuilder) { + this.groupBuilders.forEach((child) => groupBuilder.add(child)); + } +} +//# sourceMappingURL=GroupBuilder.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.js.map new file mode 100644 index 00000000..a476bcc7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/GroupBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GroupBuilder.js","sourceRoot":"","sources":["../../../src/GroupBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,YAAY,CAAA;AAE9B,MAAM,CAAC,OAAO,OAAO,YAAY;IACxB,MAAM,CAAQ;IACd,SAAS,GAAG,IAAI,CAAA;IACN,aAAa,GAAmB,EAAE,CAAA;IAE5C,GAAG,CAAC,YAA0B;QACnC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACvC,CAAC;IAEM,KAAK,CAAC,KAAsB,EAAE,cAA4B;QAC/D,MAAM,UAAU,GAAG,cAAc,EAAE,CAAA;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAA;QAChF,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,CAAA;QAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QACvC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAC1C,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACxC,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IACnF,CAAC;IAEM,eAAe;QACpB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;IACxB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,aAAa,CAAA;IAC3B,CAAC;IAEM,cAAc,CAAC,YAA0B;QAC9C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAA;IAChE,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.d.ts new file mode 100644 index 00000000..e11660f1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.d.ts @@ -0,0 +1,32 @@ +interface Constructor { + new (...args: unknown[]): T; + prototype: T; +} +type Factory = (...args: unknown[]) => T; +export type RegExps = StringOrRegExp | readonly StringOrRegExp[]; +export type StringOrRegExp = string | RegExp; +export default class ParameterType { + readonly name: string | undefined; + readonly type: Constructor | Factory | null; + readonly useForSnippets?: boolean | undefined; + readonly preferForRegexpMatch?: boolean | undefined; + readonly builtin?: boolean | undefined; + private transformFn; + static compare(pt1: ParameterType, pt2: ParameterType): number; + static checkParameterTypeName(typeName: string): void; + static isValidParameterTypeName(typeName: string): boolean; + regexpStrings: readonly string[]; + /** + * @param name {String} the name of the type + * @param regexps {Array.,RegExp,String} that matche the type + * @param type {Function} the prototype (constructor) of the type. May be null. + * @param transform {Function} function transforming string to another type. May be null. + * @param useForSnippets {boolean} true if this should be used for snippets. Defaults to true. + * @param preferForRegexpMatch {boolean} true if this is a preferential type. Defaults to false. + * @param builtin whether or not this is a built-in type + */ + constructor(name: string | undefined, regexps: RegExps, type: Constructor | Factory | null, transform?: (...match: string[]) => T | PromiseLike, useForSnippets?: boolean | undefined, preferForRegexpMatch?: boolean | undefined, builtin?: boolean | undefined); + transform(thisObj: unknown, groupValues: string[] | null): any; +} +export {}; +//# sourceMappingURL=ParameterType.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.d.ts.map new file mode 100644 index 00000000..131dba66 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterType.d.ts","sourceRoot":"","sources":["../../../src/ParameterType.ts"],"names":[],"mappings":"AAKA,UAAU,WAAW,CAAC,CAAC;IACrB,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC3B,SAAS,EAAE,CAAC,CAAA;CACb;AAED,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;AAE3C,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,SAAS,cAAc,EAAE,CAAA;AAEhE,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5C,MAAM,CAAC,OAAO,OAAO,aAAa,CAAC,CAAC;aAsChB,IAAI,EAAE,MAAM,GAAG,SAAS;aAExB,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;aAExC,cAAc,CAAC,EAAE,OAAO;aACxB,oBAAoB,CAAC,EAAE,OAAO;aAC9B,OAAO,CAAC,EAAE,OAAO;IA3CnC,OAAO,CAAC,WAAW,CAAqD;WAE1D,OAAO,CAAC,GAAG,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,OAAO,CAAC;WAUhE,sBAAsB,CAAC,QAAQ,EAAE,MAAM;WAQvC,wBAAwB,CAAC,QAAQ,EAAE,MAAM;IAKhD,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;IAEvC;;;;;;;;OAQG;gBAEe,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,OAAO,EACA,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,EACxD,SAAS,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,EACtC,cAAc,CAAC,EAAE,OAAO,YAAA,EACxB,oBAAoB,CAAC,EAAE,OAAO,YAAA,EAC9B,OAAO,CAAC,EAAE,OAAO,YAAA;IAoB5B,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI;CAGhE"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.js new file mode 100644 index 00000000..421e83fd --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.js @@ -0,0 +1,95 @@ +import CucumberExpressionError from './CucumberExpressionError.js'; +const ILLEGAL_PARAMETER_NAME_PATTERN = /([[\]()$.|?*+])/; +const UNESCAPE_PATTERN = () => /(\\([[$.|?*+\]]))/g; +export default class ParameterType { + name; + type; + useForSnippets; + preferForRegexpMatch; + builtin; + transformFn; + static compare(pt1, pt2) { + if (pt1.preferForRegexpMatch && !pt2.preferForRegexpMatch) { + return -1; + } + if (pt2.preferForRegexpMatch && !pt1.preferForRegexpMatch) { + return 1; + } + return (pt1.name || '').localeCompare(pt2.name || ''); + } + static checkParameterTypeName(typeName) { + if (!this.isValidParameterTypeName(typeName)) { + throw new CucumberExpressionError(`Illegal character in parameter name {${typeName}}. Parameter names may not contain '{', '}', '(', ')', '\\' or '/'`); + } + } + static isValidParameterTypeName(typeName) { + const unescapedTypeName = typeName.replace(UNESCAPE_PATTERN(), '$2'); + return !unescapedTypeName.match(ILLEGAL_PARAMETER_NAME_PATTERN); + } + regexpStrings; + /** + * @param name {String} the name of the type + * @param regexps {Array.,RegExp,String} that matche the type + * @param type {Function} the prototype (constructor) of the type. May be null. + * @param transform {Function} function transforming string to another type. May be null. + * @param useForSnippets {boolean} true if this should be used for snippets. Defaults to true. + * @param preferForRegexpMatch {boolean} true if this is a preferential type. Defaults to false. + * @param builtin whether or not this is a built-in type + */ + constructor(name, regexps, type, transform, useForSnippets, preferForRegexpMatch, builtin) { + this.name = name; + this.type = type; + this.useForSnippets = useForSnippets; + this.preferForRegexpMatch = preferForRegexpMatch; + this.builtin = builtin; + if (transform === undefined) { + transform = (s) => s; + } + if (useForSnippets === undefined) { + this.useForSnippets = true; + } + if (preferForRegexpMatch === undefined) { + this.preferForRegexpMatch = false; + } + if (name) { + ParameterType.checkParameterTypeName(name); + } + this.regexpStrings = stringArray(regexps); + this.transformFn = transform; + } + transform(thisObj, groupValues) { + return this.transformFn.apply(thisObj, groupValues); + } +} +function stringArray(regexps) { + const array = Array.isArray(regexps) ? regexps : [regexps]; + return array.map((r) => (r instanceof RegExp ? regexpSource(r) : r)); +} +function regexpSource(regexp) { + const flags = regexpFlags(regexp); + for (const flag of ['g', 'i', 'm', 'y']) { + if (flags.indexOf(flag) !== -1) { + throw new CucumberExpressionError(`ParameterType Regexps can't use flag '${flag}'`); + } + } + return regexp.source; +} +// Backport RegExp.flags for Node 4.x +// https://github.com/nodejs/node/issues/8390 +function regexpFlags(regexp) { + let flags = regexp.flags; + if (flags === undefined) { + flags = ''; + if (regexp.ignoreCase) { + flags += 'i'; + } + if (regexp.global) { + flags += 'g'; + } + if (regexp.multiline) { + flags += 'm'; + } + } + return flags; +} +//# sourceMappingURL=ParameterType.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.js.map new file mode 100644 index 00000000..bb377636 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterType.js","sourceRoot":"","sources":["../../../src/ParameterType.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,8BAA8B,CAAA;AAElE,MAAM,8BAA8B,GAAG,iBAAiB,CAAA;AACxD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,oBAAoB,CAAA;AAanD,MAAM,CAAC,OAAO,OAAO,aAAa;IAsCd;IAEA;IAEA;IACA;IACA;IA3CV,WAAW,CAAqD;IAEjE,MAAM,CAAC,OAAO,CAAC,GAA2B,EAAE,GAA2B;QAC5E,IAAI,GAAG,CAAC,oBAAoB,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;YAC1D,OAAO,CAAC,CAAC,CAAA;QACX,CAAC;QACD,IAAI,GAAG,CAAC,oBAAoB,IAAI,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;YAC1D,OAAO,CAAC,CAAA;QACV,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;IACvD,CAAC;IAEM,MAAM,CAAC,sBAAsB,CAAC,QAAgB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AAI,GAAG,CAAA;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.d.ts new file mode 100644 index 00000000..67de4fca --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.d.ts @@ -0,0 +1,18 @@ +import ParameterType from './ParameterType.js'; +export default class ParameterTypeMatcher { + readonly parameterType: ParameterType; + private readonly regexpString; + private readonly text; + private matchPosition; + private readonly match; + constructor(parameterType: ParameterType, regexpString: string, text: string, matchPosition?: number); + advanceTo(newMatchPosition: number): ParameterTypeMatcher; + get find(): boolean | RegExpMatchArray | null; + get start(): number; + get fullWord(): true | RegExpMatchArray | null; + get matchStartWord(): true | RegExpMatchArray | null; + get matchEndWord(): true | RegExpMatchArray | null; + get group(): string; + static compare(a: ParameterTypeMatcher, b: ParameterTypeMatcher): number; +} +//# sourceMappingURL=ParameterTypeMatcher.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.d.ts.map new file mode 100644 index 00000000..6801207f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeMatcher.d.ts","sourceRoot":"","sources":["../../../src/ParameterTypeMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,MAAM,CAAC,OAAO,OAAO,oBAAoB;aAIrB,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC;IACrD,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,aAAa;IANvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwB;gBAG5B,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,EACpC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACrB,aAAa,GAAE,MAAU;IAM5B,SAAS,CAAC,gBAAgB,EAAE,MAAM;IAsBzC,IAAI,IAAI,sCAEP;IAED,IAAI,KAAK,WAGR;IAED,IAAI,QAAQ,mCAEX;IAED,IAAI,cAAc,mCAEjB;IAED,IAAI,YAAY,mCAMf;IAED,IAAI,KAAK,WAGR;WAEa,OAAO,CAAC,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,oBAAoB;CAWvE"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.js new file mode 100644 index 00000000..5698d993 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.js @@ -0,0 +1,60 @@ +export default class ParameterTypeMatcher { + parameterType; + regexpString; + text; + matchPosition; + match; + constructor(parameterType, regexpString, text, matchPosition = 0) { + this.parameterType = parameterType; + this.regexpString = regexpString; + this.text = text; + this.matchPosition = matchPosition; + const captureGroupRegexp = new RegExp(`(${regexpString})`); + this.match = captureGroupRegexp.exec(text.slice(this.matchPosition)); + } + advanceTo(newMatchPosition) { + for (let advancedPos = newMatchPosition; advancedPos < this.text.length; advancedPos++) { + const matcher = new ParameterTypeMatcher(this.parameterType, this.regexpString, this.text, advancedPos); + if (matcher.find) { + return matcher; + } + } + return new ParameterTypeMatcher(this.parameterType, this.regexpString, this.text, this.text.length); + } + get find() { + return this.match && this.group !== '' && this.fullWord; + } + get start() { + if (!this.match) + throw new Error('No match'); + return this.matchPosition + this.match.index; + } + get fullWord() { + return this.matchStartWord && this.matchEndWord; + } + get matchStartWord() { + return this.start === 0 || this.text[this.start - 1].match(/\p{Z}|\p{P}|\p{S}/u); + } + get matchEndWord() { + const nextCharacterIndex = this.start + this.group.length; + return (nextCharacterIndex === this.text.length || + this.text[nextCharacterIndex].match(/\p{Z}|\p{P}|\p{S}/u)); + } + get group() { + if (!this.match) + throw new Error('No match'); + return this.match[0]; + } + static compare(a, b) { + const posComparison = a.start - b.start; + if (posComparison !== 0) { + return posComparison; + } + const lengthComparison = b.group.length - a.group.length; + if (lengthComparison !== 0) { + return lengthComparison; + } + return 0; + } +} +//# sourceMappingURL=ParameterTypeMatcher.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.js.map new file mode 100644 index 00000000..9621543d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeMatcher.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeMatcher.js","sourceRoot":"","sources":["../../../src/ParameterTypeMatcher.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,oBAAoB;IAIrB;IACC;IACA;IACT;IANO,KAAK,CAAwB;IAE9C,YACkB,aAAqC,EACpC,YAAoB,EACpB,IAAY,EACrB,gBAAwB,CAAC;QAHjB,kBAAa,GAAb,aAAa,CAAwB;QACpC,iBAAY,GAAZ,YAAY,CAAQ;QACpB,SAAI,GAAJ,IAAI,CAAQ;QACrB,kBAAa,GAAb,aAAa,CAAY;QAEjC,MAAM,kBAAkB,GAAG,IAAI,MAAM,CAAC,IAAI,YAAY,GAAG,CAAC,CAAA;QAC1D,IAAI,CAAC,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAA;IACtE,CAAC;IAEM,SAAS,CAAC,gBAAwB;QACvC,KAAK,IAAI,WAAW,GAAG,gBAAgB,EAAE,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAA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1D,CAAA;IACH,CAAC;IAED,IAAI,KAAK;QACP,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IAEM,MAAM,CAAC,OAAO,CAAC,CAAuB,EAAE,CAAuB;QACpE,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAA;QACvC,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,aAAa,CAAA;QACtB,CAAC;QACD,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,CAAA;QACxD,IAAI,gBAAgB,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,gBAAgB,CAAA;QACzB,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.d.ts new file mode 100644 index 00000000..e0d4a6c2 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.d.ts @@ -0,0 +1,12 @@ +import ParameterType from './ParameterType.js'; +import { DefinesParameterType } from './types.js'; +export default class ParameterTypeRegistry implements DefinesParameterType { + private readonly parameterTypeByName; + private readonly parameterTypesByRegexp; + constructor(); + get parameterTypes(): IterableIterator>; + lookupByTypeName(typeName: string): ParameterType | undefined; + lookupByRegexp(parameterTypeRegexp: string, expressionRegexp: RegExp, text: string): ParameterType | undefined; + defineParameterType(parameterType: ParameterType): void; +} +//# sourceMappingURL=ParameterTypeRegistry.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.d.ts.map new file mode 100644 index 00000000..2d43a6d3 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeRegistry.d.ts","sourceRoot":"","sources":["../../../src/ParameterTypeRegistry.ts"],"names":[],"mappings":"AAIA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,oBAAoB;IACxE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA4C;IAChF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAmD;;IAM1F,IAAI,cAAc,IAAI,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAE7D;IAEM,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAIjC,cAAc,CACnB,mBAAmB,EAAE,MAAM,EAC3B,gBAAgB,EAAE,MAAM,EACxB,IAAI,EAAE,MAAM,GACX,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS;IAsB9B,mBAAmB,CAAC,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC;CAwCjE"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.js new file mode 100644 index 00000000..4720c4e4 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.js @@ -0,0 +1,64 @@ +import CucumberExpressionError from './CucumberExpressionError.js'; +import CucumberExpressionGenerator from './CucumberExpressionGenerator.js'; +import defineDefaultParameterTypes from './defineDefaultParameterTypes.js'; +import { AmbiguousParameterTypeError } from './Errors.js'; +import ParameterType from './ParameterType.js'; +export default class ParameterTypeRegistry { + parameterTypeByName = new Map(); + parameterTypesByRegexp = new Map(); + constructor() { + defineDefaultParameterTypes(this); + } + get parameterTypes() { + return this.parameterTypeByName.values(); + } + lookupByTypeName(typeName) { + return this.parameterTypeByName.get(typeName); + } + lookupByRegexp(parameterTypeRegexp, expressionRegexp, text) { + const parameterTypes = this.parameterTypesByRegexp.get(parameterTypeRegexp); + if (!parameterTypes) { + return undefined; + } + if (parameterTypes.length > 1 && !parameterTypes[0].preferForRegexpMatch) { + // We don't do this check on insertion because we only want to restrict + // ambiguity when we look up by Regexp. Users of CucumberExpression should + // not be restricted. + const generatedExpressions = new CucumberExpressionGenerator(() => this.parameterTypes).generateExpressions(text); + throw AmbiguousParameterTypeError.forRegExp(parameterTypeRegexp, expressionRegexp, parameterTypes, generatedExpressions); + } + return parameterTypes[0]; + } + defineParameterType(parameterType) { + if (parameterType.name !== undefined) { + if (this.parameterTypeByName.has(parameterType.name)) { + if (parameterType.name.length === 0) { + throw new CucumberExpressionError(`The anonymous parameter type has already been defined`); + } + else { + throw new CucumberExpressionError(`There is already a parameter type with name ${parameterType.name}`); + } + } + this.parameterTypeByName.set(parameterType.name, parameterType); + } + for (const parameterTypeRegexp of parameterType.regexpStrings) { + if (!this.parameterTypesByRegexp.has(parameterTypeRegexp)) { + this.parameterTypesByRegexp.set(parameterTypeRegexp, []); + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const parameterTypes = this.parameterTypesByRegexp.get(parameterTypeRegexp); + const existingParameterType = parameterTypes[0]; + if (parameterTypes.length > 0 && + existingParameterType.preferForRegexpMatch && + parameterType.preferForRegexpMatch) { + throw new CucumberExpressionError('There can only be one preferential parameter type per regexp. ' + + `The regexp /${parameterTypeRegexp}/ is used for two preferential parameter types, {${existingParameterType.name}} and {${parameterType.name}}`); + } + if (parameterTypes.indexOf(parameterType) === -1) { + parameterTypes.push(parameterType); + this.parameterTypesByRegexp.set(parameterTypeRegexp, parameterTypes.sort(ParameterType.compare)); + } + } + } +} +//# sourceMappingURL=ParameterTypeRegistry.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.js.map new file mode 100644 index 00000000..9f0056d3 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/ParameterTypeRegistry.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeRegistry.js","sourceRoot":"","sources":["../../../src/ParameterTypeRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,8BAA8B,CAAA;AAClE,OAAO,2BAA2B,MAAM,kCAAkC,CAAA;AAC1E,OAAO,2BAA2B,MAAM,kCAAkC,CAAA;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAG9C,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACvB,mBAAmB,GAAG,IAAI,GAAG,EAAkC,CAAA;IAC/D,sBAAsB,GAAG,IAAI,GAAG,EAAyC,CAAA;IAE1F;QACE,2BAA2B,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAA;IAC1C,CAAC;IAEM,gBAAgB,CAAC,QAAgB;QACtC,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAC/C,CAAC;IAEM,cAAc,CACnB,mBAA2B,EAC3B,gBAAwB,EACxB,IAAY;QAEZ,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;QAC3E,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,oBAAoB,EAAE,CA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C,CAAC,CAAC,CAAA;YAC/C,IACE,cAAc,CAAC,MAAM,GAAG,CAAC;gBACzB,qBAAqB,CAAC,oBAAoB;gBAC1C,aAAa,CAAC,oBAAoB,EAClC,CAAC;gBACD,MAAM,IAAI,uBAAuB,CAC/B,gEAAgE;oBAC9D,eAAe,mBAAmB,oDAAoD,qBAAqB,CAAC,IAAI,UAAU,aAAa,CAAC,IAAI,GAAG,CAClJ,CAAA;YACH,CAAC;YACD,IAAI,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBACjD,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;gBAClC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAC7B,mBAAmB,EACnB,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAC3C,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.d.ts new file mode 100644 index 00000000..84ced213 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.d.ts @@ -0,0 +1,12 @@ +import Argument from './Argument.js'; +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import { Expression } from './types.js'; +export default class RegularExpression implements Expression { + readonly regexp: RegExp; + private readonly parameterTypeRegistry; + private readonly treeRegexp; + constructor(regexp: RegExp, parameterTypeRegistry: ParameterTypeRegistry); + match(text: string): readonly Argument[] | null; + get source(): string; +} +//# sourceMappingURL=RegularExpression.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.d.ts.map new file mode 100644 index 00000000..8d317137 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpression.d.ts","sourceRoot":"","sources":["../../../src/RegularExpression.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AAEpC,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,UAAU;aAIxC,MAAM,EAAE,MAAM;IAC9B,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IAJxC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;gBAGrB,MAAM,EAAE,MAAM,EACb,qBAAqB,EAAE,qBAAqB;IAKxD,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE,GAAG,IAAI;IA8BtD,IAAI,MAAM,IAAI,MAAM,CAEnB;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.js new file mode 100644 index 00000000..c9dd53f4 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.js @@ -0,0 +1,30 @@ +import Argument from './Argument.js'; +import ParameterType from './ParameterType.js'; +import TreeRegexp from './TreeRegexp.js'; +export default class RegularExpression { + regexp; + parameterTypeRegistry; + treeRegexp; + constructor(regexp, parameterTypeRegistry) { + this.regexp = regexp; + this.parameterTypeRegistry = parameterTypeRegistry; + this.treeRegexp = new TreeRegexp(regexp); + } + match(text) { + const group = this.treeRegexp.match(text); + if (!group) { + return null; + } + const parameterTypes = this.treeRegexp.groupBuilder.children.map((groupBuilder) => { + const parameterTypeRegexp = groupBuilder.source; + const parameterType = this.parameterTypeRegistry.lookupByRegexp(parameterTypeRegexp, this.regexp, text); + return (parameterType || + new ParameterType(undefined, parameterTypeRegexp, String, (s) => (s === undefined ? null : s), false, false)); + }); + return Argument.build(group, parameterTypes); + } + get source() { + return this.regexp.source; + } +} +//# sourceMappingURL=RegularExpression.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.js.map new file mode 100644 index 00000000..79358318 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/RegularExpression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpression.js","sourceRoot":"","sources":["../../../src/RegularExpression.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,OAAO,UAAU,MAAM,iBAAiB,CAAA;AAGxC,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAIlB;IACC;IAJF,UAAU,CAAY;IAEvC,YACkB,MAAc,EACb,qBAA4C;QAD7C,WAAM,GAAN,MAAM,CAAQ;QACb,0BAAqB,GAArB,qBAAqB,CAAuB;QAE7D,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAA;IAC1C,CAAC;IAEM,KAAK,CAAC,IAAY;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;YAChF,MAAM,mBAAmB,GAAG,YAAY,CAAC,MAAM,CAAA;YAE/C,MAAM,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAC7D,mBAAmB,EACnB,IAAI,CAAC,MAAM,EACX,IAAI,CACL,CAAA;YACD,OAAO,CACL,aAAa;gBACb,IAAI,aAAa,CACf,SAAS,EACT,mBAAmB,EACnB,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EACnC,KAAK,EACL,KAAK,CACN,CACF,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;IAC9C,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAA;IAC3B,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.d.ts new file mode 100644 index 00000000..ca190cd0 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.d.ts @@ -0,0 +1,11 @@ +import Group from './Group.js'; +import GroupBuilder from './GroupBuilder.js'; +export default class TreeRegexp { + readonly regexp: RegExp; + readonly groupBuilder: GroupBuilder; + constructor(regexp: RegExp | string); + private static createGroupBuilder; + private static isNonCapturing; + match(s: string): Group | null; +} +//# sourceMappingURL=TreeRegexp.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.d.ts.map new file mode 100644 index 00000000..f38c2f39 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeRegexp.d.ts","sourceRoot":"","sources":["../../../src/TreeRegexp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAE5C,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,SAAgB,MAAM,EAAE,MAAM,CAAA;IAC9B,SAAgB,YAAY,EAAE,YAAY,CAAA;gBAE9B,MAAM,EAAE,MAAM,GAAG,MAAM;IASnC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAuCjC,OAAO,CAAC,MAAM,CAAC,cAAc;IAgBtB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI;CAStC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.js new file mode 100644 index 00000000..66bdaa9d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.js @@ -0,0 +1,83 @@ +import execWithIndices from 'regexp-match-indices'; +import GroupBuilder from './GroupBuilder.js'; +export default class TreeRegexp { + regexp; + groupBuilder; + constructor(regexp) { + if (regexp instanceof RegExp) { + this.regexp = regexp; + } + else { + this.regexp = new RegExp(regexp); + } + this.groupBuilder = TreeRegexp.createGroupBuilder(this.regexp); + } + static createGroupBuilder(regexp) { + const source = regexp.source; + const stack = [new GroupBuilder()]; + const groupStartStack = []; + let escaping = false; + let charClass = false; + for (let i = 0; i < source.length; i++) { + const c = source[i]; + if (c === '[' && !escaping) { + charClass = true; + } + else if (c === ']' && !escaping) { + charClass = false; + } + else if (c === '(' && !escaping && !charClass) { + groupStartStack.push(i); + const nonCapturing = TreeRegexp.isNonCapturing(source, i); + const groupBuilder = new GroupBuilder(); + if (nonCapturing) { + groupBuilder.setNonCapturing(); + } + stack.push(groupBuilder); + } + else if (c === ')' && !escaping && !charClass) { + const gb = stack.pop(); + if (!gb) + throw new Error('Empty stack'); + const groupStart = groupStartStack.pop(); + if (gb.capturing) { + gb.source = source.substring((groupStart || 0) + 1, i); + stack[stack.length - 1].add(gb); + } + else { + gb.moveChildrenTo(stack[stack.length - 1]); + } + } + escaping = c === '\\' && !escaping; + } + const result = stack.pop(); + if (!result) + throw new Error('Empty stack'); + return result; + } + static isNonCapturing(source, i) { + // Regex is valid. Bounds check not required. + if (source[i + 1] !== '?') { + // (X) + return false; + } + if (source[i + 2] !== '<') { + // (?:X) + // (?=X) + // (?!X) + return true; + } + // (?<=X) or (?X) + return source[i + 3] === '=' || source[i + 3] === '!'; + } + match(s) { + const match = execWithIndices(this.regexp, s); + if (!match) { + return null; + } + let groupIndex = 0; + const nextGroupIndex = () => groupIndex++; + return this.groupBuilder.build(match, nextGroupIndex); + } +} +//# sourceMappingURL=TreeRegexp.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.js.map new file mode 100644 index 00000000..552d8780 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/TreeRegexp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeRegexp.js","sourceRoot":"","sources":["../../../src/TreeRegexp.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,sBAAsB,CAAA;AAGlD,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAE5C,MAAM,CAAC,OAAO,OAAO,UAAU;IACb,MAAM,CAAQ;IACd,YAAY,CAAc;IAE1C,YAAY,MAAuB;QACjC,IAAI,MAAM,YAAY,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACtB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;QAClC,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAChE,CAAC;IAEO,MAAM,CAAC,kBAAkB,CAAC,MAAc;QAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;QAC5B,MAAM,KAAK,GAAmB,CAAC,IAAI,YAAY,EAAE,CAAC,CAAA;QAClD,MAAM,eAAe,GAAa,EAAE,CAAA;QACpC,IAAI,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,CAAA;QACzC,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,CAAC,CAAA;IACvD,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.d.ts new file mode 100644 index 00000000..3d7a27cb --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.d.ts @@ -0,0 +1,3 @@ +import { DefinesParameterType } from './types.js'; +export default function defineDefaultParameterTypes(registry: DefinesParameterType): void; +//# sourceMappingURL=defineDefaultParameterTypes.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.d.ts.map new file mode 100644 index 00000000..8f8dde56 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"defineDefaultParameterTypes.d.ts","sourceRoot":"","sources":["../../../src/defineDefaultParameterTypes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAQjD,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAAQ,EAAE,oBAAoB,QAgHjF"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.js new file mode 100644 index 00000000..b2f22739 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.js @@ -0,0 +1,20 @@ +import ParameterType from './ParameterType.js'; +const INTEGER_REGEXPS = [/-?\d+/, /\d+/]; +const FLOAT_REGEXP = /(?=.*\d.*)[-+]?\d*(?:\.(?=\d.*))?\d*(?:\d+[E][+-]?\d+)?/; +const WORD_REGEXP = /[^\s]+/; +const STRING_REGEXP = /"([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'/; +const ANONYMOUS_REGEXP = /.*/; +export default function defineDefaultParameterTypes(registry) { + registry.defineParameterType(new ParameterType('int', INTEGER_REGEXPS, Number, (s) => (s === undefined ? null : Number(s)), true, true, true)); + registry.defineParameterType(new ParameterType('float', FLOAT_REGEXP, Number, (s) => (s === undefined ? null : parseFloat(s)), true, false, true)); + registry.defineParameterType(new ParameterType('word', WORD_REGEXP, String, (s) => s, false, false, true)); + registry.defineParameterType(new ParameterType('string', STRING_REGEXP, String, (s1, s2) => (s1 || s2 || '').replace(/\\"/g, '"').replace(/\\'/g, "'"), true, false, true)); + registry.defineParameterType(new ParameterType('', ANONYMOUS_REGEXP, String, (s) => s, false, true, true)); + registry.defineParameterType(new ParameterType('double', FLOAT_REGEXP, Number, (s) => (s === undefined ? null : parseFloat(s)), false, false, true)); + registry.defineParameterType(new ParameterType('bigdecimal', FLOAT_REGEXP, String, (s) => (s === undefined ? null : s), false, false, true)); + registry.defineParameterType(new ParameterType('byte', INTEGER_REGEXPS, Number, (s) => (s === undefined ? null : Number(s)), false, false, true)); + registry.defineParameterType(new ParameterType('short', INTEGER_REGEXPS, Number, (s) => (s === undefined ? null : Number(s)), false, false, true)); + registry.defineParameterType(new ParameterType('long', INTEGER_REGEXPS, Number, (s) => (s === undefined ? null : Number(s)), false, false, true)); + registry.defineParameterType(new ParameterType('biginteger', INTEGER_REGEXPS, BigInt, (s) => (s === undefined ? null : BigInt(s)), false, false, true)); +} +//# sourceMappingURL=defineDefaultParameterTypes.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.js.map new file mode 100644 index 00000000..549fcd51 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/defineDefaultParameterTypes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defineDefaultParameterTypes.js","sourceRoot":"","sources":["../../../src/defineDefaultParameterTypes.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAG9C,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;AACxC,MAAM,YAAY,GAAG,yDAAyD,CAAA;AAC9E,MAAM,WAAW,GAAG,QAAQ,CAAA;AAC5B,MAAM,aAAa,GAAG,mDAAmD,CAAA;AACzE,MAAM,gBAAgB,GAAG,IAAI,CAAA;AAE7B,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAA8B;IAChF,QAAQ,CAAC,mBAAmB,CAC1B,IAAI,aAAa,CACf,KAAK,EACL,eAAe,EACf,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC3C,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CACF,CAAA;IACD,QAAQ,CAAC,mBAAmB,CAC1B,IAAI,aAAa,CACf,OAAO,EACP,YAAY,EACZ,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAC/C,IAAI,EACJ,KAAK,EACL,IAAI,CACL,CACF,CAAA;IACD,QAAQ,CAAC,mBAAmB,CAC1B,IAAI,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAC7E,CAAA;IACD,QAAQ,CAAC,mBAAmB,CAC1B,IAAI,aAAa,CACf,QAAQ,EAC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Aa,CACf,OAAO,EACP,eAAe,EACf,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC3C,KAAK,EACL,KAAK,EACL,IAAI,CACL,CACF,CAAA;IAED,QAAQ,CAAC,mBAAmB,CAC1B,IAAI,aAAa,CACf,MAAM,EACN,eAAe,EACf,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC3C,KAAK,EACL,KAAK,EACL,IAAI,CACL,CACF,CAAA;IAED,QAAQ,CAAC,mBAAmB,CAC1B,IAAI,aAAa,CACf,YAAY,EACZ,eAAe,EACf,MAAM,EACN,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC3C,KAAK,EACL,KAAK,EACL,IAAI,CACL,CACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.d.ts new file mode 100644 index 00000000..73496764 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.d.ts @@ -0,0 +1,13 @@ +import Argument from './Argument.js'; +import { Located, Node, NodeType, Token, TokenType } from './Ast.js'; +import CucumberExpression from './CucumberExpression.js'; +import CucumberExpressionGenerator from './CucumberExpressionGenerator.js'; +import ExpressionFactory from './ExpressionFactory.js'; +import GeneratedExpression from './GeneratedExpression.js'; +import Group from './Group.js'; +import ParameterType, { RegExps, StringOrRegExp } from './ParameterType.js'; +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import RegularExpression from './RegularExpression.js'; +import { Expression } from './types.js'; +export { Argument, CucumberExpression, CucumberExpressionGenerator, Expression, ExpressionFactory, GeneratedExpression, Group, Located, Node, NodeType, ParameterType, ParameterTypeRegistry, RegExps, RegularExpression, StringOrRegExp, Token, TokenType, }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.d.ts.map new file mode 100644 index 00000000..3faf31a4 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,kBAAkB,MAAM,yBAAyB,CAAA;AACxD,OAAO,2BAA2B,MAAM,kCAAkC,CAAA;AAC1E,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,aAAa,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAC9D,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,2BAA2B,EAC3B,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,EACL,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,SAAS,GACV,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.js new file mode 100644 index 00000000..da2d755a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.js @@ -0,0 +1,12 @@ +import Argument from './Argument.js'; +import { Node, NodeType, Token, TokenType } from './Ast.js'; +import CucumberExpression from './CucumberExpression.js'; +import CucumberExpressionGenerator from './CucumberExpressionGenerator.js'; +import ExpressionFactory from './ExpressionFactory.js'; +import GeneratedExpression from './GeneratedExpression.js'; +import Group from './Group.js'; +import ParameterType from './ParameterType.js'; +import ParameterTypeRegistry from './ParameterTypeRegistry.js'; +import RegularExpression from './RegularExpression.js'; +export { Argument, CucumberExpression, CucumberExpressionGenerator, ExpressionFactory, GeneratedExpression, Group, Node, NodeType, ParameterType, ParameterTypeRegistry, RegularExpression, Token, TokenType, }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.js.map new file mode 100644 index 00000000..99c86949 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,EAAW,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACpE,OAAO,kBAAkB,MAAM,yBAAyB,CAAA;AACxD,OAAO,2BAA2B,MAAM,kCAAkC,CAAA;AAC1E,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,mBAAmB,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,MAAM,YAAY,CAAA;AAC9B,OAAO,aAA0C,MAAM,oBAAoB,CAAA;AAC3E,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAC9D,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AAGtD,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,2BAA2B,EAE3B,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,EAEL,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,qBAAqB,EAErB,iBAAiB,EAEjB,KAAK,EACL,SAAS,GACV,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.d.ts new file mode 100644 index 00000000..cfcd803d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.d.ts @@ -0,0 +1,24 @@ +import Argument from './Argument.js'; +import ParameterType from './ParameterType.js'; +export interface DefinesParameterType { + defineParameterType(parameterType: ParameterType): void; +} +export interface Expression { + readonly source: string; + match(text: string): readonly Argument[] | null; +} +export type ParameterInfo = { + /** + * The string representation of the original ParameterType#type property + */ + type: string | null; + /** + * The parameter type name + */ + name: string; + /** + * The number of times this name has been used so far + */ + count: number; +}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.d.ts.map new file mode 100644 index 00000000..fd76cf2e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAE9C,MAAM,WAAW,oBAAoB;IACnC,mBAAmB,CAAC,CAAC,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;CAC9D;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,QAAQ,EAAE,GAAG,IAAI,CAAA;CAChD;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.js new file mode 100644 index 00000000..718fd38a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.js.map new file mode 100644 index 00000000..70453b7a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/src/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.d.ts new file mode 100644 index 00000000..713608c4 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ArgumentTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.d.ts.map new file mode 100644 index 00000000..9d10004b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArgumentTest.d.ts","sourceRoot":"","sources":["../../../test/ArgumentTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.js new file mode 100644 index 00000000..0132bae7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.js @@ -0,0 +1,15 @@ +import * as assert from 'assert'; +import Argument from '../src/Argument.js'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +import TreeRegexp from '../src/TreeRegexp.js'; +describe('Argument', () => { + it('exposes getParameterTypeName()', () => { + const treeRegexp = new TreeRegexp('three (.*) mice'); + const parameterTypeRegistry = new ParameterTypeRegistry(); + const group = treeRegexp.match('three blind mice'); + const args = Argument.build(group, [parameterTypeRegistry.lookupByTypeName('string')]); + const argument = args[0]; + assert.strictEqual(argument.getParameterType().name, 'string'); + }); +}); +//# sourceMappingURL=ArgumentTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.js.map new file mode 100644 index 00000000..a1d3dbfd --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ArgumentTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ArgumentTest.js","sourceRoot":"","sources":["../../../test/ArgumentTest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,QAAQ,MAAM,oBAAoB,CAAA;AACzC,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AACnE,OAAO,UAAU,MAAM,sBAAsB,CAAA;AAE7C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,iBAAiB,CAAC,CAAA;QACpD,MAAM,qBAAqB,GAAG,IAAI,qBAAqB,EAAE,CAAA;QACzD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,kBAAkB,CAAE,CAAA;QACnD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,QAAQ,CAAE,CAAC,CAAC,CAAA;QACvF,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACxB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.d.ts new file mode 100644 index 00000000..a9066926 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CombinatorialGeneratedExpressionFactoryTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.d.ts.map new file mode 100644 index 00000000..768e8461 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CombinatorialGeneratedExpressionFactoryTest.d.ts","sourceRoot":"","sources":["../../../test/CombinatorialGeneratedExpressionFactoryTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.js new file mode 100644 index 00000000..0e91f843 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.js @@ -0,0 +1,29 @@ +import assert from 'assert'; +import CombinatorialGeneratedExpressionFactory from '../src/CombinatorialGeneratedExpressionFactory.js'; +import ParameterType from '../src/ParameterType.js'; +describe('CucumberExpressionGenerator', () => { + it('generates multiple expressions', () => { + const parameterTypeCombinations = [ + [ + new ParameterType('color', /red|blue|yellow/, null, (s) => s, false, true), + new ParameterType('csscolor', /red|blue|yellow/, null, (s) => s, false, true), + ], + [ + new ParameterType('date', /\d{4}-\d{2}-\d{2}/, null, (s) => s, false, true), + new ParameterType('datetime', /\d{4}-\d{2}-\d{2}/, null, (s) => s, false, true), + new ParameterType('timestamp', /\d{4}-\d{2}-\d{2}/, null, (s) => s, false, true), + ], + ]; + const factory = new CombinatorialGeneratedExpressionFactory('I bought a {{0}} ball on {{1}}', parameterTypeCombinations); + const expressions = factory.generateExpressions().map((ge) => ge.source); + assert.deepStrictEqual(expressions, [ + 'I bought a {color} ball on {date}', + 'I bought a {color} ball on {datetime}', + 'I bought a {color} ball on {timestamp}', + 'I bought a {csscolor} ball on {date}', + 'I bought a {csscolor} ball on {datetime}', + 'I bought a {csscolor} ball on {timestamp}', + ]); + }); +}); +//# sourceMappingURL=CombinatorialGeneratedExpressionFactoryTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.js.map new file mode 100644 index 00000000..aed60fd3 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CombinatorialGeneratedExpressionFactoryTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CombinatorialGeneratedExpressionFactoryTest.js","sourceRoot":"","sources":["../../../test/CombinatorialGeneratedExpressionFactoryTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,uCAAuC,MAAM,mDAAmD,CAAA;AACvG,OAAO,aAAa,MAAM,yBAAyB,CAAA;AAEnD,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,yBAAyB,GAAG;YAChC;gBACE,IAAI,aAAa,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;gBAC1E,IAAI,aAAa,CAAC,UAAU,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;aAC9E;YACD;gBACE,IAAI,aAAa,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;gBAC3E,IAAI,aAAa,CAAC,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;gBAC/E,IAAI,aAAa,CAAC,WAAW,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC;aACjF;SACF,CAAA;QAED,MAAM,OAAO,GAAG,IAAI,uCAAuC,CACzD,gCAAgC,EAChC,yBAAyB,CAC1B,CAAA;QACD,MAAM,WAAW,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;QACxE,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE;YAClC,mCAAmC;YACnC,uCAAuC;YACvC,wCAAwC;YACxC,sCAAsC;YACtC,0CAA0C;YAC1C,2CAA2C;SAC5C,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.d.ts new file mode 100644 index 00000000..f959dbd8 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionGeneratorTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.d.ts.map new file mode 100644 index 00000000..034e0052 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionGeneratorTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionGeneratorTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.js new file mode 100644 index 00000000..e0306f3c --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.js @@ -0,0 +1,227 @@ +import assert from 'assert'; +import CucumberExpression from '../src/CucumberExpression.js'; +import CucumberExpressionGenerator from '../src/CucumberExpressionGenerator.js'; +import ParameterType from '../src/ParameterType.js'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +class Currency { + s; + constructor(s) { + this.s = s; + } +} +describe('CucumberExpressionGenerator', () => { + let parameterTypeRegistry; + let generator; + function assertExpression(expectedExpression, expectedParameterInfo, text) { + const generatedExpression = generator.generateExpressions(text)[0]; + assert.deepStrictEqual(generatedExpression.parameterInfos, expectedParameterInfo); + assert.strictEqual(generatedExpression.source, expectedExpression); + const cucumberExpression = new CucumberExpression(generatedExpression.source, parameterTypeRegistry); + const match = cucumberExpression.match(text); + if (match === null) { + assert.fail(`Expected text '${text}' to match generated expression '${generatedExpression.source}'`); + } + assert.strictEqual(match.length, expectedParameterInfo.length); + } + beforeEach(() => { + parameterTypeRegistry = new ParameterTypeRegistry(); + generator = new CucumberExpressionGenerator(() => parameterTypeRegistry.parameterTypes); + }); + it('documents expression generation', () => { + parameterTypeRegistry = new ParameterTypeRegistry(); + generator = new CucumberExpressionGenerator(() => parameterTypeRegistry.parameterTypes); + const undefinedStepText = 'I have 2 cucumbers and 1.5 tomato'; + const generatedExpression = generator.generateExpressions(undefinedStepText)[0]; + assert.strictEqual(generatedExpression.source, 'I have {int} cucumbers and {float} tomato'); + assert.strictEqual(generatedExpression.parameterNames[0], 'int'); + assert.strictEqual(generatedExpression.parameterTypes[1].name, 'float'); + }); + it('generates expression for no args', () => { + assertExpression('hello', [], 'hello'); + }); + it('generates expression with escaped left parenthesis', () => { + assertExpression('\\(iii)', [], '(iii)'); + }); + it('generates expression with escaped left curly brace', () => { + assertExpression('\\{iii}', [], '{iii}'); + }); + it('generates expression with escaped slashes', () => { + assertExpression('The {int}\\/{int}\\/{int} hey', [ + { + type: 'Number', + name: 'int', + count: 1, + }, + { + type: 'Number', + name: 'int', + count: 2, + }, + { + type: 'Number', + name: 'int', + count: 3, + }, + ], 'The 1814/05/17 hey'); + }); + it('generates expression for int float arg', () => { + assertExpression('I have {int} cukes and {float} euro', [ + { + type: 'Number', + name: 'int', + count: 1, + }, + { + type: 'Number', + name: 'float', + count: 1, + }, + ], 'I have 2 cukes and 1.5 euro'); + }); + it('generates expression for strings', () => { + assertExpression('I like {string} and {string}', [ + { + type: 'String', + name: 'string', + count: 1, + }, + { + type: 'String', + name: 'string', + count: 2, + }, + ], 'I like "bangers" and \'mash\''); + }); + it('generates expression with % sign', () => { + assertExpression('I am {int}%% foobar', [ + { + type: 'Number', + name: 'int', + count: 1, + }, + ], 'I am 20%% foobar'); + }); + it('generates expression for just int', () => { + assertExpression('{int}', [ + { + type: 'Number', + name: 'int', + count: 1, + }, + ], '99999'); + }); + it('numbers only second argument when builtin type is not reserved keyword', () => { + assertExpression('I have {float} cukes and {float} euro', [ + { + type: 'Number', + name: 'float', + count: 1, + }, + { + type: 'Number', + name: 'float', + count: 2, + }, + ], 'I have 2.5 cukes and 1.5 euro'); + }); + it('generates expression for custom type', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('currency', /[A-Z]{3}/, Currency, (s) => new Currency(s), true, false)); + assertExpression('I have a {currency} account', [ + { + type: 'Currency', + name: 'currency', + count: 1, + }, + ], 'I have a EUR account'); + }); + it('prefers leftmost match when there is overlap', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('currency', /c d/, Currency, (s) => new Currency(s), true, false)); + parameterTypeRegistry.defineParameterType(new ParameterType('date', /b c/, Date, (s) => new Date(s), true, false)); + assertExpression('a {date} d e f g', [ + { + type: 'Date', + name: 'date', + count: 1, + }, + ], 'a b c d e f g'); + }); + // TODO: prefers widest match + it('generates all combinations of expressions when several parameter types match', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('currency', /x/, null, (s) => new Currency(s), true, false)); + parameterTypeRegistry.defineParameterType(new ParameterType('date', /x/, null, (s) => new Date(s), true, false)); + const generatedExpressions = generator.generateExpressions('I have x and x and another x'); + const expressions = generatedExpressions.map((e) => e.source); + assert.deepStrictEqual(expressions, [ + 'I have {currency} and {currency} and another {currency}', + 'I have {currency} and {currency} and another {date}', + 'I have {currency} and {date} and another {currency}', + 'I have {currency} and {date} and another {date}', + 'I have {date} and {currency} and another {currency}', + 'I have {date} and {currency} and another {date}', + 'I have {date} and {date} and another {currency}', + 'I have {date} and {date} and another {date}', + ]); + }); + it('exposes parameter type names in generated expression', () => { + const expression = generator.generateExpressions('I have 2 cukes and 1.5 euro')[0]; + const typeNames = expression.parameterTypes.map((parameter) => parameter.name); + assert.deepStrictEqual(typeNames, ['int', 'float']); + }); + it('matches parameter types with optional capture groups', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('optional-flight', /(1st flight)?/, null, (s) => s, true, false)); + parameterTypeRegistry.defineParameterType(new ParameterType('optional-hotel', /(1 hotel)?/, null, (s) => s, true, false)); + const expression = generator.generateExpressions('I reach Stage 4: 1st flight -1 hotel')[0]; + // While you would expect this to be `I reach Stage {int}: {optional-flight} -{optional-hotel}` the `-1` causes + // {int} to match just before {optional-hotel}. + assert.strictEqual(expression.source, 'I reach Stage {int}: {optional-flight} {int} hotel'); + }); + it('generates at most 256 expressions', () => { + for (let i = 0; i < 4; i++) { + parameterTypeRegistry.defineParameterType(new ParameterType('my-type-' + i, /([a-z] )*?[a-z]/, null, (s) => s, true, false)); + } + // This would otherwise generate 4^11=419430 expressions and consume just shy of 1.5GB. + const expressions = generator.generateExpressions('a s i m p l e s t e p'); + assert.strictEqual(expressions.length, 256); + }); + it('prefers expression with longest non empty match', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('zero-or-more', /[a-z]*/, null, (s) => s, true, false)); + parameterTypeRegistry.defineParameterType(new ParameterType('exactly-one', /[a-z]/, null, (s) => s, true, false)); + const expressions = generator.generateExpressions('a simple step'); + assert.strictEqual(expressions.length, 2); + assert.strictEqual(expressions[0].source, '{exactly-one} {zero-or-more} {zero-or-more}'); + assert.strictEqual(expressions[1].source, '{zero-or-more} {zero-or-more} {zero-or-more}'); + }); + it('does not suggest parameter included at the beginning of a word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('direction', /(up|down)/, null, (s) => s, true, false)); + const expressions = generator.generateExpressions('I download a picture'); + assert.strictEqual(expressions.length, 1); + assert.notStrictEqual(expressions[0].source, 'I {direction}load a picture'); + assert.strictEqual(expressions[0].source, 'I download a picture'); + }); + it('does not suggest parameter included inside a word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('direction', /(up|down)/, null, (s) => s, true, false)); + const expressions = generator.generateExpressions('I watch the muppet show'); + assert.strictEqual(expressions.length, 1); + assert.notStrictEqual(expressions[0].source, 'I watch the m{direction}pet show'); + assert.strictEqual(expressions[0].source, 'I watch the muppet show'); + }); + it('does not suggest parameter at the end of a word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('direction', /(up|down)/, null, (s) => s, true, false)); + const expressions = generator.generateExpressions('I create a group'); + assert.strictEqual(expressions.length, 1); + assert.notStrictEqual(expressions[0].source, 'I create a gro{direction}'); + assert.strictEqual(expressions[0].source, 'I create a group'); + }); + it('does suggest parameter that are a full word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('direction', /(up|down)/, null, (s) => s, true, false)); + assert.strictEqual(generator.generateExpressions('When I go down the road')[0].source, 'When I go {direction} the road'); + assert.strictEqual(generator.generateExpressions('When I walk up the hill')[0].source, 'When I walk {direction} the hill'); + assert.strictEqual(generator.generateExpressions('up the hill, the road goes down')[0].source, '{direction} the hill, the road goes {direction}'); + }); + it('does not consider punctuation as being part of a word', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('direction', /(up|down)/, null, (s) => s, true, false)); + assert.strictEqual(generator.generateExpressions('direction is:down')[0].source, 'direction is:{direction}'); + assert.strictEqual(generator.generateExpressions('direction is down.')[0].source, 'direction is {direction}.'); + }); +}); +//# sourceMappingURL=CucumberExpressionGeneratorTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.js.map new file mode 100644 index 00000000..1395b7a7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionGeneratorTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionGeneratorTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionGeneratorTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,kBAAkB,MAAM,8BAA8B,CAAA;AAC7D,OAAO,2BAA2B,MAAM,uCAAuC,CAAA;AAC/E,OAAO,aAAa,MAAM,yBAAyB,CAAA;AACnD,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AAGnE,MAAM,QAAQ;IACgB;IAA5B,YAA4B,CAAS;QAAT,MAAC,GAAD,CAAC,CAAQ;IAAG,CAAC;CAC1C;AAED,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,IAAI,qBAA4C,CAAA;IAChD,IAAI,SAAsC,CAAA;IAE1C,SAAS,gBAAgB,CACvB,kBAA0B,EAC1B,qBAAsC,EACtC,IAAY;QAEZ,MAAM,mBAAmB,GAAG,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QAClE,MAAM,CAAC,eAAe,CAAC,mBAAmB,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAA;QACjF,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;QAElE,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAC/C,mBAAmB,CAAC,MAAM,EAC1B,qBAAqB,CACtB,CAAA;QACD,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC5C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,MAAM,CAAC,IAAI,CACT,kBAAkB,IAAI,oCAAoC,mBAAmB,CAAC,MAAM,GAAG,CACxF,CAAA;QACH,CAAC;QACD,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAChE,CAAC;I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ules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.d.ts new file mode 100644 index 00000000..7d0e84e1 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionParserTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.d.ts.map new file mode 100644 index 00000000..e454179b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionParserTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionParserTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.js new file mode 100644 index 00000000..9b2b7c46 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.js @@ -0,0 +1,29 @@ +import assert from 'assert'; +import fs from 'fs'; +import { glob } from 'glob'; +import yaml from 'js-yaml'; +import CucumberExpressionError from '../src/CucumberExpressionError.js'; +import CucumberExpressionParser from '../src/CucumberExpressionParser.js'; +import { testDataDir } from './testDataDir.js'; +describe('CucumberExpressionParser', () => { + for (const path of glob.sync(`${testDataDir}/cucumber-expression/parser/*.yaml`)) { + const expectation = yaml.load(fs.readFileSync(path, 'utf-8')); + it(`parses ${path}`, () => { + const parser = new CucumberExpressionParser(); + if (expectation.expected_ast !== undefined) { + const node = parser.parse(expectation.expression); + assert.deepStrictEqual(JSON.parse(JSON.stringify(node)), // Removes type information. + expectation.expected_ast); + } + else if (expectation.exception !== undefined) { + assert.throws(() => { + parser.parse(expectation.expression); + }, new CucumberExpressionError(expectation.exception)); + } + else { + throw new Error(`Expectation must have expected or exception: ${JSON.stringify(expectation)}`); + } + }); + } +}); +//# sourceMappingURL=CucumberExpressionParserTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.js.map new file mode 100644 index 00000000..5c9d7250 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionParserTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionParserTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionParserTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,uBAAuB,MAAM,mCAAmC,CAAA;AACvE,OAAO,wBAAwB,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAQ9C,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,WAAW,oCAAoC,CAAC,EAAE,CAAC;QACjF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAgB,CAAA;QAC5E,EAAE,CAAC,UAAU,IAAI,EAAE,EAAE,GAAG,EAAE;YACxB,MAAM,MAAM,GAAG,IAAI,wBAAwB,EAAE,CAAA;YAC7C,IAAI,WAAW,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;gBACjD,MAAM,CAAC,eAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,4BAA4B;gBAC9D,WAAW,CAAC,YAAY,CACzB,CAAA;YACH,CAAC;iBAAM,IAAI,WAAW,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC/C,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;oBACjB,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;gBACtC,CAAC,EAAE,IAAI,uBAAuB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAA;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,gDAAgD,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAC9E,CAAA;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.d.ts new file mode 100644 index 00000000..ed6984c8 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.d.ts.map new file mode 100644 index 00000000..e1689a5a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.js new file mode 100644 index 00000000..2b956e11 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.js @@ -0,0 +1,107 @@ +import assert from 'assert'; +import fs from 'fs'; +import { glob } from 'glob'; +import yaml from 'js-yaml'; +import CucumberExpression from '../src/CucumberExpression.js'; +import CucumberExpressionError from '../src/CucumberExpressionError.js'; +import ParameterType from '../src/ParameterType.js'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +import { testDataDir } from './testDataDir.js'; +describe('CucumberExpression', () => { + for (const path of glob.sync(`${testDataDir}/cucumber-expression/matching/*.yaml`)) { + const expectation = yaml.load(fs.readFileSync(path, 'utf-8')); + it(`matches ${path}`, () => { + const parameterTypeRegistry = new ParameterTypeRegistry(); + if (expectation.expected_args !== undefined) { + const expression = new CucumberExpression(expectation.expression, parameterTypeRegistry); + const matches = expression.match(expectation.text); + assert.deepStrictEqual(JSON.parse(JSON.stringify(matches ? matches.map((value) => value.getValue(null)) : null, (key, value) => { + return typeof value === 'bigint' ? value.toString() : value; + })), // Removes type information. + expectation.expected_args); + } + else if (expectation.exception !== undefined) { + assert.throws(() => { + const expression = new CucumberExpression(expectation.expression, parameterTypeRegistry); + expression.match(expectation.text); + }, new CucumberExpressionError(expectation.exception)); + } + else { + throw new Error(`Expectation must have expected or exception: ${JSON.stringify(expectation)}`); + } + }); + } + it('matches float', () => { + assert.deepStrictEqual(match('{float}', ''), null); + assert.deepStrictEqual(match('{float}', '.'), null); + assert.deepStrictEqual(match('{float}', ','), null); + assert.deepStrictEqual(match('{float}', '-'), null); + assert.deepStrictEqual(match('{float}', 'E'), null); + assert.deepStrictEqual(match('{float}', '1,'), null); + assert.deepStrictEqual(match('{float}', ',1'), null); + assert.deepStrictEqual(match('{float}', '1.'), null); + assert.deepStrictEqual(match('{float}', '1'), [1]); + assert.deepStrictEqual(match('{float}', '-1'), [-1]); + assert.deepStrictEqual(match('{float}', '1.1'), [1.1]); + assert.deepStrictEqual(match('{float}', '1,000'), null); + assert.deepStrictEqual(match('{float}', '1,000,0'), null); + assert.deepStrictEqual(match('{float}', '1,000.1'), null); + assert.deepStrictEqual(match('{float}', '1,000,10'), null); + assert.deepStrictEqual(match('{float}', '1,0.1'), null); + assert.deepStrictEqual(match('{float}', '1,000,000.1'), null); + assert.deepStrictEqual(match('{float}', '-1.1'), [-1.1]); + assert.deepStrictEqual(match('{float}', '.1'), [0.1]); + assert.deepStrictEqual(match('{float}', '-.1'), [-0.1]); + assert.deepStrictEqual(match('{float}', '-.10000001'), [-0.10000001]); + assert.deepStrictEqual(match('{float}', '1E1'), [1e1]); // precision 1 with scale -1, can not be expressed as a decimal + assert.deepStrictEqual(match('{float}', '.1E1'), [1]); + assert.deepStrictEqual(match('{float}', 'E1'), null); + assert.deepStrictEqual(match('{float}', '-.1E-1'), [-0.01]); + assert.deepStrictEqual(match('{float}', '-.1E-2'), [-0.001]); + assert.deepStrictEqual(match('{float}', '-.1E+1'), [-1]); + assert.deepStrictEqual(match('{float}', '-.1E+2'), [-10]); + assert.deepStrictEqual(match('{float}', '-.1E1'), [-1]); + assert.deepStrictEqual(match('{float}', '-.10E2'), [-10]); + }); + it('matches float with zero', () => { + assert.deepEqual(match('{float}', '0'), [0]); + }); + it('exposes source', () => { + const expr = 'I have {int} cuke(s)'; + assert.strictEqual(new CucumberExpression(expr, new ParameterTypeRegistry()).source, expr); + }); + it('unmatched optional groups have undefined values', () => { + const parameterTypeRegistry = new ParameterTypeRegistry(); + parameterTypeRegistry.defineParameterType(new ParameterType('textAndOrNumber', /([A-Z]+)?(?: )?([0-9]+)?/, null, function (s1, s2) { + return [s1, s2]; + }, false, true)); + const expression = new CucumberExpression('{textAndOrNumber}', parameterTypeRegistry); + const world = {}; + assert.deepStrictEqual(expression.match(`TLA`)[0].getValue(world), ['TLA', undefined]); + assert.deepStrictEqual(expression.match(`123`)[0].getValue(world), [undefined, '123']); + }); + // JavaScript-specific + it('delegates transform to custom object', () => { + const parameterTypeRegistry = new ParameterTypeRegistry(); + parameterTypeRegistry.defineParameterType(new ParameterType('widget', /\w+/, null, function (s) { + return this.createWidget(s); + }, false, true)); + const expression = new CucumberExpression('I have a {widget}', parameterTypeRegistry); + const world = { + createWidget(s) { + return `widget:${s}`; + }, + }; + const args = expression.match(`I have a bolt`); + assert.strictEqual(args[0].getValue(world), 'widget:bolt'); + }); +}); +const match = (expression, text) => { + const cucumberExpression = new CucumberExpression(expression, new ParameterTypeRegistry()); + const args = cucumberExpression.match(text); + if (!args) { + return null; + } + return args.map((arg) => arg.getValue(null)); +}; +//# sourceMappingURL=CucumberExpressionTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.js.map new file mode 100644 index 00000000..ccd01597 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,kBAAkB,MAAM,8BAA8B,CAAA;AAC7D,OAAO,uBAAuB,MAAM,mCAAmC,CAAA;AACvE,OAAO,aAAa,MAAM,yBAAyB,CAAA;AACnD,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAS9C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CA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SACF,CAAA;QAED,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,eAAe,CAAE,CAAA;QAC/C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,MAAM,KAAK,GAAG,CAAC,UAAkB,EAAE,IAAY,EAAE,EAAE;IACjD,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,UAAU,EAAE,IAAI,qBAAqB,EAAE,CAAC,CAAA;IAC1F,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.d.ts new file mode 100644 index 00000000..6df46a1e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionTokenizerTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.d.ts.map new file mode 100644 index 00000000..883ddf20 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTokenizerTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionTokenizerTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.js new file mode 100644 index 00000000..1a84b354 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.js @@ -0,0 +1,29 @@ +import assert from 'assert'; +import fs from 'fs'; +import { glob } from 'glob'; +import yaml from 'js-yaml'; +import CucumberExpressionError from '../src/CucumberExpressionError.js'; +import CucumberExpressionTokenizer from '../src/CucumberExpressionTokenizer.js'; +import { testDataDir } from './testDataDir.js'; +describe('CucumberExpressionTokenizer', () => { + for (const path of glob.sync(`${testDataDir}/cucumber-expression/tokenizer/*.yaml`)) { + const expectation = yaml.load(fs.readFileSync(path, 'utf-8')); + it(`tokenizes ${path}`, () => { + const tokenizer = new CucumberExpressionTokenizer(); + if (expectation.expected_tokens !== undefined) { + const tokens = tokenizer.tokenize(expectation.expression); + assert.deepStrictEqual(JSON.parse(JSON.stringify(tokens)), // Removes type information. + expectation.expected_tokens); + } + else if (expectation.exception !== undefined) { + assert.throws(() => { + tokenizer.tokenize(expectation.expression); + }, new CucumberExpressionError(expectation.exception)); + } + else { + throw new Error(`Expectation must have expected_tokens or exception: ${JSON.stringify(expectation)}`); + } + }); + } +}); +//# sourceMappingURL=CucumberExpressionTokenizerTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.js.map new file mode 100644 index 00000000..0d2cf579 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTokenizerTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTok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C,SAAS,CAAC,CAAC,CAAA;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,uDAAuD,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CACrF,CAAA;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.d.ts new file mode 100644 index 00000000..6919a5a0 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CucumberExpressionTransformationTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.d.ts.map new file mode 100644 index 00000000..152ad37a --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTransformationTest.d.ts","sourceRoot":"","sources":["../../../test/CucumberExpressionTransformationTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.js new file mode 100644 index 00000000..3071a8ef --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.js @@ -0,0 +1,18 @@ +import assert from 'assert'; +import fs from 'fs'; +import { glob } from 'glob'; +import yaml from 'js-yaml'; +import CucumberExpression from '../src/CucumberExpression.js'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +import { testDataDir } from './testDataDir.js'; +describe('CucumberExpression', () => { + for (const path of glob.sync(`${testDataDir}/cucumber-expression/transformation/*.yaml`)) { + const expectation = yaml.load(fs.readFileSync(path, 'utf-8')); + it(`transforms ${path}`, () => { + const parameterTypeRegistry = new ParameterTypeRegistry(); + const expression = new CucumberExpression(expectation.expression, parameterTypeRegistry); + assert.deepStrictEqual(expression.regexp.source, expectation.expected_regex); + }); + } +}); +//# sourceMappingURL=CucumberExpressionTransformationTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.js.map new file mode 100644 index 00000000..ea707cf4 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CucumberExpressionTransformationTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberExpressionTransformationTest.js","sourceRoot":"","sources":["../../../test/CucumberExpressionTransformationTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,kBAAkB,MAAM,8BAA8B,CAAA;AAC7D,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAO9C,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,WAAW,4CAA4C,CAAC,EAAE,CAAC;QACzF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAgB,CAAA;QAC5E,EAAE,CAAC,cAAc,IAAI,EAAE,EAAE,GAAG,EAAE;YAC5B,MAAM,qBAAqB,GAAG,IAAI,qBAAqB,EAAE,CAAA;YACzD,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,WAAW,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAA;YACxF,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,CAAA;QAC9E,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.d.ts new file mode 100644 index 00000000..f68fbc26 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=CustomParameterTypeTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.d.ts.map new file mode 100644 index 00000000..33ae8a62 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CustomParameterTypeTest.d.ts","sourceRoot":"","sources":["../../../test/CustomParameterTypeTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.js new file mode 100644 index 00000000..89649375 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.js @@ -0,0 +1,119 @@ +import assert from 'assert'; +import CucumberExpression from '../src/CucumberExpression.js'; +import ParameterType from '../src/ParameterType.js'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +import RegularExpression from '../src/RegularExpression.js'; +class Color { + name; + constructor(name) { + this.name = name; + } +} +class CssColor { + name; + constructor(name) { + this.name = name; + } +} +describe('Custom parameter type', () => { + let parameterTypeRegistry; + beforeEach(() => { + parameterTypeRegistry = new ParameterTypeRegistry(); + parameterTypeRegistry.defineParameterType(new ParameterType('color', /red|blue|yellow/, Color, (s) => new Color(s), false, true)); + }); + describe('CucumberExpression', () => { + it('throws exception for illegal character in parameter name', () => { + assert.throws(() => new ParameterType('[string]', /.*/, String, (s) => s, false, true), { + message: "Illegal character in parameter name {[string]}. Parameter names may not contain '{', '}', '(', ')', '\\' or '/'", + }); + }); + it('matches parameters with custom parameter type', () => { + const expression = new CucumberExpression('I have a {color} ball', parameterTypeRegistry); + const value = expression.match('I have a red ball')?.[0].getValue(null); + assert.strictEqual(value?.name, 'red'); + }); + it('matches parameters with multiple capture groups', () => { + class Coordinate { + x; + y; + z; + constructor(x, y, z) { + this.x = x; + this.y = y; + this.z = z; + } + } + parameterTypeRegistry.defineParameterType(new ParameterType('coordinate', /(\d+),\s*(\d+),\s*(\d+)/, Coordinate, (x, y, z) => new Coordinate(Number(x), Number(y), Number(z)), true, true)); + const expression = new CucumberExpression('A {int} thick line from {coordinate} to {coordinate}', parameterTypeRegistry); + const args = expression.match('A 5 thick line from 10,20,30 to 40,50,60'); + const thick = args?.[0].getValue(null); + assert.strictEqual(thick, 5); + const from = args?.[1].getValue(null); + assert.strictEqual(from?.x, 10); + assert.strictEqual(from?.y, 20); + assert.strictEqual(from?.z, 30); + const to = args?.[2].getValue(null); + assert.strictEqual(to?.x, 40); + assert.strictEqual(to?.y, 50); + assert.strictEqual(to?.z, 60); + }); + it('matches parameters with custom parameter type using optional capture group', () => { + parameterTypeRegistry = new ParameterTypeRegistry(); + parameterTypeRegistry.defineParameterType(new ParameterType('color', [/red|blue|yellow/, /(?:dark|light) (?:red|blue|yellow)/], Color, (s) => new Color(s), false, true)); + const expression = new CucumberExpression('I have a {color} ball', parameterTypeRegistry); + const value = expression.match('I have a dark red ball')?.[0].getValue(null); + assert.strictEqual(value?.name, 'dark red'); + }); + it('defers transformation until queried from argument', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('throwing', /bad/, null, (s) => { + throw new Error(`Can't transform [${s}]`); + }, false, true)); + const expression = new CucumberExpression('I have a {throwing} parameter', parameterTypeRegistry); + const args = expression.match('I have a bad parameter'); + assert.throws(() => args[0].getValue(null), { + message: "Can't transform [bad]", + }); + }); + describe('conflicting parameter type', () => { + it('is detected for type name', () => { + assert.throws(() => parameterTypeRegistry.defineParameterType(new ParameterType('color', /.*/, CssColor, (s) => new CssColor(s), false, true)), { message: 'There is already a parameter type with name color' }); + }); + it('is not detected for type', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('whatever', /.*/, Color, (s) => new Color(s), false, false)); + }); + it('is not detected for regexp', () => { + parameterTypeRegistry.defineParameterType(new ParameterType('css-color', /red|blue|yellow/, CssColor, (s) => new CssColor(s), true, false)); + assert.strictEqual(new CucumberExpression('I have a {css-color} ball', parameterTypeRegistry) + .match('I have a blue ball')?.[0] + .getValue(null)?.constructor, CssColor); + assert.strictEqual(new CucumberExpression('I have a {css-color} ball', parameterTypeRegistry) + .match('I have a blue ball')?.[0] + .getValue(null)?.name, 'blue'); + assert.strictEqual(new CucumberExpression('I have a {color} ball', parameterTypeRegistry) + .match('I have a blue ball')?.[0] + .getValue(null)?.constructor, Color); + assert.strictEqual(new CucumberExpression('I have a {color} ball', parameterTypeRegistry) + .match('I have a blue ball')?.[0] + .getValue(null)?.name, 'blue'); + }); + }); + // JavaScript-specific + it('creates arguments using async transform', async () => { + parameterTypeRegistry = new ParameterTypeRegistry(); + parameterTypeRegistry.defineParameterType(new ParameterType('asyncColor', /red|blue|yellow/, Color, async (s) => new Color(s), false, true)); + const expression = new CucumberExpression('I have a {asyncColor} ball', parameterTypeRegistry); + const args = expression.match('I have a red ball'); + const value = await args?.[0].getValue(null); + assert.strictEqual(value?.name, 'red'); + }); + }); + describe('RegularExpression', () => { + it('matches arguments with custom parameter type', () => { + const expression = new RegularExpression(/I have a (red|blue|yellow) ball/, parameterTypeRegistry); + const value = expression.match('I have a red ball')?.[0].getValue(null); + assert.strictEqual(value?.constructor, Color); + assert.strictEqual(value?.name, 'red'); + }); + }); +}); +//# sourceMappingURL=CustomParameterTypeTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.js.map new file mode 100644 index 00000000..ee66c8c7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/CustomParameterTypeTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CustomParameterTypeTest.js","sourceRoot":"","sources":["../../../test/CustomParameterTypeTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,kBAAkB,MAAM,8BAA8B,CAAA;AAC7D,OAAO,aAAa,MAAM,yBAAyB,CAAA;AACnD,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AACnE,OAAO,iBAAiB,MAAM,6BAA6B,CAAA;AAE3D,MAAM,KAAK;IACmB;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AAED,MAAM,QAAQ;IACgB;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AAED,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,IAAI,qBAA4C,CAAA;IAEhD,UAAU,CAAC,GAAG,EAAE;QACd,qBAAqB,GAAG,IAAI,qBAAqB,EAAE,CAAA;QACnD,qBAAqB,CAAC,mBAAmB,CACvC,IAAI,aAAa,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,C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,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,CAAA;YAC7C,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;QACxC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.d.ts new file mode 100644 index 00000000..e96f5c0f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ExpressionFactoryTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.d.ts.map new file mode 100644 index 00000000..31895988 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpressionFactoryTest.d.ts","sourceRoot":"","sources":["../../../test/ExpressionFactoryTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.js new file mode 100644 index 00000000..ecbff0c6 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.js @@ -0,0 +1,18 @@ +import * as assert from 'assert'; +import CucumberExpression from '../src/CucumberExpression.js'; +import ExpressionFactory from '../src/ExpressionFactory.js'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +import RegularExpression from '../src/RegularExpression.js'; +describe('ExpressionFactory', () => { + let expressionFactory; + beforeEach(() => { + expressionFactory = new ExpressionFactory(new ParameterTypeRegistry()); + }); + it('creates a RegularExpression', () => { + assert.strictEqual(expressionFactory.createExpression(/x/).constructor, RegularExpression); + }); + it('creates a CucumberExpression', () => { + assert.strictEqual(expressionFactory.createExpression('x').constructor, CucumberExpression); + }); +}); +//# sourceMappingURL=ExpressionFactoryTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.js.map new file mode 100644 index 00000000..4ed228b9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ExpressionFactoryTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ExpressionFactoryTest.js","sourceRoot":"","sources":["../../../test/ExpressionFactoryTest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,kBAAkB,MAAM,8BAA8B,CAAA;AAC7D,OAAO,iBAAiB,MAAM,6BAA6B,CAAA;AAC3D,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AACnE,OAAO,iBAAiB,MAAM,6BAA6B,CAAA;AAE3D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,iBAAoC,CAAA;IACxC,UAAU,CAAC,GAAG,EAAE;QACd,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,IAAI,qBAAqB,EAAE,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAA;IAC5F,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAA;IAC7F,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.d.ts new file mode 100644 index 00000000..5cd0c9cc --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ParameterTypeRegistryTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.d.ts.map new file mode 100644 index 00000000..c1402f0b --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeRegistryTest.d.ts","sourceRoot":"","sources":["../../../test/ParameterTypeRegistryTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.js new file mode 100644 index 00000000..caf76b41 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.js @@ -0,0 +1,49 @@ +import assert from 'assert'; +import ParameterType from '../src/ParameterType.js'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +class Name { + name; + constructor(name) { + this.name = name; + } +} +class Person { + name; + constructor(name) { + this.name = name; + } +} +class Place { + name; + constructor(name) { + this.name = name; + } +} +const CAPITALISED_WORD = /[A-Z]+\w+/; +describe('ParameterTypeRegistry', () => { + let registry; + beforeEach(() => { + registry = new ParameterTypeRegistry(); + }); + it('does not allow more than one preferential parameter type for each regexp', () => { + registry.defineParameterType(new ParameterType('name', CAPITALISED_WORD, Name, (s) => new Name(s), true, true)); + registry.defineParameterType(new ParameterType('person', CAPITALISED_WORD, Person, (s) => new Person(s), true, false)); + try { + registry.defineParameterType(new ParameterType('place', CAPITALISED_WORD, Place, (s) => new Place(s), true, true)); + throw new Error('Should have failed'); + } + catch (err) { + assert.strictEqual(err.message, `There can only be one preferential parameter type per regexp. The regexp ${CAPITALISED_WORD} is used for two preferential parameter types, {name} and {place}`); + } + }); + it('looks up preferential parameter type by regexp', () => { + const name = new ParameterType('name', /[A-Z]+\w+/, null, (s) => new Name(s), true, false); + const person = new ParameterType('person', /[A-Z]+\w+/, null, (s) => new Person(s), true, true); + const place = new ParameterType('place', /[A-Z]+\w+/, null, (s) => new Place(s), true, false); + registry.defineParameterType(name); + registry.defineParameterType(person); + registry.defineParameterType(place); + assert.strictEqual(registry.lookupByRegexp('[A-Z]+\\w+', /([A-Z]+\w+) and ([A-Z]+\w+)/, 'Lisa and Bob'), person); + }); +}); +//# sourceMappingURL=ParameterTypeRegistryTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.js.map new file mode 100644 index 00000000..80f3a27d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeRegistryTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeRegistryTest.js","sourceRoot":"","sources":["../../../test/ParameterTypeRegistryTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,aAAa,MAAM,yBAAyB,CAAA;AACnD,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AAEnE,MAAM,IAAI;IACoB;IAA5B,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CA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;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;QAC1F,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;QAC/F,MAAM,KAAK,GAAG,IAAI,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;QAE7F,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QAClC,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAA;QACpC,QAAQ,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;QAEnC,MAAM,CAAC,WAAW,CAChB,QAAQ,CAAC,cAAc,CAAC,YAAY,EAAE,6BAA6B,EAAE,cAAc,CAAC,EACpF,MAAM,CACP,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.d.ts new file mode 100644 index 00000000..1d9d221f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ParameterTypeTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.d.ts.map new file mode 100644 index 00000000..745f4bd9 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeTest.d.ts","sourceRoot":"","sources":["../../../test/ParameterTypeTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.js new file mode 100644 index 00000000..cf1ee131 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.js @@ -0,0 +1,27 @@ +import * as assert from 'assert'; +import ParameterType from '../src/ParameterType.js'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +describe('ParameterType', () => { + it('does not allow ignore flag on regexp', () => { + assert.throws(() => new ParameterType('case-insensitive', /[a-z]+/i, String, (s) => s, true, true), { message: "ParameterType Regexps can't use flag 'i'" }); + }); + it('has a type name for {int}', () => { + const r = new ParameterTypeRegistry(); + const t = r.lookupByTypeName('int'); + // @ts-ignore + assert.strictEqual(t.type.name, 'Number'); + }); + it('has a type name for {bigint}', () => { + const r = new ParameterTypeRegistry(); + const t = r.lookupByTypeName('biginteger'); + // @ts-ignore + assert.strictEqual(t.type.name, 'BigInt'); + }); + it('has a type name for {word}', () => { + const r = new ParameterTypeRegistry(); + const t = r.lookupByTypeName('word'); + // @ts-ignore + assert.strictEqual(t.type.name, 'String'); + }); +}); +//# sourceMappingURL=ParameterTypeTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.js.map new file mode 100644 index 00000000..153f6a49 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/ParameterTypeTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParameterTypeTest.js","sourceRoot":"","sources":["../../../test/ParameterTypeTest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,aAAa,MAAM,yBAAyB,CAAA;AACnD,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AAEnE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,CAAC,MAAM,CACX,GAAG,EAAE,CAAC,IAAI,aAAa,CAAC,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EACpF,EAAE,OAAO,EAAE,0CAA0C,EAAE,CACxD,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,CAAC,GAAG,IAAI,qBAAqB,EAAE,CAAA;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAE,CAAA;QACpC,aAAa;QACb,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,GAAG,IAAI,qBAAqB,EAAE,CAAA;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAE,CAAA;QAC3C,aAAa;QACb,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,GAAG,IAAI,qBAAqB,EAAE,CAAA;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAE,CAAA;QACrC,aAAa;QACb,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.d.ts new file mode 100644 index 00000000..92e9ce8f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=RegularExpressionTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.d.ts.map new file mode 100644 index 00000000..f3a8391e --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpressionTest.d.ts","sourceRoot":"","sources":["../../../test/RegularExpressionTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.js new file mode 100644 index 00000000..b369e291 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.js @@ -0,0 +1,81 @@ +import assert from 'assert'; +import fs from 'fs'; +import { glob } from 'glob'; +import yaml from 'js-yaml'; +import ParameterTypeRegistry from '../src/ParameterTypeRegistry.js'; +import RegularExpression from '../src/RegularExpression.js'; +import { testDataDir } from './testDataDir.js'; +describe('RegularExpression', () => { + for (const path of glob.sync(`${testDataDir}/regular-expression/matching/*.yaml`)) { + const expectation = yaml.load(fs.readFileSync(path, 'utf-8')); + it(`matches ${path}`, () => { + const parameterTypeRegistry = new ParameterTypeRegistry(); + const expression = new RegularExpression(new RegExp(expectation.expression), parameterTypeRegistry); + const matches = expression.match(expectation.text); + assert.deepStrictEqual(JSON.parse(JSON.stringify(matches ? matches.map((value) => value.getValue(null)) : null)), // Removes type information. + expectation.expected_args); + }); + } + it('does no transform by default', () => { + assert.deepStrictEqual(match(/(\d\d)/, '22'), ['22']); + }); + it('does not transform anonymous', () => { + assert.deepStrictEqual(match(/(.*)/, '22'), ['22']); + }); + it('transforms negative int', () => { + assert.deepStrictEqual(match(/(-?\d+)/, '-22'), [-22]); + }); + it('transforms positive int', () => { + assert.deepStrictEqual(match(/(\d+)/, '22'), [22]); + }); + it('returns null when there is no match', () => { + assert.strictEqual(match(/hello/, 'world'), null); + }); + it('matches empty string', () => { + assert.deepStrictEqual(match(/^The value equals "([^"]*)"$/, 'The value equals ""'), ['']); + }); + it('matches nested capture group without match', () => { + assert.deepStrictEqual(match(/^a user( named "([^"]*)")?$/, 'a user'), [null]); + }); + it('matches nested capture group with match', () => { + assert.deepStrictEqual(match(/^a user( named "([^"]*)")?$/, 'a user named "Charlie"'), [ + 'Charlie', + ]); + }); + it('matches capture group nested in optional one', () => { + const regexp = /^a (pre-commercial transaction |pre buyer fee model )?purchase(?: for \$(\d+))?$/; + assert.deepStrictEqual(match(regexp, 'a purchase'), [null, null]); + assert.deepStrictEqual(match(regexp, 'a purchase for $33'), [null, 33]); + assert.deepStrictEqual(match(regexp, 'a pre buyer fee model purchase'), [ + 'pre buyer fee model ', + null, + ]); + }); + it('ignores non capturing groups', () => { + assert.deepStrictEqual(match(/(\S+) ?(can|cannot)? (?:delete|cancel) the (\d+)(?:st|nd|rd|th) (attachment|slide) ?(?:upload)?/, 'I can cancel the 1st slide upload'), ['I', 'can', 1, 'slide']); + }); + it('works with escaped parenthesis', () => { + assert.deepStrictEqual(match(/Across the line\(s\)/, 'Across the line(s)'), []); + }); + it('exposes regexp and source', () => { + const regexp = /I have (\d+) cukes? in my (.+) now/; + const expression = new RegularExpression(regexp, new ParameterTypeRegistry()); + assert.deepStrictEqual(expression.regexp, regexp); + assert.deepStrictEqual(expression.source, regexp.source); + }); + it('does not take consider parenthesis in character class as group', function () { + const expression = new RegularExpression(/^drawings: ([A-Z_, ()]+)$/, new ParameterTypeRegistry()); + const args = expression.match('drawings: ONE, TWO(ABC)'); + assert.strictEqual(args[0].getValue(this), 'ONE, TWO(ABC)'); + }); +}); +const match = (regexp, text) => { + const parameterRegistry = new ParameterTypeRegistry(); + const regularExpression = new RegularExpression(regexp, parameterRegistry); + const args = regularExpression.match(text); + if (!args) { + return null; + } + return args.map((arg) => arg.getValue(null)); +}; +//# sourceMappingURL=RegularExpressionTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.js.map new file mode 100644 index 00000000..15206ecd --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/RegularExpressionTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpressionTest.js","sourceRoot":"","sources":["../../../test/RegularExpressionTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,qBAAqB,MAAM,iCAAiC,CAAA;AACnE,OAAO,iBAAiB,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAQ9C,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,WA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CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;IAC7C,MAAM,iBAAiB,GAAG,IAAI,qBAAqB,EAAE,CAAA;IACrD,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC1E,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC1C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.d.ts new file mode 100644 index 00000000..396124aa --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=TreeRegexpTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.d.ts.map new file mode 100644 index 00000000..240c5f41 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeRegexpTest.d.ts","sourceRoot":"","sources":["../../../test/TreeRegexpTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.js new file mode 100644 index 00000000..097943dc --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.js @@ -0,0 +1,126 @@ +import assert from 'assert'; +import TreeRegexp from '../src/TreeRegexp.js'; +describe('TreeRegexp', () => { + it('exposes group source', () => { + const tr = new TreeRegexp(/(a(?:b)?)(c)/); + assert.deepStrictEqual(tr.groupBuilder.children.map((gb) => gb.source), ['a(?:b)?', 'c']); + }); + it('builds tree', () => { + const tr = new TreeRegexp(/(a(?:b)?)(c)/); + const group = tr.match('ac'); + assert.strictEqual(group.value, 'ac'); + assert.strictEqual(group.children?.[0].value, 'a'); + assert.deepStrictEqual(group.children[0].children, undefined); + assert.strictEqual(group.children[1].value, 'c'); + }); + it('ignores `?:` as a non-capturing group', () => { + const tr = new TreeRegexp(/a(?:b)(c)/); + const group = tr.match('abc'); + assert.strictEqual(group.value, 'abc'); + assert.strictEqual(group.children?.length, 1); + }); + it('ignores `?!` as a non-capturing group', () => { + const tr = new TreeRegexp(/a(?!b)(.+)/); + const group = tr.match('aBc'); + assert.strictEqual(group.value, 'aBc'); + assert.strictEqual(group.children?.length, 1); + }); + it('ignores `?=` as a non-capturing group', () => { + const tr = new TreeRegexp(/a(?=[b])(.+)/); + const group = tr.match('abc'); + assert.strictEqual(group.value, 'abc'); + assert.strictEqual(group.children?.length, 1); + assert.strictEqual(group.children[0].value, 'bc'); + }); + it('ignores `?<=` as a non-capturing group', () => { + const tr = new TreeRegexp(/a(.+)(?<=c)$/); + const group = tr.match('abc'); + assert.strictEqual(group.value, 'abc'); + assert.strictEqual(group.children?.length, 1); + assert.strictEqual(group.children[0].value, 'bc'); + }); + it('ignores `? { + const tr = new TreeRegexp(/a(.+?)(? { + const tr = new TreeRegexp(/a(?b)c/); + const group = tr.match('abc'); + assert.strictEqual(group.value, 'abc'); + assert.strictEqual(group.children?.length, 1); + assert.strictEqual(group.children[0].value, 'b'); + }); + it('matches optional group', () => { + const tr = new TreeRegexp(/^Something( with an optional argument)?/); + const group = tr.match('Something'); + assert.strictEqual(group.children?.[0].value, undefined); + }); + it('matches nested groups', () => { + const tr = new TreeRegexp(/^A (\d+) thick line from ((\d+),\s*(\d+),\s*(\d+)) to ((\d+),\s*(\d+),\s*(\d+))/); + const group = tr.match('A 5 thick line from 10,20,30 to 40,50,60'); + assert.strictEqual(group.children?.[0].value, '5'); + assert.strictEqual(group.children?.[1].value, '10,20,30'); + assert.strictEqual(group.children?.[1].children?.[0].value, '10'); + assert.strictEqual(group.children?.[1].children?.[1].value, '20'); + assert.strictEqual(group.children?.[1].children?.[2].value, '30'); + assert.strictEqual(group.children?.[2].value, '40,50,60'); + assert.strictEqual(group.children?.[2].children?.[0].value, '40'); + assert.strictEqual(group.children?.[2].children?.[1].value, '50'); + assert.strictEqual(group.children?.[2].children?.[2].value, '60'); + }); + it('detects multiple non capturing groups', () => { + const tr = new TreeRegexp(/(?:a)(:b)(\?c)(d)/); + const group = tr.match('a:b?cd'); + assert.strictEqual(group.children?.length, 3); + }); + it('works with escaped backslash', () => { + const tr = new TreeRegexp(/foo\\(bar|baz)/); + const group = tr.match('foo\\bar'); + assert.strictEqual(group.children?.length, 1); + }); + it('works with escaped slash', () => { + const tr = new TreeRegexp(/^I go to '\/(.+)'$/); + const group = tr.match("I go to '/hello'"); + assert.strictEqual(group.children?.length, 1); + }); + it('works with digit and word', () => { + const tr = new TreeRegexp(/^(\d) (\w+)$/); + const group = tr.match('2 you'); + assert.strictEqual(group.children?.length, 2); + }); + it('captures non capturing groups with capturing groups inside', () => { + const tr = new TreeRegexp('the stdout(?: from "(.*?)")?'); + const group = tr.match('the stdout'); + assert.strictEqual(group.value, 'the stdout'); + assert.strictEqual(group.children?.[0].value, undefined); + assert.strictEqual(group.children?.length, 1); + }); + it('works with case insensitive flag', () => { + const tr = new TreeRegexp(/HELLO/i); + const group = tr.match('hello'); + assert.strictEqual(group.value, 'hello'); + }); + it('empty capturing group', () => { + const tr = new TreeRegexp(/()/); + const group = tr.match(''); + assert.strictEqual(group.value, ''); + assert.strictEqual(group.children?.length, 1); + }); + it('empty look ahead', () => { + const tr = new TreeRegexp(/(?<=)/); + const group = tr.match(''); + assert.strictEqual(group.value, ''); + assert.strictEqual(group.children, undefined); + }); + it('does not consider parenthesis in character class as group', () => { + const tr = new TreeRegexp(/^drawings: ([A-Z, ()]+)$/); + const group = tr.match('drawings: ONE(TWO)'); + assert.strictEqual(group.value, 'drawings: ONE(TWO)'); + assert.strictEqual(group.children?.length, 1); + assert.strictEqual(group.children[0].value, 'ONE(TWO)'); + }); +}); +//# sourceMappingURL=TreeRegexpTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.js.map new file mode 100644 index 00000000..16846228 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/TreeRegexpTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TreeRegexpTest.js","sourceRoot":"","sources":["../../../test/TreeRegexpTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,UAAU,MAAM,sBAAsB,CAAA;AAE7C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAC9B,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,cAAc,CAAC,CAAA;QACzC,MAAM,CAAC,eAAe,CACpB,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,EAC/C,CAAC,SAAS,EAAE,GAAG,CAAC,CACjB,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;QACrB,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,cAAc,CAAC,CAAA;QACzC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAE,CAAA;QAC7B,MAAM,CAAC,WAAW,CAAC,KAAK,CA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E,CAAA;QAC7C,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;QACrD,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;QAC7C,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.d.ts b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.d.ts new file mode 100644 index 00000000..d1ff6beb --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.d.ts @@ -0,0 +1,2 @@ +export declare const testDataDir: string; +//# sourceMappingURL=testDataDir.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.d.ts.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.d.ts.map new file mode 100644 index 00000000..8e3eda32 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"testDataDir.d.ts","sourceRoot":"","sources":["../../../test/testDataDir.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAkE,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.js b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.js new file mode 100644 index 00000000..5e11eb03 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.js @@ -0,0 +1,2 @@ +export const testDataDir = process.env.CUCUMBER_EXPRESSIONS_TEST_DATA_DIR || '../testdata'; +//# sourceMappingURL=testDataDir.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.js.map b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.js.map new file mode 100644 index 00000000..76559cbc --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/test/testDataDir.js.map @@ -0,0 +1 @@ +{"version":3,"file":"testDataDir.js","sourceRoot":"","sources":["../../../test/testDataDir.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,kCAAkC,IAAI,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/dist/esm/tsconfig.build-esm.tsbuildinfo b/node_modules/@cucumber/cucumber-expressions/dist/esm/tsconfig.build-esm.tsbuildinfo new file mode 100644 index 00000000..9b55229c --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/dist/esm/tsconfig.build-esm.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/CucumberExpressionError.ts","../../src/Group.ts","../../src/ParameterType.ts","../../src/Argument.ts","../../src/Ast.ts","../../src/types.ts","../../src/GeneratedExpression.ts","../../src/CombinatorialGeneratedExpressionFactory.ts","../../src/Errors.ts","../../src/CucumberExpressionTokenizer.ts","../../src/CucumberExpressionParser.ts","../../src/ParameterTypeMatcher.ts","../../src/CucumberExpressionGenerator.ts","../../src/defineDefaultParameterTypes.ts","../../src/ParameterTypeRegistry.ts","../../node_modules/regexp-match-indices/types.d.ts","../../node_modules/regexp-match-indices/index.d.ts","../../src/GroupBuilder.ts","../../src/TreeRegexp.ts","../../src/CucumberExpression.ts","../../src/RegularExpression.ts","../../src/ExpressionFactory.ts","../../src/index.ts","../../test/ArgumentTest.ts","../../test/CombinatorialGeneratedExpressionFactoryTest.ts","../../test/CucumberExpressionGeneratorTest.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/@types/node/web-globals/events.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/inspector.generated.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/sqlite.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/index.d.ts","../../node_modules/minipass/dist/commonjs/index.d.ts","../../node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts","../../node_modules/path-scurry/dist/commonjs/index.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts","../../node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts","../../node_modules/glob/dist/commonjs/pattern.d.ts","../../node_modules/glob/dist/commonjs/processor.d.ts","../../node_modules/glob/dist/commonjs/walker.d.ts","../../node_modules/glob/dist/commonjs/ignore.d.ts","../../node_modules/glob/dist/commonjs/glob.d.ts","../../node_modules/glob/dist/commonjs/has-magic.d.ts","../../node_modules/glob/dist/commonjs/index.d.ts","../../node_modules/@types/js-yaml/index.d.ts","../../test/testDataDir.ts","../../test/CucumberExpressionParserTest.ts","../../test/CucumberExpressionTest.ts","../../test/CucumberExpressionTokenizerTest.ts","../../test/CucumberExpressionTransformationTest.ts","../../test/CustomParameterTypeTest.ts","../../test/ExpressionFactoryTest.ts","../../test/ParameterTypeRegistryTest.ts","../../test/ParameterTypeTest.ts","../../test/RegularExpressionTest.ts","../../test/TreeRegexpTest.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/json5/index.d.ts","../../node_modules/@types/mocha/index.d.ts"],"fileIdsList":[[89,137,154,155],[89,134,135,137,154,155],[89,136,137,154,155],[137,154,155],[89,137,142,154,155,172],[89,137,138,143,148,154,155,157,169,180],[89,137,138,139,148,154,155,157],[84,85,86,89,137,154,155],[89,137,140,154,155,181],[89,137,141,142,149,154,155,158],[89,137,142,154,155,169,177],[89,137,143,145,148,154,155,157],[89,136,137,144,154,155],[89,137,145,146,154,155],[89,137,147,148,154,155],[89,136,137,148,154,155],[89,137,148,149,150,154,155,169,180],[89,137,148,149,150,154,155,164,169,172],[89,130,137,145,148,151,154,155,157,169,180],[89,137,148,149,151,152,154,155,157,169,177,180],[89,137,151,153,154,155,169,177,180],[87,88,89,90,91,92,93,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186],[89,137,148,154,155],[89,137,154,155,156,180],[89,137,145,148,154,155,157,169],[89,137,154,155,158],[89,137,154,155,159],[89,136,137,154,155,160],[89,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186],[89,137,154,155,162],[89,137,154,155,163],[89,137,148,154,155,164,165],[89,137,154,155,164,166,181,183],[89,137,149,154,155],[89,137,148,154,155,169,170,172],[89,137,154,155,171,172],[89,137,154,155,169,170],[89,137,154,155,172],[89,137,154,155,173],[89,134,137,154,155,169,174],[89,137,148,154,155,175,176],[89,137,154,155,175,176],[89,137,142,154,155,157,169,177],[89,137,154,155,178],[89,137,154,155,157,179],[89,137,151,154,155,163,180],[89,137,142,154,155,181],[89,137,154,155,169,182],[89,137,154,155,156,183],[89,137,154,155,184],[89,130,137,154,155],[89,130,137,148,150,154,155,160,169,172,180,182,183,185],[89,137,154,155,169,186],[89,137,154,155,188,190,194,195,198],[89,137,154,155,199],[89,137,154,155,190,194,197],[89,137,154,155,188,190,194,197,198,199,200],[89,137,154,155,194],[89,137,154,155,190,194,195,197],[89,137,154,155,188,190,195,196,198],[89,137,154,155,191,192,193],[89,137,148,154,155,173,187],[89,137,149,154,155,159,188,189],[73,89,137,154,155],[89,102,106,137,154,155,180],[89,102,137,154,155,169,180],[89,97,137,154,155],[89,99,102,137,154,155,177,180],[89,137,154,155,157,177],[89,137,154,155,187],[89,97,137,154,155,187],[89,99,102,137,154,155,157,180],[89,94,95,98,101,137,148,154,155,169,180],[89,102,109,137,154,155],[89,94,100,137,154,155],[89,102,123,124,137,154,155],[89,98,102,137,154,155,172,180,187],[89,123,137,154,155,187],[89,96,97,137,154,155,187],[89,102,137,154,155],[89,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,124,125,126,127,128,129,137,154,155],[89,102,117,137,154,155],[89,102,109,110,137,154,155],[89,100,102,110,111,137,154,155],[89,101,137,154,155],[89,94,97,102,137,154,155],[89,102,106,110,111,137,154,155],[89,106,137,154,155],[89,100,102,105,137,154,155,180],[89,94,99,102,109,137,154,155],[89,137,154,155,169],[89,97,102,123,137,154,155,185,187],[58,59,60,89,137,154,155],[60,64,89,137,154,155],[58,60,61,62,63,66,68,72,76,89,137,154,155],[60,64,65,69,89,137,154,155],[62,66,67,89,137,154,155],[62,66,89,137,154,155],[58,60,62,64,89,137,154,155],[63,72,77,78,89,137,154,155],[60,63,89,137,154,155],[59,74,89,137,154,155],[58,89,137,154,155],[60,89,137,154,155],[58,60,63,66,70,71,89,137,154,155],[60,61,63,72,76,89,137,154,155],[59,74,75,89,137,154,155],[59,60,61,62,63,64,70,72,77,78,79,89,137,154,155],[60,61,89,137,154,155],[61,72,76,89,134,137,154,155],[60,65,89,134,137,154,155],[60,63,70,72,77,89,134,137,154,155],[58,68,89,134,137,149,154,155,201,202,203],[58,60,72,77,89,134,137,149,154,155,201,202,203],[58,67,89,134,137,149,154,155,201,202,203],[72,77,89,134,137,149,154,155,201,202,203],[60,72,77,78,89,134,137,154,155],[72,77,78,79,89,134,137,154,155],[60,72,89,134,137,154,155],[72,78,89,134,137,149,154,155,201,202,203],[76,89,134,137,154,155]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"06da0313a696d2e58f6a6addb168a1faa1407045975ff672d492b233e0d03d18","signature":"e19e037d802f1c50c9342228dd2efc1588da9c715c091b7eadc0162c8503d967"},{"version":"9ede140de3bd446edc8f0504efc8dd890233bff149e3e391d9bc4d9aa9d90b26","signature":"24ef89d81df156d80bde512dd17090b7d27d09020287f28760ac078be9bebf4c"},{"version":"c7df0f4ab2534847f922c0ebf91a9e4ee33e4bd4164027ccbd5e27175e35519d","signature":"57490d02476c72fe9cae1b34584e123676a0348dea80e4812a4e250c52c38468"},{"version":"48b35c8418e69a7860c9de016a31d6182a4ea0e6d8b7a76eecb147c35800385f","signature":"b95293f52864ea44926cb1d1e32b48b68b8b332458da73c58b1e987571158974"},{"version":"a39b2332d4b3b34a0bc15ede317e26df01db21ca91ed5b65d46d01959d1c5b96","signature":"dd82562bcc9bed49db1280d7df870c4b820b5a5919298dc1e3f1eb1d739224ba"},{"version":"3ff166ec4e9b528423ee62aac60c9ac8be821e7bf4518ce90a4700c9b21258e7","signature":"6726ccf9600c6d389280f6ea05c73aee451921d77cb5a3bb49bbbaf86b0a38fa"},{"version":"6f1bd6cf08275bee0efc51828ba69467f323b9d50fb452b3a16d4efd9db60921","signature":"c1dd30504a69bd635e607aaf09b8fda675d27695b625968e13abbbe48917481f"},{"version":"4e7ac7085ebf893ed30952e9d2f2b4d5c377bf23f27d3a13b592e81e501a7a15","signature":"0eb46bea5c59364676679c8c4a83284a9fefecb1b77dcef37063001e6635ddd2"},{"version":"15050d75e57b9c0c7af24607306345edc2a754d13226ff0660c6f27e9513877b","signature":"5bdd2ecd3a23eb6ea616dbde6af2f8ce53e6a475d71702be34c3507373e482ab"},{"version":"02ceec18f2977ea36bec3811ce368fc98e06fff7cb0b11d7c9643209353990d2","signature":"2138c76a0f136863b80ffe260c911617b4005089249d69c73852c125bc8d9ab4"},{"version":"92c2ef0cae2f23efbfe8297128ad0e7afb966180a190e45ebc235971e5095166","signature":"ee114ff5f88e7ee60e64b3161a1ee0579a7d04e0558c82af84788f38996f3f81"},{"version":"3f1f10e6e19a5b539236e29ef5d8318d23d2a67af3223dd0d9ca946da46aef6f","signature":"c5ad640bad7e50aad9f2557b75f64343104edf224ec3ceda26bb12c8a4a84afe"},{"version":"3216975032fc1c8bfbb5cec14b889253b161f9d07be73656cb04b4bff823d2a7","signature":"82d252437544aa799caa000db1444f0b7c98db797c2afaab02942e0a073a47d5"},{"version":"be7b6e29bef5c9d2f26580920f5cb7aeee545797ef3e46dc2e566c9459141c6c","signature":"4398e3d5a86dbe1dc3402c571726c7628955c6300fc653cdf0746780c961c957"},{"version":"690a8b7244f18c8eba19571af5c7be77515b7d751cfedebafc68dc017f06655e","signature":"8cff33b8ea70c630b18f450058ef452f0f0e1a90729cb370c41caab99e498af4"},{"version":"9aa137f97595ff06582fdb09968f1e5fb52f95cb908c6698f462898f82a0bba6","impliedFormat":1},{"version":"b3f65f9c303e875847a2fbe493a34cffdb670370f9d4fd45454f4d80f8077e92","impliedFormat":1},{"version":"cacf93178175c185d8029588737861735bc326aaefb9a5a41f16f117475d8c57","signature":"28e640b5eec581a031f5ae17928fd1bfcaabd3a724b720ee9f8a92af8c351001"},{"version":"f63cb2e3ab889485ee76b4c582af1e1dc68141def643c863072bcc3ce474e598","signature":"50427d3f68d0d5587ce95805b1a305cb644eabd24581b7b5174290bbbe99275a"},{"version":"929e9d63cbd3f3ffd9dc5b5cb42584eeba8d74213ae2c73db2593b1f1cd3204f","signature":"b69216b9607b65105ec37d75b761a66b89302243f6ff8973cb3a04cb44f10919"},{"version":"ee3cfcd57f3fd496857657db2cba3fe23b44a33208be1da2fefeae1737b59566","signature":"c917934380703484415937e8b21b1d797c413728825d2091ddfbd6df615a6e1e"},{"version":"251936125619b35babf300d0fca313df31be9f4ffb5d08ec9f79e11f5f318175","signature":"4bc26751aef71adea01a2c9cc13edf25f0c49d4c8840f4923b31eb34141d2f99"},{"version":"b7472159e705d18142777b49b2cb366fd47ff02f1eec67c1ca348a3823eb7dd5","signature":"73a104ea71e78302bb48a144e71aaef7df820cdbfa3446ffe12ad8315df8c1f3"},{"version":"4ab1230aa0c2d915e82587964b57b233a9eb1445c833550f5d55c62840f92069","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"66d910a4c1cdc79314fdeecf414e2b28527d1ff83191a1afce484b5d2c75e082","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"7bd1d50838e19b47cdf378b8925153d89d66cc9294a84162e79b48d94ca59d83","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"bb45cd435da536500f1d9692a9b49d0c570b763ccbf00473248b777f5c1f353b","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bc7425ef40526650d6db7e072c1ff4a51101c3ac2cc4b666623b19496a6e27","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c959a391a75be9789b43c8468f71e3fa06488b4d691d5729dde1416dcd38225b","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"0dba70b3fb0dcd713fda33c2df64fa6751fff6460e536971cee917260fb17882","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"041597c12abeaa2ef07766775955fc87cfc65c43e0fe86c836071bea787e967c","impliedFormat":1},{"version":"0838507efff4f479c6f603ec812810ddfe14ab32abf8f4a8def140be970fe439","impliedFormat":1},{"version":"072f583571d6e3d30cd9760ee3485d29484fb7b54ba772ac135c747a380096a1","impliedFormat":1},{"version":"7212c2d58855b8df35275180e97903a4b6093d4fbaefea863d8d028da63938c6","impliedFormat":1},{"version":"d8a6b3f899917210f00ddf13b564a2a4fdcf1e50c5a22e8d3abcfd4f1c4f9ae1","impliedFormat":1},{"version":"fd5eab954b31e761a72234031dadc3aab768763942a9637e380aed441cc94f59","impliedFormat":1},{"version":"c7aaac3119acf27e03190cc4224f1d81c7498cf6b36fa72d10d99f2c41d1bbc0","impliedFormat":1},{"version":"dd9faff42b456b5f03b85d8fbd64838eb92f6f7b03b36322cbc59c005b7033d3","impliedFormat":1},{"version":"6ff702721d87c0ba8e7f8950e7b0a3b009dfd912fab3997e0b63fab8d83919c3","impliedFormat":1},{"version":"9dce9fc12e9a79d1135699d525aa6b44b71a45e32e3fa0cf331060b980b16317","impliedFormat":1},{"version":"586b2fd8a7d582329658aaceec22f8a5399e05013deb49bcfde28f95f093c8ee","impliedFormat":1},{"version":"59c44b081724d4ab8039988aba34ee6b3bd41c30fc2d8686f4ed06588397b2f7","impliedFormat":1},{"version":"ef1f3eadd7bed282de45bafd7c2c00105cf1db93e22f6cd763bec8a9c2cf6df1","impliedFormat":1},{"version":"2b90463c902dbe4f5bbb9eae084c05de37477c17a5de1e342eb7cbc9410dc6a1","impliedFormat":1},{"version":"7a1dd1e9c8bf5e23129495b10718b280340c7500570e0cfe5cffcdee51e13e48","impliedFormat":1},{"version":"70eb87bf376ae18494fb327896dc04d556a65c41340a2f5b35d6e10cc7075afa","signature":"bd6640feffbb44ade7ce92bd1353f4ca41107af7bc1a05b290e1344854e60fcf"},{"version":"78c612ac6dd0b1ca0e84909ce3d1911b7d80770dfa8aa34958d2d649055b8f3c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"546f00a65afbab43856de4ce377a216b46eb4a0561b92c1c1c045bc61664a14d","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"c9df1727c08e547a6868f4926623ed20ab46fe8d6785a1de752ea2893e521a48","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3103fa8e4fc36db909e5d60d457c852ecffbfda0a59844fcaf5f4ad154259733","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"ff9e3afda6d0a0c4194f07192f026e04916ec75da062daf75507774e06554ec6","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"afc239b67160dbb808d7dbd7bb29ad575b5fbf1b89b95622a7eaef332f07c8c4","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"3b0142c0b79b03f4d0b2e585b1f1885313e6a736a70e8fde352acf2554220ca4","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"dcb32fa9db22b6581af2a8ea72302a7d9282bd09138069d875d88dc874abf506","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"a96d1dcfe2725b2438877eefe2be8e310aa56c387f6ba974f3e222e6a5f67254","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"9ad8981ef9c1e9c275f6a6e703761243664f43921d71ed6c5fb89ca50b0cc5bf","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1}],"root":[[58,72],[75,83],[203,213]],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":5,"noImplicitAny":true,"outDir":"./","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":9},"referencedMap":[[214,1],[202,1],[215,1],[216,1],[217,1],[134,2],[135,2],[136,3],[89,4],[137,5],[138,6],[139,7],[84,1],[87,8],[85,1],[86,1],[140,9],[141,10],[142,11],[143,12],[144,13],[145,14],[146,14],[147,15],[148,16],[149,17],[150,18],[90,1],[88,1],[151,19],[152,20],[153,21],[187,22],[154,23],[155,1],[156,24],[157,25],[158,26],[159,27],[160,28],[161,29],[162,30],[163,31],[164,32],[165,32],[166,33],[167,1],[168,34],[169,35],[171,36],[170,37],[172,38],[173,39],[174,40],[175,41],[176,42],[177,43],[178,44],[179,45],[180,46],[181,47],[182,48],[183,49],[184,50],[91,1],[92,1],[93,1],[131,51],[132,1],[133,1],[185,52],[186,53],[199,54],[200,55],[198,56],[201,57],[195,58],[196,59],[197,60],[191,58],[192,58],[194,61],[193,58],[188,62],[190,63],[189,1],[74,64],[73,1],[56,1],[57,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[20,1],[21,1],[4,1],[22,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[8,1],[49,1],[46,1],[47,1],[48,1],[50,1],[9,1],[51,1],[52,1],[53,1],[55,1],[54,1],[1,1],[109,65],[119,66],[108,65],[129,67],[100,68],[99,69],[128,70],[122,71],[127,72],[102,73],[116,74],[101,75],[125,76],[97,77],[96,70],[126,78],[98,79],[103,80],[104,1],[107,80],[94,1],[130,81],[120,82],[111,83],[112,84],[114,85],[110,86],[113,87],[123,70],[105,88],[106,89],[115,90],[95,91],[118,82],[117,80],[121,1],[124,92],[61,93],[62,1],[65,94],[77,95],[58,1],[70,96],[68,97],[67,98],[66,99],[79,100],[64,101],[59,1],[75,102],[60,103],[69,104],[72,105],[78,106],[76,107],[71,101],[80,108],[63,109],[81,110],[82,111],[83,112],[204,113],[205,114],[206,115],[207,116],[208,117],[209,118],[210,119],[211,119],[212,120],[213,121],[203,1]],"latestChangedDtsFile":"./test/TreeRegexpTest.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber-expressions/package.json b/node_modules/@cucumber/cucumber-expressions/package.json new file mode 100644 index 00000000..d0ba192d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/package.json @@ -0,0 +1,81 @@ +{ + "name": "@cucumber/cucumber-expressions", + "version": "19.0.0", + "description": "Cucumber Expressions - a simpler alternative to Regular Expressions", + "type": "module", + "main": "dist/cjs/src/index.js", + "types": "dist/cjs/src/index.d.ts", + "files": [ + "dist/cjs", + "dist/esm", + "src" + ], + "module": "dist/esm/src/index.js", + "jsnext:main": "dist/esm/src/index.js", + "exports": { + ".": { + "import": "./dist/esm/src/index.js", + "require": "./dist/cjs/src/index.js" + } + }, + "scripts": { + "build:cjs": "tsc --build tsconfig.build-cjs.json && cp package.cjs.json dist/cjs/package.json", + "build:esm": "tsc --build tsconfig.build-esm.json", + "build": "npm run build:cjs && npm run build:esm && cp ../README.md dist", + "test": "mocha && npm run test:cjs", + "test:cjs": "npm run build:cjs && mocha --no-config dist/cjs/test", + "stryker": "cross-env CUCUMBER_EXPRESSIONS_TEST_DATA_DIR=$(pwd)/../testdata stryker run", + "prepublishOnly": "npm run build", + "fix": "eslint --max-warnings 0 --fix src test && prettier --write src test", + "lint": "eslint --max-warnings 0 src test && prettier --check src test" + }, + "repository": { + "type": "git", + "url": "git://github.com/cucumber/cucumber-expressions.git" + }, + "keywords": [ + "cucumber", + "steps", + "regexp", + "regex" + ], + "author": "Cucumber Limited ", + "license": "MIT", + "bugs": { + "url": "https://github.com/cucumber/cucumber-expressions/issues" + }, + "homepage": "https://github.com/cucumber/cucumber-expressions#readme", + "devDependencies": { + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "^9.21.0", + "@stryker-mutator/core": "9.4.0", + "@stryker-mutator/mocha-runner": "9.4.0", + "@types/glob": "9.0.0", + "@types/js-yaml": "4.0.9", + "@types/mocha": "10.0.10", + "@types/node": "22.19.7", + "@typescript-eslint/eslint-plugin": "^8.43.0", + "@typescript-eslint/parser": "^8.43.0", + "cross-env": "10.1.0", + "esbuild": "0.27.2", + "eslint": "^9.21.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-simple-import-sort": "^12.1.1", + "glob": "13.0.0", + "globals": "^17.0.0", + "js-yaml": "4.1.1", + "mocha": "11.7.5", + "prettier": "^3.5.2", + "pretty-quick": "4.2.2", + "ts-node": "10.9.2", + "typescript": "5.9.3" + }, + "dependencies": { + "regexp-match-indices": "1.0.2" + }, + "directories": { + "test": "test" + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/Argument.ts b/node_modules/@cucumber/cucumber-expressions/src/Argument.ts new file mode 100644 index 00000000..72d39141 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/Argument.ts @@ -0,0 +1,46 @@ +import CucumberExpressionError from './CucumberExpressionError.js' +import Group from './Group.js' +import ParameterType from './ParameterType.js' + +export default class Argument { + public static build( + group: Group, + parameterTypes: readonly ParameterType[] + ): readonly Argument[] { + const argGroups = group.children || [] + + if (argGroups.length !== parameterTypes.length) { + throw new CucumberExpressionError( + `Group has ${argGroups.length} capture groups (${argGroups.map( + (g) => g.value + )}), but there were ${parameterTypes.length} parameter types (${parameterTypes.map( + (p) => p.name + )})` + ) + } + + return parameterTypes.map((parameterType, i) => new Argument(argGroups[i], parameterType)) + } + + constructor( + public readonly group: Group, + public readonly parameterType: ParameterType + ) { + this.group = group + this.parameterType = parameterType + } + + /** + * Get the value returned by the parameter type's transformer function. + * + * @param thisObj the object in which the transformer function is applied. + */ + public getValue(thisObj: unknown): T | null { + const groupValues = this.group ? this.group.values : null + return this.parameterType.transform(thisObj, groupValues) + } + + public getParameterType() { + return this.parameterType + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/Ast.ts b/node_modules/@cucumber/cucumber-expressions/src/Ast.ts new file mode 100644 index 00000000..44d9e18f --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/Ast.ts @@ -0,0 +1,143 @@ +const escapeCharacter = '\\' +const alternationCharacter = '/' +const beginParameterCharacter = '{' +const endParameterCharacter = '}' +const beginOptionalCharacter = '(' +const endOptionalCharacter = ')' + +export function symbolOf(token: TokenType): string { + switch (token) { + case TokenType.beginOptional: + return beginOptionalCharacter + case TokenType.endOptional: + return endOptionalCharacter + case TokenType.beginParameter: + return beginParameterCharacter + case TokenType.endParameter: + return endParameterCharacter + case TokenType.alternation: + return alternationCharacter + } + return '' +} + +export function purposeOf(token: TokenType): string { + switch (token) { + case TokenType.beginOptional: + case TokenType.endOptional: + return 'optional text' + case TokenType.beginParameter: + case TokenType.endParameter: + return 'a parameter' + case TokenType.alternation: + return 'alternation' + } + return '' +} + +export interface Located { + readonly start: number + readonly end: number +} + +export class Node implements Located { + constructor( + public readonly type: NodeType, + public readonly nodes: readonly Node[] | undefined, + private readonly token: string | undefined, + public readonly start: number, + public readonly end: number + ) { + if (nodes === undefined && token === undefined) { + throw new Error('Either nodes or token must be defined') + } + } + + text(): string { + if (this.nodes && this.nodes.length > 0) { + return this.nodes.map((value) => value.text()).join('') + } + return this.token || '' + } +} + +export enum NodeType { + text = 'TEXT_NODE', + optional = 'OPTIONAL_NODE', + alternation = 'ALTERNATION_NODE', + alternative = 'ALTERNATIVE_NODE', + parameter = 'PARAMETER_NODE', + expression = 'EXPRESSION_NODE', +} + +export class Token implements Located { + readonly type: TokenType + readonly text: string + readonly start: number + readonly end: number + + constructor(type: TokenType, text: string, start: number, end: number) { + this.type = type + this.text = text + this.start = start + this.end = end + } + + static isEscapeCharacter(codePoint: string): boolean { + return codePoint == escapeCharacter + } + + static canEscape(codePoint: string): boolean { + if (codePoint == ' ') { + // TODO: Unicode whitespace? + return true + } + switch (codePoint) { + case escapeCharacter: + return true + case alternationCharacter: + return true + case beginParameterCharacter: + return true + case endParameterCharacter: + return true + case beginOptionalCharacter: + return true + case endOptionalCharacter: + return true + } + return false + } + + static typeOf(codePoint: string): TokenType { + if (codePoint == ' ') { + // TODO: Unicode whitespace? + return TokenType.whiteSpace + } + switch (codePoint) { + case alternationCharacter: + return TokenType.alternation + case beginParameterCharacter: + return TokenType.beginParameter + case endParameterCharacter: + return TokenType.endParameter + case beginOptionalCharacter: + return TokenType.beginOptional + case endOptionalCharacter: + return TokenType.endOptional + } + return TokenType.text + } +} + +export enum TokenType { + startOfLine = 'START_OF_LINE', + endOfLine = 'END_OF_LINE', + whiteSpace = 'WHITE_SPACE', + beginOptional = 'BEGIN_OPTIONAL', + endOptional = 'END_OPTIONAL', + beginParameter = 'BEGIN_PARAMETER', + endParameter = 'END_PARAMETER', + alternation = 'ALTERNATION', + text = 'TEXT', +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/CombinatorialGeneratedExpressionFactory.ts b/node_modules/@cucumber/cucumber-expressions/src/CombinatorialGeneratedExpressionFactory.ts new file mode 100644 index 00000000..51866482 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/CombinatorialGeneratedExpressionFactory.ts @@ -0,0 +1,49 @@ +import GeneratedExpression from './GeneratedExpression.js' +import ParameterType from './ParameterType.js' + +// 256 generated expressions ought to be enough for anybody +const MAX_EXPRESSIONS = 256 + +export default class CombinatorialGeneratedExpressionFactory { + constructor( + private readonly expressionTemplate: string, + private readonly parameterTypeCombinations: Array>> + ) { + this.expressionTemplate = expressionTemplate + } + + public generateExpressions(): readonly GeneratedExpression[] { + const generatedExpressions: GeneratedExpression[] = [] + this.generatePermutations(generatedExpressions, 0, []) + return generatedExpressions + } + + private generatePermutations( + generatedExpressions: GeneratedExpression[], + depth: number, + currentParameterTypes: Array> + ) { + if (generatedExpressions.length >= MAX_EXPRESSIONS) { + return + } + + if (depth === this.parameterTypeCombinations.length) { + generatedExpressions.push( + new GeneratedExpression(this.expressionTemplate, currentParameterTypes) + ) + return + } + + // tslint:disable-next-line:prefer-for-of + for (let i = 0; i < this.parameterTypeCombinations[depth].length; ++i) { + // Avoid recursion if no elements can be added. + if (generatedExpressions.length >= MAX_EXPRESSIONS) { + return + } + + const newCurrentParameterTypes = currentParameterTypes.slice() // clone + newCurrentParameterTypes.push(this.parameterTypeCombinations[depth][i]) + this.generatePermutations(generatedExpressions, depth + 1, newCurrentParameterTypes) + } + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/CucumberExpression.ts b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpression.ts new file mode 100644 index 00000000..d1da0589 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpression.ts @@ -0,0 +1,160 @@ +import Argument from './Argument.js' +import { Node, NodeType } from './Ast.js' +import CucumberExpressionError from './CucumberExpressionError.js' +import CucumberExpressionParser from './CucumberExpressionParser.js' +import { + createAlternativeMayNotBeEmpty, + createAlternativeMayNotExclusivelyContainOptionals, + createOptionalIsNotAllowedInOptional, + createOptionalMayNotBeEmpty, + createParameterIsNotAllowedInOptional, + createUndefinedParameterType, +} from './Errors.js' +import ParameterType from './ParameterType.js' +import ParameterTypeRegistry from './ParameterTypeRegistry.js' +import TreeRegexp from './TreeRegexp.js' +import { Expression } from './types.js' + +const ESCAPE_PATTERN = () => /([\\^[({$.|?*+})\]])/g + +export default class CucumberExpression implements Expression { + private readonly parameterTypes: Array> = [] + private readonly treeRegexp: TreeRegexp + public readonly ast: Node + + /** + * @param expression + * @param parameterTypeRegistry + */ + constructor( + private readonly expression: string, + private readonly parameterTypeRegistry: ParameterTypeRegistry + ) { + const parser = new CucumberExpressionParser() + this.ast = parser.parse(expression) + const pattern = this.rewriteToRegex(this.ast) + this.treeRegexp = new TreeRegexp(pattern) + } + + private rewriteToRegex(node: Node): string { + switch (node.type) { + case NodeType.text: + return CucumberExpression.escapeRegex(node.text()) + case NodeType.optional: + return this.rewriteOptional(node) + case NodeType.alternation: + return this.rewriteAlternation(node) + case NodeType.alternative: + return this.rewriteAlternative(node) + case NodeType.parameter: + return this.rewriteParameter(node) + case NodeType.expression: + return this.rewriteExpression(node) + default: + // Can't happen as long as the switch case is exhaustive + throw new Error(node.type) + } + } + + private static escapeRegex(expression: string) { + return expression.replace(ESCAPE_PATTERN(), '\\$1') + } + + private rewriteOptional(node: Node): string { + this.assertNoParameters(node, (astNode) => + createParameterIsNotAllowedInOptional(astNode, this.expression) + ) + this.assertNoOptionals(node, (astNode) => + createOptionalIsNotAllowedInOptional(astNode, this.expression) + ) + this.assertNotEmpty(node, (astNode) => createOptionalMayNotBeEmpty(astNode, this.expression)) + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join('') + return `(?:${regex})?` + } + + private rewriteAlternation(node: Node) { + // Make sure the alternative parts aren't empty and don't contain parameter types + for (const alternative of node.nodes || []) { + if (!alternative.nodes || alternative.nodes.length == 0) { + throw createAlternativeMayNotBeEmpty(alternative, this.expression) + } + this.assertNotEmpty(alternative, (astNode) => + createAlternativeMayNotExclusivelyContainOptionals(astNode, this.expression) + ) + } + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join('|') + return `(?:${regex})` + } + + private rewriteAlternative(node: Node) { + return (node.nodes || []).map((lastNode) => this.rewriteToRegex(lastNode)).join('') + } + + private rewriteParameter(node: Node) { + const name = node.text() + const parameterType = this.parameterTypeRegistry.lookupByTypeName(name) + if (!parameterType) { + throw createUndefinedParameterType(node, this.expression, name) + } + this.parameterTypes.push(parameterType) + const regexps = parameterType.regexpStrings + if (regexps.length == 1) { + return `(${regexps[0]})` + } + return `((?:${regexps.join(')|(?:')}))` + } + + private rewriteExpression(node: Node) { + const regex = (node.nodes || []).map((node) => this.rewriteToRegex(node)).join('') + return `^${regex}$` + } + + private assertNotEmpty( + node: Node, + createNodeWasNotEmptyException: (astNode: Node) => CucumberExpressionError + ) { + const textNodes = (node.nodes || []).filter((astNode) => NodeType.text == astNode.type) + + if (textNodes.length == 0) { + throw createNodeWasNotEmptyException(node) + } + } + + private assertNoParameters( + node: Node, + createNodeContainedAParameterError: (astNode: Node) => CucumberExpressionError + ) { + const parameterNodes = (node.nodes || []).filter( + (astNode) => NodeType.parameter == astNode.type + ) + if (parameterNodes.length > 0) { + throw createNodeContainedAParameterError(parameterNodes[0]) + } + } + + private assertNoOptionals( + node: Node, + createNodeContainedAnOptionalError: (astNode: Node) => CucumberExpressionError + ) { + const parameterNodes = (node.nodes || []).filter((astNode) => NodeType.optional == astNode.type) + if (parameterNodes.length > 0) { + throw createNodeContainedAnOptionalError(parameterNodes[0]) + } + } + + public match(text: string): readonly Argument[] | null { + const group = this.treeRegexp.match(text) + if (!group) { + return null + } + return Argument.build(group, this.parameterTypes) + } + + get regexp(): RegExp { + return this.treeRegexp.regexp + } + + get source(): string { + return this.expression + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionError.ts b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionError.ts new file mode 100644 index 00000000..5fc12cfa --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionError.ts @@ -0,0 +1 @@ +export default class CucumberExpressionError extends Error {} diff --git a/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionGenerator.ts b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionGenerator.ts new file mode 100644 index 00000000..75aa59c7 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionGenerator.ts @@ -0,0 +1,97 @@ +import CombinatorialGeneratedExpressionFactory from './CombinatorialGeneratedExpressionFactory.js' +import GeneratedExpression from './GeneratedExpression.js' +import ParameterType from './ParameterType.js' +import ParameterTypeMatcher from './ParameterTypeMatcher.js' + +export default class CucumberExpressionGenerator { + constructor(private readonly parameterTypes: () => Iterable>) {} + + public generateExpressions(text: string): readonly GeneratedExpression[] { + const parameterTypeCombinations: Array>> = [] + const parameterTypeMatchers = this.createParameterTypeMatchers(text) + let expressionTemplate = '' + let pos = 0 + let counter = 0 + + while (true) { + let matchingParameterTypeMatchers = [] + + for (const parameterTypeMatcher of parameterTypeMatchers) { + const advancedParameterTypeMatcher = parameterTypeMatcher.advanceTo(pos) + if (advancedParameterTypeMatcher.find) { + matchingParameterTypeMatchers.push(advancedParameterTypeMatcher) + } + } + + if (matchingParameterTypeMatchers.length > 0) { + matchingParameterTypeMatchers = matchingParameterTypeMatchers.sort( + ParameterTypeMatcher.compare + ) + + // Find all the best parameter type matchers, they are all candidates. + const bestParameterTypeMatcher = matchingParameterTypeMatchers[0] + const bestParameterTypeMatchers = matchingParameterTypeMatchers.filter( + (m) => ParameterTypeMatcher.compare(m, bestParameterTypeMatcher) === 0 + ) + + // Build a list of parameter types without duplicates. The reason there + // might be duplicates is that some parameter types have more than one regexp, + // which means multiple ParameterTypeMatcher objects will have a reference to the + // same ParameterType. + // We're sorting the list so preferential parameter types are listed first. + // Users are most likely to want these, so they should be listed at the top. + let parameterTypes = [] + for (const parameterTypeMatcher of bestParameterTypeMatchers) { + if (parameterTypes.indexOf(parameterTypeMatcher.parameterType) === -1) { + parameterTypes.push(parameterTypeMatcher.parameterType) + } + } + parameterTypes = parameterTypes.sort(ParameterType.compare) + + parameterTypeCombinations.push(parameterTypes) + + expressionTemplate += escape(text.slice(pos, bestParameterTypeMatcher.start)) + expressionTemplate += `{{${counter++}}}` + + pos = bestParameterTypeMatcher.start + bestParameterTypeMatcher.group.length + } else { + break + } + + if (pos >= text.length) { + break + } + } + + expressionTemplate += escape(text.slice(pos)) + return new CombinatorialGeneratedExpressionFactory( + expressionTemplate, + parameterTypeCombinations + ).generateExpressions() + } + + private createParameterTypeMatchers(text: string): ParameterTypeMatcher[] { + let parameterMatchers: ParameterTypeMatcher[] = [] + for (const parameterType of this.parameterTypes()) { + if (parameterType.useForSnippets) { + parameterMatchers = parameterMatchers.concat( + CucumberExpressionGenerator.createParameterTypeMatchers2(parameterType, text) + ) + } + } + return parameterMatchers + } + + private static createParameterTypeMatchers2( + parameterType: ParameterType, + text: string + ): ParameterTypeMatcher[] { + return parameterType.regexpStrings.map( + (regexp) => new ParameterTypeMatcher(parameterType, regexp, text) + ) + } +} + +function escape(s: string): string { + return s.replace(/\(/g, '\\(').replace(/{/g, '\\{').replace(/\//g, '\\/') +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionParser.ts b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionParser.ts new file mode 100644 index 00000000..747c1b80 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionParser.ts @@ -0,0 +1,321 @@ +import { Node, NodeType, Token, TokenType } from './Ast.js' +import CucumberExpressionTokenizer from './CucumberExpressionTokenizer.js' +import { + createAlternationNotAllowedInOptional, + createInvalidParameterTypeNameInNode, + createMissingEndToken, +} from './Errors.js' + +/* + * text := whitespace | ')' | '}' | . + */ +function parseText(expression: string, tokens: readonly Token[], current: number): Result { + const token = tokens[current] + switch (token.type) { + case TokenType.whiteSpace: + case TokenType.text: + case TokenType.endParameter: + case TokenType.endOptional: + return { + consumed: 1, + ast: [new Node(NodeType.text, undefined, token.text, token.start, token.end)], + } + case TokenType.alternation: + throw createAlternationNotAllowedInOptional(expression, token) + case TokenType.startOfLine: + case TokenType.endOfLine: + case TokenType.beginOptional: + case TokenType.beginParameter: + default: + // If configured correctly this will never happen + return { consumed: 0, ast: [] } + } +} + +/* + * parameter := '{' + name* + '}' + */ +function parseName(expression: string, tokens: readonly Token[], current: number): Result { + const token = tokens[current] + switch (token.type) { + case TokenType.whiteSpace: + case TokenType.text: + return { + consumed: 1, + ast: [new Node(NodeType.text, undefined, token.text, token.start, token.end)], + } + case TokenType.beginOptional: + case TokenType.endOptional: + case TokenType.beginParameter: + case TokenType.endParameter: + case TokenType.alternation: + throw createInvalidParameterTypeNameInNode(token, expression) + case TokenType.startOfLine: + case TokenType.endOfLine: + default: + // If configured correctly this will never happen + return { consumed: 0, ast: [] } + } +} + +/* + * parameter := '{' + text* + '}' + */ +const parseParameter = parseBetween( + NodeType.parameter, + TokenType.beginParameter, + TokenType.endParameter, + [parseName] +) + +/* + * optional := '(' + option* + ')' + * option := optional | parameter | text + */ +const optionalSubParsers: Array = [] +const parseOptional = parseBetween( + NodeType.optional, + TokenType.beginOptional, + TokenType.endOptional, + optionalSubParsers +) +optionalSubParsers.push(parseOptional, parseParameter, parseText) + +/* + * alternation := alternative* + ( '/' + alternative* )+ + */ +function parseAlternativeSeparator( + expression: string, + tokens: readonly Token[], + current: number +): Result { + if (!lookingAt(tokens, current, TokenType.alternation)) { + return { consumed: 0, ast: [] } + } + const token = tokens[current] + return { + consumed: 1, + ast: [new Node(NodeType.alternative, undefined, token.text, token.start, token.end)], + } +} + +const alternativeParsers: readonly Parser[] = [ + parseAlternativeSeparator, + parseOptional, + parseParameter, + parseText, +] + +/* + * alternation := (?<=left-boundary) + alternative* + ( '/' + alternative* )+ + (?=right-boundary) + * left-boundary := whitespace | } | ^ + * right-boundary := whitespace | { | $ + * alternative: = optional | parameter | text + */ +const parseAlternation: Parser = (expression, tokens, current) => { + const previous = current - 1 + if ( + !lookingAtAny(tokens, previous, [ + TokenType.startOfLine, + TokenType.whiteSpace, + TokenType.endParameter, + ]) + ) { + return { consumed: 0, ast: [] } + } + + const result = parseTokensUntil(expression, alternativeParsers, tokens, current, [ + TokenType.whiteSpace, + TokenType.endOfLine, + TokenType.beginParameter, + ]) + const subCurrent = current + result.consumed + if (!result.ast.some((astNode) => astNode.type == NodeType.alternative)) { + return { consumed: 0, ast: [] } + } + + const start = tokens[current].start + const end = tokens[subCurrent].start + // Does not consume right hand boundary token + return { + consumed: result.consumed, + ast: [ + new Node( + NodeType.alternation, + splitAlternatives(start, end, result.ast), + undefined, + start, + end + ), + ], + } +} + +/* + * cucumber-expression := ( alternation | optional | parameter | text )* + */ +const parseCucumberExpression = parseBetween( + NodeType.expression, + TokenType.startOfLine, + TokenType.endOfLine, + [parseAlternation, parseOptional, parseParameter, parseText] +) + +export default class CucumberExpressionParser { + parse(expression: string): Node { + const tokenizer = new CucumberExpressionTokenizer() + const tokens = tokenizer.tokenize(expression) + const result = parseCucumberExpression(expression, tokens, 0) + return result.ast[0] + } +} + +interface Parser { + (expression: string, tokens: readonly Token[], current: number): Result +} + +type Result = { + readonly consumed: number + readonly ast: readonly Node[] +} + +function parseBetween( + type: NodeType, + beginToken: TokenType, + endToken: TokenType, + parsers: Array +): Parser { + return (expression, tokens, current) => { + if (!lookingAt(tokens, current, beginToken)) { + return { consumed: 0, ast: [] } + } + let subCurrent = current + 1 + const result = parseTokensUntil(expression, parsers, tokens, subCurrent, [ + endToken, + TokenType.endOfLine, + ]) + subCurrent += result.consumed + + // endToken not found + if (!lookingAt(tokens, subCurrent, endToken)) { + throw createMissingEndToken(expression, beginToken, endToken, tokens[current]) + } + // consumes endToken + const start = tokens[current].start + const end = tokens[subCurrent].end + const consumed = subCurrent + 1 - current + const ast = [new Node(type, result.ast, undefined, start, end)] + return { consumed, ast } + } +} + +function parseToken( + expression: string, + parsers: readonly Parser[], + tokens: readonly Token[], + startAt: number +): Result { + for (let i = 0; i < parsers.length; i++) { + const parse = parsers[i] + const result = parse(expression, tokens, startAt) + if (result.consumed != 0) { + return result + } + } + // If configured correctly this will never happen + throw new Error('No eligible parsers for ' + tokens) +} + +function parseTokensUntil( + expression: string, + parsers: readonly Parser[], + tokens: readonly Token[], + startAt: number, + endTokens: readonly TokenType[] +): Result { + let current = startAt + const size = tokens.length + const ast: Node[] = [] + while (current < size) { + if (lookingAtAny(tokens, current, endTokens)) { + break + } + const result = parseToken(expression, parsers, tokens, current) + if (result.consumed == 0) { + // If configured correctly this will never happen + // Keep to avoid infinite loops + throw new Error('No eligible parsers for ' + tokens) + } + current += result.consumed + ast.push(...result.ast) + } + return { consumed: current - startAt, ast } +} + +function lookingAtAny( + tokens: readonly Token[], + at: number, + tokenTypes: readonly TokenType[] +): boolean { + return tokenTypes.some((tokenType) => lookingAt(tokens, at, tokenType)) +} + +function lookingAt(tokens: readonly Token[], at: number, token: TokenType): boolean { + if (at < 0) { + // If configured correctly this will never happen + // Keep for completeness + return token == TokenType.startOfLine + } + if (at >= tokens.length) { + return token == TokenType.endOfLine + } + return tokens[at].type == token +} + +function splitAlternatives( + start: number, + end: number, + alternation: readonly Node[] +): readonly Node[] { + const separators: Node[] = [] + const alternatives: Node[][] = [] + let alternative: Node[] = [] + alternation.forEach((n) => { + if (NodeType.alternative == n.type) { + separators.push(n) + alternatives.push(alternative) + alternative = [] + } else { + alternative.push(n) + } + }) + alternatives.push(alternative) + return createAlternativeNodes(start, end, separators, alternatives) +} + +function createAlternativeNodes( + start: number, + end: number, + separators: readonly Node[], + alternatives: readonly ReadonlyArray[] +): readonly Node[] { + const nodes: Node[] = [] + + for (let i = 0; i < alternatives.length; i++) { + const n = alternatives[i] + if (i == 0) { + const rightSeparator = separators[i] + nodes.push(new Node(NodeType.alternative, n, undefined, start, rightSeparator.start)) + } else if (i == alternatives.length - 1) { + const leftSeparator = separators[i - 1] + nodes.push(new Node(NodeType.alternative, n, undefined, leftSeparator.end, end)) + } else { + const leftSeparator = separators[i - 1] + const rightSeparator = separators[i] + nodes.push( + new Node(NodeType.alternative, n, undefined, leftSeparator.end, rightSeparator.start) + ) + } + } + return nodes +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionTokenizer.ts b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionTokenizer.ts new file mode 100644 index 00000000..0b1714d4 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/CucumberExpressionTokenizer.ts @@ -0,0 +1,81 @@ +import { Token, TokenType } from './Ast.js' +import { createCantEscaped, createTheEndOfLIneCanNotBeEscaped } from './Errors.js' + +export default class CucumberExpressionTokenizer { + tokenize(expression: string): readonly Token[] { + const codePoints = Array.from(expression) + const tokens: Array = [] + let buffer: Array = [] + let previousTokenType = TokenType.startOfLine + let treatAsText = false + let escaped = 0 + let bufferStartIndex = 0 + + function convertBufferToToken(tokenType: TokenType): Token { + let escapeTokens = 0 + if (tokenType == TokenType.text) { + escapeTokens = escaped + escaped = 0 + } + + const consumedIndex = bufferStartIndex + buffer.length + escapeTokens + const t = new Token(tokenType, buffer.join(''), bufferStartIndex, consumedIndex) + buffer = [] + bufferStartIndex = consumedIndex + return t + } + + function tokenTypeOf(codePoint: string, treatAsText: boolean): TokenType { + if (!treatAsText) { + return Token.typeOf(codePoint) + } + if (Token.canEscape(codePoint)) { + return TokenType.text + } + throw createCantEscaped(expression, bufferStartIndex + buffer.length + escaped) + } + + function shouldCreateNewToken(previousTokenType: TokenType, currentTokenType: TokenType) { + if (currentTokenType != previousTokenType) { + return true + } + return currentTokenType != TokenType.whiteSpace && currentTokenType != TokenType.text + } + + if (codePoints.length == 0) { + tokens.push(new Token(TokenType.startOfLine, '', 0, 0)) + } + + codePoints.forEach((codePoint) => { + if (!treatAsText && Token.isEscapeCharacter(codePoint)) { + escaped++ + treatAsText = true + return + } + const currentTokenType = tokenTypeOf(codePoint, treatAsText) + treatAsText = false + + if (shouldCreateNewToken(previousTokenType, currentTokenType)) { + const token = convertBufferToToken(previousTokenType) + previousTokenType = currentTokenType + buffer.push(codePoint) + tokens.push(token) + } else { + previousTokenType = currentTokenType + buffer.push(codePoint) + } + }) + + if (buffer.length > 0) { + const token = convertBufferToToken(previousTokenType) + tokens.push(token) + } + + if (treatAsText) { + throw createTheEndOfLIneCanNotBeEscaped(expression) + } + + tokens.push(new Token(TokenType.endOfLine, '', codePoints.length, codePoints.length)) + return tokens + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/Errors.ts b/node_modules/@cucumber/cucumber-expressions/src/Errors.ts new file mode 100644 index 00000000..3bef9173 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/Errors.ts @@ -0,0 +1,237 @@ +import { Located, Node, purposeOf, symbolOf, Token, TokenType } from './Ast.js' +import CucumberExpressionError from './CucumberExpressionError.js' +import GeneratedExpression from './GeneratedExpression.js' +import ParameterType from './ParameterType.js' + +export function createAlternativeMayNotExclusivelyContainOptionals( + node: Node, + expression: string +): CucumberExpressionError { + return new CucumberExpressionError( + message( + node.start, + expression, + pointAtLocated(node), + 'An alternative may not exclusively contain optionals', + "If you did not mean to use an optional you can use '\\(' to escape the '('" + ) + ) +} +export function createAlternativeMayNotBeEmpty( + node: Node, + expression: string +): CucumberExpressionError { + return new CucumberExpressionError( + message( + node.start, + expression, + pointAtLocated(node), + 'Alternative may not be empty', + "If you did not mean to use an alternative you can use '\\/' to escape the '/'" + ) + ) +} +export function createOptionalMayNotBeEmpty( + node: Node, + expression: string +): CucumberExpressionError { + return new CucumberExpressionError( + message( + node.start, + expression, + pointAtLocated(node), + 'An optional must contain some text', + "If you did not mean to use an optional you can use '\\(' to escape the '('" + ) + ) +} +export function createParameterIsNotAllowedInOptional( + node: Node, + expression: string +): CucumberExpressionError { + return new CucumberExpressionError( + message( + node.start, + expression, + pointAtLocated(node), + 'An optional may not contain a parameter type', + "If you did not mean to use an parameter type you can use '\\{' to escape the '{'" + ) + ) +} + +export function createOptionalIsNotAllowedInOptional( + node: Node, + expression: string +): CucumberExpressionError { + return new CucumberExpressionError( + message( + node.start, + expression, + pointAtLocated(node), + 'An optional may not contain an other optional', + "If you did not mean to use an optional type you can use '\\(' to escape the '('. For more complicated expressions consider using a regular expression instead." + ) + ) +} + +export function createTheEndOfLIneCanNotBeEscaped(expression: string): CucumberExpressionError { + const index = Array.from(expression).length - 1 + return new CucumberExpressionError( + message( + index, + expression, + pointAt(index), + 'The end of line can not be escaped', + "You can use '\\\\' to escape the '\\'" + ) + ) +} + +export function createMissingEndToken( + expression: string, + beginToken: TokenType, + endToken: TokenType, + current: Token +) { + const beginSymbol = symbolOf(beginToken) + const endSymbol = symbolOf(endToken) + const purpose = purposeOf(beginToken) + return new CucumberExpressionError( + message( + current.start, + expression, + pointAtLocated(current), + `The '${beginSymbol}' does not have a matching '${endSymbol}'`, + `If you did not intend to use ${purpose} you can use '\\${beginSymbol}' to escape the ${purpose}` + ) + ) +} + +export function createAlternationNotAllowedInOptional(expression: string, current: Token) { + return new CucumberExpressionError( + message( + current.start, + expression, + pointAtLocated(current), + 'An alternation can not be used inside an optional', + "If you did not mean to use an alternation you can use '\\/' to escape the '/'. Otherwise rephrase your expression or consider using a regular expression instead." + ) + ) +} + +export function createCantEscaped(expression: string, index: number) { + return new CucumberExpressionError( + message( + index, + expression, + pointAt(index), + "Only the characters '{', '}', '(', ')', '\\', '/' and whitespace can be escaped", + "If you did mean to use an '\\' you can use '\\\\' to escape it" + ) + ) +} + +export function createInvalidParameterTypeNameInNode(token: Token, expression: string) { + return new CucumberExpressionError( + message( + token.start, + expression, + pointAtLocated(token), + "Parameter names may not contain '{', '}', '(', ')', '\\' or '/'", + 'Did you mean to use a regular expression?' + ) + ) +} + +function message( + index: number, + expression: string, + pointer: string, + problem: string, + solution: string +): string { + return `This Cucumber Expression has a problem at column ${index + 1}: + +${expression} +${pointer} +${problem}. +${solution}` +} + +function pointAt(index: number): string { + const pointer: Array = [] + for (let i = 0; i < index; i++) { + pointer.push(' ') + } + pointer.push('^') + return pointer.join('') +} + +function pointAtLocated(node: Located): string { + const pointer = [pointAt(node.start)] + if (node.start + 1 < node.end) { + for (let i = node.start + 1; i < node.end - 1; i++) { + pointer.push('-') + } + pointer.push('^') + } + return pointer.join('') +} + +export class AmbiguousParameterTypeError extends CucumberExpressionError { + public static forRegExp( + parameterTypeRegexp: string, + expressionRegexp: RegExp, + parameterTypes: readonly ParameterType[], + generatedExpressions: readonly GeneratedExpression[] + ) { + return new this( + `Your Regular Expression ${expressionRegexp} +matches multiple parameter types with regexp ${parameterTypeRegexp}: + ${this._parameterTypeNames(parameterTypes)} + +I couldn't decide which one to use. You have two options: + +1) Use a Cucumber Expression instead of a Regular Expression. Try one of these: + ${this._expressions(generatedExpressions)} + +2) Make one of the parameter types preferential and continue to use a Regular Expression. +` + ) + } + + public static _parameterTypeNames(parameterTypes: readonly ParameterType[]) { + return parameterTypes.map((p) => `{${p.name}}`).join('\n ') + } + + public static _expressions(generatedExpressions: readonly GeneratedExpression[]) { + return generatedExpressions.map((e) => e.source).join('\n ') + } +} + +export class UndefinedParameterTypeError extends CucumberExpressionError { + constructor( + public readonly undefinedParameterTypeName: string, + message: string + ) { + super(message) + } +} + +export function createUndefinedParameterType( + node: Node, + expression: string, + undefinedParameterTypeName: string +) { + return new UndefinedParameterTypeError( + undefinedParameterTypeName, + message( + node.start, + expression, + pointAtLocated(node), + `Undefined parameter type '${undefinedParameterTypeName}'`, + `Please register a ParameterType for '${undefinedParameterTypeName}'` + ) + ) +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/ExpressionFactory.ts b/node_modules/@cucumber/cucumber-expressions/src/ExpressionFactory.ts new file mode 100644 index 00000000..c33261e3 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/ExpressionFactory.ts @@ -0,0 +1,14 @@ +import CucumberExpression from './CucumberExpression.js' +import ParameterTypeRegistry from './ParameterTypeRegistry.js' +import RegularExpression from './RegularExpression.js' +import { Expression } from './types.js' + +export default class ExpressionFactory { + public constructor(private readonly parameterTypeRegistry: ParameterTypeRegistry) {} + + public createExpression(expression: string | RegExp): Expression { + return typeof expression === 'string' + ? new CucumberExpression(expression, this.parameterTypeRegistry) + : new RegularExpression(expression, this.parameterTypeRegistry) + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/GeneratedExpression.ts b/node_modules/@cucumber/cucumber-expressions/src/GeneratedExpression.ts new file mode 100644 index 00000000..18e950d5 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/GeneratedExpression.ts @@ -0,0 +1,61 @@ +import ParameterType from './ParameterType.js' +import { ParameterInfo } from './types.js' + +export default class GeneratedExpression { + constructor( + private readonly expressionTemplate: string, + public readonly parameterTypes: readonly ParameterType[] + ) {} + + get source() { + return format(this.expressionTemplate, ...this.parameterTypes.map((t) => t.name || '')) + } + + /** + * Returns an array of parameter names to use in generated function/method signatures + * + * @returns {ReadonlyArray.} + */ + get parameterNames(): readonly string[] { + return this.parameterInfos.map((i) => `${i.name}${i.count === 1 ? '' : i.count.toString()}`) + } + + /** + * Returns an array of ParameterInfo to use in generated function/method signatures + */ + get parameterInfos(): readonly ParameterInfo[] { + const usageByTypeName: { [key: string]: number } = {} + return this.parameterTypes.map((t) => getParameterInfo(t, usageByTypeName)) + } +} + +function getParameterInfo( + parameterType: ParameterType, + usageByName: { [key: string]: number } +): ParameterInfo { + const name = parameterType.name || '' + let counter = usageByName[name] + counter = counter ? counter + 1 : 1 + usageByName[name] = counter + let type: string | null + if (parameterType.type) { + if (typeof parameterType.type === 'string') { + type = parameterType.type + } else if ('name' in parameterType.type) { + type = parameterType.type.name + } else { + type = null + } + } else { + type = null + } + return { + type, + name, + count: counter, + } +} + +function format(pattern: string, ...args: readonly string[]): string { + return pattern.replace(/{(\d+)}/g, (match, number) => args[number]) +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/Group.ts b/node_modules/@cucumber/cucumber-expressions/src/Group.ts new file mode 100644 index 00000000..657a0699 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/Group.ts @@ -0,0 +1,17 @@ +export default class Group { + constructor( + public readonly value: string, + public readonly start: number | undefined, + public readonly end: number | undefined, + /** + * A groups children. + * + * There are either one or more children or the attribute is undefined. + */ + public readonly children: readonly Group[] | undefined + ) {} + + get values(): string[] | null { + return (this.children === undefined ? [this] : this.children).map((g) => g.value) + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/GroupBuilder.ts b/node_modules/@cucumber/cucumber-expressions/src/GroupBuilder.ts new file mode 100644 index 00000000..e34ede32 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/GroupBuilder.ts @@ -0,0 +1,35 @@ +import { RegExpExecArray } from 'regexp-match-indices' + +import Group from './Group.js' + +export default class GroupBuilder { + public source: string + public capturing = true + private readonly groupBuilders: GroupBuilder[] = [] + + public add(groupBuilder: GroupBuilder) { + this.groupBuilders.push(groupBuilder) + } + + public build(match: RegExpExecArray, nextGroupIndex: () => number): Group { + const groupIndex = nextGroupIndex() + const children = this.groupBuilders.map((gb) => gb.build(match, nextGroupIndex)) + const value = match[groupIndex] + const index = match.indices[groupIndex] + const start = index ? index[0] : undefined + const end = index ? index[1] : undefined + return new Group(value, start, end, children.length === 0 ? undefined : children) + } + + public setNonCapturing() { + this.capturing = false + } + + get children() { + return this.groupBuilders + } + + public moveChildrenTo(groupBuilder: GroupBuilder) { + this.groupBuilders.forEach((child) => groupBuilder.add(child)) + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/ParameterType.ts b/node_modules/@cucumber/cucumber-expressions/src/ParameterType.ts new file mode 100644 index 00000000..c11c7b43 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/ParameterType.ts @@ -0,0 +1,119 @@ +import CucumberExpressionError from './CucumberExpressionError.js' + +const ILLEGAL_PARAMETER_NAME_PATTERN = /([[\]()$.|?*+])/ +const UNESCAPE_PATTERN = () => /(\\([[$.|?*+\]]))/g + +interface Constructor { + new (...args: unknown[]): T + prototype: T +} + +type Factory = (...args: unknown[]) => T + +export type RegExps = StringOrRegExp | readonly StringOrRegExp[] + +export type StringOrRegExp = string | RegExp + +export default class ParameterType { + private transformFn: (...match: readonly string[]) => T | PromiseLike + + public static compare(pt1: ParameterType, pt2: ParameterType) { + if (pt1.preferForRegexpMatch && !pt2.preferForRegexpMatch) { + return -1 + } + if (pt2.preferForRegexpMatch && !pt1.preferForRegexpMatch) { + return 1 + } + return (pt1.name || '').localeCompare(pt2.name || '') + } + + public static checkParameterTypeName(typeName: string) { + if (!this.isValidParameterTypeName(typeName)) { + throw new CucumberExpressionError( + `Illegal character in parameter name {${typeName}}. Parameter names may not contain '{', '}', '(', ')', '\\' or '/'` + ) + } + } + + public static isValidParameterTypeName(typeName: string) { + const unescapedTypeName = typeName.replace(UNESCAPE_PATTERN(), '$2') + return !unescapedTypeName.match(ILLEGAL_PARAMETER_NAME_PATTERN) + } + + public regexpStrings: readonly string[] + + /** + * @param name {String} the name of the type + * @param regexps {Array.,RegExp,String} that matche the type + * @param type {Function} the prototype (constructor) of the type. May be null. + * @param transform {Function} function transforming string to another type. May be null. + * @param useForSnippets {boolean} true if this should be used for snippets. Defaults to true. + * @param preferForRegexpMatch {boolean} true if this is a preferential type. Defaults to false. + * @param builtin whether or not this is a built-in type + */ + constructor( + public readonly name: string | undefined, + regexps: RegExps, + public readonly type: Constructor | Factory | null, + transform?: (...match: string[]) => T | PromiseLike, + public readonly useForSnippets?: boolean, + public readonly preferForRegexpMatch?: boolean, + public readonly builtin?: boolean + ) { + if (transform === undefined) { + transform = (s) => s as unknown as T + } + if (useForSnippets === undefined) { + this.useForSnippets = true + } + if (preferForRegexpMatch === undefined) { + this.preferForRegexpMatch = false + } + + if (name) { + ParameterType.checkParameterTypeName(name) + } + + this.regexpStrings = stringArray(regexps) + this.transformFn = transform + } + + public transform(thisObj: unknown, groupValues: string[] | null) { + return this.transformFn.apply(thisObj, groupValues) + } +} + +function stringArray(regexps: RegExps): string[] { + const array: StringOrRegExp[] = Array.isArray(regexps) ? regexps : [regexps] + return array.map((r) => (r instanceof RegExp ? regexpSource(r) : r)) +} + +function regexpSource(regexp: RegExp): string { + const flags = regexpFlags(regexp) + + for (const flag of ['g', 'i', 'm', 'y']) { + if (flags.indexOf(flag) !== -1) { + throw new CucumberExpressionError(`ParameterType Regexps can't use flag '${flag}'`) + } + } + return regexp.source +} + +// Backport RegExp.flags for Node 4.x +// https://github.com/nodejs/node/issues/8390 +function regexpFlags(regexp: RegExp) { + let flags = regexp.flags + if (flags === undefined) { + flags = '' + if (regexp.ignoreCase) { + flags += 'i' + } + if (regexp.global) { + flags += 'g' + } + if (regexp.multiline) { + flags += 'm' + } + } + return flags +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/ParameterTypeMatcher.ts b/node_modules/@cucumber/cucumber-expressions/src/ParameterTypeMatcher.ts new file mode 100644 index 00000000..58882536 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/ParameterTypeMatcher.ts @@ -0,0 +1,79 @@ +import ParameterType from './ParameterType.js' + +export default class ParameterTypeMatcher { + private readonly match: RegExpExecArray | null + + constructor( + public readonly parameterType: ParameterType, + private readonly regexpString: string, + private readonly text: string, + private matchPosition: number = 0 + ) { + const captureGroupRegexp = new RegExp(`(${regexpString})`) + this.match = captureGroupRegexp.exec(text.slice(this.matchPosition)) + } + + public advanceTo(newMatchPosition: number) { + for (let advancedPos = newMatchPosition; advancedPos < this.text.length; advancedPos++) { + const matcher = new ParameterTypeMatcher( + this.parameterType, + this.regexpString, + this.text, + advancedPos + ) + + if (matcher.find) { + return matcher + } + } + + return new ParameterTypeMatcher( + this.parameterType, + this.regexpString, + this.text, + this.text.length + ) + } + + get find() { + return this.match && this.group !== '' && this.fullWord + } + + get start() { + if (!this.match) throw new Error('No match') + return this.matchPosition + this.match.index + } + + get fullWord() { + return this.matchStartWord && this.matchEndWord + } + + get matchStartWord() { + return this.start === 0 || this.text[this.start - 1].match(/\p{Z}|\p{P}|\p{S}/u) + } + + get matchEndWord() { + const nextCharacterIndex = this.start + this.group.length + return ( + nextCharacterIndex === this.text.length || + this.text[nextCharacterIndex].match(/\p{Z}|\p{P}|\p{S}/u) + ) + } + + get group() { + if (!this.match) throw new Error('No match') + return this.match[0] + } + + public static compare(a: ParameterTypeMatcher, b: ParameterTypeMatcher) { + const posComparison = a.start - b.start + if (posComparison !== 0) { + return posComparison + } + const lengthComparison = b.group.length - a.group.length + if (lengthComparison !== 0) { + return lengthComparison + } + return 0 + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/ParameterTypeRegistry.ts b/node_modules/@cucumber/cucumber-expressions/src/ParameterTypeRegistry.ts new file mode 100644 index 00000000..fb5a15b3 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/ParameterTypeRegistry.ts @@ -0,0 +1,90 @@ +import CucumberExpressionError from './CucumberExpressionError.js' +import CucumberExpressionGenerator from './CucumberExpressionGenerator.js' +import defineDefaultParameterTypes from './defineDefaultParameterTypes.js' +import { AmbiguousParameterTypeError } from './Errors.js' +import ParameterType from './ParameterType.js' +import { DefinesParameterType } from './types.js' + +export default class ParameterTypeRegistry implements DefinesParameterType { + private readonly parameterTypeByName = new Map>() + private readonly parameterTypesByRegexp = new Map>>() + + constructor() { + defineDefaultParameterTypes(this) + } + + get parameterTypes(): IterableIterator> { + return this.parameterTypeByName.values() + } + + public lookupByTypeName(typeName: string) { + return this.parameterTypeByName.get(typeName) + } + + public lookupByRegexp( + parameterTypeRegexp: string, + expressionRegexp: RegExp, + text: string + ): ParameterType | undefined { + const parameterTypes = this.parameterTypesByRegexp.get(parameterTypeRegexp) + if (!parameterTypes) { + return undefined + } + if (parameterTypes.length > 1 && !parameterTypes[0].preferForRegexpMatch) { + // We don't do this check on insertion because we only want to restrict + // ambiguity when we look up by Regexp. Users of CucumberExpression should + // not be restricted. + const generatedExpressions = new CucumberExpressionGenerator( + () => this.parameterTypes + ).generateExpressions(text) + throw AmbiguousParameterTypeError.forRegExp( + parameterTypeRegexp, + expressionRegexp, + parameterTypes, + generatedExpressions + ) + } + return parameterTypes[0] + } + + public defineParameterType(parameterType: ParameterType) { + if (parameterType.name !== undefined) { + if (this.parameterTypeByName.has(parameterType.name)) { + if (parameterType.name.length === 0) { + throw new CucumberExpressionError(`The anonymous parameter type has already been defined`) + } else { + throw new CucumberExpressionError( + `There is already a parameter type with name ${parameterType.name}` + ) + } + } + this.parameterTypeByName.set(parameterType.name, parameterType) + } + + for (const parameterTypeRegexp of parameterType.regexpStrings) { + if (!this.parameterTypesByRegexp.has(parameterTypeRegexp)) { + this.parameterTypesByRegexp.set(parameterTypeRegexp, []) + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const parameterTypes = this.parameterTypesByRegexp.get(parameterTypeRegexp)! + const existingParameterType = parameterTypes[0] + if ( + parameterTypes.length > 0 && + existingParameterType.preferForRegexpMatch && + parameterType.preferForRegexpMatch + ) { + throw new CucumberExpressionError( + 'There can only be one preferential parameter type per regexp. ' + + `The regexp /${parameterTypeRegexp}/ is used for two preferential parameter types, {${existingParameterType.name}} and {${parameterType.name}}` + ) + } + if (parameterTypes.indexOf(parameterType) === -1) { + parameterTypes.push(parameterType) + this.parameterTypesByRegexp.set( + parameterTypeRegexp, + parameterTypes.sort(ParameterType.compare) + ) + } + } + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/RegularExpression.ts b/node_modules/@cucumber/cucumber-expressions/src/RegularExpression.ts new file mode 100644 index 00000000..40880512 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/RegularExpression.ts @@ -0,0 +1,50 @@ +import Argument from './Argument.js' +import ParameterType from './ParameterType.js' +import ParameterTypeRegistry from './ParameterTypeRegistry.js' +import TreeRegexp from './TreeRegexp.js' +import { Expression } from './types.js' + +export default class RegularExpression implements Expression { + private readonly treeRegexp: TreeRegexp + + constructor( + public readonly regexp: RegExp, + private readonly parameterTypeRegistry: ParameterTypeRegistry + ) { + this.treeRegexp = new TreeRegexp(regexp) + } + + public match(text: string): readonly Argument[] | null { + const group = this.treeRegexp.match(text) + if (!group) { + return null + } + + const parameterTypes = this.treeRegexp.groupBuilder.children.map((groupBuilder) => { + const parameterTypeRegexp = groupBuilder.source + + const parameterType = this.parameterTypeRegistry.lookupByRegexp( + parameterTypeRegexp, + this.regexp, + text + ) + return ( + parameterType || + new ParameterType( + undefined, + parameterTypeRegexp, + String, + (s) => (s === undefined ? null : s), + false, + false + ) + ) + }) + + return Argument.build(group, parameterTypes) + } + + get source(): string { + return this.regexp.source + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/TreeRegexp.ts b/node_modules/@cucumber/cucumber-expressions/src/TreeRegexp.ts new file mode 100644 index 00000000..d5f46b61 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/TreeRegexp.ts @@ -0,0 +1,83 @@ +import execWithIndices from 'regexp-match-indices' + +import Group from './Group.js' +import GroupBuilder from './GroupBuilder.js' + +export default class TreeRegexp { + public readonly regexp: RegExp + public readonly groupBuilder: GroupBuilder + + constructor(regexp: RegExp | string) { + if (regexp instanceof RegExp) { + this.regexp = regexp + } else { + this.regexp = new RegExp(regexp) + } + this.groupBuilder = TreeRegexp.createGroupBuilder(this.regexp) + } + + private static createGroupBuilder(regexp: RegExp): GroupBuilder { + const source = regexp.source + const stack: GroupBuilder[] = [new GroupBuilder()] + const groupStartStack: number[] = [] + let escaping = false + let charClass = false + + for (let i = 0; i < source.length; i++) { + const c = source[i] + if (c === '[' && !escaping) { + charClass = true + } else if (c === ']' && !escaping) { + charClass = false + } else if (c === '(' && !escaping && !charClass) { + groupStartStack.push(i) + const nonCapturing = TreeRegexp.isNonCapturing(source, i) + const groupBuilder = new GroupBuilder() + if (nonCapturing) { + groupBuilder.setNonCapturing() + } + stack.push(groupBuilder) + } else if (c === ')' && !escaping && !charClass) { + const gb = stack.pop() + if (!gb) throw new Error('Empty stack') + const groupStart = groupStartStack.pop() + if (gb.capturing) { + gb.source = source.substring((groupStart || 0) + 1, i) + stack[stack.length - 1].add(gb) + } else { + gb.moveChildrenTo(stack[stack.length - 1]) + } + } + escaping = c === '\\' && !escaping + } + const result = stack.pop() + if (!result) throw new Error('Empty stack') + return result + } + + private static isNonCapturing(source: string, i: number): boolean { + // Regex is valid. Bounds check not required. + if (source[i + 1] !== '?') { + // (X) + return false + } + if (source[i + 2] !== '<') { + // (?:X) + // (?=X) + // (?!X) + return true + } + // (?<=X) or (?X) + return source[i + 3] === '=' || source[i + 3] === '!' + } + + public match(s: string): Group | null { + const match = execWithIndices(this.regexp, s) + if (!match) { + return null + } + let groupIndex = 0 + const nextGroupIndex = () => groupIndex++ + return this.groupBuilder.build(match, nextGroupIndex) + } +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/defineDefaultParameterTypes.ts b/node_modules/@cucumber/cucumber-expressions/src/defineDefaultParameterTypes.ts new file mode 100644 index 00000000..045ec21d --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/defineDefaultParameterTypes.ts @@ -0,0 +1,122 @@ +import ParameterType from './ParameterType.js' +import { DefinesParameterType } from './types.js' + +const INTEGER_REGEXPS = [/-?\d+/, /\d+/] +const FLOAT_REGEXP = /(?=.*\d.*)[-+]?\d*(?:\.(?=\d.*))?\d*(?:\d+[E][+-]?\d+)?/ +const WORD_REGEXP = /[^\s]+/ +const STRING_REGEXP = /"([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'/ +const ANONYMOUS_REGEXP = /.*/ + +export default function defineDefaultParameterTypes(registry: DefinesParameterType) { + registry.defineParameterType( + new ParameterType( + 'int', + INTEGER_REGEXPS, + Number, + (s) => (s === undefined ? null : Number(s)), + true, + true, + true + ) + ) + registry.defineParameterType( + new ParameterType( + 'float', + FLOAT_REGEXP, + Number, + (s) => (s === undefined ? null : parseFloat(s)), + true, + false, + true + ) + ) + registry.defineParameterType( + new ParameterType('word', WORD_REGEXP, String, (s) => s, false, false, true) + ) + registry.defineParameterType( + new ParameterType( + 'string', + STRING_REGEXP, + String, + (s1, s2) => (s1 || s2 || '').replace(/\\"/g, '"').replace(/\\'/g, "'"), + true, + false, + true + ) + ) + registry.defineParameterType( + new ParameterType('', ANONYMOUS_REGEXP, String, (s) => s, false, true, true) + ) + + registry.defineParameterType( + new ParameterType( + 'double', + FLOAT_REGEXP, + Number, + (s) => (s === undefined ? null : parseFloat(s)), + false, + false, + true + ) + ) + + registry.defineParameterType( + new ParameterType( + 'bigdecimal', + FLOAT_REGEXP, + String, + (s) => (s === undefined ? null : s), + false, + false, + true + ) + ) + + registry.defineParameterType( + new ParameterType( + 'byte', + INTEGER_REGEXPS, + Number, + (s) => (s === undefined ? null : Number(s)), + false, + false, + true + ) + ) + + registry.defineParameterType( + new ParameterType( + 'short', + INTEGER_REGEXPS, + Number, + (s) => (s === undefined ? null : Number(s)), + false, + false, + true + ) + ) + + registry.defineParameterType( + new ParameterType( + 'long', + INTEGER_REGEXPS, + Number, + (s) => (s === undefined ? null : Number(s)), + false, + false, + true + ) + ) + + registry.defineParameterType( + new ParameterType( + 'biginteger', + INTEGER_REGEXPS, + BigInt, + (s) => (s === undefined ? null : BigInt(s)), + false, + false, + true + ) + ) +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/index.ts b/node_modules/@cucumber/cucumber-expressions/src/index.ts new file mode 100644 index 00000000..8e2563ae --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/index.ts @@ -0,0 +1,31 @@ +import Argument from './Argument.js' +import { Located, Node, NodeType, Token, TokenType } from './Ast.js' +import CucumberExpression from './CucumberExpression.js' +import CucumberExpressionGenerator from './CucumberExpressionGenerator.js' +import ExpressionFactory from './ExpressionFactory.js' +import GeneratedExpression from './GeneratedExpression.js' +import Group from './Group.js' +import ParameterType, { RegExps, StringOrRegExp } from './ParameterType.js' +import ParameterTypeRegistry from './ParameterTypeRegistry.js' +import RegularExpression from './RegularExpression.js' +import { Expression } from './types.js' + +export { + Argument, + CucumberExpression, + CucumberExpressionGenerator, + Expression, + ExpressionFactory, + GeneratedExpression, + Group, + Located, + Node, + NodeType, + ParameterType, + ParameterTypeRegistry, + RegExps, + RegularExpression, + StringOrRegExp, + Token, + TokenType, +} diff --git a/node_modules/@cucumber/cucumber-expressions/src/types.ts b/node_modules/@cucumber/cucumber-expressions/src/types.ts new file mode 100644 index 00000000..1a3db787 --- /dev/null +++ b/node_modules/@cucumber/cucumber-expressions/src/types.ts @@ -0,0 +1,26 @@ +import Argument from './Argument.js' +import ParameterType from './ParameterType.js' + +export interface DefinesParameterType { + defineParameterType(parameterType: ParameterType): void +} + +export interface Expression { + readonly source: string + match(text: string): readonly Argument[] | null +} + +export type ParameterInfo = { + /** + * The string representation of the original ParameterType#type property + */ + type: string | null + /** + * The parameter type name + */ + name: string + /** + * The number of times this name has been used so far + */ + count: number +} diff --git a/node_modules/@cucumber/cucumber/LICENSE b/node_modules/@cucumber/cucumber/LICENSE new file mode 100644 index 00000000..9251d8e6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Julien Biezemans and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/cucumber/README.md b/node_modules/@cucumber/cucumber/README.md new file mode 100644 index 00000000..12e6a79a --- /dev/null +++ b/node_modules/@cucumber/cucumber/README.md @@ -0,0 +1,128 @@ +

+ +
+ Cucumber +

+

+ Automated tests in plain language, for Node.js +

+ +

+ Latest version on npm + Build status + Coverage + Backers + Sponsors + Ukraine solidarity +

+ +[Cucumber](https://github.com/cucumber) is a tool for running automated tests written in plain language. Because they're +written in plain language, they can be read by anyone on your team. Because they can be +read by anyone, you can use them to help improve communication, collaboration and trust on +your team. + +This is the JavaScript implementation of Cucumber. It runs on [maintained versions](https://github.com/nodejs/Release) of Node.js. You can [quickly try it via CodeSandbox](https://codesandbox.io/s/cucumber-js-demo-2p3vrl?file=/features/greeting.feature), or read on to get started locally in a couple of minutes. + +Looking to contribute? Read our [code of conduct](https://github.com/cucumber/.github/blob/main/CODE_OF_CONDUCT.md) first, then check the [contributing guide](./CONTRIBUTING.md) to get up and running. + +## Install + +Cucumber is [available on npm](https://www.npmjs.com/package/@cucumber/cucumber): + +```shell +npm install @cucumber/cucumber +``` + +## Get Started + +Let's take this example of something to test: + + +First, write your main code in `src/index.js`: + +```js +class Greeter { + sayHello() { + return 'hello' + } +} + +module.exports = { + Greeter +} +``` + +Then, write your feature in `features/greeting.feature`: + +```gherkin +Feature: Greeting + + Scenario: Say hello + When the greeter says hello + Then I should have heard "hello" +``` + +Next, implement your steps in `features/support/steps.js`: + +```js +const assert = require('assert') +const { When, Then } = require('@cucumber/cucumber') +const { Greeter } = require('../../src') + +When('the greeter says hello', function () { + this.whatIHeard = new Greeter().sayHello() +}); + +Then('I should have heard {string}', function (expectedResponse) { + assert.equal(this.whatIHeard, expectedResponse) +}); +``` + +Finally, run Cucumber: + +```shell +npx cucumber-js +``` + +And see the output: + +![Terminal output showing a successful test run with 1 scenario and 2 steps, all passing](./docs/images/readme-output.png) + +If you learn best by example, we have [a repo with several example projects](https://github.com/cucumber/cucumber-js-examples), that might help you get going. + +## Documentation + +The following documentation is for `main`, which might contain some unreleased features. See [documentation for older versions](./docs/older_versions.md) if you need it. + +* [Installation](./docs/installation.md) +* [CLI](./docs/cli.md) +* [Configuration](./docs/configuration.md) +* Support Code + * [API Reference](./docs/support_files/api_reference.md) + * [Attachments](./docs/support_files/attachments.md) + * [Data Tables](./docs/support_files/data_table_interface.md) + * [Hooks](./docs/support_files/hooks.md) + * [Step Definitions](./docs/support_files/step_definitions.md) + * [Timeouts](./docs/support_files/timeouts.md) + * [World](./docs/support_files/world.md) +* Guides + * [Debugging](./docs/debugging.md) + * [Dry run](./docs/dry_run.md) + * [ES Modules](./docs/esm.md) + * [Failing fast](./docs/fail_fast.md) + * [Filtering which scenarios run](./docs/filtering.md) + * [Formatters for feedback and reporting](./docs/formatters.md) + * [Parallel running for speed](./docs/parallel.md) + * [Plugins for extending functionality](./docs/plugins.md) + * [Profiles for composable configuration](./docs/profiles.md) + * [Rerunning just failures](./docs/rerun.md) + * [Retrying flaky scenarios](./docs/retry.md) + * [Sharding to split tests across machines](./docs/sharding.md) + * [JavaScript API for running programmatically](./docs/javascript_api.md) + * [Snippets for undefined steps](./docs/snippets.md) + * [Transpiling (from TypeScript etc)](./docs/transpiling.md) +* [FAQ](./docs/faq.md) + +## Support + +Support is [available from the community](https://cucumber.io/tools/cucumber-open/support/) if you need it. diff --git a/node_modules/@cucumber/cucumber/api/index.d.ts b/node_modules/@cucumber/cucumber/api/index.d.ts new file mode 100644 index 00000000..ade5a81b --- /dev/null +++ b/node_modules/@cucumber/cucumber/api/index.d.ts @@ -0,0 +1,6 @@ +/* +allows TypeScript to see `@cucumber/cucumber/api` where it doesn't yet support +subpath exports, see + */ + +export * from '../lib/api' diff --git a/node_modules/@cucumber/cucumber/bin/cucumber-js b/node_modules/@cucumber/cucumber/bin/cucumber-js new file mode 100644 index 00000000..2460cb26 --- /dev/null +++ b/node_modules/@cucumber/cucumber/bin/cucumber-js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require('../lib/cli/run.js').default(); diff --git a/node_modules/@cucumber/cucumber/bin/cucumber.js b/node_modules/@cucumber/cucumber/bin/cucumber.js new file mode 100644 index 00000000..2460cb26 --- /dev/null +++ b/node_modules/@cucumber/cucumber/bin/cucumber.js @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require('../lib/cli/run.js').default(); diff --git a/node_modules/@cucumber/cucumber/lib/api/convert_configuration.d.ts b/node_modules/@cucumber/cucumber/lib/api/convert_configuration.d.ts new file mode 100644 index 00000000..843e0c77 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/convert_configuration.d.ts @@ -0,0 +1,4 @@ +import { IConfiguration } from '../configuration'; +import { ILogger } from '../environment'; +import { IRunConfiguration } from './types'; +export declare function convertConfiguration(logger: ILogger, flatConfiguration: IConfiguration, env: NodeJS.ProcessEnv): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/api/convert_configuration.js b/node_modules/@cucumber/cucumber/lib/api/convert_configuration.js new file mode 100644 index 00000000..a0cad041 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/convert_configuration.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertConfiguration = convertConfiguration; +const configuration_1 = require("../configuration"); +async function convertConfiguration(logger, flatConfiguration, env) { + return { + sources: { + paths: flatConfiguration.paths, + defaultDialect: flatConfiguration.language, + names: flatConfiguration.name, + tagExpression: flatConfiguration.tags, + order: flatConfiguration.order, + shard: flatConfiguration.shard, + }, + support: { + requireModules: flatConfiguration.requireModule, + requirePaths: flatConfiguration.require, + importPaths: flatConfiguration.import, + loaders: flatConfiguration.loader, + }, + runtime: { + dryRun: flatConfiguration.dryRun, + failFast: flatConfiguration.failFast, + filterStacktraces: !flatConfiguration.backtrace, + parallel: flatConfiguration.parallel, + retry: flatConfiguration.retry, + retryTagFilter: flatConfiguration.retryTagFilter, + strict: flatConfiguration.strict, + worldParameters: flatConfiguration.worldParameters, + }, + formats: convertFormats(logger, flatConfiguration, env), + plugins: { + specifiers: flatConfiguration.plugin, + options: flatConfiguration.pluginOptions, + }, + }; +} +function convertFormats(logger, flatConfiguration, env) { + const splitFormats = flatConfiguration.format.map((item) => Array.isArray(item) ? item : (0, configuration_1.splitFormatDescriptor)(logger, item)); + return { + stdout: [...splitFormats].reverse().find(([, target]) => !target)?.[0] ?? + 'progress', + files: splitFormats + .filter(([, target]) => !!target) + .reduce((mapped, [type, target]) => { + return { + ...mapped, + [target]: type, + }; + }, {}), + publish: makePublishConfig(flatConfiguration, env), + options: flatConfiguration.formatOptions, + }; +} +function makePublishConfig(flatConfiguration, env) { + const enabled = isPublishing(flatConfiguration, env); + if (!enabled) { + return false; + } + return { + url: env.CUCUMBER_PUBLISH_URL, + token: env.CUCUMBER_PUBLISH_TOKEN, + }; +} +function isPublishing(flatConfiguration, env) { + return (flatConfiguration.publish || + (0, configuration_1.isTruthyString)(env.CUCUMBER_PUBLISH_ENABLED) || + env.CUCUMBER_PUBLISH_TOKEN !== undefined); +} +//# sourceMappingURL=convert_configuration.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/convert_configuration.js.map b/node_modules/@cucumber/cucumber/lib/api/convert_configuration.js.map new file mode 100644 index 00000000..f5dcd179 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/convert_configuration.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convert_configuration.js","sourceRoot":"","sources":["../../src/api/convert_configuration.ts"],"names":[],"mappings":";;AASA,oDAoCC;AA7CD,oDAIyB;AAKlB,KAAK,UAAU,oBAAoB,CACxC,MAAe,EACf,iBAAiC,EACjC,GAAsB;IAEtB,OAAO;QACL,OAAO,EAAE;YACP,KAAK,EAAE,iBAAiB,CAAC,KAAK;YAC9B,cAAc,EAAE,iBAAiB,CAAC,QAAQ;YAC1C,KAAK,EAAE,iBAAiB,CAAC,IAAI;YAC7B,aAAa,EAAE,iBAAiB,CAAC,IAAI;YACrC,KAAK,EAAE,iBAAiB,CAAC,KAAK;YAC9B,KAAK,EAAE,iBAAiB,CAAC,KAAK;SAC/B;QACD,OAAO,EAAE;YACP,cAAc,EAAE,iBAAiB,CAAC,aAAa;YAC/C,YAAY,EAAE,iBAAiB,CAAC,OAAO;YACvC,WAAW,EAAE,iBAAiB,CAAC,MAAM;YACrC,OAAO,EAAE,iBAAiB,CAAC,MAAM;SAClC;QACD,OAAO,EAAE;YACP,MAAM,EAAE,iBAAiB,CAAC,MAAM;YAChC,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;YACpC,iBAAiB,EAAE,CAAC,iBAAiB,CAAC,SAAS;YAC/C,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;YACpC,KAAK,EAAE,iBAAiB,CAAC,KAAK;YAC9B,cAAc,EAAE,iBAAiB,CAAC,cAAc;YAChD,MAAM,EAAE,iBAAiB,CAAC,MAAM;YAChC,eAAe,EAAE,iBAAiB,CAAC,eAAe;SACnD;QACD,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,iBAAiB,EAA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AAG,EAAE,GAAG,CAAC,oBAAoB;QAC7B,KAAK,EAAE,GAAG,CAAC,sBAAsB;KAClC,CAAA;AACH,CAAC;AAED,SAAS,YAAY,CACnB,iBAAiC,EACjC,GAAsB;IAEtB,OAAO,CACL,iBAAiB,CAAC,OAAO;QACzB,IAAA,8BAAc,EAAC,GAAG,CAAC,wBAAwB,CAAC;QAC5C,GAAG,CAAC,sBAAsB,KAAK,SAAS,CACzC,CAAA;AACH,CAAC","sourcesContent":["import {\n IConfiguration,\n isTruthyString,\n splitFormatDescriptor,\n} from '../configuration'\nimport { IPublishConfig } from '../publish'\nimport { ILogger } from '../environment'\nimport { IRunConfiguration } from './types'\n\nexport async function convertConfiguration(\n logger: ILogger,\n flatConfiguration: IConfiguration,\n env: NodeJS.ProcessEnv\n): Promise {\n return {\n sources: {\n paths: flatConfiguration.paths,\n defaultDialect: flatConfiguration.language,\n names: flatConfiguration.name,\n tagExpression: flatConfiguration.tags,\n order: flatConfiguration.order,\n shard: flatConfiguration.shard,\n },\n support: {\n requireModules: flatConfiguration.requireModule,\n requirePaths: flatConfiguration.require,\n importPaths: flatConfiguration.import,\n loaders: flatConfiguration.loader,\n },\n runtime: {\n dryRun: flatConfiguration.dryRun,\n failFast: flatConfiguration.failFast,\n filterStacktraces: !flatConfiguration.backtrace,\n parallel: flatConfiguration.parallel,\n retry: flatConfiguration.retry,\n retryTagFilter: flatConfiguration.retryTagFilter,\n strict: flatConfiguration.strict,\n worldParameters: flatConfiguration.worldParameters,\n },\n formats: convertFormats(logger, flatConfiguration, env),\n plugins: {\n specifiers: flatConfiguration.plugin,\n options: flatConfiguration.pluginOptions,\n },\n }\n}\n\nfunction convertFormats(\n logger: ILogger,\n flatConfiguration: IConfiguration,\n env: NodeJS.ProcessEnv\n) {\n const splitFormats: string[][] = flatConfiguration.format.map((item) =>\n Array.isArray(item) ? item : splitFormatDescriptor(logger, item)\n )\n return {\n stdout:\n [...splitFormats].reverse().find(([, target]) => !target)?.[0] ??\n 'progress',\n files: splitFormats\n .filter(([, target]) => !!target)\n .reduce((mapped, [type, target]) => {\n return {\n ...mapped,\n [target]: type,\n }\n }, {}),\n publish: makePublishConfig(flatConfiguration, env),\n options: flatConfiguration.formatOptions,\n }\n}\n\nfunction makePublishConfig(\n flatConfiguration: IConfiguration,\n env: NodeJS.ProcessEnv\n): IPublishConfig | false {\n const enabled = isPublishing(flatConfiguration, env)\n if (!enabled) {\n return false\n }\n return {\n url: env.CUCUMBER_PUBLISH_URL,\n token: env.CUCUMBER_PUBLISH_TOKEN,\n }\n}\n\nfunction isPublishing(\n flatConfiguration: IConfiguration,\n env: NodeJS.ProcessEnv\n): boolean {\n return (\n flatConfiguration.publish ||\n isTruthyString(env.CUCUMBER_PUBLISH_ENABLED) ||\n env.CUCUMBER_PUBLISH_TOKEN !== undefined\n )\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.d.ts b/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.d.ts new file mode 100644 index 00000000..e1c4e9f6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.d.ts @@ -0,0 +1,9 @@ +import { EventEmitter } from 'node:events'; +import { IdGenerator } from '@cucumber/messages'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +export declare function emitMetaMessage(eventBroadcaster: EventEmitter, env: NodeJS.ProcessEnv): Promise; +export declare function emitSupportCodeMessages({ eventBroadcaster, supportCodeLibrary, newId, }: { + eventBroadcaster: EventEmitter; + supportCodeLibrary: SupportCodeLibrary; + newId: IdGenerator.NewId; +}): void; diff --git a/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.js b/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.js new file mode 100644 index 00000000..41544a1b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.js @@ -0,0 +1,180 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.emitMetaMessage = emitMetaMessage; +exports.emitSupportCodeMessages = emitSupportCodeMessages; +const node_os_1 = __importDefault(require("node:os")); +const messages = __importStar(require("@cucumber/messages")); +const messages_1 = require("@cucumber/messages"); +const ci_environment_1 = __importDefault(require("@cucumber/ci-environment")); +const version_1 = require("../version"); +async function emitMetaMessage(eventBroadcaster, env) { + const meta = { + protocolVersion: messages.version, + implementation: { + version: version_1.version, + name: 'cucumber-js', + }, + cpu: { + name: node_os_1.default.arch(), + }, + os: { + name: node_os_1.default.platform(), + version: node_os_1.default.release(), + }, + runtime: { + name: 'node.js', + version: process.versions.node, + }, + ci: (0, ci_environment_1.default)(env), + }; + eventBroadcaster.emit('envelope', { + meta, + }); +} +function makeSourceReference(source) { + return { + uri: source.uri, + location: { + line: source.line, + }, + }; +} +function extractPatternSource(pattern) { + if (pattern instanceof RegExp) { + return pattern.flags ? pattern.toString() : pattern.source; + } + return pattern; +} +function collectParameterTypeEnvelopes(supportCodeLibrary, newId) { + const ordered = []; + for (const parameterType of supportCodeLibrary.parameterTypeRegistry + .parameterTypes) { + if (parameterType.builtin) { + continue; + } + const source = supportCodeLibrary.parameterTypeRegistry.lookupSource(parameterType); + ordered.push({ + order: source.order, + envelope: { + parameterType: { + id: newId(), + name: parameterType.name, + preferForRegularExpressionMatch: parameterType.preferForRegexpMatch, + regularExpressions: parameterType.regexpStrings, + useForSnippets: parameterType.useForSnippets, + sourceReference: makeSourceReference(source), + }, + }, + }); + } + return ordered; +} +function collectStepDefinitionEnvelopes(supportCodeLibrary) { + return supportCodeLibrary.stepDefinitions.map((stepDefinition) => ({ + order: stepDefinition.order, + envelope: { + stepDefinition: { + id: stepDefinition.id, + pattern: { + source: extractPatternSource(stepDefinition.pattern), + type: typeof stepDefinition.pattern === 'string' + ? messages.StepDefinitionPatternType.CUCUMBER_EXPRESSION + : messages.StepDefinitionPatternType.REGULAR_EXPRESSION, + }, + sourceReference: makeSourceReference(stepDefinition), + }, + }, + })); +} +function collectHookEnvelopes(supportCodeLibrary) { + const allHooks = [ + [ + supportCodeLibrary.beforeTestCaseHookDefinitions, + messages_1.HookType.BEFORE_TEST_CASE, + ], + [ + supportCodeLibrary.afterTestCaseHookDefinitions, + messages_1.HookType.AFTER_TEST_CASE, + ], + [ + supportCodeLibrary.beforeTestRunHookDefinitions, + messages_1.HookType.BEFORE_TEST_RUN, + ], + [ + supportCodeLibrary.afterTestRunHookDefinitions, + messages_1.HookType.AFTER_TEST_RUN, + ], + ]; + const ordered = []; + allHooks.forEach(([hooks, type]) => { + hooks.forEach((hook) => { + ordered.push({ + order: hook.order, + envelope: { + hook: { + id: hook.id, + type, + name: hook.name, + ...('tagExpression' in hook && { + tagExpression: hook.tagExpression, + }), + sourceReference: makeSourceReference(hook), + }, + }, + }); + }); + }); + return ordered; +} +function emitSupportCodeMessages({ eventBroadcaster, supportCodeLibrary, newId, }) { + const orderedEnvelopes = [ + ...collectParameterTypeEnvelopes(supportCodeLibrary, newId), + ...collectStepDefinitionEnvelopes(supportCodeLibrary), + ...collectHookEnvelopes(supportCodeLibrary), + ]; + orderedEnvelopes + .sort((a, b) => a.order - b.order) + .forEach(({ envelope }) => eventBroadcaster.emit('envelope', envelope)); + supportCodeLibrary.undefinedParameterTypes + .map((undefinedParameterType) => ({ + undefinedParameterType, + })) + .forEach((envelope) => eventBroadcaster.emit('envelope', envelope)); +} +//# sourceMappingURL=emit_support_code_messages.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.js.map b/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.js.map new file mode 100644 index 00000000..1fa14936 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/emit_support_code_messages.js.map @@ -0,0 +1 @@ +{"version":3,"file":"emit_support_code_messages.js","sourceRoot":"","sources":["../../src/api/emit_support_code_messages.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,0CA0BC;AA+GD,0DAuBC;AA7KD,sDAAwB;AACxB,6DAA8C;AAC9C,iDAAoE;AACpE,8EAA0D;AAE1D,wCAAoC;AAQ7B,KAAK,UAAU,eAAe,CACnC,gBAA8B,EAC9B,GAAsB;IAEtB,MAAM,IAAI,GAAkB;QAC1B,eAAe,EAAE,QAAQ,CAAC,OAAO;QACjC,cAAc,EAAE;YACd,OAAO,EAAP,iBAAO;YACP,IAAI,EAAE,aAAa;SACpB;QACD,GAAG,EAAE;YACH,IAAI,EAAE,iBAAE,CAAC,IAAI,EAAE;SAChB;QACD,EAAE,EAAE;YACF,IAAI,EAAE,iBAAE,CAAC,QAAQ,EAAE;YACnB,OAAO,EAAE,iBAAE,CAAC,OAAO,EAAE;SACtB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,OAAO,CAA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oBACR,IAAI,EAAE;wBACJ,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,IAAI;wBACJ,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,GAAG,CAAC,eAAe,IAAI,IAAI,IAAI;4BAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;yBAClC,CAAC;wBACF,eAAe,EAAE,mBAAmB,CAAC,IAAI,CAAC;qBAC3C;iBACiB;aACrB,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAgB,uBAAuB,CAAC,EACtC,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,GAKN;IACC,MAAM,gBAAgB,GAAG;QACvB,GAAG,6BAA6B,CAAC,kBAAkB,EAAE,KAAK,CAAC;QAC3D,GAAG,8BAA8B,CAAC,kBAAkB,CAAC;QACrD,GAAG,oBAAoB,CAAC,kBAAkB,CAAC;KAC5C,CAAA;IACD,gBAAgB;SACb,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;SACjC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEzE,kBAAkB,CAAC,uBAAuB;SACvC,GAAG,CAAC,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;QAChC,sBAAsB;KACvB,CAAC,CAAC;SACF,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA;AACvE,CAAC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport os from 'node:os'\nimport * as messages from '@cucumber/messages'\nimport { Envelope, HookType, IdGenerator } from '@cucumber/messages'\nimport detectCiEnvironment from '@cucumber/ci-environment'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport { version } from '../version'\nimport { ILineAndUri } from '../types'\n\ninterface OrderedEnvelope {\n order: number\n envelope: messages.Envelope\n}\n\nexport async function emitMetaMessage(\n eventBroadcaster: EventEmitter,\n env: NodeJS.ProcessEnv\n): Promise {\n const meta: messages.Meta = {\n protocolVersion: messages.version,\n implementation: {\n version,\n name: 'cucumber-js',\n },\n cpu: {\n name: os.arch(),\n },\n os: {\n name: os.platform(),\n version: os.release(),\n },\n runtime: {\n name: 'node.js',\n version: process.versions.node,\n },\n ci: detectCiEnvironment(env),\n }\n eventBroadcaster.emit('envelope', {\n meta,\n })\n}\n\nfunction makeSourceReference(source: ILineAndUri) {\n return {\n uri: source.uri,\n location: {\n line: source.line,\n },\n }\n}\n\nfunction extractPatternSource(pattern: string | RegExp) {\n if (pattern instanceof RegExp) {\n return pattern.flags ? pattern.toString() : pattern.source\n }\n return pattern\n}\n\nfunction collectParameterTypeEnvelopes(\n supportCodeLibrary: SupportCodeLibrary,\n newId: IdGenerator.NewId\n): ReadonlyArray {\n const ordered: Array = []\n for (const parameterType of supportCodeLibrary.parameterTypeRegistry\n .parameterTypes) {\n if (parameterType.builtin) {\n continue\n }\n const source =\n supportCodeLibrary.parameterTypeRegistry.lookupSource(parameterType)\n ordered.push({\n order: source.order,\n envelope: {\n parameterType: {\n id: newId(),\n name: parameterType.name,\n preferForRegularExpressionMatch: parameterType.preferForRegexpMatch,\n regularExpressions: parameterType.regexpStrings,\n useForSnippets: parameterType.useForSnippets,\n sourceReference: makeSourceReference(source),\n },\n },\n })\n }\n return ordered\n}\n\nfunction collectStepDefinitionEnvelopes(\n supportCodeLibrary: SupportCodeLibrary\n): ReadonlyArray {\n return supportCodeLibrary.stepDefinitions.map((stepDefinition) => ({\n order: stepDefinition.order,\n envelope: {\n stepDefinition: {\n id: stepDefinition.id,\n pattern: {\n source: extractPatternSource(stepDefinition.pattern),\n type:\n typeof stepDefinition.pattern === 'string'\n ? messages.StepDefinitionPatternType.CUCUMBER_EXPRESSION\n : messages.StepDefinitionPatternType.REGULAR_EXPRESSION,\n },\n sourceReference: makeSourceReference(stepDefinition),\n },\n },\n }))\n}\n\nfunction collectHookEnvelopes(\n supportCodeLibrary: SupportCodeLibrary\n): ReadonlyArray {\n const allHooks = [\n [\n supportCodeLibrary.beforeTestCaseHookDefinitions,\n HookType.BEFORE_TEST_CASE,\n ] as const,\n [\n supportCodeLibrary.afterTestCaseHookDefinitions,\n HookType.AFTER_TEST_CASE,\n ] as const,\n [\n supportCodeLibrary.beforeTestRunHookDefinitions,\n HookType.BEFORE_TEST_RUN,\n ] as const,\n [\n supportCodeLibrary.afterTestRunHookDefinitions,\n HookType.AFTER_TEST_RUN,\n ] as const,\n ]\n const ordered: Array = []\n allHooks.forEach(([hooks, type]) => {\n hooks.forEach((hook) => {\n ordered.push({\n order: hook.order,\n envelope: {\n hook: {\n id: hook.id,\n type,\n name: hook.name,\n ...('tagExpression' in hook && {\n tagExpression: hook.tagExpression,\n }),\n sourceReference: makeSourceReference(hook),\n },\n } satisfies Envelope,\n })\n })\n })\n return ordered\n}\n\nexport function emitSupportCodeMessages({\n eventBroadcaster,\n supportCodeLibrary,\n newId,\n}: {\n eventBroadcaster: EventEmitter\n supportCodeLibrary: SupportCodeLibrary\n newId: IdGenerator.NewId\n}): void {\n const orderedEnvelopes = [\n ...collectParameterTypeEnvelopes(supportCodeLibrary, newId),\n ...collectStepDefinitionEnvelopes(supportCodeLibrary),\n ...collectHookEnvelopes(supportCodeLibrary),\n ]\n orderedEnvelopes\n .sort((a, b) => a.order - b.order)\n .forEach(({ envelope }) => eventBroadcaster.emit('envelope', envelope))\n\n supportCodeLibrary.undefinedParameterTypes\n .map((undefinedParameterType) => ({\n undefinedParameterType,\n }))\n .forEach((envelope) => eventBroadcaster.emit('envelope', envelope))\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/formatters.d.ts b/node_modules/@cucumber/cucumber/lib/api/formatters.d.ts new file mode 100644 index 00000000..703d2c17 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/formatters.d.ts @@ -0,0 +1,20 @@ +import { EventEmitter } from 'node:events'; +import { IFormatterStream } from '../formatter'; +import { EventDataCollector } from '../formatter/helpers'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +import { ILogger } from '../environment'; +import { PluginManager } from '../plugin'; +import { IRunOptionsFormats } from './types'; +export declare function initializeFormatters({ env, cwd, stdout, logger, onStreamError, eventBroadcaster, eventDataCollector, configuration, supportCodeLibrary, pluginManager, }: { + env: NodeJS.ProcessEnv; + cwd: string; + stdout: IFormatterStream; + stderr: IFormatterStream; + logger: ILogger; + onStreamError: () => void; + eventBroadcaster: EventEmitter; + eventDataCollector: EventDataCollector; + configuration: IRunOptionsFormats; + supportCodeLibrary: SupportCodeLibrary; + pluginManager: PluginManager; +}): Promise<() => Promise>; diff --git a/node_modules/@cucumber/cucumber/lib/api/formatters.js b/node_modules/@cucumber/cucumber/lib/api/formatters.js new file mode 100644 index 00000000..54ba2c3b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/formatters.js @@ -0,0 +1,52 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initializeFormatters = initializeFormatters; +const node_util_1 = require("node:util"); +const builder_1 = __importDefault(require("../formatter/builder")); +const create_stream_1 = require("../formatter/create_stream"); +const resolve_implementation_1 = require("../formatter/resolve_implementation"); +async function initializeFormatters({ env, cwd, stdout, logger, onStreamError, eventBroadcaster, eventDataCollector, configuration, supportCodeLibrary, pluginManager, }) { + const cleanupFns = []; + async function initializeFormatter(stream, directory, target, specifier) { + if (specifier === 'progress-bar' && !stream.isTTY) { + logger.warn(`Cannot use 'progress-bar' formatter for output to '${target}' as not a TTY. Switching to 'progress' formatter.`); + specifier = 'progress'; + } + const implementation = await (0, resolve_implementation_1.resolveImplementation)(specifier, cwd); + if (typeof implementation === 'function') { + const typeOptions = { + env, + cwd, + eventBroadcaster, + eventDataCollector, + log: stream.write.bind(stream), + parsedArgvOptions: configuration.options, + stream, + cleanup: stream === stdout + ? async () => await Promise.resolve() + : (0, node_util_1.promisify)(stream.end.bind(stream)), + supportCodeLibrary, + }; + const formatter = await builder_1.default.build(implementation, typeOptions); + cleanupFns.push(async () => formatter.finished()); + } + else { + await pluginManager.initFormatter(implementation, configuration.options, stream, stream.write.bind(stream), directory); + if (stream !== stdout) { + cleanupFns.push((0, node_util_1.promisify)(stream.end.bind(stream))); + } + } + } + await initializeFormatter(stdout, undefined, 'stdout', configuration.stdout); + for (const [target, specifier] of Object.entries(configuration.files)) { + const { stream, directory } = await (0, create_stream_1.createStream)(target, onStreamError, cwd, logger); + await initializeFormatter(stream, directory, target, specifier); + } + return async function () { + await Promise.all(cleanupFns.map((cleanupFn) => cleanupFn())); + }; +} +//# sourceMappingURL=formatters.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/formatters.js.map b/node_modules/@cucumber/cucumber/lib/api/formatters.js.map new file mode 100644 index 00000000..388f825b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/formatters.js.map @@ -0,0 +1 @@ +{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/api/formatters.ts"],"names":[],"mappings":";;;;;AAaA,oDAuFC;AAnGD,yCAAqC;AAKrC,mEAAmD;AAEnD,8DAAyD;AACzD,gFAA2E;AAIpE,KAAK,UAAU,oBAAoB,CAAC,EACzC,GAAG,EACH,GAAG,EACH,MAAM,EACN,MAAM,EACN,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,aAAa,GAad;IACC,MAAM,UAAU,GAA+B,EAAE,CAAA;IAEjD,KAAK,UAAU,mBAAmB,CAChC,MAAwB,EACxB,SAA6B,EAC7B,MAAc,EACd,SAAiB;QAEjB,IAAI,SAAS,KAAK,cAAc,IAA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AC;IACH,CAAC;IAED,MAAM,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC5E,KAAK,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACtE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,4BAAY,EAC9C,MAAM,EACN,aAAa,EACb,GAAG,EACH,MAAM,CACP,CAAA;QACD,MAAM,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;IACjE,CAAC;IAED,OAAO,KAAK;QACV,MAAM,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;IAC/D,CAAC,CAAA;AACH,CAAC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { promisify } from 'node:util'\nimport { WriteStream as TtyWriteStream } from 'node:tty'\nimport { IFormatterStream } from '../formatter'\nimport { EventDataCollector } from '../formatter/helpers'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport FormatterBuilder from '../formatter/builder'\nimport { ILogger } from '../environment'\nimport { createStream } from '../formatter/create_stream'\nimport { resolveImplementation } from '../formatter/resolve_implementation'\nimport { PluginManager } from '../plugin'\nimport { IRunOptionsFormats } from './types'\n\nexport async function initializeFormatters({\n env,\n cwd,\n stdout,\n logger,\n onStreamError,\n eventBroadcaster,\n eventDataCollector,\n configuration,\n supportCodeLibrary,\n pluginManager,\n}: {\n env: NodeJS.ProcessEnv\n cwd: string\n stdout: IFormatterStream\n stderr: IFormatterStream\n logger: ILogger\n onStreamError: () => void\n eventBroadcaster: EventEmitter\n eventDataCollector: EventDataCollector\n configuration: IRunOptionsFormats\n supportCodeLibrary: SupportCodeLibrary\n pluginManager: PluginManager\n}): Promise<() => Promise> {\n const cleanupFns: Array<() => Promise> = []\n\n async function initializeFormatter(\n stream: IFormatterStream,\n directory: string | undefined,\n target: string,\n specifier: string\n ): Promise {\n if (specifier === 'progress-bar' && !(stream as TtyWriteStream).isTTY) {\n logger.warn(\n `Cannot use 'progress-bar' formatter for output to '${target}' as not a TTY. Switching to 'progress' formatter.`\n )\n specifier = 'progress'\n }\n const implementation = await resolveImplementation(specifier, cwd)\n if (typeof implementation === 'function') {\n const typeOptions = {\n env,\n cwd,\n eventBroadcaster,\n eventDataCollector,\n log: stream.write.bind(stream),\n parsedArgvOptions: configuration.options,\n stream,\n cleanup:\n stream === stdout\n ? async () => await Promise.resolve()\n : promisify(stream.end.bind(stream)),\n supportCodeLibrary,\n }\n const formatter = await FormatterBuilder.build(\n implementation,\n typeOptions\n )\n cleanupFns.push(async () => formatter.finished())\n } else {\n await pluginManager.initFormatter(\n implementation,\n configuration.options,\n stream,\n stream.write.bind(stream),\n directory\n )\n if (stream !== stdout) {\n cleanupFns.push(promisify(stream.end.bind(stream)))\n }\n }\n }\n\n await initializeFormatter(stdout, undefined, 'stdout', configuration.stdout)\n for (const [target, specifier] of Object.entries(configuration.files)) {\n const { stream, directory } = await createStream(\n target,\n onStreamError,\n cwd,\n logger\n )\n await initializeFormatter(stream, directory, target, specifier)\n }\n\n return async function () {\n await Promise.all(cleanupFns.map((cleanupFn) => cleanupFn()))\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/gherkin.d.ts b/node_modules/@cucumber/cucumber/lib/api/gherkin.d.ts new file mode 100644 index 00000000..ad60c927 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/gherkin.d.ts @@ -0,0 +1,13 @@ +import { Envelope, IdGenerator, ParseError } from '@cucumber/messages'; +import { IFilterablePickle } from '../filter'; +import { ISourcesCoordinates } from './types'; +export declare function getPicklesAndErrors({ newId, cwd, sourcePaths, coordinates, onEnvelope, }: { + newId: IdGenerator.NewId; + cwd: string; + sourcePaths: string[]; + coordinates: ISourcesCoordinates; + onEnvelope?: (envelope: Envelope) => void; +}): Promise<{ + filterablePickles: readonly IFilterablePickle[]; + parseErrors: ParseError[]; +}>; diff --git a/node_modules/@cucumber/cucumber/lib/api/gherkin.js b/node_modules/@cucumber/cucumber/lib/api/gherkin.js new file mode 100644 index 00000000..086eae1b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/gherkin.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getPicklesAndErrors = getPicklesAndErrors; +const gherkin_streams_1 = require("@cucumber/gherkin-streams"); +const gherkin_utils_1 = require("@cucumber/gherkin-utils"); +async function getPicklesAndErrors({ newId, cwd, sourcePaths, coordinates, onEnvelope, }) { + const gherkinQuery = new gherkin_utils_1.Query(); + const parseErrors = []; + await gherkinFromPaths(sourcePaths, { + newId, + relativeTo: cwd, + defaultDialect: coordinates.defaultDialect, + }, (envelope) => { + gherkinQuery.update(envelope); + if (envelope.parseError) { + parseErrors.push(envelope.parseError); + } + onEnvelope?.(envelope); + }); + const filterablePickles = gherkinQuery.getPickles().map((pickle) => { + const gherkinDocument = gherkinQuery + .getGherkinDocuments() + .find((doc) => doc.uri === pickle.uri); + const location = gherkinQuery.getLocation(pickle.astNodeIds[pickle.astNodeIds.length - 1]); + return { + gherkinDocument, + location, + pickle, + }; + }); + return { + filterablePickles, + parseErrors, + }; +} +async function gherkinFromPaths(paths, options, onEnvelope) { + return new Promise((resolve, reject) => { + const gherkinMessageStream = gherkin_streams_1.GherkinStreams.fromPaths(paths, options); + gherkinMessageStream.on('data', onEnvelope); + gherkinMessageStream.on('end', resolve); + gherkinMessageStream.on('error', reject); + }); +} +//# sourceMappingURL=gherkin.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/gherkin.js.map b/node_modules/@cucumber/cucumber/lib/api/gherkin.js.map new file mode 100644 index 00000000..e28a643c --- /dev/null +++ b/node_modules/@cucumber/cucum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AU,gBAAgB,CAC7B,KAAe,EACf,OAA8B,EAC9B,UAAwC;IAExC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,oBAAoB,GAAG,gCAAc,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QACrE,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;QAC3C,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QACvC,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {\n GherkinStreams,\n IGherkinStreamOptions,\n} from '@cucumber/gherkin-streams'\nimport { Envelope, IdGenerator, ParseError } from '@cucumber/messages'\nimport { Query as GherkinQuery } from '@cucumber/gherkin-utils'\nimport { IFilterablePickle } from '../filter'\nimport { ISourcesCoordinates } from './types'\n\nexport async function getPicklesAndErrors({\n newId,\n cwd,\n sourcePaths,\n coordinates,\n onEnvelope,\n}: {\n newId: IdGenerator.NewId\n cwd: string\n sourcePaths: string[]\n coordinates: ISourcesCoordinates\n onEnvelope?: (envelope: Envelope) => void\n}): Promise<{\n filterablePickles: readonly IFilterablePickle[]\n parseErrors: ParseError[]\n}> {\n const gherkinQuery = new GherkinQuery()\n const parseErrors: ParseError[] = []\n await gherkinFromPaths(\n sourcePaths,\n {\n newId,\n relativeTo: cwd,\n defaultDialect: coordinates.defaultDialect,\n },\n (envelope) => {\n gherkinQuery.update(envelope)\n if (envelope.parseError) {\n parseErrors.push(envelope.parseError)\n }\n onEnvelope?.(envelope)\n }\n )\n const filterablePickles = gherkinQuery.getPickles().map((pickle) => {\n const gherkinDocument = gherkinQuery\n .getGherkinDocuments()\n .find((doc) => doc.uri === pickle.uri)\n const location = gherkinQuery.getLocation(\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n )\n return {\n gherkinDocument,\n location,\n pickle,\n }\n })\n return {\n filterablePickles,\n parseErrors,\n }\n}\n\nasync function gherkinFromPaths(\n paths: string[],\n options: IGherkinStreamOptions,\n onEnvelope: (envelope: Envelope) => void\n): Promise {\n return new Promise((resolve, reject) => {\n const gherkinMessageStream = GherkinStreams.fromPaths(paths, options)\n gherkinMessageStream.on('data', onEnvelope)\n gherkinMessageStream.on('end', resolve)\n gherkinMessageStream.on('error', reject)\n })\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/index.d.ts b/node_modules/@cucumber/cucumber/lib/api/index.d.ts new file mode 100644 index 00000000..71e13938 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/index.d.ts @@ -0,0 +1,19 @@ +/** + * JavaScript API for running and extending Cucumber + * + * @packageDocumentation + * @module api + * @remarks + * These docs cover the API used for running Cucumber programmatically. The entry point is `@cucumber/cucumber/api`. + */ +export { IConfiguration } from '../configuration'; +export { ILogger, IRunEnvironment } from '../environment'; +export { IFilterablePickle, IPickleOrder } from '../filter'; +export { IResolvedPaths } from '../paths'; +export { CoordinatorEventKey, CoordinatorEventValues, CoordinatorEventHandler, CoordinatorTransformKey, CoordinatorTransformValues, CoordinatorTransformer, CoordinatorContext, CoordinatorEnvironment, Plugin, PluginCleanup, PluginOperation, } from '../plugin'; +export { IPublishConfig } from '../publish'; +export * from './load_configuration'; +export * from './load_sources'; +export * from './load_support'; +export * from './run_cucumber'; +export * from './types'; diff --git a/node_modules/@cucumber/cucumber/lib/api/index.js b/node_modules/@cucumber/cucumber/lib/api/index.js new file mode 100644 index 00000000..475b0865 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/index.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * JavaScript API for running and extending Cucumber + * + * @packageDocumentation + * @module api + * @remarks + * These docs cover the API used for running Cucumber programmatically. The entry point is `@cucumber/cucumber/api`. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./load_configuration"), exports); +__exportStar(require("./load_sources"), exports); +__exportStar(require("./load_support"), exports); +__exportStar(require("./run_cucumber"), exports); +__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/index.js.map b/node_modules/@cucumber/cucumber/lib/api/index.js.map new file mode 100644 index 00000000..f7446d0e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;AAoBH,uDAAoC;AACpC,iDAA8B;AAC9B,iDAA8B;AAC9B,iDAA8B;AAC9B,0CAAuB","sourcesContent":["/**\n * JavaScript API for running and extending Cucumber\n *\n * @packageDocumentation\n * @module api\n * @remarks\n * These docs cover the API used for running Cucumber programmatically. The entry point is `@cucumber/cucumber/api`.\n */\n\nexport { IConfiguration } from '../configuration'\nexport { ILogger, IRunEnvironment } from '../environment'\nexport { IFilterablePickle, IPickleOrder } from '../filter'\nexport { IResolvedPaths } from '../paths'\nexport {\n CoordinatorEventKey,\n CoordinatorEventValues,\n CoordinatorEventHandler,\n CoordinatorTransformKey,\n CoordinatorTransformValues,\n CoordinatorTransformer,\n CoordinatorContext,\n CoordinatorEnvironment,\n Plugin,\n PluginCleanup,\n PluginOperation,\n} from '../plugin'\nexport { IPublishConfig } from '../publish'\nexport * from './load_configuration'\nexport * from './load_sources'\nexport * from './load_support'\nexport * from './run_cucumber'\nexport * from './types'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/load_configuration.d.ts b/node_modules/@cucumber/cucumber/lib/api/load_configuration.d.ts new file mode 100644 index 00000000..6b97e493 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_configuration.d.ts @@ -0,0 +1,10 @@ +import { IRunEnvironment } from '../environment'; +import { ILoadConfigurationOptions, IResolvedConfiguration } from './types'; +/** + * Load user-authored configuration to be used in a test run + * + * @public + * @param options - Coordinates required to find configuration + * @param environment - Project environment + */ +export declare function loadConfiguration(options?: ILoadConfigurationOptions, environment?: IRunEnvironment): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/api/load_configuration.js b/node_modules/@cucumber/cucumber/lib/api/load_configuration.js new file mode 100644 index 00000000..99b0aba7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_configuration.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadConfiguration = loadConfiguration; +const locate_file_1 = require("../configuration/locate_file"); +const configuration_1 = require("../configuration"); +const environment_1 = require("../environment"); +const convert_configuration_1 = require("./convert_configuration"); +/** + * Load user-authored configuration to be used in a test run + * + * @public + * @param options - Coordinates required to find configuration + * @param environment - Project environment + */ +async function loadConfiguration(options = {}, environment = {}) { + const { cwd, env, logger } = (0, environment_1.makeEnvironment)(environment); + const configFile = options.file ?? (0, locate_file_1.locateFile)(cwd); + if (configFile) { + logger.debug(`Configuration will be loaded from "${configFile}"`); + } + else if (configFile === false) { + logger.debug('Skipping configuration file resolution'); + } + else { + logger.debug('No configuration file found'); + } + const profileConfiguration = configFile + ? await (0, configuration_1.fromFile)(logger, cwd, configFile, options.profiles) + : {}; + const providedConfiguration = (0, configuration_1.parseConfiguration)(logger, 'Provided', options.provided); + if (profileConfiguration.paths?.length > 0 && + providedConfiguration.paths?.length > 0) { + const configPaths = profileConfiguration.paths; + const cliPaths = providedConfiguration.paths; + const mergedPaths = [...configPaths, ...cliPaths]; + logger.warn(`You have specified paths in both your configuration file and as CLI arguments.\n` + + `In a future major version, the CLI argument will override the configuration file instead of being merged.\n` + + `To prepare for this change, see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md\n` + + ` Current result: ${mergedPaths.join(', ')}\n` + + ` Future result: ${cliPaths.join(', ')}`); + } + const original = (0, configuration_1.mergeConfigurations)(configuration_1.DEFAULT_CONFIGURATION, profileConfiguration, providedConfiguration); + logger.debug('Resolved configuration:', original); + (0, configuration_1.validateConfiguration)(original, logger); + const runnable = await (0, convert_configuration_1.convertConfiguration)(logger, original, env); + return { + useConfiguration: original, + runConfiguration: runnable, + }; +} +//# sourceMappingURL=load_configuration.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/load_configuration.js.map b/node_modules/@cucumber/cucumber/lib/api/load_configuration.js.map new file mode 100644 index 00000000..18f522a1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_configuration.js.map @@ -0,0 +1 @@ +{"version":3,"file":"load_configuration.js","sourceRoot":"","sources":["../../src/api/load_configuration.ts"],"names":[],"mappings":";;AAmBA,8CAgDC;AAnED,8DAAyD;AACzD,oDAMyB;AACzB,gDAAiE;AACjE,mEAA8D;AAG9D;;;;;;GAMG;AACI,KAAK,UAAU,iBAAiB,CACrC,UAAqC,EAAE,EACvC,cAA+B,EAAE;IAEjC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAA,6BAAe,EAAC,WAAW,CAAC,CAAA;IACzD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,IAAI,IAAA,wBAAU,EAAC,GAAG,CAAC,CAAA;IAClD,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,sCAAsC,UAAU,GAAG,CAAC,CAAA;IACnE,CAAC;SAAM,IAAI,UAAU,K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AAA;IAClE,OAAO;QACL,gBAAgB,EAAE,QAAQ;QAC1B,gBAAgB,EAAE,QAAQ;KAC3B,CAAA;AACH,CAAC","sourcesContent":["import { locateFile } from '../configuration/locate_file'\nimport {\n DEFAULT_CONFIGURATION,\n fromFile,\n mergeConfigurations,\n parseConfiguration,\n validateConfiguration,\n} from '../configuration'\nimport { IRunEnvironment, makeEnvironment } from '../environment'\nimport { convertConfiguration } from './convert_configuration'\nimport { ILoadConfigurationOptions, IResolvedConfiguration } from './types'\n\n/**\n * Load user-authored configuration to be used in a test run\n *\n * @public\n * @param options - Coordinates required to find configuration\n * @param environment - Project environment\n */\nexport async function loadConfiguration(\n options: ILoadConfigurationOptions = {},\n environment: IRunEnvironment = {}\n): Promise {\n const { cwd, env, logger } = makeEnvironment(environment)\n const configFile = options.file ?? locateFile(cwd)\n if (configFile) {\n logger.debug(`Configuration will be loaded from \"${configFile}\"`)\n } else if (configFile === false) {\n logger.debug('Skipping configuration file resolution')\n } else {\n logger.debug('No configuration file found')\n }\n const profileConfiguration = configFile\n ? await fromFile(logger, cwd, configFile, options.profiles)\n : {}\n const providedConfiguration = parseConfiguration(\n logger,\n 'Provided',\n options.provided\n )\n if (\n profileConfiguration.paths?.length > 0 &&\n providedConfiguration.paths?.length > 0\n ) {\n const configPaths = profileConfiguration.paths\n const cliPaths = providedConfiguration.paths\n const mergedPaths = [...configPaths, ...cliPaths]\n logger.warn(\n `You have specified paths in both your configuration file and as CLI arguments.\\n` +\n `In a future major version, the CLI argument will override the configuration file instead of being merged.\\n` +\n `To prepare for this change, see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md\\n` +\n ` Current result: ${mergedPaths.join(', ')}\\n` +\n ` Future result: ${cliPaths.join(', ')}`\n )\n }\n const original = mergeConfigurations(\n DEFAULT_CONFIGURATION,\n profileConfiguration,\n providedConfiguration\n )\n logger.debug('Resolved configuration:', original)\n validateConfiguration(original, logger)\n const runnable = await convertConfiguration(logger, original, env)\n return {\n useConfiguration: original,\n runConfiguration: runnable,\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/load_sources.d.ts b/node_modules/@cucumber/cucumber/lib/api/load_sources.d.ts new file mode 100644 index 00000000..2a5ad8e1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_sources.d.ts @@ -0,0 +1,11 @@ +import { IRunEnvironment } from '../environment'; +import { ILoadSourcesResult, ISourcesCoordinates } from './types'; +/** + * Load and parse features, produce a filtered and ordered test plan and/or + * parse errors + * + * @public + * @param coordinates - Coordinates required to find and process features + * @param environment - Project environment + */ +export declare function loadSources(coordinates: ISourcesCoordinates, environment?: IRunEnvironment): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/api/load_sources.js b/node_modules/@cucumber/cucumber/lib/api/load_sources.js new file mode 100644 index 00000000..db7e4e56 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_sources.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadSources = loadSources; +const messages_1 = require("@cucumber/messages"); +const paths_1 = require("../paths"); +const environment_1 = require("../environment"); +const gherkin_1 = require("./gherkin"); +const plugins_1 = require("./plugins"); +/** + * Load and parse features, produce a filtered and ordered test plan and/or + * parse errors + * + * @public + * @param coordinates - Coordinates required to find and process features + * @param environment - Project environment + */ +async function loadSources(coordinates, environment = {}) { + const mergedEnvironment = (0, environment_1.makeEnvironment)(environment); + const { cwd, logger } = mergedEnvironment; + const newId = messages_1.IdGenerator.uuid(); + const pluginManager = await (0, plugins_1.initializeForLoadSources)(coordinates, mergedEnvironment); + const resolvedPaths = await (0, paths_1.resolvePaths)(logger, cwd, coordinates); + pluginManager.emit('paths:resolve', resolvedPaths); + const { sourcePaths } = resolvedPaths; + if (sourcePaths.length === 0) { + return { + plan: [], + errors: [], + }; + } + const { filterablePickles, parseErrors } = await (0, gherkin_1.getPicklesAndErrors)({ + newId, + cwd, + sourcePaths, + coordinates, + onEnvelope: (envelope) => pluginManager.emit('message', envelope), + }); + const filteredPickles = await pluginManager.transform('pickles:filter', filterablePickles); + const orderedPickles = await pluginManager.transform('pickles:order', filteredPickles); + const plan = orderedPickles.map(({ location, pickle }) => ({ + name: pickle.name, + uri: pickle.uri, + location, + })); + const errors = parseErrors.map(({ source, message }) => { + return { + uri: source.uri, + location: source.location, + message, + }; + }); + await pluginManager.cleanup(); + return { + plan, + errors, + }; +} +//# sourceMappingURL=load_sources.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/load_sources.js.map b/node_modules/@cucumber/cucumber/lib/api/load_sources.js.map new file mode 100644 index 00000000..3ebc8914 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_sources.js.map @@ -0,0 +1 @@ +{"version":3,"file":"load_sources.js","sourceRoot":"","sources":["../../src/api/load_sources.ts"],"names":[],"mappings":";;AAoBA,kCAoDC;AAxED,iDAAgD;AAChD,oCAAuC;AACvC,gDAAiE;AAOjE,uCAA+C;AAC/C,uCAAoD;AAEpD;;;;;;;GAOG;AACI,KAAK,UAAU,WAAW,CAC/B,WAAgC,EAChC,cAA+B,EAAE;IAEjC,MAAM,iBAAiB,GAAG,IAAA,6BAAe,EAAC,WAAW,CAAC,CAAA;IACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAA;IACzC,MAAM,KAAK,GAAG,sBAAW,CAAC,IAAI,EAAE,CAAA;IAChC,MAAM,aAAa,GAAG,MAAM,IAAA,kCAAwB,EAClD,WAAW,EACX,iBAAiB,CAClB,CAAA;IACD,MAAM,aAAa,GAAG,MAAM,IAAA,oBAAY,EAAC,MAAM,EAAE,GAAG,EAAE,WAAW,CAAC,CAAA;IAClE,aAAa,CAAC,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,CAAA;IAClD,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,CAAA;IACrC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,IAAI,EAAE,EAAE;YACR,MAAM,EAAE,EAAE;SACX,CAAA;IACH,CAAC;IACD,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,6BAAmB,EAAC;QACnE,KAAK;QACL,GAAG;QACH,WAAW;QACX,WAAW;QACX,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC;KAClE,CAAC,CAAA;IACF,MAAM,eAAe,GAAG,MAAM,aAAa,CAAC,SAAS,CACnD,gBAAgB,EAChB,iBAAiB,CAClB,CAAA;IACD,MAAM,cAAc,GAAG,MAAM,aAAa,CAAC,SAAS,CAClD,eAAe,EACf,eAAe,CAChB,CAAA;IACD,MAAM,IAAI,GAAqB,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3E,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,QAAQ;KACT,CAAC,CAAC,CAAA;IACH,MAAM,MAAM,GAAoB,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QACtE,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IACF,MAAM,aAAa,CAAC,OAAO,EAAE,CAAA;IAC7B,OAAO;QACL,IAAI;QACJ,MAAM;KACP,CAAA;AACH,CAAC","sourcesContent":["import { IdGenerator } from '@cucumber/messages'\nimport { resolvePaths } from '../paths'\nimport { IRunEnvironment, makeEnvironment } from '../environment'\nimport {\n ILoadSourcesResult,\n IPlannedPickle,\n ISourcesCoordinates,\n ISourcesError,\n} from './types'\nimport { getPicklesAndErrors } from './gherkin'\nimport { initializeForLoadSources } from './plugins'\n\n/**\n * Load and parse features, produce a filtered and ordered test plan and/or\n * parse errors\n *\n * @public\n * @param coordinates - Coordinates required to find and process features\n * @param environment - Project environment\n */\nexport async function loadSources(\n coordinates: ISourcesCoordinates,\n environment: IRunEnvironment = {}\n): Promise {\n const mergedEnvironment = makeEnvironment(environment)\n const { cwd, logger } = mergedEnvironment\n const newId = IdGenerator.uuid()\n const pluginManager = await initializeForLoadSources(\n coordinates,\n mergedEnvironment\n )\n const resolvedPaths = await resolvePaths(logger, cwd, coordinates)\n pluginManager.emit('paths:resolve', resolvedPaths)\n const { sourcePaths } = resolvedPaths\n if (sourcePaths.length === 0) {\n return {\n plan: [],\n errors: [],\n }\n }\n const { filterablePickles, parseErrors } = await getPicklesAndErrors({\n newId,\n cwd,\n sourcePaths,\n coordinates,\n onEnvelope: (envelope) => pluginManager.emit('message', envelope),\n })\n const filteredPickles = await pluginManager.transform(\n 'pickles:filter',\n filterablePickles\n )\n const orderedPickles = await pluginManager.transform(\n 'pickles:order',\n filteredPickles\n )\n const plan: IPlannedPickle[] = orderedPickles.map(({ location, pickle }) => ({\n name: pickle.name,\n uri: pickle.uri,\n location,\n }))\n const errors: ISourcesError[] = parseErrors.map(({ source, message }) => {\n return {\n uri: source.uri,\n location: source.location,\n message,\n }\n })\n await pluginManager.cleanup()\n return {\n plan,\n errors,\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/load_support.d.ts b/node_modules/@cucumber/cucumber/lib/api/load_support.d.ts new file mode 100644 index 00000000..b49e1c08 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_support.d.ts @@ -0,0 +1,10 @@ +import { IRunEnvironment } from '../environment'; +import { ILoadSupportOptions, ISupportCodeLibrary } from './types'; +/** + * Load support code for use in test runs + * + * @public + * @param options - Options required to find the support code + * @param environment - Project environment + */ +export declare function loadSupport(options: ILoadSupportOptions, environment?: IRunEnvironment): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/api/load_support.js b/node_modules/@cucumber/cucumber/lib/api/load_support.js new file mode 100644 index 00000000..adf7ae52 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_support.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.loadSupport = loadSupport; +const messages_1 = require("@cucumber/messages"); +const paths_1 = require("../paths"); +const environment_1 = require("../environment"); +const support_1 = require("./support"); +const plugins_1 = require("./plugins"); +/** + * Load support code for use in test runs + * + * @public + * @param options - Options required to find the support code + * @param environment - Project environment + */ +async function loadSupport(options, environment = {}) { + const mergedEnvironment = (0, environment_1.makeEnvironment)(environment); + const { cwd, logger } = mergedEnvironment; + const newId = messages_1.IdGenerator.uuid(); + const supportCoordinates = Object.assign({ + requireModules: [], + requirePaths: [], + loaders: [], + importPaths: [], + }, options.support); + const pluginManager = await (0, plugins_1.initializeForLoadSupport)(mergedEnvironment); + const resolvedPaths = await (0, paths_1.resolvePaths)(logger, cwd, options.sources, supportCoordinates); + pluginManager.emit('paths:resolve', resolvedPaths); + const { requirePaths, importPaths } = resolvedPaths; + const supportCodeLibrary = await (0, support_1.getSupportCodeLibrary)({ + logger, + cwd, + newId, + requireModules: supportCoordinates.requireModules, + requirePaths, + loaders: supportCoordinates.loaders, + importPaths, + }); + await pluginManager.cleanup(); + return supportCodeLibrary; +} +//# sourceMappingURL=load_support.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/load_support.js.map b/node_modules/@cucumber/cucumber/lib/api/load_support.js.map new file mode 100644 index 00000000..664a8649 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/load_support.js.map @@ -0,0 +1 @@ +{"version":3,"file":"load_support.js","sourceRoot":"","sources":["../../src/api/load_support.ts"],"names":[],"mappings":";;AAcA,kCAoCC;AAlDD,iDAAgD;AAChD,oCAAuC;AACvC,gDAAiE;AAEjE,uCAAiD;AACjD,uCAAoD;AAEpD;;;;;;GAMG;AACI,KAAK,UAAU,WAAW,CAC/B,OAA4B,EAC5B,cAA+B,EAAE;IAEjC,MAAM,iBAAiB,GAAG,IAAA,6BAAe,EAAC,WAAW,CAAC,CAAA;IACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAA;IACzC,MAAM,KAAK,GAAG,sBAAW,CAAC,IAAI,EAAE,CAAA;IAChC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CACtC;QACE,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,EAAE;KAChB,EACD,OAAO,CAAC,OAAO,CAChB,CAAA;IACD,MAAM,aAAa,GAAG,MAAM,IAAA,kCAAwB,EAAC,iBAAiB,CAAC,CAAA;IACvE,MAAM,aAAa,GAAG,MAAM,IAAA,oBAAY,EACtC,MAAM,EACN,GAAG,EACH,OAAO,CAAC,OAAO,EACf,kBAAkB,CACnB,CAAA;IACD,aAAa,CAAC,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,CAAA;IAClD,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,aAAa,CAAA;IACnD,MAAM,kBAAkB,GAAG,MAAM,IAAA,+BAAqB,EAAC;QACrD,MAAM;QACN,GAAG;QACH,KAAK;QACL,cAAc,EAAE,kBAAkB,CAAC,cAAc;QACjD,YAAY;QACZ,OAAO,EAAE,kBAAkB,CAAC,OAAO;QACnC,WAAW;KACZ,CAAC,CAAA;IACF,MAAM,aAAa,CAAC,OAAO,EAAE,CAAA;IAC7B,OAAO,kBAAkB,CAAA;AAC3B,CAAC","sourcesContent":["import { IdGenerator } from '@cucumber/messages'\nimport { resolvePaths } from '../paths'\nimport { IRunEnvironment, makeEnvironment } from '../environment'\nimport { ILoadSupportOptions, ISupportCodeLibrary } from './types'\nimport { getSupportCodeLibrary } from './support'\nimport { initializeForLoadSupport } from './plugins'\n\n/**\n * Load support code for use in test runs\n *\n * @public\n * @param options - Options required to find the support code\n * @param environment - Project environment\n */\nexport async function loadSupport(\n options: ILoadSupportOptions,\n environment: IRunEnvironment = {}\n): Promise {\n const mergedEnvironment = makeEnvironment(environment)\n const { cwd, logger } = mergedEnvironment\n const newId = IdGenerator.uuid()\n const supportCoordinates = Object.assign(\n {\n requireModules: [],\n requirePaths: [],\n loaders: [],\n importPaths: [],\n },\n options.support\n )\n const pluginManager = await initializeForLoadSupport(mergedEnvironment)\n const resolvedPaths = await resolvePaths(\n logger,\n cwd,\n options.sources,\n supportCoordinates\n )\n pluginManager.emit('paths:resolve', resolvedPaths)\n const { requirePaths, importPaths } = resolvedPaths\n const supportCodeLibrary = await getSupportCodeLibrary({\n logger,\n cwd,\n newId,\n requireModules: supportCoordinates.requireModules,\n requirePaths,\n loaders: supportCoordinates.loaders,\n importPaths,\n })\n await pluginManager.cleanup()\n return supportCodeLibrary\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/plugins.d.ts b/node_modules/@cucumber/cucumber/lib/api/plugins.d.ts new file mode 100644 index 00000000..ecac9448 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/plugins.d.ts @@ -0,0 +1,6 @@ +import { UsableEnvironment } from '../environment'; +import { PluginManager } from '../plugin'; +import { IRunConfiguration, ISourcesCoordinates } from './types'; +export declare function initializeForLoadSources(coordinates: ISourcesCoordinates, environment: UsableEnvironment): Promise; +export declare function initializeForLoadSupport(environment: UsableEnvironment): Promise; +export declare function initializeForRunCucumber(configuration: IRunConfiguration, environment: UsableEnvironment): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/api/plugins.js b/node_modules/@cucumber/cucumber/lib/api/plugins.js new file mode 100644 index 00000000..c3ac3b29 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/plugins.js @@ -0,0 +1,81 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initializeForLoadSources = initializeForLoadSources; +exports.initializeForLoadSupport = initializeForLoadSupport; +exports.initializeForRunCucumber = initializeForRunCucumber; +const node_url_1 = require("node:url"); +const node_path_1 = __importDefault(require("node:path")); +const filter_1 = __importDefault(require("../filter")); +const plugin_1 = require("../plugin"); +const publish_1 = __importDefault(require("../publish")); +const sharding_1 = __importDefault(require("../sharding")); +const value_checker_1 = require("../value_checker"); +async function importPlugin(specifier, cwd) { + try { + let normalized = specifier; + if (specifier.startsWith('.')) { + normalized = (0, node_url_1.pathToFileURL)(node_path_1.default.resolve(cwd, specifier)); + } + else if (specifier.startsWith('file://')) { + normalized = new URL(specifier); + } + return await import(normalized.toString()); + } + catch (e) { + throw new Error(`Failed to import plugin ${specifier}`, { + cause: e, + }); + } +} +function findPlugin(imported) { + return findPluginRecursive(imported, 3); +} +function findPluginRecursive(thing, depth) { + if ((0, value_checker_1.doesNotHaveValue)(thing)) { + return null; + } + if (typeof thing === 'object' && thing.type === 'plugin') { + return thing; + } + depth--; + if (depth > 0) { + return findPluginRecursive(thing.default, depth); + } + return null; +} +async function loadPlugin(specifier, cwd) { + const imported = await importPlugin(specifier, cwd); + const found = findPlugin(imported); + if (!found) { + throw new Error(`${specifier} does not export a plugin`); + } + return found; +} +async function initializeForLoadSources(coordinates, environment) { + // eventually we'll load plugin packages here + const pluginManager = new plugin_1.PluginManager(environment); + await pluginManager.initCoordinatorInternal('loadSources', filter_1.default, coordinates); + return pluginManager; +} +async function initializeForLoadSupport(environment) { + // eventually we'll load plugin packages here + return new plugin_1.PluginManager(environment); +} +async function initializeForRunCucumber(configuration, environment) { + const pluginManager = new plugin_1.PluginManager(environment); + await pluginManager.initCoordinatorInternal('runCucumber', filter_1.default, configuration.sources); + await pluginManager.initCoordinatorInternal('runCucumber', sharding_1.default, configuration.sources); + if (configuration.plugins) { + for (const specifier of configuration.plugins.specifiers) { + const plugin = await loadPlugin(specifier, environment.cwd); + await pluginManager.initCoordinatorExternal('runCucumber', plugin, configuration.plugins.options, specifier); + } + } + // internal plugins that `emit` go last so consumers have a chance to `on` + await pluginManager.initCoordinatorInternal('runCucumber', publish_1.default, configuration.formats.publish); + return pluginManager; +} +//# sourceMappingURL=plugins.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/plugins.js.map b/node_modules/@cucumber/cucumber/lib/api/plugins.js.map new file mode 100644 index 00000000..133ca43a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/plugins.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/api/plugins.ts"],"names":[],"mappings":";;;;;AAqDA,4DAYC;AAED,4DAKC;AAED,4DAqCC;AA/GD,uCAAwC;AACxC,0DAA4B;AAE5B,uDAAoC;AACpC,sCAAiD;AACjD,yDAAsC;AACtC,2DAAwC;AACxC,oDAAmD;AAGnD,KAAK,UAAU,YAAY,CAAC,SAAiB,EAAE,GAAW;IACxD,IAAI,CAAC;QACH,IAAI,UAAU,GAAiB,SAAS,CAAA;QACxC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,UAAU,GAAG,IAAA,wBAAa,EAAC,mBAAI,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAA;QAC1D,CAAC;aAAM,IAAI,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3C,UAAU,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAA;QACjC,CAAC;QACD,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,2BAA2B,SAAS,EAAE,EAAE;YACtD,KAAK,EAAE,CAAC;SACT,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,QAAa;IAC/B,OAAO,mBAAmB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;AACzC,CAAC;AA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AA;IAEpD,MAAM,aAAa,CAAC,uBAAuB,CACzC,aAAa,EACb,gBAAY,EACZ,aAAa,CAAC,OAAO,CACtB,CAAA;IACD,MAAM,aAAa,CAAC,uBAAuB,CACzC,aAAa,EACb,kBAAc,EACd,aAAa,CAAC,OAAO,CACtB,CAAA;IAED,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;QAC1B,KAAK,MAAM,SAAS,IAAI,aAAa,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACzD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,CAAA;YAC3D,MAAM,aAAa,CAAC,uBAAuB,CACzC,aAAa,EACb,MAAM,EACN,aAAa,CAAC,OAAO,CAAC,OAAO,EAC7B,SAAS,CACV,CAAA;QACH,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,MAAM,aAAa,CAAC,uBAAuB,CACzC,aAAa,EACb,iBAAa,EACb,aAAa,CAAC,OAAO,CAAC,OAAO,CAC9B,CAAA;IAED,OAAO,aAAa,CAAA;AACtB,CAAC","sourcesContent":["import { pathToFileURL } from 'node:url'\nimport path from 'node:path'\nimport { UsableEnvironment } from '../environment'\nimport filterPlugin from '../filter'\nimport { PluginManager, Plugin } from '../plugin'\nimport publishPlugin from '../publish'\nimport shardingPlugin from '../sharding'\nimport { doesNotHaveValue } from '../value_checker'\nimport { IRunConfiguration, ISourcesCoordinates } from './types'\n\nasync function importPlugin(specifier: string, cwd: string): Promise {\n try {\n let normalized: URL | string = specifier\n if (specifier.startsWith('.')) {\n normalized = pathToFileURL(path.resolve(cwd, specifier))\n } else if (specifier.startsWith('file://')) {\n normalized = new URL(specifier)\n }\n return await import(normalized.toString())\n } catch (e) {\n throw new Error(`Failed to import plugin ${specifier}`, {\n cause: e,\n })\n }\n}\n\nfunction findPlugin(imported: any): Plugin | null {\n return findPluginRecursive(imported, 3)\n}\n\nfunction findPluginRecursive(thing: any, depth: number): Plugin | null {\n if (doesNotHaveValue(thing)) {\n return null\n }\n if (typeof thing === 'object' && thing.type === 'plugin') {\n return thing\n }\n depth--\n if (depth > 0) {\n return findPluginRecursive(thing.default, depth)\n }\n return null\n}\n\nasync function loadPlugin(specifier: string, cwd: string): Promise {\n const imported = await importPlugin(specifier, cwd)\n const found = findPlugin(imported)\n if (!found) {\n throw new Error(`${specifier} does not export a plugin`)\n }\n return found\n}\n\nexport async function initializeForLoadSources(\n coordinates: ISourcesCoordinates,\n environment: UsableEnvironment\n): Promise {\n // eventually we'll load plugin packages here\n const pluginManager = new PluginManager(environment)\n await pluginManager.initCoordinatorInternal(\n 'loadSources',\n filterPlugin,\n coordinates\n )\n return pluginManager\n}\n\nexport async function initializeForLoadSupport(\n environment: UsableEnvironment\n): Promise {\n // eventually we'll load plugin packages here\n return new PluginManager(environment)\n}\n\nexport async function initializeForRunCucumber(\n configuration: IRunConfiguration,\n environment: UsableEnvironment\n): Promise {\n const pluginManager = new PluginManager(environment)\n\n await pluginManager.initCoordinatorInternal(\n 'runCucumber',\n filterPlugin,\n configuration.sources\n )\n await pluginManager.initCoordinatorInternal(\n 'runCucumber',\n shardingPlugin,\n configuration.sources\n )\n\n if (configuration.plugins) {\n for (const specifier of configuration.plugins.specifiers) {\n const plugin = await loadPlugin(specifier, environment.cwd)\n await pluginManager.initCoordinatorExternal(\n 'runCucumber',\n plugin,\n configuration.plugins.options,\n specifier\n )\n }\n }\n\n // internal plugins that `emit` go last so consumers have a chance to `on`\n await pluginManager.initCoordinatorInternal(\n 'runCucumber',\n publishPlugin,\n configuration.formats.publish\n )\n\n return pluginManager\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/run_cucumber.d.ts b/node_modules/@cucumber/cucumber/lib/api/run_cucumber.d.ts new file mode 100644 index 00000000..03d2d5ab --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/run_cucumber.d.ts @@ -0,0 +1,12 @@ +import { Envelope } from '@cucumber/messages'; +import { IRunEnvironment } from '../environment'; +import { IRunOptions, IRunResult } from './types'; +/** + * Execute a Cucumber test run and return the overall result + * + * @public + * @param options - Options for the run, obtainable via {@link loadConfiguration} + * @param environment - Project environment + * @param onMessage - Callback fired each time Cucumber emits a message + */ +export declare function runCucumber(options: IRunOptions, environment?: IRunEnvironment, onMessage?: (message: Envelope) => void): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/api/run_cucumber.js b/node_modules/@cucumber/cucumber/lib/api/run_cucumber.js new file mode 100644 index 00000000..c6ee9dcc --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/run_cucumber.js @@ -0,0 +1,127 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.runCucumber = runCucumber; +const node_events_1 = require("node:events"); +const messages_1 = require("@cucumber/messages"); +const environment_1 = require("../environment"); +const helpers_1 = require("../formatter/helpers"); +const paths_1 = require("../paths"); +const runtime_1 = require("../runtime"); +const version_1 = require("../version"); +const emit_support_code_messages_1 = require("./emit_support_code_messages"); +const formatters_1 = require("./formatters"); +const gherkin_1 = require("./gherkin"); +const plugins_1 = require("./plugins"); +const support_1 = require("./support"); +/** + * Execute a Cucumber test run and return the overall result + * + * @public + * @param options - Options for the run, obtainable via {@link loadConfiguration} + * @param environment - Project environment + * @param onMessage - Callback fired each time Cucumber emits a message + */ +async function runCucumber(options, environment = {}, onMessage) { + const mergedEnvironment = (0, environment_1.makeEnvironment)(environment); + const { cwd, stdout, stderr, env, logger } = mergedEnvironment; + logger.debug(`Running cucumber-js ${version_1.version} +Working directory: ${cwd} +Running from: ${__dirname} +`); + const newId = messages_1.IdGenerator.uuid(); + const supportCoordinates = 'originalCoordinates' in options.support + ? options.support.originalCoordinates + : Object.assign({ + requireModules: [], + requirePaths: [], + loaders: [], + importPaths: [], + }, options.support); + const pluginManager = await (0, plugins_1.initializeForRunCucumber)({ + ...options, + support: supportCoordinates, + }, mergedEnvironment); + const resolvedPaths = await (0, paths_1.resolvePaths)(logger, cwd, options.sources, supportCoordinates); + pluginManager.emit('paths:resolve', resolvedPaths); + const { sourcePaths, requirePaths, importPaths } = resolvedPaths; + const supportCodeLibrary = 'originalCoordinates' in options.support + ? options.support + : await (0, support_1.getSupportCodeLibrary)({ + logger, + cwd, + newId, + requirePaths, + requireModules: supportCoordinates.requireModules, + importPaths, + loaders: supportCoordinates.loaders, + }); + const eventBroadcaster = new node_events_1.EventEmitter(); + if (onMessage) { + eventBroadcaster.on('envelope', onMessage); + } + eventBroadcaster.on('envelope', (value) => pluginManager.emit('message', value)); + const eventDataCollector = new helpers_1.EventDataCollector(eventBroadcaster); + let formatterStreamError = false; + const cleanupFormatters = await (0, formatters_1.initializeFormatters)({ + env, + cwd, + stdout, + stderr, + logger, + onStreamError: () => (formatterStreamError = true), + eventBroadcaster, + eventDataCollector, + configuration: options.formats, + supportCodeLibrary, + pluginManager, + }); + await (0, emit_support_code_messages_1.emitMetaMessage)(eventBroadcaster, env); + let filteredPickles = []; + let parseErrors = []; + if (sourcePaths.length > 0) { + const gherkinResult = await (0, gherkin_1.getPicklesAndErrors)({ + newId, + cwd, + sourcePaths, + coordinates: options.sources, + onEnvelope: (envelope) => eventBroadcaster.emit('envelope', envelope), + }); + filteredPickles = await pluginManager.transform('pickles:filter', gherkinResult.filterablePickles); + filteredPickles = await pluginManager.transform('pickles:order', filteredPickles); + parseErrors = gherkinResult.parseErrors; + } + if (parseErrors.length) { + parseErrors.forEach((parseError) => { + logger.error(`Parse error in "${parseError.source.uri}" ${parseError.message}`); + }); + await cleanupFormatters(); + await pluginManager.cleanup(); + return { + success: false, + support: supportCodeLibrary, + }; + } + (0, emit_support_code_messages_1.emitSupportCodeMessages)({ + eventBroadcaster, + supportCodeLibrary, + newId, + }); + const runtime = await (0, runtime_1.makeRuntime)({ + environment: mergedEnvironment, + logger, + eventBroadcaster, + sourcedPickles: filteredPickles, + newId, + supportCodeLibrary, + options: options.runtime, + snippetOptions: options.formats.options, + }); + const success = await runtime.run(); + await pluginManager.cleanup(); + await cleanupFormatters(); + return { + success: success && !formatterStreamError, + support: supportCodeLibrary, + }; +} +//# sourceMappingURL=run_cucumber.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/run_cucumber.js.map b/node_modules/@cucumber/cucumber/lib/api/run_cucumber.js.map new file mode 100644 index 00000000..faee7c35 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/run_cucumber.js.map @@ -0,0 +1 @@ +{"version":3,"file":"run_cucumber.js","sourceRoot":"","sources":["../../src/api/run_cucumber.ts"],"names":[],"mappings":";;AA2BA,kCA6IC;AAxKD,6CAA0C;AAC1C,iDAAsE;AACtE,gDAAiE;AAEjE,kDAAyD;AACzD,oCAAuC;AACvC,wCAAwC;AAExC,wCAAoC;AACpC,6EAGqC;AACrC,6CAAmD;AACnD,uCAA+C;AAC/C,uCAAoD;AACpD,uCAAiD;AAGjD;;;;;;;GAOG;AACI,KAAK,UAAU,WAAW,CAC/B,OAAoB,EACpB,cAA+B,EAAE,EACjC,SAAuC;IAEvC,MAAM,iBAAiB,GAAG,IAAA,6BAAe,EAAC,WAAW,CAAC,CAAA;IACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,iBAAiB,CAAA;IAE9D,MAAM,CAAC,KAAK,CAAC,uBAAuB,iBAAO;qBACxB,GAAG;gBACR,SAAS;CACxB,CAAC,CAAA;IAEA,MAAM,KAAK,GAAG,sBAAW,CAAC,IAAI,EAAE,CAAA;IAEhC,MAAM,kBAAkB,GACtB,qBAAqB,IAAI,OAAO,CAAC,OAAO;QACtC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB;QACrC,CAAC,CAAC,MAAM,CAAC,MAAM,CACX;YACE,cAAc,EAAE,EAAE;YAClB,YAAY,EAAE,EAAE;YAChB,OAAO,EAAE,EAAE;YACX,WAAW,EAAE,EAAE;SAChB,EACD,OAAO,CAAC,OAAO,CAChB,CAAA;IAEP,MAAM,aAAa,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AM,OAAO,GAAG,MAAM,IAAA,qBAAW,EAAC;QAChC,WAAW,EAAE,iBAAiB;QAC9B,MAAM;QACN,gBAAgB;QAChB,cAAc,EAAE,eAAe;QAC/B,KAAK;QACL,kBAAkB;QAClB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO;KACxC,CAAC,CAAA;IACF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,CAAA;IACnC,MAAM,aAAa,CAAC,OAAO,EAAE,CAAA;IAC7B,MAAM,iBAAiB,EAAE,CAAA;IAEzB,OAAO;QACL,OAAO,EAAE,OAAO,IAAI,CAAC,oBAAoB;QACzC,OAAO,EAAE,kBAAkB;KAC5B,CAAA;AACH,CAAC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { Envelope, IdGenerator, ParseError } from '@cucumber/messages'\nimport { IRunEnvironment, makeEnvironment } from '../environment'\nimport { IFilterablePickle } from '../filter'\nimport { EventDataCollector } from '../formatter/helpers'\nimport { resolvePaths } from '../paths'\nimport { makeRuntime } from '../runtime'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport { version } from '../version'\nimport {\n emitMetaMessage,\n emitSupportCodeMessages,\n} from './emit_support_code_messages'\nimport { initializeFormatters } from './formatters'\nimport { getPicklesAndErrors } from './gherkin'\nimport { initializeForRunCucumber } from './plugins'\nimport { getSupportCodeLibrary } from './support'\nimport { IRunOptions, IRunResult } from './types'\n\n/**\n * Execute a Cucumber test run and return the overall result\n *\n * @public\n * @param options - Options for the run, obtainable via {@link loadConfiguration}\n * @param environment - Project environment\n * @param onMessage - Callback fired each time Cucumber emits a message\n */\nexport async function runCucumber(\n options: IRunOptions,\n environment: IRunEnvironment = {},\n onMessage?: (message: Envelope) => void\n): Promise {\n const mergedEnvironment = makeEnvironment(environment)\n const { cwd, stdout, stderr, env, logger } = mergedEnvironment\n\n logger.debug(`Running cucumber-js ${version} \nWorking directory: ${cwd}\nRunning from: ${__dirname} \n`)\n\n const newId = IdGenerator.uuid()\n\n const supportCoordinates =\n 'originalCoordinates' in options.support\n ? options.support.originalCoordinates\n : Object.assign(\n {\n requireModules: [],\n requirePaths: [],\n loaders: [],\n importPaths: [],\n },\n options.support\n )\n\n const pluginManager = await initializeForRunCucumber(\n {\n ...options,\n support: supportCoordinates,\n },\n mergedEnvironment\n )\n\n const resolvedPaths = await resolvePaths(\n logger,\n cwd,\n options.sources,\n supportCoordinates\n )\n pluginManager.emit('paths:resolve', resolvedPaths)\n const { sourcePaths, requirePaths, importPaths } = resolvedPaths\n\n const supportCodeLibrary =\n 'originalCoordinates' in options.support\n ? (options.support as SupportCodeLibrary)\n : await getSupportCodeLibrary({\n logger,\n cwd,\n newId,\n requirePaths,\n requireModules: supportCoordinates.requireModules,\n importPaths,\n loaders: supportCoordinates.loaders,\n })\n\n const eventBroadcaster = new EventEmitter()\n if (onMessage) {\n eventBroadcaster.on('envelope', onMessage)\n }\n eventBroadcaster.on('envelope', (value) =>\n pluginManager.emit('message', value)\n )\n const eventDataCollector = new EventDataCollector(eventBroadcaster)\n\n let formatterStreamError = false\n const cleanupFormatters = await initializeFormatters({\n env,\n cwd,\n stdout,\n stderr,\n logger,\n onStreamError: () => (formatterStreamError = true),\n eventBroadcaster,\n eventDataCollector,\n configuration: options.formats,\n supportCodeLibrary,\n pluginManager,\n })\n await emitMetaMessage(eventBroadcaster, env)\n\n let filteredPickles: ReadonlyArray = []\n let parseErrors: ParseError[] = []\n if (sourcePaths.length > 0) {\n const gherkinResult = await getPicklesAndErrors({\n newId,\n cwd,\n sourcePaths,\n coordinates: options.sources,\n onEnvelope: (envelope) => eventBroadcaster.emit('envelope', envelope),\n })\n filteredPickles = await pluginManager.transform(\n 'pickles:filter',\n gherkinResult.filterablePickles\n )\n filteredPickles = await pluginManager.transform(\n 'pickles:order',\n filteredPickles\n )\n parseErrors = gherkinResult.parseErrors\n }\n if (parseErrors.length) {\n parseErrors.forEach((parseError) => {\n logger.error(\n `Parse error in \"${parseError.source.uri}\" ${parseError.message}`\n )\n })\n await cleanupFormatters()\n await pluginManager.cleanup()\n return {\n success: false,\n support: supportCodeLibrary,\n }\n }\n\n emitSupportCodeMessages({\n eventBroadcaster,\n supportCodeLibrary,\n newId,\n })\n\n const runtime = await makeRuntime({\n environment: mergedEnvironment,\n logger,\n eventBroadcaster,\n sourcedPickles: filteredPickles,\n newId,\n supportCodeLibrary,\n options: options.runtime,\n snippetOptions: options.formats.options,\n })\n const success = await runtime.run()\n await pluginManager.cleanup()\n await cleanupFormatters()\n\n return {\n success: success && !formatterStreamError,\n support: supportCodeLibrary,\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/support.d.ts b/node_modules/@cucumber/cucumber/lib/api/support.d.ts new file mode 100644 index 00000000..a1913915 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/support.d.ts @@ -0,0 +1,12 @@ +import { IdGenerator } from '@cucumber/messages'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +import { ILogger } from '../environment'; +export declare function getSupportCodeLibrary({ logger, cwd, newId, requireModules, requirePaths, importPaths, loaders, }: { + logger: ILogger; + cwd: string; + newId: IdGenerator.NewId; + requireModules: string[]; + requirePaths: string[]; + importPaths: string[]; + loaders: string[]; +}): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/api/support.js b/node_modules/@cucumber/cucumber/lib/api/support.js new file mode 100644 index 00000000..cae1308f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/support.js @@ -0,0 +1,36 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSupportCodeLibrary = getSupportCodeLibrary; +const node_module_1 = require("node:module"); +const node_url_1 = require("node:url"); +const support_code_library_builder_1 = __importDefault(require("../support_code_library_builder")); +const try_require_1 = __importDefault(require("../try_require")); +async function getSupportCodeLibrary({ logger, cwd, newId, requireModules, requirePaths, importPaths, loaders, }) { + support_code_library_builder_1.default.reset(cwd, newId, { + requireModules, + requirePaths, + importPaths, + loaders, + }); + requireModules.map((path) => { + logger.debug(`Attempting to require code from "${path}"`); + (0, try_require_1.default)(path); + }); + requirePaths.map((path) => { + logger.debug(`Attempting to require code from "${path}"`); + (0, try_require_1.default)(path); + }); + for (const specifier of loaders) { + logger.debug(`Attempting to register loader "${specifier}"`); + (0, node_module_1.register)(specifier, (0, node_url_1.pathToFileURL)('./')); + } + for (const path of importPaths) { + logger.debug(`Attempting to import code from "${path}"`); + await import((0, node_url_1.pathToFileURL)(path).toString()); + } + return support_code_library_builder_1.default.finalize(); +} +//# sourceMappingURL=support.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/support.js.map b/node_modules/@cucumber/cucumber/lib/api/support.js.map new file mode 100644 index 00000000..9103a0bb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/support.js.map @@ -0,0 +1 @@ +{"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/api/support.ts"],"names":[],"mappings":";;;;;AAQA,sDA4CC;AApDD,6CAAsC;AACtC,uCAAwC;AAGxC,mGAAuE;AACvE,iEAAuC;AAGhC,KAAK,UAAU,qBAAqB,CAAC,EAC1C,MAAM,EACN,GAAG,EACH,KAAK,EACL,cAAc,EACd,YAAY,EACZ,WAAW,EACX,OAAO,GASR;IACC,sCAAyB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE;QAC1C,cAAc;QACd,YAAY;QACZ,WAAW;QACX,OAAO;KACR,CAAC,CAAA;IAEF,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC1B,MAAM,CAAC,KAAK,CAAC,oCAAoC,IAAI,GAAG,CAAC,CAAA;QACzD,IAAA,qBAAU,EAAC,IAAI,CAAC,CAAA;IAClB,CAAC,CAAC,CAAA;IACF,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,CAAC,KAAK,CAAC,oCAAoC,IAAI,GAAG,CAAC,CAAA;QACzD,IAAA,qBAAU,EAAC,IAAI,CAAC,CAAA;IAClB,CAAC,CAAC,CAAA;IAEF,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,kCAAkC,SAAS,GAAG,CAAC,CAAA;QAC5D,IAAA,sBAAQ,EAAC,SAAS,EAAE,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,CAAA;IAC1C,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,mCAAmC,IAAI,GAAG,CAAC,CAAA;QACxD,MAAM,MAAM,CAAC,IAAA,wBAAa,EAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC9C,CAAC;IAED,OAAO,sCAAyB,CAAC,QAAQ,EAAE,CAAA;AAC7C,CAAC","sourcesContent":["import { register } from 'node:module'\nimport { pathToFileURL } from 'node:url'\nimport { IdGenerator } from '@cucumber/messages'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport supportCodeLibraryBuilder from '../support_code_library_builder'\nimport tryRequire from '../try_require'\nimport { ILogger } from '../environment'\n\nexport async function getSupportCodeLibrary({\n logger,\n cwd,\n newId,\n requireModules,\n requirePaths,\n importPaths,\n loaders,\n}: {\n logger: ILogger\n cwd: string\n newId: IdGenerator.NewId\n requireModules: string[]\n requirePaths: string[]\n importPaths: string[]\n loaders: string[]\n}): Promise {\n supportCodeLibraryBuilder.reset(cwd, newId, {\n requireModules,\n requirePaths,\n importPaths,\n loaders,\n })\n\n requireModules.map((path) => {\n logger.debug(`Attempting to require code from \"${path}\"`)\n tryRequire(path)\n })\n requirePaths.map((path) => {\n logger.debug(`Attempting to require code from \"${path}\"`)\n tryRequire(path)\n })\n\n for (const specifier of loaders) {\n logger.debug(`Attempting to register loader \"${specifier}\"`)\n register(specifier, pathToFileURL('./'))\n }\n\n for (const path of importPaths) {\n logger.debug(`Attempting to import code from \"${path}\"`)\n await import(pathToFileURL(path).toString())\n }\n\n return supportCodeLibraryBuilder.finalize()\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/test_helpers.d.ts b/node_modules/@cucumber/cucumber/lib/api/test_helpers.d.ts new file mode 100644 index 00000000..487e467b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/test_helpers.d.ts @@ -0,0 +1,3 @@ +import { IRunEnvironment } from '../environment'; +export declare function setupEnvironment(): Promise>; +export declare function teardownEnvironment(environment: IRunEnvironment): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/api/test_helpers.js b/node_modules/@cucumber/cucumber/lib/api/test_helpers.js new file mode 100644 index 00000000..b8678be3 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/test_helpers.js @@ -0,0 +1,35 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setupEnvironment = setupEnvironment; +exports.teardownEnvironment = teardownEnvironment; +const node_path_1 = __importDefault(require("node:path")); +const node_stream_1 = require("node:stream"); +const fs_1 = __importDefault(require("mz/fs")); +const reindent_template_literals_1 = require("reindent-template-literals"); +const messages_1 = require("@cucumber/messages"); +const newId = messages_1.IdGenerator.uuid(); +async function setupEnvironment() { + const cwd = node_path_1.default.join(__dirname, '..', '..', 'tmp', `api_${newId()}`); + await fs_1.default.mkdir(node_path_1.default.join(cwd, 'features'), { recursive: true }); + await fs_1.default.writeFile(node_path_1.default.join(cwd, 'features', 'test.feature'), (0, reindent_template_literals_1.reindent)(`Feature: test fixture + Scenario: one + Given a step + Then another step`)); + await fs_1.default.writeFile(node_path_1.default.join(cwd, 'features', 'steps.ts'), (0, reindent_template_literals_1.reindent)(`import { Given, Then } from '../../../src' + Given('a step', function () {}) + Then('another step', function () {})`)); + await fs_1.default.writeFile(node_path_1.default.join(cwd, 'cucumber.mjs'), `export default {paths: ['features/test.feature'], requireModule: ['ts-node/register'], require: ['features/steps.ts']}`); + const stdout = new node_stream_1.PassThrough(); + return { cwd, stdout }; +} +async function teardownEnvironment(environment) { + return new Promise((resolve) => { + fs_1.default.rm(environment.cwd, { recursive: true }, resolve); + }).then(() => { + environment.stdout.end(); + }); +} +//# sourceMappingURL=test_helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/test_helpers.js.map b/node_modules/@cucumber/cucumber/lib/api/test_helpers.js.map new file mode 100644 index 00000000..c5cc7936 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/test_helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_helpers.js","sourceRoot":"","sources":["../../src/api/test_helpers.ts"],"names":[],"mappings":";;;;;AASA,4CAsBC;AAED,kDAMC;AAvCD,0DAA4B;AAC5B,6CAAyC;AACzC,+CAAsB;AACtB,2EAAqD;AACrD,iDAAgD;AAGhD,MAAM,KAAK,GAAG,sBAAW,CAAC,IAAI,EAAE,CAAA;AAEzB,KAAK,UAAU,gBAAgB;IACpC,MAAM,GAAG,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,KAAK,EAAE,EAAE,CAAC,CAAA;IACrE,MAAM,YAAE,CAAC,KAAK,CAAC,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC/D,MAAM,YAAE,CAAC,SAAS,CAChB,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,cAAc,CAAC,EAC1C,IAAA,qCAAQ,EAAC;;;0BAGa,CAAC,CACxB,CAAA;IACD,MAAM,YAAE,CAAC,SAAS,CAChB,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EACtC,IAAA,qCAAQ,EAAC;;yCAE4B,CAAC,CACvC,CAAA;IACD,MAAM,YAAE,CAAC,SAAS,CAChB,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAC9B,wHAAwH,CACzH,CAAA;IACD,MAAM,MAAM,GAAG,IAAI,yBAAW,EAAE,CAAA;IAChC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAA;AACxB,CAAC;AAEM,KAAK,UAAU,mBAAmB,CAAC,WAA4B;IACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,YAAE,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;QACX,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import path from 'node:path'\nimport { PassThrough } from 'node:stream'\nimport fs from 'mz/fs'\nimport { reindent } from 'reindent-template-literals'\nimport { IdGenerator } from '@cucumber/messages'\nimport { IRunEnvironment } from '../environment'\n\nconst newId = IdGenerator.uuid()\n\nexport async function setupEnvironment(): Promise> {\n const cwd = path.join(__dirname, '..', '..', 'tmp', `api_${newId()}`)\n await fs.mkdir(path.join(cwd, 'features'), { recursive: true })\n await fs.writeFile(\n path.join(cwd, 'features', 'test.feature'),\n reindent(`Feature: test fixture\n Scenario: one\n Given a step\n Then another step`)\n )\n await fs.writeFile(\n path.join(cwd, 'features', 'steps.ts'),\n reindent(`import { Given, Then } from '../../../src'\n Given('a step', function () {})\n Then('another step', function () {})`)\n )\n await fs.writeFile(\n path.join(cwd, 'cucumber.mjs'),\n `export default {paths: ['features/test.feature'], requireModule: ['ts-node/register'], require: ['features/steps.ts']}`\n )\n const stdout = new PassThrough()\n return { cwd, stdout }\n}\n\nexport async function teardownEnvironment(environment: IRunEnvironment) {\n return new Promise((resolve) => {\n fs.rm(environment.cwd, { recursive: true }, resolve)\n }).then(() => {\n environment.stdout.end()\n })\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/types.d.ts b/node_modules/@cucumber/cucumber/lib/api/types.d.ts new file mode 100644 index 00000000..d50c839d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/types.d.ts @@ -0,0 +1,330 @@ +import { JsonObject } from 'type-fest'; +import { IPublishConfig } from '../publish'; +import { IConfiguration } from '../configuration'; +import { IPickleOrder } from '../filter'; +/** + * Options for {@link loadConfiguration} + * @public + */ +export interface ILoadConfigurationOptions { + /** + * Path to load configuration file from, or `false` to skip + * @default `cucumber.(json|yaml|yml|js|cjs|mjs)` + */ + file?: string | false; + /** + * Zero or more profile names from which to source configuration in the file + * @remarks + * If omitted or empty, the `default` profile will be used. + */ + profiles?: string[]; + /** + * Ad-hoc configuration options to be merged over the top of whatever is + * loaded from the configuration file/profiles + * @example + * \{ + * failFast: true, + * parallel: 2 + * \} + * @example ["--fail-fast", "--parallel", "2"] + * @example "--fail-fast --parallel 2" + * @remarks + * This can also be provided as an array or single string of argv-style + * arguments. + */ + provided?: Partial | string[] | string; +} +/** + * Response from {@link loadConfiguration} + * @public + */ +export interface IResolvedConfiguration { + /** + * The final flat configuration object resolved from the configuration + * file/profiles plus any extra provided + */ + useConfiguration: IConfiguration; + /** + * The format that can be passed into {@link runCucumber} + */ + runConfiguration: IRunConfiguration; +} +/** + * Options relating to sources (i.e. feature files) - where to load them from, + * how to interpret, filter and order them + * @public + */ +export interface ISourcesCoordinates { + /** + * Default Gherkin dialect + * @remarks + * Used if no dialect is specified in the feature file itself. + */ + defaultDialect: string; + /** + * Paths and/or glob expressions to feature files + */ + paths: string[]; + /** + * Regular expressions of which scenario names should match one of to be run + */ + names: string[]; + /** + * Tag expression to filter which scenarios should be run + */ + tagExpression: string; + /** + * Run in the order defined, or in a random order + */ + order: IPickleOrder; + /** + * Shard tests and execute only the selected shard, format `/` + * @example 1/4 + * @remarks + * Shards use 1-based numbering + */ + shard?: string; +} +/** + * A pickle that has been successfully compiled from a source + * @public + */ +export interface IPlannedPickle { + /** + * Name of the pickle (after parameter resolution) + */ + name: string; + uri: string; + location: { + line: number; + column?: number; + }; +} +/** + * An error encountered when parsing a source + * @public + */ +export interface ISourcesError { + uri: string; + location: { + line: number; + column?: number; + }; + /** + * Error message explaining what went wrong with the parse + */ + message: string; +} +/** + * Response from {@link loadSources} + * @public + */ +export interface ILoadSourcesResult { + /** + * Pickles that have been successfully compiled, in the order they would be + * run in + */ + plan: IPlannedPickle[]; + /** + * Any errors encountered when parsing sources + */ + errors: ISourcesError[]; +} +/** + * Options relating to user code (aka support code) - where to load it from and + * how to preprocess it + * @public + */ +export interface ISupportCodeCoordinates { + /** + * Names of transpilation modules to load, via `require()` + */ + requireModules: string[]; + /** + * Paths and/or glob expressions of user code to load, via `require()` + */ + requirePaths: string[]; + /** + * Paths and/or glob expressions of user code to load, via `import()` + */ + importPaths: string[]; + /** + * Specifiers of loaders to register, via `register()` + */ + loaders: string[]; +} +/** + * Options for {@link loadSupport} + * @public + * @remarks + * A subset of {@link IRunConfiguration} + */ +export interface ILoadSupportOptions { + /** + * @remarks + * This is needed because the default support path locations are derived from + * feature file locations. + */ + sources: ISourcesCoordinates; + support: Partial; +} +/** + * Options relating to behaviour when actually running tests + * @public + */ +export interface IRunOptionsRuntime { + /** + * Perform a dry run, where a test run is prepared but nothing is executed + */ + dryRun: boolean; + /** + * Stop running tests when a test fails + */ + failFast: boolean; + /** + * Filter out stack frames from Cucumber's code when formatting stack traces + */ + filterStacktraces: boolean; + /** + * Run tests in parallel with the given number of worker processes + */ + parallel: number; + /** + * Retry failing tests up to the given number of times + */ + retry: number; + /** + * Tag expression to filter which scenarios can be retried + */ + retryTagFilter: string; + /** + * Fail the test run if there are pending steps + */ + strict: boolean; + /** + * Parameters to be passed to the World + * @remarks + * The value must be a JSON-serializable object. + */ + worldParameters: JsonObject; +} +/** + * Options relating to formatters - which ones to use, where to write their + * output, how they should behave + * @public + */ +export interface IRunOptionsFormats { + /** + * Name/path of the formatter to use for `stdout` output + */ + stdout: string; + /** + * Zero or more mappings of file output path (key) to name/path of the + * formatter to use (value) + * @example + * \{ + * "./reports/cucumber.html": "html", + * "./reports/custom.txt": "./custom-formatter.js" + * \} + */ + files: Record; + /** + * Options for report publication, or `false` to disable publication + */ + publish: IPublishConfig | false; + /** + * Options to be provided to formatters + * @remarks + * The value must be a JSON-serializable object. + */ + options: JsonObject; +} +/** + * Options relating to plugins - which ones to use and how they should behave + * @public + */ +export interface IRunOptionsPlugins { + /** + * Specifiers of plugins to load + * @example + * [ + * "\@cucumber/my-plugin", + * "./custom-plugin.js" + * ] + * @remarks + * Each item is a module specifier for a plugin to be loaded. + */ + specifiers: string[]; + /** + * Options to be provided to plugins + * @remarks + * The value must be a JSON-serializable object. + */ + options: JsonObject; +} +/** + * Structured configuration object suitable for passing to {@link runCucumber} + * @public + */ +export interface IRunConfiguration { + sources: ISourcesCoordinates; + support: Partial; + runtime: IRunOptionsRuntime; + formats: IRunOptionsFormats; + plugins?: IRunOptionsPlugins; +} +/** + * A collection of user-defined code and setup ("support code") that can be + * used for a test run + * @public + * @remarks + * This is mostly a marker interface. The actual instance is a complex object + * that you shouldn't interact with directly, but some functions return and/or + * accept it as a means of optimising a test workflow. + */ +export interface ISupportCodeLibrary { + readonly originalCoordinates: ISupportCodeCoordinates; +} +/** + * Either an actual {@link ISupportCodeLibrary | support code library}, or the + * {@link ISupportCodeCoordinates | coordinates} required to create and + * populate one + * @public + * @remarks + * This alias exists because {@link runCucumber} will accept an existing + * support code library in its options and thus avoid trying to load it again, + * improving performance and avoiding cache issues for use cases where multiple + * test runs happen within the same process. Note this is only useful in serial + * mode, as parallel workers will each load the support code themselves anyway. + */ +export type ISupportCodeCoordinatesOrLibrary = Partial | ISupportCodeLibrary; +/** + * Options for {@link runCucumber} + * @public + */ +export interface IRunOptions { + sources: ISourcesCoordinates; + support: ISupportCodeCoordinatesOrLibrary; + runtime: IRunOptionsRuntime; + formats: IRunOptionsFormats; + plugins?: IRunOptionsPlugins; +} +/** + * Response from {@link runCucumber} + * @public + */ +export interface IRunResult { + /** + * Whether the test run was overall successful + * @remarks + * The exact meaning can vary based on the `strict` configuration option. + */ + success: boolean; + /** + * The support code library that was used in the test run + * @remarks + * This can be reused in subsequent {@link runCucumber} calls, + * see {@link ISupportCodeCoordinatesOrLibrary} + */ + support: ISupportCodeLibrary; +} diff --git a/node_modules/@cucumber/cucumber/lib/api/types.js b/node_modules/@cucumber/cucumber/lib/api/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/types.js.map b/node_modules/@cucumber/cucumber/lib/api/types.js.map new file mode 100644 index 00000000..a01b4f0e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonObject } from 'type-fest'\nimport { IPublishConfig } from '../publish'\nimport { IConfiguration } from '../configuration'\nimport { IPickleOrder } from '../filter'\n\n/**\n * Options for {@link loadConfiguration}\n * @public\n */\nexport interface ILoadConfigurationOptions {\n /**\n * Path to load configuration file from, or `false` to skip\n * @default `cucumber.(json|yaml|yml|js|cjs|mjs)`\n */\n file?: string | false\n /**\n * Zero or more profile names from which to source configuration in the file\n * @remarks\n * If omitted or empty, the `default` profile will be used.\n */\n profiles?: string[]\n /**\n * Ad-hoc configuration options to be merged over the top of whatever is\n * loaded from the configuration file/profiles\n * @example\n * \\{\n * failFast: true,\n * parallel: 2\n * \\}\n * @example [\"--fail-fast\", \"--parallel\", \"2\"]\n * @example \"--fail-fast --parallel 2\"\n * @remarks\n * This can also be provided as an array or single string of argv-style\n * arguments.\n */\n provided?: Partial | string[] | string\n}\n\n/**\n * Response from {@link loadConfiguration}\n * @public\n */\nexport interface IResolvedConfiguration {\n /**\n * The final flat configuration object resolved from the configuration\n * file/profiles plus any extra provided\n */\n useConfiguration: IConfiguration\n /**\n * The format that can be passed into {@link runCucumber}\n */\n runConfiguration: IRunConfiguration\n}\n\n/**\n * Options relating to sources (i.e. feature files) - where to load them from,\n * how to interpret, filter and order them\n * @public\n */\nexport interface ISourcesCoordinates {\n /**\n * Default Gherkin dialect\n * @remarks\n * Used if no dialect is specified in the feature file itself.\n */\n defaultDialect: string\n /**\n * Paths and/or glob expressions to feature files\n */\n paths: string[]\n /**\n * Regular expressions of which scenario names should match one of to be run\n */\n names: string[]\n /**\n * Tag expression to filter which scenarios should be run\n */\n tagExpression: string\n /**\n * Run in the order defined, or in a random order\n */\n order: IPickleOrder\n /**\n * Shard tests and execute only the selected shard, format `/`\n * @example 1/4\n * @remarks\n * Shards use 1-based numbering\n */\n shard?: string\n}\n\n/**\n * A pickle that has been successfully compiled from a source\n * @public\n */\nexport interface IPlannedPickle {\n /**\n * Name of the pickle (after parameter resolution)\n */\n name: string\n uri: string\n location: {\n line: number\n column?: number\n }\n}\n\n/**\n * An error encountered when parsing a source\n * @public\n */\nexport interface ISourcesError {\n uri: string\n location: {\n line: number\n column?: number\n }\n /**\n * Error message explaining what went wrong with the parse\n */\n message: string\n}\n\n/**\n * Response from {@link loadSources}\n * @public\n */\nexport interface ILoadSourcesResult {\n /**\n * Pickles that have been successfully compiled, in the order they would be\n * run in\n */\n plan: IPlannedPickle[]\n /**\n * Any errors encountered when parsing sources\n */\n errors: ISourcesError[]\n}\n\n/**\n * Options relating to user code (aka support code) - where to load it from and\n * how to preprocess it\n * @public\n */\nexport interface ISupportCodeCoordinates {\n /**\n * Names of transpilation modules to load, via `require()`\n */\n requireModules: string[]\n /**\n * Paths and/or glob expressions of user code to load, via `require()`\n */\n requirePaths: string[]\n /**\n * Paths and/or glob expressions of user code to load, via `import()`\n */\n importPaths: string[]\n /**\n * Specifiers of loaders to register, via `register()`\n */\n loaders: string[]\n}\n\n/**\n * Options for {@link loadSupport}\n * @public\n * @remarks\n * A subset of {@link IRunConfiguration}\n */\nexport interface ILoadSupportOptions {\n /**\n * @remarks\n * This is needed because the default support path locations are derived from\n * feature file locations.\n */\n sources: ISourcesCoordinates\n support: Partial\n}\n\n/**\n * Options relating to behaviour when actually running tests\n * @public\n */\nexport interface IRunOptionsRuntime {\n /**\n * Perform a dry run, where a test run is prepared but nothing is executed\n */\n dryRun: boolean\n /**\n * Stop running tests when a test fails\n */\n failFast: boolean\n /**\n * Filter out stack frames from Cucumber's code when formatting stack traces\n */\n filterStacktraces: boolean\n /**\n * Run tests in parallel with the given number of worker processes\n */\n parallel: number\n /**\n * Retry failing tests up to the given number of times\n */\n retry: number\n /**\n * Tag expression to filter which scenarios can be retried\n */\n retryTagFilter: string\n /**\n * Fail the test run if there are pending steps\n */\n strict: boolean\n /**\n * Parameters to be passed to the World\n * @remarks\n * The value must be a JSON-serializable object.\n */\n worldParameters: JsonObject\n}\n\n/**\n * Options relating to formatters - which ones to use, where to write their\n * output, how they should behave\n * @public\n */\nexport interface IRunOptionsFormats {\n /**\n * Name/path of the formatter to use for `stdout` output\n */\n stdout: string\n /**\n * Zero or more mappings of file output path (key) to name/path of the\n * formatter to use (value)\n * @example\n * \\{\n * \"./reports/cucumber.html\": \"html\",\n * \"./reports/custom.txt\": \"./custom-formatter.js\"\n * \\}\n */\n files: Record\n /**\n * Options for report publication, or `false` to disable publication\n */\n publish: IPublishConfig | false\n /**\n * Options to be provided to formatters\n * @remarks\n * The value must be a JSON-serializable object.\n */\n options: JsonObject\n}\n\n/**\n * Options relating to plugins - which ones to use and how they should behave\n * @public\n */\nexport interface IRunOptionsPlugins {\n /**\n * Specifiers of plugins to load\n * @example\n * [\n * \"\\@cucumber/my-plugin\",\n * \"./custom-plugin.js\"\n * ]\n * @remarks\n * Each item is a module specifier for a plugin to be loaded.\n */\n specifiers: string[]\n /**\n * Options to be provided to plugins\n * @remarks\n * The value must be a JSON-serializable object.\n */\n options: JsonObject\n}\n\n/**\n * Structured configuration object suitable for passing to {@link runCucumber}\n * @public\n */\nexport interface IRunConfiguration {\n sources: ISourcesCoordinates\n support: Partial\n runtime: IRunOptionsRuntime\n formats: IRunOptionsFormats\n plugins?: IRunOptionsPlugins\n}\n\n/**\n * A collection of user-defined code and setup (\"support code\") that can be\n * used for a test run\n * @public\n * @remarks\n * This is mostly a marker interface. The actual instance is a complex object\n * that you shouldn't interact with directly, but some functions return and/or\n * accept it as a means of optimising a test workflow.\n */\nexport interface ISupportCodeLibrary {\n readonly originalCoordinates: ISupportCodeCoordinates\n}\n\n/**\n * Either an actual {@link ISupportCodeLibrary | support code library}, or the\n * {@link ISupportCodeCoordinates | coordinates} required to create and\n * populate one\n * @public\n * @remarks\n * This alias exists because {@link runCucumber} will accept an existing\n * support code library in its options and thus avoid trying to load it again,\n * improving performance and avoiding cache issues for use cases where multiple\n * test runs happen within the same process. Note this is only useful in serial\n * mode, as parallel workers will each load the support code themselves anyway.\n */\nexport type ISupportCodeCoordinatesOrLibrary =\n | Partial\n | ISupportCodeLibrary\n\n/**\n * Options for {@link runCucumber}\n * @public\n */\nexport interface IRunOptions {\n sources: ISourcesCoordinates\n support: ISupportCodeCoordinatesOrLibrary\n runtime: IRunOptionsRuntime\n formats: IRunOptionsFormats\n plugins?: IRunOptionsPlugins\n}\n\n/**\n * Response from {@link runCucumber}\n * @public\n */\nexport interface IRunResult {\n /**\n * Whether the test run was overall successful\n * @remarks\n * The exact meaning can vary based on the `strict` configuration option.\n */\n success: boolean\n /**\n * The support code library that was used in the test run\n * @remarks\n * This can be reused in subsequent {@link runCucumber} calls,\n * see {@link ISupportCodeCoordinatesOrLibrary}\n */\n support: ISupportCodeLibrary\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/api/wrapper.mjs b/node_modules/@cucumber/cucumber/lib/api/wrapper.mjs new file mode 100644 index 00000000..7f111949 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/api/wrapper.mjs @@ -0,0 +1,6 @@ +import api from './index.js' + +export const loadConfiguration = api.loadConfiguration +export const loadSupport = api.loadSupport +export const loadSources = api.loadSources +export const runCucumber = api.runCucumber diff --git a/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.d.ts b/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.d.ts new file mode 100644 index 00000000..6da45a4e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.d.ts @@ -0,0 +1,5 @@ +import { EventEmitter } from 'node:events'; +import { IdGenerator } from '@cucumber/messages'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +import { AssembledTestCase, SourcedPickle } from './types'; +export declare function assembleTestCases(testRunStartedId: string, eventBroadcaster: EventEmitter, newId: IdGenerator.NewId, sourcedPickles: ReadonlyArray, supportCodeLibrary: SupportCodeLibrary): Promise>; diff --git a/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.js b/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.js new file mode 100644 index 00000000..ad3d2ea6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.js @@ -0,0 +1,89 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assembleTestCases = assembleTestCases; +const value_checker_1 = require("../value_checker"); +async function assembleTestCases(testRunStartedId, eventBroadcaster, newId, sourcedPickles, supportCodeLibrary) { + return sourcedPickles.map(({ gherkinDocument, pickle }) => { + const testCaseId = newId(); + const fromBeforeHooks = makeBeforeHookSteps({ + supportCodeLibrary, + pickle, + newId, + }); + const fromStepDefinitions = makeSteps({ + pickle, + supportCodeLibrary, + newId, + }); + const fromAfterHooks = makeAfterHookSteps({ + supportCodeLibrary, + pickle, + newId, + }); + const testCase = { + testRunStartedId, + pickleId: pickle.id, + id: testCaseId, + testSteps: [ + ...fromBeforeHooks, + ...fromStepDefinitions, + ...fromAfterHooks, + ], + }; + eventBroadcaster.emit('envelope', { testCase }); + return { + gherkinDocument, + pickle, + testCase, + }; + }); +} +function makeAfterHookSteps({ supportCodeLibrary, pickle, newId, }) { + return supportCodeLibrary.afterTestCaseHookDefinitions + .slice(0) + .reverse() + .filter((hookDefinition) => hookDefinition.appliesToTestCase(pickle)) + .map((hookDefinition) => ({ + id: newId(), + hookId: hookDefinition.id, + })); +} +function makeBeforeHookSteps({ supportCodeLibrary, pickle, newId, }) { + return supportCodeLibrary.beforeTestCaseHookDefinitions + .filter((hookDefinition) => hookDefinition.appliesToTestCase(pickle)) + .map((hookDefinition) => ({ + id: newId(), + hookId: hookDefinition.id, + })); +} +function makeSteps({ pickle, supportCodeLibrary, newId, }) { + return pickle.steps.map((pickleStep) => { + const stepDefinitions = supportCodeLibrary.stepDefinitions.filter((stepDefinition) => stepDefinition.matchesStepName(pickleStep.text)); + return { + id: newId(), + pickleStepId: pickleStep.id, + stepDefinitionIds: stepDefinitions.map((stepDefinition) => stepDefinition.id), + stepMatchArgumentsLists: stepDefinitions.map((stepDefinition) => { + const result = stepDefinition.expression.match(pickleStep.text); + return { + stepMatchArguments: result.map((arg) => { + return { + group: mapArgumentGroup(arg.group), + parameterTypeName: arg.parameterType.name, + }; + }), + }; + }), + }; + }); +} +function mapArgumentGroup(group) { + return { + start: group.start, + value: group.value, + children: (0, value_checker_1.doesHaveValue)(group.children) + ? group.children.map((child) => mapArgumentGroup(child)) + : undefined, + }; +} +//# sourceMappingURL=assemble_test_cases.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.js.map b/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.js.map new file mode 100644 index 00000000..55ab2831 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/assemble_test_cases.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assemble_test_cases.js","sour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AK,CAAC;4BAClC,iBAAiB,EAAE,GAAG,CAAC,aAAa,CAAC,IAAI;yBAC1C,CAAA;oBACH,CAAC,CAAC;iBACH,CAAA;YACH,CAAC,CAAC;SACH,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAY;IACpC,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ,EAAE,IAAA,6BAAa,EAAC,KAAK,CAAC,QAAQ,CAAC;YACrC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YACxD,CAAC,CAAC,SAAS;KACd,CAAA;AACH,CAAC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport {\n Envelope,\n IdGenerator,\n Pickle,\n TestCase,\n TestStep,\n Group as MessagesGroup,\n} from '@cucumber/messages'\nimport { Group } from '@cucumber/cucumber-expressions'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport { doesHaveValue } from '../value_checker'\nimport { AssembledTestCase, SourcedPickle } from './types'\n\nexport async function assembleTestCases(\n testRunStartedId: string,\n eventBroadcaster: EventEmitter,\n newId: IdGenerator.NewId,\n sourcedPickles: ReadonlyArray,\n supportCodeLibrary: SupportCodeLibrary\n): Promise> {\n return sourcedPickles.map(({ gherkinDocument, pickle }) => {\n const testCaseId = newId()\n const fromBeforeHooks: TestStep[] = makeBeforeHookSteps({\n supportCodeLibrary,\n pickle,\n newId,\n })\n const fromStepDefinitions: TestStep[] = makeSteps({\n pickle,\n supportCodeLibrary,\n newId,\n })\n const fromAfterHooks: TestStep[] = makeAfterHookSteps({\n supportCodeLibrary,\n pickle,\n newId,\n })\n const testCase: TestCase = {\n testRunStartedId,\n pickleId: pickle.id,\n id: testCaseId,\n testSteps: [\n ...fromBeforeHooks,\n ...fromStepDefinitions,\n ...fromAfterHooks,\n ],\n }\n eventBroadcaster.emit('envelope', { testCase } satisfies Envelope)\n return {\n gherkinDocument,\n pickle,\n testCase,\n }\n })\n}\n\nfunction makeAfterHookSteps({\n supportCodeLibrary,\n pickle,\n newId,\n}: {\n supportCodeLibrary: SupportCodeLibrary\n pickle: Pickle\n newId: IdGenerator.NewId\n}): TestStep[] {\n return supportCodeLibrary.afterTestCaseHookDefinitions\n .slice(0)\n .reverse()\n .filter((hookDefinition) => hookDefinition.appliesToTestCase(pickle))\n .map((hookDefinition) => ({\n id: newId(),\n hookId: hookDefinition.id,\n }))\n}\n\nfunction makeBeforeHookSteps({\n supportCodeLibrary,\n pickle,\n newId,\n}: {\n supportCodeLibrary: SupportCodeLibrary\n pickle: Pickle\n newId: IdGenerator.NewId\n}): TestStep[] {\n return supportCodeLibrary.beforeTestCaseHookDefinitions\n .filter((hookDefinition) => hookDefinition.appliesToTestCase(pickle))\n .map((hookDefinition) => ({\n id: newId(),\n hookId: hookDefinition.id,\n }))\n}\n\nfunction makeSteps({\n pickle,\n supportCodeLibrary,\n newId,\n}: {\n pickle: Pickle\n supportCodeLibrary: SupportCodeLibrary\n newId: () => string\n}): TestStep[] {\n return pickle.steps.map((pickleStep) => {\n const stepDefinitions = supportCodeLibrary.stepDefinitions.filter(\n (stepDefinition) => stepDefinition.matchesStepName(pickleStep.text)\n )\n return {\n id: newId(),\n pickleStepId: pickleStep.id,\n stepDefinitionIds: stepDefinitions.map(\n (stepDefinition) => stepDefinition.id\n ),\n stepMatchArgumentsLists: stepDefinitions.map((stepDefinition) => {\n const result = stepDefinition.expression.match(pickleStep.text)\n return {\n stepMatchArguments: result.map((arg) => {\n return {\n group: mapArgumentGroup(arg.group),\n parameterTypeName: arg.parameterType.name,\n }\n }),\n }\n }),\n }\n })\n}\n\nfunction mapArgumentGroup(group: Group): MessagesGroup {\n return {\n start: group.start,\n value: group.value,\n children: doesHaveValue(group.children)\n ? group.children.map((child) => mapArgumentGroup(child))\n : undefined,\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/assemble/index.d.ts b/node_modules/@cucumber/cucumber/lib/assemble/index.d.ts new file mode 100644 index 00000000..c697b8f0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/index.d.ts @@ -0,0 +1,2 @@ +export * from './assemble_test_cases'; +export * from './types'; diff --git a/node_modules/@cucumber/cucumber/lib/assemble/index.js b/node_modules/@cucumber/cucumber/lib/assemble/index.js new file mode 100644 index 00000000..d5065a32 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./assemble_test_cases"), exports); +__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/assemble/index.js.map b/node_modules/@cucumber/cucumber/lib/assemble/index.js.map new file mode 100644 index 00000000..4f76d585 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/assemble/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,0CAAuB","sourcesContent":["export * from './assemble_test_cases'\nexport * from './types'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/assemble/types.d.ts b/node_modules/@cucumber/cucumber/lib/assemble/types.d.ts new file mode 100644 index 00000000..2cbef07e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/types.d.ts @@ -0,0 +1,10 @@ +import { GherkinDocument, Pickle, TestCase } from '@cucumber/messages'; +export interface SourcedPickle { + gherkinDocument: GherkinDocument; + pickle: Pickle; +} +export interface AssembledTestCase { + gherkinDocument: GherkinDocument; + pickle: Pickle; + testCase: TestCase; +} diff --git a/node_modules/@cucumber/cucumber/lib/assemble/types.js b/node_modules/@cucumber/cucumber/lib/assemble/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/assemble/types.js.map b/node_modules/@cucumber/cucumber/lib/assemble/types.js.map new file mode 100644 index 00000000..41322ba3 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/assemble/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/assemble/types.ts"],"names":[],"mappings":"","sourcesContent":["import { GherkinDocument, Pickle, TestCase } from '@cucumber/messages'\n\nexport interface SourcedPickle {\n gherkinDocument: GherkinDocument\n pickle: Pickle\n}\n\nexport interface AssembledTestCase {\n gherkinDocument: GherkinDocument\n pickle: Pickle\n testCase: TestCase\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/i18n.d.ts b/node_modules/@cucumber/cucumber/lib/cli/i18n.d.ts new file mode 100644 index 00000000..82dc3b04 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/i18n.d.ts @@ -0,0 +1,2 @@ +export declare function getLanguages(): string; +export declare function getKeywords(isoCode: string): string; diff --git a/node_modules/@cucumber/cucumber/lib/cli/i18n.js b/node_modules/@cucumber/cucumber/lib/cli/i18n.js new file mode 100644 index 00000000..d79b2dc1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/i18n.js @@ -0,0 +1,69 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getLanguages = getLanguages; +exports.getKeywords = getKeywords; +const gherkin_1 = require("@cucumber/gherkin"); +const cli_table3_1 = __importDefault(require("cli-table3")); +const capital_case_1 = require("capital-case"); +const keywords = [ + 'feature', + 'rule', + 'background', + 'scenario', + 'scenarioOutline', + 'examples', + 'given', + 'when', + 'then', + 'and', + 'but', +]; +function getAsTable(header, rows) { + const table = new cli_table3_1.default({ + chars: { + bottom: '', + 'bottom-left': '', + 'bottom-mid': '', + 'bottom-right': '', + left: '', + 'left-mid': '', + mid: '', + 'mid-mid': '', + middle: ' | ', + right: '', + 'right-mid': '', + top: '', + 'top-left': '', + 'top-mid': '', + 'top-right': '', + }, + style: { + border: [], + 'padding-left': 0, + 'padding-right': 0, + }, + }); + table.push(header); + table.push(...rows); + return table.toString(); +} +function getLanguages() { + const rows = Object.keys(gherkin_1.dialects).map((isoCode) => [ + isoCode, + gherkin_1.dialects[isoCode].name, + gherkin_1.dialects[isoCode].native, + ]); + return getAsTable(['ISO 639-1', 'ENGLISH NAME', 'NATIVE NAME'], rows); +} +function getKeywords(isoCode) { + const language = gherkin_1.dialects[isoCode]; + const rows = keywords.map((keyword) => { + const words = language[keyword].map((s) => `"${s}"`).join(', '); + return [(0, capital_case_1.capitalCase)(keyword), words]; + }); + return getAsTable(['ENGLISH KEYWORD', 'NATIVE KEYWORDS'], rows); +} +//# sourceMappingURL=i18n.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/i18n.js.map b/node_modules/@cucumber/cucumber/lib/cli/i18n.js.map new file mode 100644 index 00000000..f545dd4f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/i18n.js.map @@ -0,0 +1 @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CAAC,OAAO,CAAC,CAAC,MAAM;KACzB,CAAC,CAAA;IACF,OAAO,UAAU,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,aAAa,CAAC,EAAE,IAAI,CAAC,CAAA;AACvE,CAAC;AAED,SAAgB,WAAW,CAAC,OAAe;IACzC,MAAM,QAAQ,GAAG,kBAAQ,CAAC,OAAO,CAAC,CAAA;IAClC,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC/D,OAAO,CAAC,IAAA,0BAAW,EAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;IACF,OAAO,UAAU,CAAC,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,EAAE,IAAI,CAAC,CAAA;AACjE,CAAC","sourcesContent":["import { dialects } from '@cucumber/gherkin'\nimport Table from 'cli-table3'\nimport { capitalCase } from 'capital-case'\n\nconst keywords = [\n 'feature',\n 'rule',\n 'background',\n 'scenario',\n 'scenarioOutline',\n 'examples',\n 'given',\n 'when',\n 'then',\n 'and',\n 'but',\n] as const\n\nfunction getAsTable(header: string[], rows: string[][]): string {\n const table = new Table({\n chars: {\n bottom: '',\n 'bottom-left': '',\n 'bottom-mid': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n middle: ' | ',\n right: '',\n 'right-mid': '',\n top: '',\n 'top-left': '',\n 'top-mid': '',\n 'top-right': '',\n },\n style: {\n border: [],\n 'padding-left': 0,\n 'padding-right': 0,\n },\n })\n table.push(header)\n table.push(...rows)\n return table.toString()\n}\n\nexport function getLanguages(): string {\n const rows = Object.keys(dialects).map((isoCode) => [\n isoCode,\n dialects[isoCode].name,\n dialects[isoCode].native,\n ])\n return getAsTable(['ISO 639-1', 'ENGLISH NAME', 'NATIVE NAME'], rows)\n}\n\nexport function getKeywords(isoCode: string): string {\n const language = dialects[isoCode]\n const rows = keywords.map((keyword) => {\n const words = language[keyword].map((s) => `\"${s}\"`).join(', ')\n return [capitalCase(keyword), words]\n })\n return getAsTable(['ENGLISH KEYWORD', 'NATIVE KEYWORDS'], rows)\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/index.d.ts b/node_modules/@cucumber/cucumber/lib/cli/index.d.ts new file mode 100644 index 00000000..60cf7bfc --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/index.d.ts @@ -0,0 +1,20 @@ +import { IFormatterStream } from '../formatter'; +export interface ICliRunResult { + shouldExitImmediately: boolean; + success: boolean; +} +export default class Cli { + private readonly argv; + private readonly cwd; + private readonly stdout; + private readonly stderr; + private readonly env; + constructor({ argv, cwd, stdout, stderr, env, }: { + argv: string[]; + cwd: string; + stdout: IFormatterStream; + stderr?: IFormatterStream; + env: NodeJS.ProcessEnv; + }); + run(): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/cli/index.js b/node_modules/@cucumber/cucumber/lib/cli/index.js new file mode 100644 index 00000000..aefa5ca8 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/index.js @@ -0,0 +1,64 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const debug_1 = __importDefault(require("debug")); +const configuration_1 = require("../configuration"); +const api_1 = require("../api"); +const i18n_1 = require("./i18n"); +const install_validator_1 = require("./install_validator"); +class Cli { + argv; + cwd; + stdout; + stderr; + env; + constructor({ argv, cwd, stdout, stderr = process.stderr, env, }) { + this.argv = argv; + this.cwd = cwd; + this.stdout = stdout; + this.stderr = stderr; + this.env = env; + } + async run() { + const debugEnabled = debug_1.default.enabled('cucumber'); + if (debugEnabled) { + await (0, install_validator_1.validateInstall)(); + } + const { options, configuration: argvConfiguration } = configuration_1.ArgvParser.parse(this.argv); + if (options.i18nLanguages) { + this.stdout.write((0, i18n_1.getLanguages)()); + return { + shouldExitImmediately: true, + success: true, + }; + } + if (options.i18nKeywords) { + this.stdout.write((0, i18n_1.getKeywords)(options.i18nKeywords)); + return { + shouldExitImmediately: true, + success: true, + }; + } + const environment = { + cwd: this.cwd, + stdout: this.stdout, + stderr: this.stderr, + env: this.env, + debug: debugEnabled, + }; + const { useConfiguration: configuration, runConfiguration } = await (0, api_1.loadConfiguration)({ + file: options.config, + profiles: options.profile, + provided: argvConfiguration, + }, environment); + const { success } = await (0, api_1.runCucumber)(runConfiguration, environment); + return { + shouldExitImmediately: configuration.forceExit, + success, + }; + } +} +exports.default = Cli; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/index.js.map b/node_modules/@cucumber/cucumber/lib/cli/index.js.map new file mode 100644 index 00000000..5e952d35 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,oDAA6C;AAE7C,gCAAuD;AACvD,iCAAkD;AAClD,2DAAqD;AAOrD,MAAqB,GAAG;IACL,IAAI,CAAU;IACd,GAAG,CAAQ;IACX,MAAM,CAAkB;IACxB,MAAM,CAAkB;IACxB,GAAG,CAAmB;IAEvC,YAAY,EACV,IAAI,EACJ,GAAG,EACH,MAAM,EACN,MAAM,GAAG,OAAO,CAAC,MAAM,EACvB,GAAG,GAOJ;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CA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gBAAgB,EAAE,WAAW,CAAC,CAAA;QACpE,OAAO;YACL,qBAAqB,EAAE,aAAa,CAAC,SAAS;YAC9C,OAAO;SACR,CAAA;IACH,CAAC;CACF;AAxED,sBAwEC","sourcesContent":["import debug from 'debug'\nimport { ArgvParser } from '../configuration'\nimport { IFormatterStream } from '../formatter'\nimport { loadConfiguration, runCucumber } from '../api'\nimport { getKeywords, getLanguages } from './i18n'\nimport { validateInstall } from './install_validator'\n\nexport interface ICliRunResult {\n shouldExitImmediately: boolean\n success: boolean\n}\n\nexport default class Cli {\n private readonly argv: string[]\n private readonly cwd: string\n private readonly stdout: IFormatterStream\n private readonly stderr: IFormatterStream\n private readonly env: NodeJS.ProcessEnv\n\n constructor({\n argv,\n cwd,\n stdout,\n stderr = process.stderr,\n env,\n }: {\n argv: string[]\n cwd: string\n stdout: IFormatterStream\n stderr?: IFormatterStream\n env: NodeJS.ProcessEnv\n }) {\n this.argv = argv\n this.cwd = cwd\n this.stdout = stdout\n this.stderr = stderr\n this.env = env\n }\n\n async run(): Promise {\n const debugEnabled = debug.enabled('cucumber')\n if (debugEnabled) {\n await validateInstall()\n }\n const { options, configuration: argvConfiguration } = ArgvParser.parse(\n this.argv\n )\n if (options.i18nLanguages) {\n this.stdout.write(getLanguages())\n return {\n shouldExitImmediately: true,\n success: true,\n }\n }\n if (options.i18nKeywords) {\n this.stdout.write(getKeywords(options.i18nKeywords))\n return {\n shouldExitImmediately: true,\n success: true,\n }\n }\n\n const environment = {\n cwd: this.cwd,\n stdout: this.stdout,\n stderr: this.stderr,\n env: this.env,\n debug: debugEnabled,\n }\n const { useConfiguration: configuration, runConfiguration } =\n await loadConfiguration(\n {\n file: options.config,\n profiles: options.profile,\n provided: argvConfiguration,\n },\n environment\n )\n const { success } = await runCucumber(runConfiguration, environment)\n return {\n shouldExitImmediately: configuration.forceExit,\n success,\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/install_validator.d.ts b/node_modules/@cucumber/cucumber/lib/cli/install_validator.d.ts new file mode 100644 index 00000000..c299da65 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/install_validator.d.ts @@ -0,0 +1 @@ +export declare function validateInstall(): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/cli/install_validator.js b/node_modules/@cucumber/cucumber/lib/cli/install_validator.js new file mode 100644 index 00000000..c378bbbb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/install_validator.js @@ -0,0 +1,17 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateInstall = validateInstall; +/* eslint-disable no-console */ +const is_installed_globally_1 = __importDefault(require("is-installed-globally")); +async function validateInstall() { + if (is_installed_globally_1.default) + console.warn(` + It looks like you're running Cucumber from a global installation. + If so, you'll likely see issues - you need to have Cucumber installed as a local dependency in your project. + See https://github.com/cucumber/cucumber-js/blob/main/docs/installation.md#invalid-installations + `); +} +//# sourceMappingURL=install_validator.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/install_validator.js.map b/node_modules/@cucumber/cucumber/lib/cli/install_validator.js.map new file mode 100644 index 00000000..0e1bcea9 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/install_validator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"install_validator.js","sourceRoot":"","sources":["../../src/cli/install_validator.ts"],"names":[],"mappings":";;;;;AAGA,0CASC;AAZD,+BAA+B;AAC/B,kFAAuD;AAEhD,KAAK,UAAU,eAAe;IACnC,IAAI,+BAAmB;QACrB,OAAO,CAAC,IAAI,CACV;;;;OAIC,CACF,CAAA;AACL,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport isInstalledGlobally from 'is-installed-globally'\n\nexport async function validateInstall(): Promise {\n if (isInstalledGlobally)\n console.warn(\n `\n It looks like you're running Cucumber from a global installation.\n If so, you'll likely see issues - you need to have Cucumber installed as a local dependency in your project.\n See https://github.com/cucumber/cucumber-js/blob/main/docs/installation.md#invalid-installations\n `\n )\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/run.d.ts b/node_modules/@cucumber/cucumber/lib/cli/run.d.ts new file mode 100644 index 00000000..b3c9871c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/run.d.ts @@ -0,0 +1 @@ +export default function run(): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/cli/run.js b/node_modules/@cucumber/cucumber/lib/cli/run.js new file mode 100644 index 00000000..7bdf6ce8 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/run.js @@ -0,0 +1,43 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = run; +/* eslint-disable no-console */ +/* This is one rare place where we're fine to use process/console directly, + * but other code abstracts those to remain composable and testable. */ +const validate_node_engine_version_1 = require("./validate_node_engine_version"); +const _1 = __importDefault(require("./")); +function logErrorMessageAndExit(message) { + console.error(message); + process.exit(1); +} +async function run() { + (0, validate_node_engine_version_1.validateNodeEngineVersion)(process.version, (error) => { + console.error(error); + process.exit(1); + }, console.warn); + const cli = new _1.default({ + argv: process.argv, + cwd: process.cwd(), + stdout: process.stdout, + stderr: process.stderr, + env: process.env, + }); + let result; + try { + result = await cli.run(); + } + catch (error) { + logErrorMessageAndExit(error); + } + const exitCode = result.success ? 0 : 1; + if (result.shouldExitImmediately) { + process.exit(exitCode); + } + else { + process.exitCode = exitCode; + } +} +//# sourceMappingURL=run.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/run.js.map b/node_modules/@cucumber/cucumber/lib/cli/run.js.map new file mode 100644 index 00000000..12ac449f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/run.js.map @@ -0,0 +1 @@ +{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src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* This is one rare place where we're fine to use process/console directly,\n * but other code abstracts those to remain composable and testable. */\nimport { validateNodeEngineVersion } from './validate_node_engine_version'\nimport Cli, { ICliRunResult } from './'\n\nfunction logErrorMessageAndExit(message: string): void {\n console.error(message)\n process.exit(1)\n}\n\nexport default async function run(): Promise {\n validateNodeEngineVersion(\n process.version,\n (error) => {\n console.error(error)\n process.exit(1)\n },\n console.warn\n )\n\n const cli = new Cli({\n argv: process.argv,\n cwd: process.cwd(),\n stdout: process.stdout,\n stderr: process.stderr,\n env: process.env,\n })\n\n let result: ICliRunResult\n try {\n result = await cli.run()\n } catch (error) {\n logErrorMessageAndExit(error)\n }\n\n const exitCode = result.success ? 0 : 1\n if (result.shouldExitImmediately) {\n process.exit(exitCode)\n } else {\n process.exitCode = exitCode\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.d.ts b/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.d.ts new file mode 100644 index 00000000..52063343 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.d.ts @@ -0,0 +1,10 @@ +type PackageJSON = { + engines: { + node: string; + }; + enginesTested: { + node: string; + }; +}; +export declare function validateNodeEngineVersion(currentVersion: string, onError: (message: string) => void, onWarning: (message: string) => void, readPackageJSON?: () => PackageJSON): void; +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.js b/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.js new file mode 100644 index 00000000..74186121 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.js @@ -0,0 +1,23 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateNodeEngineVersion = validateNodeEngineVersion; +const node_fs_1 = __importDefault(require("node:fs")); +const node_path_1 = __importDefault(require("node:path")); +const semver_1 = __importDefault(require("semver")); +const readActualPackageJSON = () => JSON.parse(node_fs_1.default + .readFileSync(node_path_1.default.resolve(__dirname, '..', '..', 'package.json')) + .toString()); +function validateNodeEngineVersion(currentVersion, onError, onWarning, readPackageJSON = readActualPackageJSON) { + const requiredVersions = readPackageJSON().engines.node; + const testedVersions = readPackageJSON().enginesTested.node; + if (!semver_1.default.satisfies(currentVersion, requiredVersions)) { + onError(`Cucumber can only run on Node.js versions ${requiredVersions}. This Node.js version is ${currentVersion}`); + } + else if (!semver_1.default.satisfies(currentVersion, testedVersions)) { + onWarning(`This Node.js version (${currentVersion}) has not been tested with this version of Cucumber; it should work normally, but please raise an issue if you see anything unexpected.`); + } +} +//# sourceMappingURL=validate_node_engine_version.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.js.map b/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.js.map new file mode 100644 index 00000000..4665bdad --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/cli/validate_node_engine_version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate_node_engine_version.js","sourceRoot":"","sources":["../../src/cli/validate_node_engine_version.ts"],"names":[],"mappings":";;;;;AAgBA,8DAiBC;AAjCD,sDAAwB;AACxB,0DAA4B;AAC5B,oDAA2B;AAO3B,MAAM,qBAAqB,GAAsB,GAAG,EAAE,CACpD,IAAI,CAAC,KAAK,CACR,iBAAE;KACC,YAAY,CAAC,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;KACjE,QAAQ,EAAE,CACd,CAAA;AAEH,SAAgB,yBAAyB,CACvC,cAAsB,EACtB,OAAkC,EAClC,SAAoC,EACpC,kBAAqC,qBAAqB;IAE1D,MAAM,gBAAgB,GAAG,eAAe,EAAE,CAAC,OAAO,CAAC,IAAI,CAAA;IACvD,MAAM,cAAc,GAAG,eAAe,EAAE,CAAC,aAAa,CAAC,IAAI,CAAA;IAC3D,IAAI,CAAC,gBAAM,CAAC,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC,EAAE,CAAC;QACxD,OAAO,CACL,6CAA6C,gBAAgB,6BAA6B,cAAc,EAAE,CAC3G,CAAA;IACH,CAAC;SAAM,IAAI,CAAC,gBAAM,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC;QAC7D,SAAS,CACP,yBAAyB,cAAc,yIAAyI,CACjL,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport semver from 'semver'\n\ntype PackageJSON = {\n engines: { node: string }\n enginesTested: { node: string }\n}\n\nconst readActualPackageJSON: () => PackageJSON = () =>\n JSON.parse(\n fs\n .readFileSync(path.resolve(__dirname, '..', '..', 'package.json'))\n .toString()\n )\n\nexport function validateNodeEngineVersion(\n currentVersion: string,\n onError: (message: string) => void,\n onWarning: (message: string) => void,\n readPackageJSON: () => PackageJSON = readActualPackageJSON\n): void {\n const requiredVersions = readPackageJSON().engines.node\n const testedVersions = readPackageJSON().enginesTested.node\n if (!semver.satisfies(currentVersion, requiredVersions)) {\n onError(\n `Cucumber can only run on Node.js versions ${requiredVersions}. This Node.js version is ${currentVersion}`\n )\n } else if (!semver.satisfies(currentVersion, testedVersions)) {\n onWarning(\n `This Node.js version (${currentVersion}) has not been tested with this version of Cucumber; it should work normally, but please raise an issue if you see anything unexpected.`\n )\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.d.ts new file mode 100644 index 00000000..92a59cb2 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.d.ts @@ -0,0 +1,22 @@ +import { IConfiguration } from './types'; +export interface IParsedArgvOptions { + config?: string; + i18nKeywords?: string; + i18nLanguages?: boolean; + profile: string[]; + plugin?: string[]; + pluginOptions?: object; +} +export interface IParsedArgv { + options: IParsedArgvOptions; + configuration: Partial; +} +declare const ArgvParser: { + collect(val: T, memo?: T[]): T[]; + mergeJson(option: string): (str: string, memo?: object) => object; + mergeTags(value: string, memo?: string): string; + validateCountOption(value: string, optionName: string): number; + validateLanguage(value: string): string; + parse(argv: string[]): IParsedArgv; +}; +export default ArgvParser; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.js b/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.js new file mode 100644 index 00000000..221ec21f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.js @@ -0,0 +1,106 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const commander_1 = require("commander"); +const lodash_merge_1 = __importDefault(require("lodash.merge")); +const gherkin_1 = require("@cucumber/gherkin"); +const version_1 = require("../version"); +const builtin_1 = require("../formatter/builtin"); +const ArgvParser = { + collect(val, memo = []) { + if (val) { + return [...memo, val]; + } + return undefined; + }, + mergeJson(option) { + return function (str, memo = {}) { + let val; + try { + val = JSON.parse(str); + } + catch (error) { + const e = error; + throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`); + } + if (typeof val !== 'object' || Array.isArray(val)) { + throw new Error(`${option} must be passed JSON of an object: ${str}`); + } + return (0, lodash_merge_1.default)(memo, val); + }; + }, + mergeTags(value, memo) { + return memo ? `${memo} and (${value})` : `(${value})`; + }, + validateCountOption(value, optionName) { + const numericValue = parseInt(value); + if (isNaN(numericValue) || numericValue < 0) { + throw new Error(`${optionName} must be a non negative integer`); + } + return numericValue; + }, + validateLanguage(value) { + if (!Object.keys(gherkin_1.dialects).includes(value)) { + throw new Error(`Unsupported ISO 639-1: ${value}`); + } + return value; + }, + parse(argv) { + const program = new commander_1.Command('cucumber-js'); + program + .allowExcessArguments(true) + .storeOptionsAsProperties(false) + .usage('[options] [...]') + .version(version_1.version, '-v, --version') + .option('-b, --backtrace', 'show full backtrace for errors') + .option('-c, --config ', 'specify configuration file') + .option('-d, --dry-run', 'invoke formatters without executing steps') + .option('--exit, --force-exit', 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit') + .option('--fail-fast', 'abort the run on first failure') + .option('-f, --format ', 'specify the output format, optionally supply PATH to redirect formatter output (repeatable). Available formats:\n' + + Object.entries(builtin_1.documentation).reduce((previous, [key, description]) => previous + ` ${key}: ${description}\n`, ''), ArgvParser.collect) + .option('--format-options ', 'provide options for formatters (repeatable)', ArgvParser.mergeJson('--format-options')) + .option('--i18n-keywords ', 'list language keywords', ArgvParser.validateLanguage) + .option('--i18n-languages', 'list languages') + .option('-i, --import ', 'import files before executing features (repeatable)', ArgvParser.collect) + .option('-l, --loader ', 'module specifier(s) for loaders to be registered ahead of loading support code', ArgvParser.collect) + .option('--language ', 'provide the default language for feature files') + .option('--name ', 'only execute the scenarios with name matching the expression (repeatable)', ArgvParser.collect) + .option('--order ', 'run scenarios in the specified order. Type should be `defined`, `reverse` or `random`') + .option('-p, --profile ', 'specify the profile to use (repeatable)', ArgvParser.collect, []) + .option('--parallel ', 'run in parallel with the given number of workers', (val) => ArgvParser.validateCountOption(val, '--parallel')) + .option('--plugin ', 'load a plugin (repeatable)', ArgvParser.collect) + .option('--plugin-options ', 'provide options for plugins (repeatable)', ArgvParser.mergeJson('--plugin-options')) + .option('--publish', 'Publish a report to https://reports.cucumber.io') + .option('-r, --require ', 'require files before executing features (repeatable)', ArgvParser.collect) + .option('--require-module ', 'require node modules before requiring files (repeatable)', ArgvParser.collect) + .option('--retry ', 'specify the number of times to retry failing test cases (default: 0)', (val) => ArgvParser.validateCountOption(val, '--retry')) + .option('--retry-tag-filter ', `only retries the features or scenarios with tags matching the expression (repeatable). + This option requires '--retry' to be specified.`, ArgvParser.mergeTags) + .option('--shard ', 'run shard INDEX of TOTAL shards. The index starts at 1') + .option('--strict', 'fail if there are pending steps') + .option('--no-strict', 'succeed even if there are pending steps') + .option('-t, --tags ', 'only execute the features or scenarios with tags matching the expression (repeatable)', ArgvParser.mergeTags) + .option('--world-parameters ', 'provide parameters that will be passed to the world constructor (repeatable)', ArgvParser.mergeJson('--world-parameters')); + program.addHelpText('afterAll', 'For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md'); + program.parse(argv); + const { config, i18nKeywords, i18nLanguages, profile, ...regularStuff } = program.opts(); + const configuration = regularStuff; + if (program.args.length > 0) { + configuration.paths = program.args; + } + return { + options: { + config, + i18nKeywords, + i18nLanguages, + profile, + }, + configuration, + }; + }, +}; +exports.default = ArgvParser; +//# sourceMappingURL=argv_parser.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.js.map b/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.js.map new file mode 100644 index 00000000..a576eb34 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/argv_parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"argv_parser.js","sourceRoot":"","sources":["../../src/configuration/argv_parser.ts"],"names":[],"mappings":";;;;;AAAA,yCAAmC;AACnC,gEAAgC;AAChC,+CAA4C;AAC5C,wCAAoC;AACpC,kDAAoD;AAoBpD,MAAM,UAAU,GAAG;IACjB,OAAO,CAAI,GAAM,EAAE,OAAY,EAAE;QAC/B,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,OAAO,UAAU,GAAW,EAAE,OAAe,EAAE;YAC7C,IAAI,GAAW,CAAA;YACf,IAAI,CAAC;gBACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACvB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,CAAC,GAAU,KAAK,CAAA;gBACtB,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,yBAAyB,CAAC,CAAC,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,OAAO,EAAE;gBACP,MAAM;gBACN,YAAY;gBACZ,aAAa;gBACb,OAAO;aACR;YACD,aAAa;SACd,CAAA;IACH,CAAC;CACF,CAAA;AAED,kBAAe,UAAU,CAAA","sourcesContent":["import { Command } from 'commander'\nimport merge from 'lodash.merge'\nimport { dialects } from '@cucumber/gherkin'\nimport { version } from '../version'\nimport { documentation } from '../formatter/builtin'\nimport { IConfiguration } from './types'\n\nexport interface IParsedArgvOptions {\n config?: string\n i18nKeywords?: string\n i18nLanguages?: boolean\n profile: string[]\n plugin?: string[]\n pluginOptions?: object\n}\n\nexport interface IParsedArgv {\n options: IParsedArgvOptions\n configuration: Partial\n}\n\ntype IRawArgvOptions = Partial> &\n IParsedArgvOptions\n\nconst ArgvParser = {\n collect(val: T, memo: T[] = []): T[] {\n if (val) {\n return [...memo, val]\n }\n return undefined\n },\n\n mergeJson(option: string): (str: string, memo?: object) => object {\n return function (str: string, memo: object = {}) {\n let val: object\n try {\n val = JSON.parse(str)\n } catch (error) {\n const e: Error = error\n throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`)\n }\n if (typeof val !== 'object' || Array.isArray(val)) {\n throw new Error(`${option} must be passed JSON of an object: ${str}`)\n }\n return merge(memo, val)\n }\n },\n\n mergeTags(value: string, memo?: string): string {\n return memo ? `${memo} and (${value})` : `(${value})`\n },\n\n validateCountOption(value: string, optionName: string): number {\n const numericValue = parseInt(value)\n if (isNaN(numericValue) || numericValue < 0) {\n throw new Error(`${optionName} must be a non negative integer`)\n }\n return numericValue\n },\n\n validateLanguage(value: string): string {\n if (!Object.keys(dialects).includes(value)) {\n throw new Error(`Unsupported ISO 639-1: ${value}`)\n }\n return value\n },\n\n parse(argv: string[]): IParsedArgv {\n const program = new Command('cucumber-js')\n\n program\n .allowExcessArguments(true)\n .storeOptionsAsProperties(false)\n .usage('[options] [...]')\n .version(version, '-v, --version')\n .option('-b, --backtrace', 'show full backtrace for errors')\n .option('-c, --config ', 'specify configuration file')\n .option('-d, --dry-run', 'invoke formatters without executing steps')\n .option(\n '--exit, --force-exit',\n 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit'\n )\n .option('--fail-fast', 'abort the run on first failure')\n .option(\n '-f, --format ',\n 'specify the output format, optionally supply PATH to redirect formatter output (repeatable). Available formats:\\n' +\n Object.entries(documentation).reduce(\n (previous, [key, description]) =>\n previous + ` ${key}: ${description}\\n`,\n ''\n ),\n ArgvParser.collect\n )\n .option(\n '--format-options ',\n 'provide options for formatters (repeatable)',\n ArgvParser.mergeJson('--format-options')\n )\n .option(\n '--i18n-keywords ',\n 'list language keywords',\n ArgvParser.validateLanguage\n )\n .option('--i18n-languages', 'list languages')\n .option(\n '-i, --import ',\n 'import files before executing features (repeatable)',\n ArgvParser.collect\n )\n .option(\n '-l, --loader ',\n 'module specifier(s) for loaders to be registered ahead of loading support code',\n ArgvParser.collect\n )\n .option(\n '--language ',\n 'provide the default language for feature files'\n )\n .option(\n '--name ',\n 'only execute the scenarios with name matching the expression (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--order ',\n 'run scenarios in the specified order. Type should be `defined`, `reverse` or `random`'\n )\n .option(\n '-p, --profile ',\n 'specify the profile to use (repeatable)',\n ArgvParser.collect,\n []\n )\n .option(\n '--parallel ',\n 'run in parallel with the given number of workers',\n (val) => ArgvParser.validateCountOption(val, '--parallel')\n )\n .option(\n '--plugin ',\n 'load a plugin (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--plugin-options ',\n 'provide options for plugins (repeatable)',\n ArgvParser.mergeJson('--plugin-options')\n )\n .option('--publish', 'Publish a report to https://reports.cucumber.io')\n .option(\n '-r, --require ',\n 'require files before executing features (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--require-module ',\n 'require node modules before requiring files (repeatable)',\n ArgvParser.collect\n )\n .option(\n '--retry ',\n 'specify the number of times to retry failing test cases (default: 0)',\n (val) => ArgvParser.validateCountOption(val, '--retry')\n )\n .option(\n '--retry-tag-filter ',\n `only retries the features or scenarios with tags matching the expression (repeatable).\n This option requires '--retry' to be specified.`,\n ArgvParser.mergeTags\n )\n .option(\n '--shard ',\n 'run shard INDEX of TOTAL shards. The index starts at 1'\n )\n .option('--strict', 'fail if there are pending steps')\n .option('--no-strict', 'succeed even if there are pending steps')\n .option(\n '-t, --tags ',\n 'only execute the features or scenarios with tags matching the expression (repeatable)',\n ArgvParser.mergeTags\n )\n .option(\n '--world-parameters ',\n 'provide parameters that will be passed to the world constructor (repeatable)',\n ArgvParser.mergeJson('--world-parameters')\n )\n\n program.addHelpText(\n 'afterAll',\n 'For more details please visit https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md'\n )\n\n program.parse(argv)\n const {\n config,\n i18nKeywords,\n i18nLanguages,\n profile,\n ...regularStuff\n }: IRawArgvOptions = program.opts()\n const configuration: Partial = regularStuff\n if (program.args.length > 0) {\n configuration.paths = program.args\n }\n\n return {\n options: {\n config,\n i18nKeywords,\n i18nLanguages,\n profile,\n },\n configuration,\n }\n },\n}\n\nexport default ArgvParser\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/check_schema.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/check_schema.d.ts new file mode 100644 index 00000000..802fd3bc --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/check_schema.d.ts @@ -0,0 +1,2 @@ +import { IConfiguration } from './types'; +export declare function checkSchema(configuration: any): Partial; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/check_schema.js b/node_modules/@cucumber/cucumber/lib/configuration/check_schema.js new file mode 100644 index 00000000..e11ecb04 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/check_schema.js @@ -0,0 +1,74 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkSchema = checkSchema; +const yup = __importStar(require("yup")); +const gherkin_1 = require("@cucumber/gherkin"); +const schema = yup.object().shape({ + backtrace: yup.boolean(), + dryRun: yup.boolean(), + exit: yup.boolean(), + failFast: yup.boolean(), + format: yup + .array() + .of(yup.lazy((val) => Array.isArray(val) + ? yup.array().of(yup.string()).min(1).max(2) + : yup.string())), + formatOptions: yup.object(), + import: yup.array().of(yup.string()), + language: yup.string().oneOf(Object.keys(gherkin_1.dialects)), + name: yup.array().of(yup.string()), + order: yup.string().matches(/^random:.*|random|defined$/), + paths: yup.array().of(yup.string()), + parallel: yup.number().integer().min(0), + plugin: yup.array().of(yup.string().trim().required()), + pluginOptions: yup.object(), + publish: yup.boolean(), + require: yup.array().of(yup.string()), + requireModule: yup.array().of(yup.string()), + retry: yup.number().integer().min(0), + retryTagFilter: yup.string(), + strict: yup.boolean(), + tags: yup.string(), + worldParameters: yup.object(), +}); +function checkSchema(configuration) { + return schema.validateSync(configuration, { + abortEarly: false, + strict: true, + stripUnknown: true, + }); +} +//# sourceMappingURL=check_schema.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/check_schema.js.map b/node_modules/@cucumber/cucumber/lib/configuration/check_schema.js.map new file mode 100644 index 00000000..8821ecbc --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/check_schema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"check_schema.js","sourceRoot":"","sources":["../../src/configuration/check_schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,kCAMC;AA3CD,yCAA0B;AAC1B,+CAA4C;AAG5C,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC;IAChC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE;IACxB,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE;IACrB,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE;IACvB,MAAM,EAAE,GAAG;SACR,KAAK,EAAE;SACP,EAAE,CACD,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACf,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAChB,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CACjB,CACF;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IACpC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAQ,CAAC,CAAC;IACnD,IAAI,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IAClC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,4BAA4B,CAAC;IACzD,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;IACtD,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE;IAC3B,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;IACtB,OAAO,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IACrC,aAAa,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IAC3C,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE;IAC5B,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE;IACrB,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE;IAClB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE;CAC9B,CAAC,CAAA;AAEF,SAAgB,WAAW,CAAC,aAAkB;IAC5C,OAAO,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE;QACxC,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;KACnB,CAA4B,CAAA;AAC/B,CAAC","sourcesContent":["import * as yup from 'yup'\nimport { dialects } from '@cucumber/gherkin'\nimport { IConfiguration } from './types'\n\nconst schema = yup.object().shape({\n backtrace: yup.boolean(),\n dryRun: yup.boolean(),\n exit: yup.boolean(),\n failFast: yup.boolean(),\n format: yup\n .array()\n .of(\n yup.lazy((val) =>\n Array.isArray(val)\n ? yup.array().of(yup.string()).min(1).max(2)\n : yup.string()\n )\n ),\n formatOptions: yup.object(),\n import: yup.array().of(yup.string()),\n language: yup.string().oneOf(Object.keys(dialects)),\n name: yup.array().of(yup.string()),\n order: yup.string().matches(/^random:.*|random|defined$/),\n paths: yup.array().of(yup.string()),\n parallel: yup.number().integer().min(0),\n plugin: yup.array().of(yup.string().trim().required()),\n pluginOptions: yup.object(),\n publish: yup.boolean(),\n require: yup.array().of(yup.string()),\n requireModule: yup.array().of(yup.string()),\n retry: yup.number().integer().min(0),\n retryTagFilter: yup.string(),\n strict: yup.boolean(),\n tags: yup.string(),\n worldParameters: yup.object(),\n})\n\nexport function checkSchema(configuration: any): Partial {\n return schema.validateSync(configuration, {\n abortEarly: false,\n strict: true,\n stripUnknown: true,\n }) as Partial\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.d.ts new file mode 100644 index 00000000..1f48c843 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.d.ts @@ -0,0 +1,2 @@ +import { IConfiguration } from './types'; +export declare const DEFAULT_CONFIGURATION: IConfiguration; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.js b/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.js new file mode 100644 index 00000000..a132da07 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_CONFIGURATION = void 0; +exports.DEFAULT_CONFIGURATION = { + backtrace: false, + dryRun: false, + forceExit: false, + failFast: false, + format: [], + formatOptions: {}, + plugin: [], + pluginOptions: {}, + import: [], + language: 'en', + loader: [], + name: [], + order: 'defined', + paths: [], + parallel: 0, + publish: false, + require: [], + requireModule: [], + retry: 0, + retryTagFilter: '', + shard: '', + strict: true, + tags: '', + worldParameters: {}, +}; +//# sourceMappingURL=default_configuration.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.js.map b/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.js.map new file mode 100644 index 00000000..202da6d7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/default_configuration.js.map @@ -0,0 +1 @@ +{"version":3,"file":"default_configuration.js","sourceRoot":"","sources":["../../src/configuration/default_configuration.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAmB;IACnD,SAAS,EAAE,KAAK;IAChB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,EAAE;IACV,aAAa,EAAE,EAAE;IACjB,MAAM,EAAE,EAAE;IACV,aAAa,EAAE,EAAE;IACjB,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,EAAE;IACjB,KAAK,EAAE,CAAC;IACR,cAAc,EAAE,EAAE;IAClB,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,EAAE;IACR,eAAe,EAAE,EAAE;CACpB,CAAA","sourcesContent":["import { IConfiguration } from './types'\n\nexport const DEFAULT_CONFIGURATION: IConfiguration = {\n backtrace: false,\n dryRun: false,\n forceExit: false,\n failFast: false,\n format: [],\n formatOptions: {},\n plugin: [],\n pluginOptions: {},\n import: [],\n language: 'en',\n loader: [],\n name: [],\n order: 'defined',\n paths: [],\n parallel: 0,\n publish: false,\n require: [],\n requireModule: [],\n retry: 0,\n retryTagFilter: '',\n shard: '',\n strict: true,\n tags: '',\n worldParameters: {},\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/from_file.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/from_file.d.ts new file mode 100644 index 00000000..d5b3dffb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/from_file.d.ts @@ -0,0 +1,3 @@ +import { ILogger } from '../environment'; +import { IConfiguration } from './types'; +export declare function fromFile(logger: ILogger, cwd: string, file: string, profiles?: string[]): Promise>; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/from_file.js b/node_modules/@cucumber/cucumber/lib/configuration/from_file.js new file mode 100644 index 00000000..d959318c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/from_file.js @@ -0,0 +1,131 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromFile = fromFile; +const node_fs_1 = __importDefault(require("node:fs")); +const node_path_1 = __importDefault(require("node:path")); +const node_util_1 = require("node:util"); +const node_url_1 = require("node:url"); +const yaml_1 = __importDefault(require("yaml")); +const merge_configurations_1 = require("./merge_configurations"); +const parse_configuration_1 = require("./parse_configuration"); +const SUPPORTED_EXTENSIONS = [ + '.json', + '.yaml', + '.yml', + '.js', + '.cjs', + '.mjs', + '.ts', + '.cts', + '.mts', +]; +async function fromFile(logger, cwd, file, profiles = []) { + let definitions = await loadFile(logger, cwd, file); + const defaultDefinition = definitions.default; + if (defaultDefinition) { + if (typeof defaultDefinition === 'function') { + logger.debug('Default function found; loading profiles'); + definitions = await handleDefaultFunctionDefinition(definitions, defaultDefinition); + } + } + else { + logger.debug('No default profile defined in configuration file'); + definitions.default = {}; + } + if (profiles.length < 1) { + logger.debug('No profiles specified; using default profile'); + profiles = ['default']; + } + const definedKeys = Object.keys(definitions); + profiles.forEach((profileKey) => { + if (!definedKeys.includes(profileKey)) { + throw new Error(`Requested profile "${profileKey}" doesn't exist`); + } + }); + return (0, merge_configurations_1.mergeConfigurations)({}, ...profiles.map((profileKey) => (0, parse_configuration_1.parseConfiguration)(logger, `Profile "${profileKey}"`, definitions[profileKey]))); +} +async function handleDefaultFunctionDefinition(definitions, defaultDefinition) { + if (Object.keys(definitions).length > 1) { + throw new Error('Invalid profiles specified: if a default function definition is provided, no other static profiles should be specified'); + } + const definitionsFromDefault = await defaultDefinition(); + return { + default: {}, + ...definitionsFromDefault, + }; +} +async function loadFile(logger, cwd, file) { + const filePath = node_path_1.default.join(cwd, file); + const extension = node_path_1.default.extname(filePath); + if (!SUPPORTED_EXTENSIONS.includes(extension)) { + throw new Error(`Unsupported configuration file extension "${extension}"`); + } + let definitions; + try { + switch (extension) { + case '.json': + definitions = JSON.parse(await (0, node_util_1.promisify)(node_fs_1.default.readFile)(filePath, { encoding: 'utf-8' })); + break; + case '.yaml': + case '.yml': + definitions = yaml_1.default.parse(await (0, node_util_1.promisify)(node_fs_1.default.readFile)(filePath, { encoding: 'utf-8' })); + break; + case '.cjs': + logger.debug(`Loading configuration file "${file}" as CommonJS based on extension`); + // eslint-disable-next-line @typescript-eslint/no-require-imports + definitions = require(filePath); + break; + case '.cts': + logger.debug(`Loading configuration file "${file}" as TypeScript based on extension`); + // eslint-disable-next-line @typescript-eslint/no-require-imports + definitions = require(filePath); + break; + case '.mjs': + logger.debug(`Loading configuration file "${file}" as ESM based on extension`); + definitions = await import((0, node_url_1.pathToFileURL)(filePath).toString()); + break; + case '.mts': + case '.ts': + logger.debug(`Loading configuration file "${file}" as TypeScript based on extension`); + definitions = await import((0, node_url_1.pathToFileURL)(filePath).toString()); + break; + case '.js': + { + const parentPackage = await readPackageJson(filePath); + if (!parentPackage) { + logger.debug(`Loading configuration file "${file}" as CommonJS based on absence of a parent package`); + // eslint-disable-next-line @typescript-eslint/no-require-imports + definitions = require(filePath); + } + else if (parentPackage.type === 'module') { + logger.debug(`Loading configuration file "${file}" as ESM based on "${parentPackage.name}" package type`); + definitions = await import((0, node_url_1.pathToFileURL)(filePath).toString()); + } + else { + logger.debug(`Loading configuration file "${file}" as CommonJS based on "${parentPackage.name}" package type`); + // eslint-disable-next-line @typescript-eslint/no-require-imports + definitions = require(filePath); + } + } + break; + } + } + catch (error) { + throw new Error(`Configuration file "${file}" failed to load/parse`, { + cause: error, + }); + } + if (typeof definitions !== 'object') { + throw new Error(`Configuration file ${filePath} does not export an object`); + } + return definitions; +} +async function readPackageJson(filePath) { + const { readPackageUp } = await import('read-package-up'); + const parentPackage = await readPackageUp({ cwd: node_path_1.default.dirname(filePath) }); + return parentPackage?.packageJson; +} +//# sourceMappingURL=from_file.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/from_file.js.map b/node_modules/@cucumber/cucumber/lib/configuration/from_file.js.map new file mode 100644 index 00000000..58e4cbe0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/from_file.js.map @@ -0,0 +1 @@ +{"version":3,"file":"from_file.js","sourceRoot":"","sources":["../../src/configuration/from_file.ts"],"names":[],"mappings":";;;;;AAsBA,4BA4CC;AAlED,sDAAwB;AACxB,0DAA4B;AAC5B,yCAAqC;AACrC,uCAAwC;AACxC,gDAAuB;AAGvB,iEAA4D;AAC5D,+DAA0D;AAE1D,MAAM,oBAAoB,GAAG;IAC3B,OAAO;IACP,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;CACP,CAAA;AAEM,KAAK,UAAU,QAAQ,CAC5B,MAAe,EACf,GAAW,EACX,IAAY,EACZ,WAAqB,EAAE;IAEvB,IAAI,WAAW,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAEnD,MAAM,iBAAiB,GAAY,WAAW,CAAC,OAAO,CAAA;IAEtD,IAAI,iBAAiB,EAAE,CAAC;QACtB,IAAI,OAAO,iBAAiB,KAAK,UAAU,EAA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EAAE,KAAK;SACb,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,4BAA4B,CAAC,CAAA;IAC7E,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,QAAgB;IAC7C,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAA;IACzD,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC,EAAE,GAAG,EAAE,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC1E,OAAO,aAAa,EAAE,WAAW,CAAA;AACnC,CAAC","sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport { promisify } from 'node:util'\nimport { pathToFileURL } from 'node:url'\nimport YAML from 'yaml'\nimport { ILogger } from '../environment'\nimport { IConfiguration } from './types'\nimport { mergeConfigurations } from './merge_configurations'\nimport { parseConfiguration } from './parse_configuration'\n\nconst SUPPORTED_EXTENSIONS = [\n '.json',\n '.yaml',\n '.yml',\n '.js',\n '.cjs',\n '.mjs',\n '.ts',\n '.cts',\n '.mts',\n]\n\nexport async function fromFile(\n logger: ILogger,\n cwd: string,\n file: string,\n profiles: string[] = []\n): Promise> {\n let definitions = await loadFile(logger, cwd, file)\n\n const defaultDefinition: unknown = definitions.default\n\n if (defaultDefinition) {\n if (typeof defaultDefinition === 'function') {\n logger.debug('Default function found; loading profiles')\n definitions = await handleDefaultFunctionDefinition(\n definitions,\n defaultDefinition\n )\n }\n } else {\n logger.debug('No default profile defined in configuration file')\n definitions.default = {}\n }\n\n if (profiles.length < 1) {\n logger.debug('No profiles specified; using default profile')\n profiles = ['default']\n }\n\n const definedKeys = Object.keys(definitions)\n profiles.forEach((profileKey) => {\n if (!definedKeys.includes(profileKey)) {\n throw new Error(`Requested profile \"${profileKey}\" doesn't exist`)\n }\n })\n return mergeConfigurations(\n {},\n ...profiles.map((profileKey) =>\n parseConfiguration(\n logger,\n `Profile \"${profileKey}\"`,\n definitions[profileKey]\n )\n )\n )\n}\n\nasync function handleDefaultFunctionDefinition(\n definitions: Record,\n defaultDefinition: Function\n): Promise> {\n if (Object.keys(definitions).length > 1) {\n throw new Error(\n 'Invalid profiles specified: if a default function definition is provided, no other static profiles should be specified'\n )\n }\n\n const definitionsFromDefault = await defaultDefinition()\n\n return {\n default: {},\n ...definitionsFromDefault,\n }\n}\n\nasync function loadFile(\n logger: ILogger,\n cwd: string,\n file: string\n): Promise> {\n const filePath: string = path.join(cwd, file)\n const extension = path.extname(filePath)\n if (!SUPPORTED_EXTENSIONS.includes(extension)) {\n throw new Error(`Unsupported configuration file extension \"${extension}\"`)\n }\n let definitions\n try {\n switch (extension) {\n case '.json':\n definitions = JSON.parse(\n await promisify(fs.readFile)(filePath, { encoding: 'utf-8' })\n )\n break\n case '.yaml':\n case '.yml':\n definitions = YAML.parse(\n await promisify(fs.readFile)(filePath, { encoding: 'utf-8' })\n )\n break\n case '.cjs':\n logger.debug(\n `Loading configuration file \"${file}\" as CommonJS based on extension`\n )\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n definitions = require(filePath)\n break\n case '.cts':\n logger.debug(\n `Loading configuration file \"${file}\" as TypeScript based on extension`\n )\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n definitions = require(filePath)\n break\n case '.mjs':\n logger.debug(\n `Loading configuration file \"${file}\" as ESM based on extension`\n )\n definitions = await import(pathToFileURL(filePath).toString())\n break\n case '.mts':\n case '.ts':\n logger.debug(\n `Loading configuration file \"${file}\" as TypeScript based on extension`\n )\n definitions = await import(pathToFileURL(filePath).toString())\n break\n case '.js':\n {\n const parentPackage = await readPackageJson(filePath)\n if (!parentPackage) {\n logger.debug(\n `Loading configuration file \"${file}\" as CommonJS based on absence of a parent package`\n )\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n definitions = require(filePath)\n } else if (parentPackage.type === 'module') {\n logger.debug(\n `Loading configuration file \"${file}\" as ESM based on \"${parentPackage.name}\" package type`\n )\n definitions = await import(pathToFileURL(filePath).toString())\n } else {\n logger.debug(\n `Loading configuration file \"${file}\" as CommonJS based on \"${parentPackage.name}\" package type`\n )\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n definitions = require(filePath)\n }\n }\n break\n }\n } catch (error) {\n throw new Error(`Configuration file \"${file}\" failed to load/parse`, {\n cause: error,\n })\n }\n\n if (typeof definitions !== 'object') {\n throw new Error(`Configuration file ${filePath} does not export an object`)\n }\n return definitions\n}\n\nasync function readPackageJson(filePath: string) {\n const { readPackageUp } = await import('read-package-up')\n const parentPackage = await readPackageUp({ cwd: path.dirname(filePath) })\n return parentPackage?.packageJson\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/helpers.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/helpers.d.ts new file mode 100644 index 00000000..11025f1d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/helpers.d.ts @@ -0,0 +1 @@ +export declare function isTruthyString(s: string | undefined): boolean; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/helpers.js b/node_modules/@cucumber/cucumber/lib/configuration/helpers.js new file mode 100644 index 00000000..e5c9a9b2 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/helpers.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTruthyString = isTruthyString; +function isTruthyString(s) { + if (s === undefined) { + return false; + } + return s.match(/^(false|no|0)$/i) === null; +} +//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/helpers.js.map b/node_modules/@cucumber/cucumber/lib/configuration/helpers.js.map new file mode 100644 index 00000000..0ecfc913 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/configuration/helpers.ts"],"names":[],"mappings":";;AAAA,wCAKC;AALD,SAAgB,cAAc,CAAC,CAAqB;IAClD,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACpB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;AAC5C,CAAC","sourcesContent":["export function isTruthyString(s: string | undefined): boolean {\n if (s === undefined) {\n return false\n }\n return s.match(/^(false|no|0)$/i) === null\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/index.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/index.d.ts new file mode 100644 index 00000000..ed3f906f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/index.d.ts @@ -0,0 +1,9 @@ +export { default as ArgvParser } from './argv_parser'; +export * from './default_configuration'; +export * from './from_file'; +export * from './helpers'; +export * from './merge_configurations'; +export * from './parse_configuration'; +export * from './split_format_descriptor'; +export * from './types'; +export * from './validate_configuration'; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/index.js b/node_modules/@cucumber/cucumber/lib/configuration/index.js new file mode 100644 index 00000000..70efb0e4 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/index.js @@ -0,0 +1,31 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ArgvParser = void 0; +var argv_parser_1 = require("./argv_parser"); +Object.defineProperty(exports, "ArgvParser", { enumerable: true, get: function () { return __importDefault(argv_parser_1).default; } }); +__exportStar(require("./default_configuration"), exports); +__exportStar(require("./from_file"), exports); +__exportStar(require("./helpers"), exports); +__exportStar(require("./merge_configurations"), exports); +__exportStar(require("./parse_configuration"), exports); +__exportStar(require("./split_format_descriptor"), exports); +__exportStar(require("./types"), exports); +__exportStar(require("./validate_configuration"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/index.js.map b/node_modules/@cucumber/cucumber/lib/configuration/index.js.map new file mode 100644 index 00000000..c83b9751 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/configuration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,6CAAqD;AAA5C,0HAAA,OAAO,OAAc;AAC9B,0DAAuC;AACvC,8CAA2B;AAC3B,4CAAyB;AACzB,yDAAsC;AACtC,wDAAqC;AACrC,4DAAyC;AACzC,0CAAuB;AACvB,2DAAwC","sourcesContent":["export { default as ArgvParser } from './argv_parser'\nexport * from './default_configuration'\nexport * from './from_file'\nexport * from './helpers'\nexport * from './merge_configurations'\nexport * from './parse_configuration'\nexport * from './split_format_descriptor'\nexport * from './types'\nexport * from './validate_configuration'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/locate_file.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/locate_file.d.ts new file mode 100644 index 00000000..b1b9e69e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/locate_file.d.ts @@ -0,0 +1 @@ +export declare function locateFile(cwd: string): string | undefined; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/locate_file.js b/node_modules/@cucumber/cucumber/lib/configuration/locate_file.js new file mode 100644 index 00000000..5f29cca5 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/locate_file.js @@ -0,0 +1,20 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.locateFile = locateFile; +const node_path_1 = __importDefault(require("node:path")); +const fs_1 = __importDefault(require("mz/fs")); +const DEFAULT_FILENAMES = [ + 'cucumber.js', + 'cucumber.cjs', + 'cucumber.mjs', + 'cucumber.json', + 'cucumber.yaml', + 'cucumber.yml', +]; +function locateFile(cwd) { + return DEFAULT_FILENAMES.find((filename) => fs_1.default.existsSync(node_path_1.default.join(cwd, filename))); +} +//# sourceMappingURL=locate_file.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/locate_file.js.map b/node_modules/@cucumber/cucumber/lib/configuration/locate_file.js.map new file mode 100644 index 00000000..b418b803 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/locate_file.js.map @@ -0,0 +1 @@ +{"version":3,"file":"locate_file.js","sourceRoot":"","sources":["../../src/configuration/locate_file.ts"],"names":[],"mappings":";;;;;AAYA,gCAIC;AAhBD,0DAA4B;AAC5B,+CAAsB;AAEtB,MAAM,iBAAiB,GAAG;IACxB,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,cAAc;CACf,CAAA;AAED,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACzC,YAAE,CAAC,UAAU,CAAC,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CACxC,CAAA;AACH,CAAC","sourcesContent":["import path from 'node:path'\nimport fs from 'mz/fs'\n\nconst DEFAULT_FILENAMES = [\n 'cucumber.js',\n 'cucumber.cjs',\n 'cucumber.mjs',\n 'cucumber.json',\n 'cucumber.yaml',\n 'cucumber.yml',\n]\n\nexport function locateFile(cwd: string): string | undefined {\n return DEFAULT_FILENAMES.find((filename) =>\n fs.existsSync(path.join(cwd, filename))\n )\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.d.ts new file mode 100644 index 00000000..94558fdb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.d.ts @@ -0,0 +1,2 @@ +import { IConfiguration } from './types'; +export declare function mergeConfigurations>(source: T, ...configurations: Partial[]): T; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.js b/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.js new file mode 100644 index 00000000..a9aad013 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.js @@ -0,0 +1,48 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mergeConfigurations = mergeConfigurations; +const lodash_mergewith_1 = __importDefault(require("lodash.mergewith")); +const ADDITIVE_ARRAYS = [ + 'format', + 'import', + 'loader', + 'name', + 'paths', + 'require', + 'requireModule', +]; +const TAG_EXPRESSIONS = ['tags', 'retryTagFilter']; +function mergeArrays(objValue, srcValue) { + if (objValue && srcValue) { + return [].concat(objValue, srcValue); + } + return undefined; +} +function mergeTagExpressions(objValue, srcValue) { + if (objValue && srcValue) { + return `${wrapTagExpression(objValue)} and ${wrapTagExpression(srcValue)}`; + } + return undefined; +} +function wrapTagExpression(raw) { + if (raw.startsWith('(') && raw.endsWith(')')) { + return raw; + } + return `(${raw})`; +} +function customizer(objValue, srcValue, key) { + if (ADDITIVE_ARRAYS.includes(key)) { + return mergeArrays(objValue, srcValue); + } + if (TAG_EXPRESSIONS.includes(key)) { + return mergeTagExpressions(objValue, srcValue); + } + return undefined; +} +function mergeConfigurations(source, ...configurations) { + return (0, lodash_mergewith_1.default)({}, source, ...configurations, customizer); +} +//# sourceMappingURL=merge_configurations.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.js.map b/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.js.map new file mode 100644 index 00000000..5c5dc020 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/merge_configurations.js.map @@ -0,0 +1 @@ +{"version":3,"file":"merge_configurations.js","sourceRoot":"","sources":["../../src/configuration/merge_configurations.ts"],"names":[],"mappings":";;;;;AA6CA,kDAKC;AAlDD,wEAAwC;AAGxC,MAAM,eAAe,GAAG;IACtB,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,eAAe;CAChB,CAAA;AACD,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;AAElD,SAAS,WAAW,CAAC,QAAe,EAAE,QAAe;IACnD,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IACtC,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAgB,EAAE,QAAgB;IAC7D,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,GAAG,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,iBAAiB,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC5E,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,OAAO,GAAG,CAAA;IACZ,CAAC;IACD,OAAO,IAAI,GAAG,GAAG,CAAA;AACnB,CAAC;AAED,SAAS,UAAU,CAAC,QAAa,EAAE,QAAa,EAAE,GAAW;IAC3D,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IACxC,CAAC;IACD,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAChD,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAgB,mBAAmB,CACjC,MAAS,EACT,GAAG,cAAyC;IAE5C,OAAO,IAAA,0BAAS,EAAC,EAAE,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,UAAU,CAAC,CAAA;AAC7D,CAAC","sourcesContent":["import mergeWith from 'lodash.mergewith'\nimport { IConfiguration } from './types'\n\nconst ADDITIVE_ARRAYS = [\n 'format',\n 'import',\n 'loader',\n 'name',\n 'paths',\n 'require',\n 'requireModule',\n]\nconst TAG_EXPRESSIONS = ['tags', 'retryTagFilter']\n\nfunction mergeArrays(objValue: any[], srcValue: any[]) {\n if (objValue && srcValue) {\n return [].concat(objValue, srcValue)\n }\n return undefined\n}\n\nfunction mergeTagExpressions(objValue: string, srcValue: string) {\n if (objValue && srcValue) {\n return `${wrapTagExpression(objValue)} and ${wrapTagExpression(srcValue)}`\n }\n return undefined\n}\n\nfunction wrapTagExpression(raw: string) {\n if (raw.startsWith('(') && raw.endsWith(')')) {\n return raw\n }\n return `(${raw})`\n}\n\nfunction customizer(objValue: any, srcValue: any, key: string): any {\n if (ADDITIVE_ARRAYS.includes(key)) {\n return mergeArrays(objValue, srcValue)\n }\n if (TAG_EXPRESSIONS.includes(key)) {\n return mergeTagExpressions(objValue, srcValue)\n }\n return undefined\n}\n\nexport function mergeConfigurations>(\n source: T,\n ...configurations: Partial[]\n): T {\n return mergeWith({}, source, ...configurations, customizer)\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.d.ts new file mode 100644 index 00000000..3b6b7a91 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.d.ts @@ -0,0 +1,3 @@ +import { ILogger } from '../environment'; +import { IConfiguration } from './types'; +export declare function parseConfiguration(logger: ILogger, source: string, definition: Partial | string[] | string | undefined): Partial; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.js b/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.js new file mode 100644 index 00000000..10f3b430 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.js @@ -0,0 +1,39 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseConfiguration = parseConfiguration; +const string_argv_1 = __importDefault(require("string-argv")); +const argv_parser_1 = __importDefault(require("./argv_parser")); +const check_schema_1 = require("./check_schema"); +function parseConfiguration(logger, source, definition) { + if (!definition) { + return {}; + } + if (Array.isArray(definition)) { + logger.debug(`${source} configuration value is an array; parsing as argv`); + const { configuration } = argv_parser_1.default.parse([ + 'node', + 'cucumber-js', + ...definition, + ]); + return configuration; + } + if (typeof definition === 'string') { + logger.debug(`${source} configuration value is a string; parsing as argv`); + const { configuration } = argv_parser_1.default.parse([ + 'node', + 'cucumber-js', + ...(0, string_argv_1.default)(definition), + ]); + return configuration; + } + try { + return (0, check_schema_1.checkSchema)(definition); + } + catch (error) { + throw new Error(`${source} configuration value failed schema validation: ${error.errors.join(' ')}`); + } +} +//# sourceMappingURL=parse_configuration.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.js.map b/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.js.map new file mode 100644 index 00000000..c0691203 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/parse_configuration.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parse_configuration.js","sourceRoot":"","sources":["../../src/configuration/parse_configuration.ts"],"names":[],"mappings":";;;;;AAMA,gDAmCC;AAzCD,8DAAoC;AAGpC,gEAAsC;AACtC,iDAA4C;AAE5C,SAAgB,kBAAkB,CAChC,MAAe,EACf,MAAc,EACd,UAAmE;IAEnE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,EAAE,CAAA;IACX,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,mDAAmD,CAAC,CAAA;QAC1E,MAAM,EAAE,aAAa,EAAE,GAAG,qBAAU,CAAC,KAAK,CAAC;YACzC,MAAM;YACN,aAAa;YACb,GAAG,UAAU;SACd,CAAC,CAAA;QACF,OAAO,aAAa,CAAA;IACtB,CAAC;IACD,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,mDAAmD,CAAC,CAAA;QAC1E,MAAM,EAAE,aAAa,EAAE,GAAG,qBAAU,CAAC,KAAK,CAAC;YACzC,MAAM;YACN,aAAa;YACb,GAAG,IAAA,qBAAU,EAAC,UAAU,CAAC;SAC1B,CAAC,CAAA;QACF,OAAO,aAAa,CAAA;IACtB,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAA,0BAAW,EAAC,UAAU,CAAC,CAAA;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,kDAAkD,KAAK,CAAC,MAAM,CAAC,IAAI,CAC1E,GAAG,CACJ,EAAE,CACJ,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["import stringArgv from 'string-argv'\nimport { ILogger } from '../environment'\nimport { IConfiguration } from './types'\nimport ArgvParser from './argv_parser'\nimport { checkSchema } from './check_schema'\n\nexport function parseConfiguration(\n logger: ILogger,\n source: string,\n definition: Partial | string[] | string | undefined\n): Partial {\n if (!definition) {\n return {}\n }\n if (Array.isArray(definition)) {\n logger.debug(`${source} configuration value is an array; parsing as argv`)\n const { configuration } = ArgvParser.parse([\n 'node',\n 'cucumber-js',\n ...definition,\n ])\n return configuration\n }\n if (typeof definition === 'string') {\n logger.debug(`${source} configuration value is a string; parsing as argv`)\n const { configuration } = ArgvParser.parse([\n 'node',\n 'cucumber-js',\n ...stringArgv(definition),\n ])\n return configuration\n }\n try {\n return checkSchema(definition)\n } catch (error) {\n throw new Error(\n `${source} configuration value failed schema validation: ${error.errors.join(\n ' '\n )}`\n )\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.d.ts new file mode 100644 index 00000000..52d8e4fc --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.d.ts @@ -0,0 +1,2 @@ +import { ILogger } from '../environment'; +export declare function splitFormatDescriptor(logger: ILogger, option: string): string[]; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.js b/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.js new file mode 100644 index 00000000..53005cd5 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.splitFormatDescriptor = splitFormatDescriptor; +function splitFormatDescriptor(logger, option) { + const doWarning = (result) => { + let expected = `"${result[0]}"`; + if (result[1]) { + expected += `:"${result[1]}"`; + } + logger.warn(`Each part of a user-specified format should be quoted; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md#ambiguous-colons-in-formats +Change to ${expected}`); + }; + let result; + let match1, match2; + // "foo":"bar" or "foo":bar + if ((match1 = option.match(/^"([^"]*)":(.*)$/)) !== null) { + // "foo":"bar" + if ((match2 = match1[2].match(/^"([^"]*)"$/)) !== null) { + result = [match1[1], match2[1]]; + } + // "foo":bar + else { + result = [match1[1], match1[2]]; + if (result[1].includes(':')) { + doWarning(result); + } + } + } + // foo:"bar" + else if ((match1 = option.match(/^(.*):"([^"]*)"$/)) !== null) { + result = [match1[1], match1[2]]; + if (result[0].includes(':')) { + doWarning(result); + } + } + // "foo" + else if ((match1 = option.match(/^"([^"]*)"$/)) !== null) { + result = [match1[1], '']; + } + // file://foo or file:///foo or file://C:/foo or file://C:\foo or file:///C:/foo or file:///C:\foo + else if ((match1 = option.match(/^(file:\/{2,3}(?:[a-zA-Z]:[/\\])?)(.*)$/)) !== null) { + // file://foo:bar + if ((match2 = match1[2].match(/^([^:]*):(.*)$/)) !== null) { + result = [match1[1] + match2[1], match2[2]]; + } + else { + result = [option, '']; + } + doWarning(result); + } + // C:\foo or C:/foo + else if ((match1 = option.match(/^([a-zA-Z]:[/\\])(.*)$/)) !== null) { + // C:\foo:bar or C:/foo:bar + if ((match2 = match1[2].match(/^([^:]*):(.*)$/)) !== null) { + result = [match1[1] + match2[1], match2[2]]; + } + else { + result = [option, '']; + } + doWarning(result); + } + // foo:bar + else if ((match1 = option.match(/^([^:]*):(.*)$/)) !== null) { + result = [match1[1], match1[2]]; + if (option.split(':').length > 2) { + doWarning(result); + } + } + // foo + else { + result = [option, '']; + } + return result; +} +//# sourceMappingURL=split_format_descriptor.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.js.map b/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.js.map new file mode 100644 index 00000000..f41fc7e3 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/split_format_descriptor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"split_format_descriptor.js","sourceRoot":"","sources":["../../src/configuration/split_format_descriptor.ts"],"names":[],"mappings":";;AAEA,sDA6EC;AA7ED,SAAgB,qBAAqB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EAAE,CAAC,CAAA;QACvB,CAAC;QACD,SAAS,CAAC,MAAM,CAAC,CAAA;IACnB,CAAC;IACD,UAAU;SACL,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC5D,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAC/B,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,SAAS,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IACD,MAAM;SACD,CAAC;QACJ,MAAM,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACvB,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { ILogger } from '../environment'\n\nexport function splitFormatDescriptor(\n logger: ILogger,\n option: string\n): string[] {\n const doWarning = (result: string[]) => {\n let expected = `\"${result[0]}\"`\n if (result[1]) {\n expected += `:\"${result[1]}\"`\n }\n logger.warn(\n `Each part of a user-specified format should be quoted; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md#ambiguous-colons-in-formats\nChange to ${expected}`\n )\n }\n let result: string[]\n let match1, match2\n\n // \"foo\":\"bar\" or \"foo\":bar\n if ((match1 = option.match(/^\"([^\"]*)\":(.*)$/)) !== null) {\n // \"foo\":\"bar\"\n if ((match2 = match1[2].match(/^\"([^\"]*)\"$/)) !== null) {\n result = [match1[1], match2[1]]\n }\n // \"foo\":bar\n else {\n result = [match1[1], match1[2]]\n if (result[1].includes(':')) {\n doWarning(result)\n }\n }\n }\n // foo:\"bar\"\n else if ((match1 = option.match(/^(.*):\"([^\"]*)\"$/)) !== null) {\n result = [match1[1], match1[2]]\n if (result[0].includes(':')) {\n doWarning(result)\n }\n }\n // \"foo\"\n else if ((match1 = option.match(/^\"([^\"]*)\"$/)) !== null) {\n result = [match1[1], '']\n }\n // file://foo or file:///foo or file://C:/foo or file://C:\\foo or file:///C:/foo or file:///C:\\foo\n else if (\n (match1 = option.match(/^(file:\\/{2,3}(?:[a-zA-Z]:[/\\\\])?)(.*)$/)) !== null\n ) {\n // file://foo:bar\n if ((match2 = match1[2].match(/^([^:]*):(.*)$/)) !== null) {\n result = [match1[1] + match2[1], match2[2]]\n } else {\n result = [option, '']\n }\n doWarning(result)\n }\n // C:\\foo or C:/foo\n else if ((match1 = option.match(/^([a-zA-Z]:[/\\\\])(.*)$/)) !== null) {\n // C:\\foo:bar or C:/foo:bar\n if ((match2 = match1[2].match(/^([^:]*):(.*)$/)) !== null) {\n result = [match1[1] + match2[1], match2[2]]\n } else {\n result = [option, '']\n }\n doWarning(result)\n }\n // foo:bar\n else if ((match1 = option.match(/^([^:]*):(.*)$/)) !== null) {\n result = [match1[1], match1[2]]\n if (option.split(':').length > 2) {\n doWarning(result)\n }\n }\n // foo\n else {\n result = [option, '']\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/types.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/types.d.ts new file mode 100644 index 00000000..08848007 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/types.d.ts @@ -0,0 +1,177 @@ +import { JsonObject } from 'type-fest'; +import { IPickleOrder } from '../filter'; +/** + * User-defined configuration + * + * @public + */ +export interface IConfiguration { + /** + * Paths to where your feature files are + * @default [] + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-features} + */ + paths: string[]; + /** + * Show the full backtrace for errors + * @default false + */ + backtrace: boolean; + /** + * Perform a dry run, where a test run is prepared but nothing is executed + * @default false + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/dry_run.md} + */ + dryRun: boolean; + /** + * Explicitly call `process.exit()` after the test run + * @default false + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md#exiting} + * @remarks + * This option is only used by the CLI. + */ + forceExit: boolean; + /** + * Stop running tests when a test fails + * @default false + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/fail_fast.md} + */ + failFast: boolean; + /** + * Name/path and (optionally) output file path of each formatter to use + * + * @example + * [ + * "\@cucumber/pretty-formatter", + * ["html", "./reports/cucumber.html"], + * ["./custom-formatter.js", "./reports/custom.txt"] + * ] + * @default [] + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md} + * @remarks + * Each item has one or two values. The first (required) identifies the + * formatter to be used. The second (optional) specifies where the output + * should be written. + */ + format: Array; + /** + * Options to be provided to formatters + * @default \{\} + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md#options} + * @remarks + * The value must be a JSON-serializable object. + */ + formatOptions: JsonObject; + /** + * Name/path of each plugin to use + * + * @example + * [ + * "\@cucumber/my-plugin", + * "./custom-plugin.js" + * ] + * @default [] + * @remarks + * Each item is a module specifier for a plugin to be loaded. + */ + plugin: string[]; + /** + * Options to be provided to plugins + * @default \{\} + * @remarks + * The value must be a JSON-serializable object. + */ + pluginOptions: JsonObject; + /** + * Paths to where your support code is + * @default [] + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code} + */ + import: string[]; + /** + * Default language for your feature files + * @default "en" + */ + language: string; + /** + * Module specifier(s) for loaders to be registered ahead of loading support code + * @default [] + */ + loader: string[]; + /** + * Regular expressions of which scenario names should match one of to be run + * @default [] + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#names} + */ + name: string[]; + /** + * Run in the order defined, or in a random order + * @default "defined" + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#order} + */ + order: IPickleOrder; + /** + * Run tests in parallel with the given number of worker processes + * @default 0 + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/parallel.md} + */ + parallel: number; + /** + * Shard tests and execute only the selected shard, format `/` + * @default "" + */ + shard: string; + /** + * Publish a report of your test run to https://reports.cucumber.io/ + * @default false + */ + publish: boolean; + /** + * Paths to where your support code is, for CommonJS + * @default [] + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code} + */ + require: string[]; + /** + * Names of transpilation modules to load, via `require()` + * @default [] + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/transpiling.md} + */ + requireModule: string[]; + /** + * Retry failing tests up to the given number of times + * @default 0 + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md} + */ + retry: number; + /** + * Tag expression to filter which scenarios can be retried + * @default "" + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md} + */ + retryTagFilter: string; + /** + * Fail the test run if there are pending steps + * @default true + */ + strict: boolean; + /** + * Tag expression to filter which scenarios should be run + * @default "" + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#tags} + */ + tags: string; + /** + * Parameters to be passed to your World + * @default \{\} + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/world.md} + * @remarks + * The value must be a JSON-serializable object. + */ + worldParameters: JsonObject; +} +/** + * Collection of named configuration profiles + * @public + */ +export type IProfiles = Record>; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/types.js b/node_modules/@cucumber/cucumber/lib/configuration/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/types.js.map b/node_modules/@cucumber/cucumber/lib/configuration/types.js.map new file mode 100644 index 00000000..97564fb1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/configuration/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonObject } from 'type-fest'\nimport { IPickleOrder } from '../filter'\n\n/**\n * User-defined configuration\n *\n * @public\n */\nexport interface IConfiguration {\n /**\n * Paths to where your feature files are\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-features}\n */\n paths: string[]\n /**\n * Show the full backtrace for errors\n * @default false\n */\n backtrace: boolean\n /**\n * Perform a dry run, where a test run is prepared but nothing is executed\n * @default false\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/dry_run.md}\n */\n dryRun: boolean\n /**\n * Explicitly call `process.exit()` after the test run\n * @default false\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/cli.md#exiting}\n * @remarks\n * This option is only used by the CLI.\n */\n forceExit: boolean\n /**\n * Stop running tests when a test fails\n * @default false\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/fail_fast.md}\n */\n failFast: boolean\n /**\n * Name/path and (optionally) output file path of each formatter to use\n *\n * @example\n * [\n * \"\\@cucumber/pretty-formatter\",\n * [\"html\", \"./reports/cucumber.html\"],\n * [\"./custom-formatter.js\", \"./reports/custom.txt\"]\n * ]\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md}\n * @remarks\n * Each item has one or two values. The first (required) identifies the\n * formatter to be used. The second (optional) specifies where the output\n * should be written.\n */\n format: Array\n /**\n * Options to be provided to formatters\n * @default \\{\\}\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md#options}\n * @remarks\n * The value must be a JSON-serializable object.\n */\n formatOptions: JsonObject\n /**\n * Name/path of each plugin to use\n *\n * @example\n * [\n * \"\\@cucumber/my-plugin\",\n * \"./custom-plugin.js\"\n * ]\n * @default []\n * @remarks\n * Each item is a module specifier for a plugin to be loaded.\n */\n plugin: string[]\n /**\n * Options to be provided to plugins\n * @default \\{\\}\n * @remarks\n * The value must be a JSON-serializable object.\n */\n pluginOptions: JsonObject\n /**\n * Paths to where your support code is\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code}\n */\n import: string[]\n /**\n * Default language for your feature files\n * @default \"en\"\n */\n language: string\n /**\n * Module specifier(s) for loaders to be registered ahead of loading support code\n * @default []\n */\n loader: string[]\n /**\n * Regular expressions of which scenario names should match one of to be run\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#names}\n */\n name: string[]\n /**\n * Run in the order defined, or in a random order\n * @default \"defined\"\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#order}\n */\n order: IPickleOrder\n /**\n * Run tests in parallel with the given number of worker processes\n * @default 0\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/parallel.md}\n */\n parallel: number\n /**\n * Shard tests and execute only the selected shard, format `/`\n * @default \"\"\n */\n shard: string\n /**\n * Publish a report of your test run to https://reports.cucumber.io/\n * @default false\n */\n publish: boolean\n /**\n * Paths to where your support code is, for CommonJS\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code}\n */\n require: string[]\n /**\n * Names of transpilation modules to load, via `require()`\n * @default []\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/transpiling.md}\n */\n requireModule: string[]\n /**\n * Retry failing tests up to the given number of times\n * @default 0\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md}\n */\n retry: number\n /**\n * Tag expression to filter which scenarios can be retried\n * @default \"\"\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/retry.md}\n */\n retryTagFilter: string\n /**\n * Fail the test run if there are pending steps\n * @default true\n */\n strict: boolean\n /**\n * Tag expression to filter which scenarios should be run\n * @default \"\"\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/filtering.md#tags}\n */\n tags: string\n /**\n * Parameters to be passed to your World\n * @default \\{\\}\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/world.md}\n * @remarks\n * The value must be a JSON-serializable object.\n */\n worldParameters: JsonObject\n}\n\n/**\n * Collection of named configuration profiles\n * @public\n */\nexport type IProfiles = Record>\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.d.ts b/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.d.ts new file mode 100644 index 00000000..c3bbb7ca --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.d.ts @@ -0,0 +1,3 @@ +import { ILogger } from '../environment'; +import { IConfiguration } from './types'; +export declare function validateConfiguration(configuration: IConfiguration, logger: ILogger): void; diff --git a/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.js b/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.js new file mode 100644 index 00000000..29554ce7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateConfiguration = validateConfiguration; +function validateConfiguration(configuration, logger) { + if (configuration.requireModule.length && !configuration.require.length) { + logger.warn('Use of `require-module` option normally means you should specify your support code paths with `require`; see https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code'); + } + if (configuration.loader.length && !configuration.import.length) { + logger.warn('Use of `loader` option normally means you should specify your support code paths with `import`; see https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code'); + } + if (configuration.formatOptions.colorsEnabled !== undefined) { + logger.warn(`The 'colorsEnabled' format option is deprecated and will be removed in a future major version. ` + + `Use the FORCE_COLOR environment variable instead (FORCE_COLOR=1 to enable, FORCE_COLOR=0 to disable); ` + + `see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md`); + } + if (configuration.retryTagFilter && !configuration.retry) { + throw new Error('a positive `retry` count must be specified when setting `retryTagFilter`'); + } + if (configuration.shard && !/^\d+\/\d+$/.test(configuration.shard)) { + throw new Error('the shard option must be in the format / (e.g. 1/3)'); + } +} +//# sourceMappingURL=validate_configuration.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.js.map b/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.js.map new file mode 100644 index 00000000..c5800afc --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/configuration/validate_configuration.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate_configuration.js","sourceRoot":"","sources":["../../src/configuration/validate_configuration.ts"],"names":[],"mappings":";;AAGA,sDA+BC;AA/BD,SAAgB,qBAAqB,CACnC,aAA6B,EAC7B,MAAe;IAEf,IAAI,aAAa,CAAC,aAAa,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACxE,MAAM,CAAC,IAAI,CACT,wMAAwM,CACzM,CAAA;IACH,CAAC;IACD,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAChE,MAAM,CAAC,IAAI,CACT,+LAA+L,CAChM,CAAA;IACH,CAAC;IACD,IAAI,aAAa,CAAC,aAAa,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAC5D,MAAM,CAAC,IAAI,CACT,iGAAiG;YAC/F,wGAAwG;YACxG,4EAA4E,CAC/E,CAAA;IACH,CAAC;IACD,IAAI,aAAa,CAAC,cAAc,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CACb,0EAA0E,CAC3E,CAAA;IACH,CAAC;IACD,IAAI,aAAa,CAAC,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAA;IACH,CAAC;AACH,CAAC","sourcesContent":["import { ILogger } from '../environment'\nimport { IConfiguration } from './types'\n\nexport function validateConfiguration(\n configuration: IConfiguration,\n logger: ILogger\n): void {\n if (configuration.requireModule.length && !configuration.require.length) {\n logger.warn(\n 'Use of `require-module` option normally means you should specify your support code paths with `require`; see https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code'\n )\n }\n if (configuration.loader.length && !configuration.import.length) {\n logger.warn(\n 'Use of `loader` option normally means you should specify your support code paths with `import`; see https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md#finding-your-code'\n )\n }\n if (configuration.formatOptions.colorsEnabled !== undefined) {\n logger.warn(\n `The 'colorsEnabled' format option is deprecated and will be removed in a future major version. ` +\n `Use the FORCE_COLOR environment variable instead (FORCE_COLOR=1 to enable, FORCE_COLOR=0 to disable); ` +\n `see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md`\n )\n }\n if (configuration.retryTagFilter && !configuration.retry) {\n throw new Error(\n 'a positive `retry` count must be specified when setting `retryTagFilter`'\n )\n }\n if (configuration.shard && !/^\\d+\\/\\d+$/.test(configuration.shard)) {\n throw new Error(\n 'the shard option must be in the format / (e.g. 1/3)'\n )\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/environment/console_logger.d.ts b/node_modules/@cucumber/cucumber/lib/environment/console_logger.d.ts new file mode 100644 index 00000000..203f7606 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/console_logger.d.ts @@ -0,0 +1,12 @@ +import { Writable } from 'node:stream'; +import { ILogger } from './types'; +export declare class ConsoleLogger implements ILogger { + private stream; + private debugEnabled; + private readonly console; + constructor(stream: Writable, debugEnabled: boolean); + debug(message?: any, ...optionalParams: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; + info(message?: any, ...optionalParams: any[]): void; +} diff --git a/node_modules/@cucumber/cucumber/lib/environment/console_logger.js b/node_modules/@cucumber/cucumber/lib/environment/console_logger.js new file mode 100644 index 00000000..77ba893a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/console_logger.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConsoleLogger = void 0; +const node_console_1 = require("node:console"); +class ConsoleLogger { + stream; + debugEnabled; + console; + constructor(stream, debugEnabled) { + this.stream = stream; + this.debugEnabled = debugEnabled; + this.console = new node_console_1.Console(this.stream); + } + debug(message, ...optionalParams) { + if (this.debugEnabled) { + this.console.debug(message, ...optionalParams); + } + } + error(message, ...optionalParams) { + this.console.error(message, ...optionalParams); + } + warn(message, ...optionalParams) { + this.console.warn(message, ...optionalParams); + } + info(message, ...optionalParams) { + this.console.info(message, ...optionalParams); + } +} +exports.ConsoleLogger = ConsoleLogger; +//# sourceMappingURL=console_logger.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/environment/console_logger.js.map b/node_modules/@cucumber/cucumber/lib/environment/console_logger.js.map new file mode 100644 index 00000000..3f4f6234 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/console_logger.js.map @@ -0,0 +1 @@ +{"version":3,"file":"console_logger.js","sourceRoot":"","sources":["../../src/environment/console_logger.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AAItC,MAAa,aAAa;IAId;IACA;IAJO,OAAO,CAAS;IAEjC,YACU,MAAgB,EAChB,YAAqB;QADrB,WAAM,GAAN,MAAM,CAAU;QAChB,iBAAY,GAAZ,YAAY,CAAS;QAE7B,IAAI,CAAC,OAAO,GAAG,IAAI,sBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,OAAa,EAAE,GAAG,cAAqB;QAC3C,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAa,EAAE,GAAG,cAAqB;QAC3C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAA;IAChD,CAAC;IAED,IAAI,CAAC,OAAa,EAAE,GAAG,cAAqB;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,CAAC,OAAa,EAAE,GAAG,cAAqB;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAA;IAC/C,CAAC;CACF;AA3BD,sCA2BC","sourcesContent":["import { Console } from 'node:console'\nimport { Writable } from 'node:stream'\nimport { ILogger } from './types'\n\nexport class ConsoleLogger implements ILogger {\n private readonly console: Console\n\n constructor(\n private stream: Writable,\n private debugEnabled: boolean\n ) {\n this.console = new Console(this.stream)\n }\n\n debug(message?: any, ...optionalParams: any[]): void {\n if (this.debugEnabled) {\n this.console.debug(message, ...optionalParams)\n }\n }\n\n error(message?: any, ...optionalParams: any[]): void {\n this.console.error(message, ...optionalParams)\n }\n\n warn(message?: any, ...optionalParams: any[]): void {\n this.console.warn(message, ...optionalParams)\n }\n\n info(message?: any, ...optionalParams: any[]): void {\n this.console.info(message, ...optionalParams)\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/environment/index.d.ts b/node_modules/@cucumber/cucumber/lib/environment/index.d.ts new file mode 100644 index 00000000..006f4d96 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/index.d.ts @@ -0,0 +1,2 @@ +export * from './make_environment'; +export * from './types'; diff --git a/node_modules/@cucumber/cucumber/lib/environment/index.js b/node_modules/@cucumber/cucumber/lib/environment/index.js new file mode 100644 index 00000000..fda5966c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./make_environment"), exports); +__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/environment/index.js.map b/node_modules/@cucumber/cucumber/lib/environment/index.js.map new file mode 100644 index 00000000..e2fc65c2 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/environment/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,0CAAuB","sourcesContent":["export * from './make_environment'\nexport * from './types'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/environment/make_environment.d.ts b/node_modules/@cucumber/cucumber/lib/environment/make_environment.d.ts new file mode 100644 index 00000000..570db890 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/make_environment.d.ts @@ -0,0 +1,2 @@ +import { UsableEnvironment, IRunEnvironment } from './types'; +export declare function makeEnvironment(provided: IRunEnvironment): UsableEnvironment; diff --git a/node_modules/@cucumber/cucumber/lib/environment/make_environment.js b/node_modules/@cucumber/cucumber/lib/environment/make_environment.js new file mode 100644 index 00000000..9e0027dd --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/make_environment.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeEnvironment = makeEnvironment; +const console_logger_1 = require("./console_logger"); +function makeEnvironment(provided) { + const fullEnvironment = Object.assign({}, { + cwd: process.cwd(), + stdout: process.stdout, + stderr: process.stderr, + env: process.env, + debug: false, + }, provided); + const logger = new console_logger_1.ConsoleLogger(fullEnvironment.stderr, fullEnvironment.debug); + logger.debug('Resolved environment:', fullEnvironment); + return { + ...fullEnvironment, + logger: logger, + }; +} +//# sourceMappingURL=make_environment.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/environment/make_environment.js.map b/node_modules/@cucumber/cucumber/lib/environment/make_environment.js.map new file mode 100644 index 00000000..1ea42353 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/make_environment.js.map @@ -0,0 +1 @@ +{"version":3,"file":"make_environment.js","sourceRoot":"","sources":["../../src/environment/make_environment.ts"],"names":[],"mappings":";;AAGA,0CAqBC;AAxBD,qDAAgD;AAGhD,SAAgB,eAAe,CAAC,QAAyB;IACvD,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CACnC,EAAE,EACF;QACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,KAAK;KACb,EACD,QAAQ,CACT,CAAA;IACD,MAAM,MAAM,GAAG,IAAI,8BAAa,CAC9B,eAAe,CAAC,MAAM,EACtB,eAAe,CAAC,KAAK,CACtB,CAAA;IACD,MAAM,CAAC,KAAK,CAAC,uBAAuB,EAAE,eAAe,CAAC,CAAA;IACtD,OAAO;QACL,GAAG,eAAe;QAClB,MAAM,EAAE,MAAM;KACf,CAAA;AACH,CAAC","sourcesContent":["import { ConsoleLogger } from './console_logger'\nimport { UsableEnvironment, IRunEnvironment } from './types'\n\nexport function makeEnvironment(provided: IRunEnvironment): UsableEnvironment {\n const fullEnvironment = Object.assign(\n {},\n {\n cwd: process.cwd(),\n stdout: process.stdout,\n stderr: process.stderr,\n env: process.env,\n debug: false,\n },\n provided\n )\n const logger = new ConsoleLogger(\n fullEnvironment.stderr,\n fullEnvironment.debug\n )\n logger.debug('Resolved environment:', fullEnvironment)\n return {\n ...fullEnvironment,\n logger: logger,\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/environment/types.d.ts b/node_modules/@cucumber/cucumber/lib/environment/types.d.ts new file mode 100644 index 00000000..677d2395 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/types.d.ts @@ -0,0 +1,48 @@ +import { Writable } from 'node:stream'; +/** + * A logger that can be used to direct messages to stderr or similar + * @public + * @remarks + * Matches the interface of Node.js Console, for the methods it has. + */ +export interface ILogger { + debug: (message?: any, ...optionalParams: any[]) => void; + error: (message?: any, ...optionalParams: any[]) => void; + warn: (message?: any, ...optionalParams: any[]) => void; + info: (message?: any, ...optionalParams: any[]) => void; +} +/** + * Contextual data about the project environment + * @public + */ +export interface IRunEnvironment { + /** + * Working directory for the project + * @default process.cwd() + */ + cwd?: string; + /** + * Writable stream where the test run's main formatter output is written + * @default process.stdout + */ + stdout?: Writable; + /** + * Writable stream where the test run's warning/error output is written + * @default process.stderr + */ + stderr?: Writable; + /** + * Environment variables + * @default process.env + */ + env?: Record; + /** + * Whether debug logging should be emitted to {@link IRunEnvironment.stderr} + * @default false + * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/debugging.md} + */ + debug?: boolean; +} +export type UsableEnvironment = Required & { + logger: ILogger; +}; diff --git a/node_modules/@cucumber/cucumber/lib/environment/types.js b/node_modules/@cucumber/cucumber/lib/environment/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/environment/types.js.map b/node_modules/@cucumber/cucumber/lib/environment/types.js.map new file mode 100644 index 00000000..90ca980e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/environment/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/environment/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Writable } from 'node:stream'\n\n/**\n * A logger that can be used to direct messages to stderr or similar\n * @public\n * @remarks\n * Matches the interface of Node.js Console, for the methods it has.\n */\nexport interface ILogger {\n debug: (message?: any, ...optionalParams: any[]) => void\n error: (message?: any, ...optionalParams: any[]) => void\n warn: (message?: any, ...optionalParams: any[]) => void\n info: (message?: any, ...optionalParams: any[]) => void\n}\n\n/**\n * Contextual data about the project environment\n * @public\n */\nexport interface IRunEnvironment {\n /**\n * Working directory for the project\n * @default process.cwd()\n */\n cwd?: string\n /**\n * Writable stream where the test run's main formatter output is written\n * @default process.stdout\n */\n stdout?: Writable\n /**\n * Writable stream where the test run's warning/error output is written\n * @default process.stderr\n */\n stderr?: Writable\n /**\n * Environment variables\n * @default process.env\n */\n env?: Record\n /**\n * Whether debug logging should be emitted to {@link IRunEnvironment.stderr}\n * @default false\n * @see {@link https://github.com/cucumber/cucumber-js/blob/main/docs/debugging.md}\n */\n debug?: boolean\n}\n\nexport type UsableEnvironment = Required & {\n logger: ILogger\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.d.ts b/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.d.ts new file mode 100644 index 00000000..c52063a1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.d.ts @@ -0,0 +1,2 @@ +import { InternalPlugin } from '../plugin'; +export declare const filterPlugin: InternalPlugin; diff --git a/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.js b/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.js new file mode 100644 index 00000000..82f59ccd --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.js @@ -0,0 +1,32 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.filterPlugin = void 0; +const pickle_filter_1 = __importDefault(require("../pickle_filter")); +const order_pickles_1 = require("./order_pickles"); +exports.filterPlugin = { + type: 'plugin', + coordinator: async ({ on, transform, options, logger, environment }) => { + let unexpandedSourcePaths = []; + on('paths:resolve', (paths) => { + unexpandedSourcePaths = paths.unexpandedSourcePaths; + }); + transform('pickles:filter', async (allPickles) => { + const pickleFilter = new pickle_filter_1.default({ + cwd: environment.cwd, + featurePaths: unexpandedSourcePaths, + names: options.names, + tagExpression: options.tagExpression, + }); + return allPickles.filter((pickle) => pickleFilter.matches(pickle)); + }); + transform('pickles:order', async (unorderedPickles) => { + const orderedPickles = [...unorderedPickles]; + (0, order_pickles_1.orderPickles)(orderedPickles, options.order, logger); + return orderedPickles; + }); + }, +}; +//# sourceMappingURL=filter_plugin.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.js.map b/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.js.map new file mode 100644 index 00000000..bd27cbfe --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/filter_plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"filter_plugin.js","sourceRoot":"","sources":["../../src/filter/filter_plugin.ts"],"names":[],"mappings":";;;;;;AACA,qEAA2C;AAC3C,mDAA8C;AAEjC,QAAA,YAAY,GAAmB;IAC1C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE;QACrE,IAAI,qBAAqB,GAAa,EAAE,CAAA;QACxC,EAAE,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;YAC5B,qBAAqB,GAAG,KAAK,CAAC,qBAAqB,CAAA;QACrD,CAAC,CAAC,CAAA;QAEF,SAAS,CAAC,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;YAC/C,MAAM,YAAY,GAAG,IAAI,uBAAY,CAAC;gBACpC,GAAG,EAAE,WAAW,CAAC,GAAG;gBACpB,YAAY,EAAE,qBAAqB;gBACnC,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,aAAa,EAAE,OAAO,CAAC,aAAa;aACrC,CAAC,CAAA;YAEF,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;QACpE,CAAC,CAAC,CAAA;QAEF,SAAS,CAAC,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE;YACpD,MAAM,cAAc,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAA;YAC5C,IAAA,4BAAY,EAAC,cAAc,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;YACnD,OAAO,cAAc,CAAA;QACvB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { InternalPlugin } from '../plugin'\nimport PickleFilter from '../pickle_filter'\nimport { orderPickles } from './order_pickles'\n\nexport const filterPlugin: InternalPlugin = {\n type: 'plugin',\n coordinator: async ({ on, transform, options, logger, environment }) => {\n let unexpandedSourcePaths: string[] = []\n on('paths:resolve', (paths) => {\n unexpandedSourcePaths = paths.unexpandedSourcePaths\n })\n\n transform('pickles:filter', async (allPickles) => {\n const pickleFilter = new PickleFilter({\n cwd: environment.cwd,\n featurePaths: unexpandedSourcePaths,\n names: options.names,\n tagExpression: options.tagExpression,\n })\n\n return allPickles.filter((pickle) => pickleFilter.matches(pickle))\n })\n\n transform('pickles:order', async (unorderedPickles) => {\n const orderedPickles = [...unorderedPickles]\n orderPickles(orderedPickles, options.order, logger)\n return orderedPickles\n })\n },\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter/index.d.ts b/node_modules/@cucumber/cucumber/lib/filter/index.d.ts new file mode 100644 index 00000000..e67b8ea0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/index.d.ts @@ -0,0 +1,4 @@ +import { filterPlugin } from './filter_plugin'; +export * from './types'; +export { orderPickles } from './order_pickles'; +export default filterPlugin; diff --git a/node_modules/@cucumber/cucumber/lib/filter/index.js b/node_modules/@cucumber/cucumber/lib/filter/index.js new file mode 100644 index 00000000..e279d019 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/index.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.orderPickles = void 0; +const filter_plugin_1 = require("./filter_plugin"); +__exportStar(require("./types"), exports); +var order_pickles_1 = require("./order_pickles"); +Object.defineProperty(exports, "orderPickles", { enumerable: true, get: function () { return order_pickles_1.orderPickles; } }); +exports.default = filter_plugin_1.filterPlugin; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter/index.js.map b/node_modules/@cucumber/cucumber/lib/filter/index.js.map new file mode 100644 index 00000000..17db04fd --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/filter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAA8C;AAC9C,0CAAuB;AACvB,iDAA8C;AAArC,6GAAA,YAAY,OAAA;AAErB,kBAAe,4BAAY,CAAA","sourcesContent":["import { filterPlugin } from './filter_plugin'\nexport * from './types'\nexport { orderPickles } from './order_pickles'\n\nexport default filterPlugin\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter/order_pickles.d.ts b/node_modules/@cucumber/cucumber/lib/filter/order_pickles.d.ts new file mode 100644 index 00000000..83b29b58 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/order_pickles.d.ts @@ -0,0 +1,3 @@ +import { ILogger } from '../environment'; +import { IPickleOrder } from './types'; +export declare function orderPickles(pickleIds: T[], order: IPickleOrder, logger: ILogger): void; diff --git a/node_modules/@cucumber/cucumber/lib/filter/order_pickles.js b/node_modules/@cucumber/cucumber/lib/filter/order_pickles.js new file mode 100644 index 00000000..f33c7186 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/order_pickles.js @@ -0,0 +1,37 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.orderPickles = orderPickles; +const knuth_shuffle_seeded_1 = __importDefault(require("knuth-shuffle-seeded")); +// Orders the pickleIds in place - morphs input +function orderPickles(pickleIds, order, logger) { + const [type, seed] = splitOrder(order); + switch (type) { + case 'defined': + break; + case 'reverse': + pickleIds.reverse(); + break; + case 'random': + if (seed === '') { + const newSeed = Math.floor(Math.random() * 1000 * 1000).toString(); + logger.warn(`Random order using seed: ${newSeed}`); + (0, knuth_shuffle_seeded_1.default)(pickleIds, newSeed); + } + else { + (0, knuth_shuffle_seeded_1.default)(pickleIds, seed); + } + break; + default: + throw new Error('Unrecognized order type. Should be `defined` or `random`'); + } +} +function splitOrder(order) { + if (!order.includes(':')) { + return [order, '']; + } + return order.split(':'); +} +//# sourceMappingURL=order_pickles.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter/order_pickles.js.map b/node_modules/@cucumber/cucumber/lib/filter/order_pickles.js.map new file mode 100644 index 00000000..e3f36d72 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/order_pickles.js.map @@ -0,0 +1 @@ +{"version":3,"file":"order_pickles.js","sourceRoot":"","sources":["../../src/filter/order_pickles.ts"],"names":[],"mappings":";;;;;AAKA,oCA0BC;AA/BD,gFAA0C;AAI1C,+CAA+C;AAC/C,SAAgB,YAAY,CAC1B,SAAc,EACd,KAAmB,EACnB,MAAe;IAEf,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACtC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS;YACZ,MAAK;QACP,KAAK,SAAS;YACZ,SAAS,CAAC,OAAO,EAAE,CAAA;YACnB,MAAK;QACP,KAAK,QAAQ;YACX,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;gBAChB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAA;gBAClE,MAAM,CAAC,IAAI,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAA;gBAClD,IAAA,8BAAO,EAAC,SAAS,EAAE,OAAO,CAAC,CAAA;YAC7B,CAAC;iBAAM,CAAC;gBACN,IAAA,8BAAO,EAAC,SAAS,EAAE,IAAI,CAAC,CAAA;YAC1B,CAAC;YACD,MAAK;QACP;YACE,MAAM,IAAI,KAAK,CACb,0DAA0D,CAC3D,CAAA;IACL,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACpB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import shuffle from 'knuth-shuffle-seeded'\nimport { ILogger } from '../environment'\nimport { IPickleOrder } from './types'\n\n// Orders the pickleIds in place - morphs input\nexport function orderPickles(\n pickleIds: T[],\n order: IPickleOrder,\n logger: ILogger\n): void {\n const [type, seed] = splitOrder(order)\n switch (type) {\n case 'defined':\n break\n case 'reverse':\n pickleIds.reverse()\n break\n case 'random':\n if (seed === '') {\n const newSeed = Math.floor(Math.random() * 1000 * 1000).toString()\n logger.warn(`Random order using seed: ${newSeed}`)\n shuffle(pickleIds, newSeed)\n } else {\n shuffle(pickleIds, seed)\n }\n break\n default:\n throw new Error(\n 'Unrecognized order type. Should be `defined` or `random`'\n )\n }\n}\n\nfunction splitOrder(order: string) {\n if (!order.includes(':')) {\n return [order, '']\n }\n return order.split(':')\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter/types.d.ts b/node_modules/@cucumber/cucumber/lib/filter/types.d.ts new file mode 100644 index 00000000..11b54b0e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/types.d.ts @@ -0,0 +1,19 @@ +import { GherkinDocument, Location, Pickle } from '@cucumber/messages'; +/** + * The ordering strategy for pickles + * @public + * @example "defined" + * @example "reverse" + * @example "random" + * @example "random:234119" + */ +export type IPickleOrder = 'defined' | 'reverse' | 'random' | `random:${string}`; +/** + * A Pickle decorated with relevant context that can be filtered or sorted + * @public + */ +export interface IFilterablePickle { + pickle: Pickle; + gherkinDocument: GherkinDocument; + location: Location; +} diff --git a/node_modules/@cucumber/cucumber/lib/filter/types.js b/node_modules/@cucumber/cucumber/lib/filter/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter/types.js.map b/node_modules/@cucumber/cucumber/lib/filter/types.js.map new file mode 100644 index 00000000..d0bb9046 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/filter/types.ts"],"names":[],"mappings":"","sourcesContent":["import { GherkinDocument, Location, Pickle } from '@cucumber/messages'\n\n/**\n * The ordering strategy for pickles\n * @public\n * @example \"defined\"\n * @example \"reverse\"\n * @example \"random\"\n * @example \"random:234119\"\n */\nexport type IPickleOrder = 'defined' | 'reverse' | 'random' | `random:${string}`\n\n/**\n * A Pickle decorated with relevant context that can be filtered or sorted\n * @public\n */\nexport interface IFilterablePickle {\n pickle: Pickle\n gherkinDocument: GherkinDocument\n location: Location\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter_stack_trace.d.ts b/node_modules/@cucumber/cucumber/lib/filter_stack_trace.d.ts new file mode 100644 index 00000000..b1cb2037 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter_stack_trace.d.ts @@ -0,0 +1,3 @@ +import { StackFrame } from 'error-stack-parser'; +export declare function isFileNameInCucumber(fileName: string): boolean; +export declare function filterStackTrace(frames: StackFrame[]): StackFrame[]; diff --git a/node_modules/@cucumber/cucumber/lib/filter_stack_trace.js b/node_modules/@cucumber/cucumber/lib/filter_stack_trace.js new file mode 100644 index 00000000..4c102c09 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter_stack_trace.js @@ -0,0 +1,37 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isFileNameInCucumber = isFileNameInCucumber; +exports.filterStackTrace = filterStackTrace; +const node_path_1 = __importDefault(require("node:path")); +const value_checker_1 = require("./value_checker"); +const projectRootPath = node_path_1.default.join(__dirname, '..'); +const projectChildDirs = ['src', 'lib', 'node_modules']; +function isFileNameInCucumber(fileName) { + return projectChildDirs.some((dir) => fileName.startsWith(node_path_1.default.join(projectRootPath, dir))); +} +function filterStackTrace(frames) { + if (isErrorInCucumber(frames)) { + return frames; + } + const index = frames.findIndex((x) => isFrameInCucumber(x)); + if (index === -1) { + return frames; + } + return frames.slice(0, index); +} +function isErrorInCucumber(frames) { + const filteredFrames = frames.filter((x) => !isFrameInNode(x)); + return filteredFrames.length > 0 && isFrameInCucumber(filteredFrames[0]); +} +function isFrameInCucumber(frame) { + const fileName = (0, value_checker_1.valueOrDefault)(frame.getFileName(), ''); + return isFileNameInCucumber(fileName); +} +function isFrameInNode(frame) { + const fileName = (0, value_checker_1.valueOrDefault)(frame.getFileName(), ''); + return !fileName.includes(node_path_1.default.sep); +} +//# sourceMappingURL=filter_stack_trace.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/filter_stack_trace.js.map b/node_modules/@cucumber/cucumber/lib/filter_stack_trace.js.map new file mode 100644 index 00000000..4472b792 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/filter_stack_trace.js.map @@ -0,0 +1 @@ +{"version":3,"file":"filter_stack_trace.js","sourceRoot":"","sources":["../src/filter_stack_trace.ts"],"names":[],"mappings":";;;;;AAOA,oDAIC;AAED,4CASC;AAtBD,0DAA4B;AAE5B,mDAAgD;AAEhD,MAAM,eAAe,GAAG,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;AAClD,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,CAAA;AAEvD,SAAgB,oBAAoB,CAAC,QAAgB;IACnD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CACnC,QAAQ,CAAC,UAAU,CAAC,mBAAI,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,CACrD,CAAA;AACH,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAAoB;IACnD,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAA;IACf,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3D,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;QACjB,OAAO,MAAM,CAAA;IACf,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAC/B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAoB;IAC7C,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9D,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,iBAAiB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AAC1E,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAiB;IAC1C,MAAM,QAAQ,GAAG,IAAA,8BAAc,EAAC,KAAK,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAA;IACxD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAA;AACvC,CAAC;AAED,SAAS,aAAa,CAAC,KAAiB;IACtC,MAAM,QAAQ,GAAG,IAAA,8BAAc,EAAC,KAAK,CAAC,WAAW,EAAE,EAAE,EAAE,CAAC,CAAA;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,mBAAI,CAAC,GAAG,CAAC,CAAA;AACrC,CAAC","sourcesContent":["import path from 'node:path'\nimport { StackFrame } from 'error-stack-parser'\nimport { valueOrDefault } from './value_checker'\n\nconst projectRootPath = path.join(__dirname, '..')\nconst projectChildDirs = ['src', 'lib', 'node_modules']\n\nexport function isFileNameInCucumber(fileName: string): boolean {\n return projectChildDirs.some((dir) =>\n fileName.startsWith(path.join(projectRootPath, dir))\n )\n}\n\nexport function filterStackTrace(frames: StackFrame[]): StackFrame[] {\n if (isErrorInCucumber(frames)) {\n return frames\n }\n const index = frames.findIndex((x) => isFrameInCucumber(x))\n if (index === -1) {\n return frames\n }\n return frames.slice(0, index)\n}\n\nfunction isErrorInCucumber(frames: StackFrame[]): boolean {\n const filteredFrames = frames.filter((x) => !isFrameInNode(x))\n return filteredFrames.length > 0 && isFrameInCucumber(filteredFrames[0])\n}\n\nfunction isFrameInCucumber(frame: StackFrame): boolean {\n const fileName = valueOrDefault(frame.getFileName(), '')\n return isFileNameInCucumber(fileName)\n}\n\nfunction isFrameInNode(frame: StackFrame): boolean {\n const fileName = valueOrDefault(frame.getFileName(), '')\n return !fileName.includes(path.sep)\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builder.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/builder.d.ts new file mode 100644 index 00000000..be18d271 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builder.d.ts @@ -0,0 +1,33 @@ +import { EventEmitter } from 'node:events'; +import { Writable as WritableStream } from 'node:stream'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +import { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'; +import EventDataCollector from './helpers/event_data_collector'; +import StepDefinitionSnippetBuilder from './step_definition_snippet_builder'; +import Formatter, { FormatOptions, IFormatterCleanupFn, IFormatterLogFn } from '.'; +interface IGetStepDefinitionSnippetBuilderOptions { + cwd: string; + snippetInterface?: SnippetInterface; + snippetSyntax?: string; + supportCodeLibrary: SupportCodeLibrary; +} +export interface IBuildOptions { + env: NodeJS.ProcessEnv; + cwd: string; + eventBroadcaster: EventEmitter; + eventDataCollector: EventDataCollector; + log: IFormatterLogFn; + parsedArgvOptions: FormatOptions; + stream: WritableStream; + cleanup: IFormatterCleanupFn; + supportCodeLibrary: SupportCodeLibrary; +} +declare const FormatterBuilder: { + build(FormatterConstructor: string | typeof Formatter, options: IBuildOptions): Promise; + getConstructorByType(type: string, cwd: string): Promise; + getStepDefinitionSnippetBuilder({ cwd, snippetInterface, snippetSyntax, supportCodeLibrary, }: IGetStepDefinitionSnippetBuilderOptions): Promise; + loadCustomClass(type: "formatter" | "syntax", descriptor: string, cwd: string): Promise; + loadFile(urlOrName: URL | string): Promise; + resolveConstructor(ImportedCode: any): any; +}; +export default FormatterBuilder; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builder.js b/node_modules/@cucumber/cucumber/lib/formatter/builder.js new file mode 100644 index 00000000..aad8dd8c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builder.js @@ -0,0 +1,81 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const value_checker_1 = require("../value_checker"); +const snippet_syntax_1 = require("./step_definition_snippet_builder/snippet_syntax"); +const step_definition_snippet_builder_1 = __importDefault(require("./step_definition_snippet_builder")); +const javascript_snippet_syntax_1 = __importDefault(require("./step_definition_snippet_builder/javascript_snippet_syntax")); +const get_color_fns_1 = __importDefault(require("./get_color_fns")); +const formatters_1 = __importDefault(require("./helpers/formatters")); +const import_code_1 = require("./import_code"); +const FormatterBuilder = { + async build(FormatterConstructor, options) { + if (typeof FormatterConstructor === 'string') { + FormatterConstructor = await FormatterBuilder.getConstructorByType(FormatterConstructor, options.cwd); + } + const colorFns = (0, get_color_fns_1.default)(options.stream, options.env, options.parsedArgvOptions.colorsEnabled); + const snippetBuilder = await FormatterBuilder.getStepDefinitionSnippetBuilder({ + cwd: options.cwd, + snippetInterface: options.parsedArgvOptions.snippetInterface, + snippetSyntax: options.parsedArgvOptions.snippetSyntax, + supportCodeLibrary: options.supportCodeLibrary, + }); + return new FormatterConstructor({ + colorFns, + snippetBuilder, + ...options, + }); + }, + async getConstructorByType(type, cwd) { + const formatters = formatters_1.default.getFormatters(); + return formatters[type] + ? formatters[type] + : await FormatterBuilder.loadCustomClass('formatter', type, cwd); + }, + async getStepDefinitionSnippetBuilder({ cwd, snippetInterface, snippetSyntax, supportCodeLibrary, }) { + if ((0, value_checker_1.doesNotHaveValue)(snippetInterface)) { + snippetInterface = snippet_syntax_1.SnippetInterface.Synchronous; + } + let Syntax = javascript_snippet_syntax_1.default; + if ((0, value_checker_1.doesHaveValue)(snippetSyntax)) { + Syntax = await FormatterBuilder.loadCustomClass('syntax', snippetSyntax, cwd); + } + return new step_definition_snippet_builder_1.default({ + snippetSyntax: new Syntax(snippetInterface), + parameterTypeRegistry: supportCodeLibrary.parameterTypeRegistry, + }); + }, + async loadCustomClass(type, descriptor, cwd) { + const CustomClass = FormatterBuilder.resolveConstructor(await (0, import_code_1.importCode)(descriptor, cwd)); + if ((0, value_checker_1.doesHaveValue)(CustomClass)) { + return CustomClass; + } + else { + throw new Error(`Custom ${type} (${descriptor}) does not export a function/class`); + } + }, + async loadFile(urlOrName) { + return await import(urlOrName.toString()); + }, + resolveConstructor(ImportedCode) { + if ((0, value_checker_1.doesNotHaveValue)(ImportedCode)) { + return null; + } + if (typeof ImportedCode === 'function') { + return ImportedCode; + } + else if (typeof ImportedCode === 'object' && + typeof ImportedCode.default === 'function') { + return ImportedCode.default; + } + else if (typeof ImportedCode.default === 'object' && + typeof ImportedCode.default.default === 'function') { + return ImportedCode.default.default; + } + return null; + }, +}; +exports.default = FormatterBuilder; +//# sourceMappingURL=builder.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builder.js.map b/node_modules/@cucumber/cucumber/lib/formatter/builder.js.map new file mode 100644 index 00000000..4cc2ec60 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/formatter/builder.ts"],"names":[],"mappings":";;;;;AAEA,oDAAkE;AAElE,qFAAmF;AAEnF,wGAA4E;AAC5E,4HAAiG;AACjG,oEAAyC;AACzC,sEAA6C;AAC7C,+CAA0C;AA0B1C,MAAM,gBAAgB,GAAG;IACvB,KAAK,CAAC,KAAK,CACT,oBAA+C,EAC/C,OAAsB;QAEtB,IAAI,OAAO,oBAAoB,KAAK,QAAQ,EAAE,CAAC;YAC7C,oBAAoB,GAAG,MAAM,gBAAgB,CAAC,oBAAoB,CAChE,oB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AgB,CAAA","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { Writable as WritableStream } from 'node:stream'\nimport { doesHaveValue, doesNotHaveValue } from '../value_checker'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'\nimport EventDataCollector from './helpers/event_data_collector'\nimport StepDefinitionSnippetBuilder from './step_definition_snippet_builder'\nimport JavascriptSnippetSyntax from './step_definition_snippet_builder/javascript_snippet_syntax'\nimport getColorFns from './get_color_fns'\nimport Formatters from './helpers/formatters'\nimport { importCode } from './import_code'\nimport Formatter, {\n FormatOptions,\n IFormatterCleanupFn,\n IFormatterLogFn,\n} from '.'\n\ninterface IGetStepDefinitionSnippetBuilderOptions {\n cwd: string\n snippetInterface?: SnippetInterface\n snippetSyntax?: string\n supportCodeLibrary: SupportCodeLibrary\n}\n\nexport interface IBuildOptions {\n env: NodeJS.ProcessEnv\n cwd: string\n eventBroadcaster: EventEmitter\n eventDataCollector: EventDataCollector\n log: IFormatterLogFn\n parsedArgvOptions: FormatOptions\n stream: WritableStream\n cleanup: IFormatterCleanupFn\n supportCodeLibrary: SupportCodeLibrary\n}\n\nconst FormatterBuilder = {\n async build(\n FormatterConstructor: string | typeof Formatter,\n options: IBuildOptions\n ): Promise {\n if (typeof FormatterConstructor === 'string') {\n FormatterConstructor = await FormatterBuilder.getConstructorByType(\n FormatterConstructor,\n options.cwd\n )\n }\n const colorFns = getColorFns(\n options.stream,\n options.env,\n options.parsedArgvOptions.colorsEnabled\n )\n const snippetBuilder =\n await FormatterBuilder.getStepDefinitionSnippetBuilder({\n cwd: options.cwd,\n snippetInterface: options.parsedArgvOptions.snippetInterface,\n snippetSyntax: options.parsedArgvOptions.snippetSyntax,\n supportCodeLibrary: options.supportCodeLibrary,\n })\n return new FormatterConstructor({\n colorFns,\n snippetBuilder,\n ...options,\n })\n },\n\n async getConstructorByType(\n type: string,\n cwd: string\n ): Promise {\n const formatters: Record =\n Formatters.getFormatters()\n\n return formatters[type]\n ? formatters[type]\n : await FormatterBuilder.loadCustomClass('formatter', type, cwd)\n },\n\n async getStepDefinitionSnippetBuilder({\n cwd,\n snippetInterface,\n snippetSyntax,\n supportCodeLibrary,\n }: IGetStepDefinitionSnippetBuilderOptions) {\n if (doesNotHaveValue(snippetInterface)) {\n snippetInterface = SnippetInterface.Synchronous\n }\n let Syntax = JavascriptSnippetSyntax\n if (doesHaveValue(snippetSyntax)) {\n Syntax = await FormatterBuilder.loadCustomClass(\n 'syntax',\n snippetSyntax,\n cwd\n )\n }\n return new StepDefinitionSnippetBuilder({\n snippetSyntax: new Syntax(snippetInterface),\n parameterTypeRegistry: supportCodeLibrary.parameterTypeRegistry,\n })\n },\n\n async loadCustomClass(\n type: 'formatter' | 'syntax',\n descriptor: string,\n cwd: string\n ) {\n const CustomClass = FormatterBuilder.resolveConstructor(\n await importCode(descriptor, cwd)\n )\n if (doesHaveValue(CustomClass)) {\n return CustomClass\n } else {\n throw new Error(\n `Custom ${type} (${descriptor}) does not export a function/class`\n )\n }\n },\n\n async loadFile(urlOrName: URL | string) {\n return await import(urlOrName.toString())\n },\n\n resolveConstructor(ImportedCode: any) {\n if (doesNotHaveValue(ImportedCode)) {\n return null\n }\n if (typeof ImportedCode === 'function') {\n return ImportedCode\n } else if (\n typeof ImportedCode === 'object' &&\n typeof ImportedCode.default === 'function'\n ) {\n return ImportedCode.default\n } else if (\n typeof ImportedCode.default === 'object' &&\n typeof ImportedCode.default.default === 'function'\n ) {\n return ImportedCode.default.default\n }\n return null\n },\n}\n\nexport default FormatterBuilder\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.d.ts new file mode 100644 index 00000000..4875e352 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.d.ts @@ -0,0 +1,9 @@ +interface Options { + externalAttachments?: boolean | ReadonlyArray; +} +declare const _default: { + type: "formatter"; + formatter({ on, options, write, directory }: import("../../plugin").FormatterPluginContext): () => Promise; + optionsKey: string; +}; +export default _default; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.js b/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.js new file mode 100644 index 00000000..a7a98446 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_util_1 = require("node:util"); +const node_stream_1 = require("node:stream"); +const html_formatter_1 = require("@cucumber/html-formatter"); +const message_streams_1 = require("@cucumber/message-streams"); +exports.default = { + type: 'formatter', + formatter({ on, options, write, directory }) { + if (!directory && options.externalAttachments) { + throw new Error('Unable to externalise attachments when formatter is not writing to a file'); + } + const externaliseStream = new message_streams_1.AttachmentExternalisingStream({ + behaviour: options.externalAttachments, + directory, + }); + const htmlStream = new html_formatter_1.CucumberHtmlStream(); + externaliseStream.pipe(htmlStream); + on('message', (message) => { + externaliseStream.write(message); + }); + htmlStream.on('data', (chunk) => write(chunk)); + return async () => { + externaliseStream.end(); + await (0, node_util_1.promisify)(node_stream_1.finished)(htmlStream); + }; + }, + optionsKey: 'html', +}; +//# sourceMappingURL=html.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.js.map b/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.js.map new file mode 100644 index 00000000..f5574b5d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/html.js.map @@ -0,0 +1 @@ +{"version":3,"file":"html.js","sourceRoot":"","sources":["../../../src/formatter/builtin/html.ts"],"names":[],"mappings":";;AAAA,yCAAqC;AACrC,6CAAsC;AACtC,6DAA6D;AAC7D,+DAAyE;AAOzE,kBAAe;IACb,IAAI,EAAE,WAAW;IACjB,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;QACzC,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAA;QACH,CAAC;QACD,MAAM,iBAAiB,GAAG,IAAI,+CAA6B,CAAC;YAC1D,SAAS,EAAE,OAAO,CAAC,mBAAmB;YACtC,SAAS;SACV,CAAC,CAAA;QACF,MAAM,UAAU,GAAG,IAAI,mCAAkB,EAAE,CAAA;QAC3C,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAClC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YACxB,iBAAiB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAClC,CAAC,CAAC,CAAA;QACF,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;QAE9C,OAAO,KAAK,IAAI,EAAE;YAChB,iBAAiB,CAAC,GAAG,EAAE,CAAA;YACvB,MAAM,IAAA,qBAAS,EAAC,sBAAQ,CAAC,CAAC,UAAU,CAAC,CAAA;QACvC,CAAC,CAAA;IACH,CAAC;IACD,UAAU,EAAE,MAAM;CACgB,CAAA","sourcesContent":["import { promisify } from 'node:util'\nimport { finished } from 'node:stream'\nimport { CucumberHtmlStream } from '@cucumber/html-formatter'\nimport { AttachmentExternalisingStream } from '@cucumber/message-streams'\nimport { FormatterPlugin } from '../../plugin'\n\ninterface Options {\n externalAttachments?: boolean | ReadonlyArray\n}\n\nexport default {\n type: 'formatter',\n formatter({ on, options, write, directory }) {\n if (!directory && options.externalAttachments) {\n throw new Error(\n 'Unable to externalise attachments when formatter is not writing to a file'\n )\n }\n const externaliseStream = new AttachmentExternalisingStream({\n behaviour: options.externalAttachments,\n directory,\n })\n const htmlStream = new CucumberHtmlStream()\n externaliseStream.pipe(htmlStream)\n on('message', (message) => {\n externaliseStream.write(message)\n })\n htmlStream.on('data', (chunk) => write(chunk))\n\n return async () => {\n externaliseStream.end()\n await promisify(finished)(htmlStream)\n }\n },\n optionsKey: 'html',\n} satisfies FormatterPlugin\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.d.ts new file mode 100644 index 00000000..a86fa282 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.d.ts @@ -0,0 +1,17 @@ +import { FormatterImplementation } from '../index'; +declare const _default: Record; +export default _default; +export declare const documentation: { + html: string; + junit: string; + pretty: string; + message: string; + json: string; + progress: string; + 'progress-bar': string; + rerun: string; + snippets: string; + summary: string; + usage: string; + 'usage-json': string; +}; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.js b/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.js new file mode 100644 index 00000000..9f635e71 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.js @@ -0,0 +1,50 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.documentation = void 0; +const json_formatter_1 = __importDefault(require("../json_formatter")); +const progress_formatter_1 = __importDefault(require("../progress_formatter")); +const progress_bar_formatter_1 = __importDefault(require("../progress_bar_formatter")); +const rerun_formatter_1 = __importDefault(require("../rerun_formatter")); +const snippets_formatter_1 = __importDefault(require("../snippets_formatter")); +const summary_formatter_1 = __importDefault(require("../summary_formatter")); +const usage_formatter_1 = __importDefault(require("../usage_formatter")); +const usage_json_formatter_1 = __importDefault(require("../usage_json_formatter")); +const message_1 = __importDefault(require("./message")); +const html_1 = __importDefault(require("./html")); +const builtin = { + // new plugin-based formatters + html: html_1.default, + junit: '@cucumber/junit-xml-formatter', + pretty: '@cucumber/pretty-formatter', + message: message_1.default, + // legacy class-based formatters + json: json_formatter_1.default, + progress: progress_formatter_1.default, + 'progress-bar': progress_bar_formatter_1.default, + rerun: rerun_formatter_1.default, + snippets: snippets_formatter_1.default, + summary: summary_formatter_1.default, + usage: usage_formatter_1.default, + 'usage-json': usage_json_formatter_1.default, +}; +exports.default = builtin; +exports.documentation = { + // new plugin-based formatters + html: 'Outputs a HTML report', + junit: 'Produces a JUnit XML report', + pretty: 'Writes a rich report of the scenario and example execution as it happens', + message: 'Emits Cucumber messages in newline-delimited JSON', + // legacy class-based formatters + json: json_formatter_1.default.documentation, + progress: progress_formatter_1.default.documentation, + 'progress-bar': progress_bar_formatter_1.default.documentation, + rerun: rerun_formatter_1.default.documentation, + snippets: snippets_formatter_1.default.documentation, + summary: summary_formatter_1.default.documentation, + usage: usage_formatter_1.default.documentation, + 'usage-json': usage_json_formatter_1.default.documentation, +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.js.map b/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.js.map new file mode 100644 index 00000000..c88aaebb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formatter/builtin/index.ts"],"names":[],"mappings":";;;;;;AACA,uEAA6C;AAC7C,+EAAqD;AACrD,uFAA4D;AAC5D,yEAA+C;AAC/C,+EAAqD;AACrD,6EAAmD;AACnD,yEAA+C;AAC/C,mFAAwD;AACxD,wDAAwC;AACxC,kDAAkC;AAElC,MAAM,OAAO,GAAG;IACd,8BAA8B;IAC9B,IAAI,EAAE,cAAa;IACnB,KAAK,EAAE,+BAA+B;IACtC,MAAM,EAAE,4BAA4B;IACpC,OAAO,EAAE,iBAAgB;IACzB,gCAAgC;IAChC,IAAI,EAAE,wBAAa;IACnB,QAAQ,EAAE,4BAAiB;IAC3B,cAAc,EAAE,gCAAoB;IACpC,KAAK,EAAE,yBAAc;IACrB,QAAQ,EAAE,4BAAiB;IAC3B,OAAO,EAAE,2BAAgB;IACzB,KAAK,EAAE,yBAAc;IACrB,YAAY,EAAE,8BAAkB;CACmC,CAAA;AAErE,kBAAe,OAA2D,CAAA;AAE7D,QAAA,aAAa,GAAG;IAC3B,8BAA8B;IAC9B,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,6BAA6B;IACpC,MAAM,EACJ,0EAA0E;IAC5E,OAAO,EAAE,mDAAmD;IAC5D,gCAAgC;IAChC,IAAI,EAAE,wBAAa,CAAC,aAAa;IACjC,QAAQ,EAAE,4BAAiB,CAAC,aAAa;IACzC,cAAc,EAAE,gCAAoB,CAAC,aAAa;IAClD,KAAK,EAAE,yBAAc,CAAC,aAAa;IACnC,QAAQ,EAAE,4BAAiB,CAAC,aAAa;IACzC,OAAO,EAAE,2BAAgB,CAAC,aAAa;IACvC,KAAK,EAAE,yBAAc,CAAC,aAAa;IACnC,YAAY,EAAE,8BAAkB,CAAC,aAAa;CACA,CAAA","sourcesContent":["import { FormatterImplementation } from '../index'\nimport JsonFormatter from '../json_formatter'\nimport ProgressFormatter from '../progress_formatter'\nimport ProgressBarFormatter from '../progress_bar_formatter'\nimport RerunFormatter from '../rerun_formatter'\nimport SnippetsFormatter from '../snippets_formatter'\nimport SummaryFormatter from '../summary_formatter'\nimport UsageFormatter from '../usage_formatter'\nimport UsageJsonFormatter from '../usage_json_formatter'\nimport messageFormatter from './message'\nimport htmlFormatter from './html'\n\nconst builtin = {\n // new plugin-based formatters\n html: htmlFormatter,\n junit: '@cucumber/junit-xml-formatter',\n pretty: '@cucumber/pretty-formatter',\n message: messageFormatter,\n // legacy class-based formatters\n json: JsonFormatter,\n progress: ProgressFormatter,\n 'progress-bar': ProgressBarFormatter,\n rerun: RerunFormatter,\n snippets: SnippetsFormatter,\n summary: SummaryFormatter,\n usage: UsageFormatter,\n 'usage-json': UsageJsonFormatter,\n} as const satisfies Record\n\nexport default builtin as Record\n\nexport const documentation = {\n // new plugin-based formatters\n html: 'Outputs a HTML report',\n junit: 'Produces a JUnit XML report',\n pretty:\n 'Writes a rich report of the scenario and example execution as it happens',\n message: 'Emits Cucumber messages in newline-delimited JSON',\n // legacy class-based formatters\n json: JsonFormatter.documentation,\n progress: ProgressFormatter.documentation,\n 'progress-bar': ProgressBarFormatter.documentation,\n rerun: RerunFormatter.documentation,\n snippets: SnippetsFormatter.documentation,\n summary: SummaryFormatter.documentation,\n usage: UsageFormatter.documentation,\n 'usage-json': UsageJsonFormatter.documentation,\n} satisfies Record\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.d.ts new file mode 100644 index 00000000..172c1676 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.d.ts @@ -0,0 +1,5 @@ +declare const _default: { + type: "formatter"; + formatter({ on, write }: import("../../plugin").FormatterPluginContext): void; +}; +export default _default; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.js b/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.js new file mode 100644 index 00000000..51dfdc75 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = { + type: 'formatter', + formatter({ on, write }) { + on('message', (message) => write(JSON.stringify(message) + '\n')); + }, +}; +//# sourceMappingURL=message.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.js.map b/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.js.map new file mode 100644 index 00000000..a606b5b7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/builtin/message.js.map @@ -0,0 +1 @@ +{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/formatter/builtin/message.ts"],"names":[],"mappings":";;AAEA,kBAAe;IACb,IAAI,EAAE,WAAW;IACjB,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE;QACrB,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;IACnE,CAAC;CACwB,CAAA","sourcesContent":["import { FormatterPlugin } from '../../plugin'\n\nexport default {\n type: 'formatter',\n formatter({ on, write }) {\n on('message', (message) => write(JSON.stringify(message) + '\\n'))\n },\n} satisfies FormatterPlugin\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/create_stream.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/create_stream.d.ts new file mode 100644 index 00000000..01733c21 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/create_stream.d.ts @@ -0,0 +1,6 @@ +import { Writable } from 'node:stream'; +import { ILogger } from '../environment'; +export declare function createStream(target: string, onStreamError: () => void, cwd: string, logger: ILogger): Promise<{ + directory: string; + stream: Writable; +}>; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/create_stream.js b/node_modules/@cucumber/cucumber/lib/formatter/create_stream.js new file mode 100644 index 00000000..e5c86e13 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/create_stream.js @@ -0,0 +1,31 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createStream = createStream; +const node_path_1 = __importDefault(require("node:path")); +const mkdirp_1 = require("mkdirp"); +const fs_1 = __importDefault(require("mz/fs")); +async function createStream(target, onStreamError, cwd, logger) { + const absoluteTarget = node_path_1.default.resolve(cwd, target); + const directory = node_path_1.default.dirname(absoluteTarget); + try { + await (0, mkdirp_1.mkdirp)(directory); + } + catch (e) { + logger.warn('Failed to ensure directory for formatter target exists', e); + } + const stream = fs_1.default.createWriteStream(null, { + fd: await fs_1.default.open(absoluteTarget, 'w'), + }); + stream.on('error', (error) => { + logger.error(error.message); + onStreamError(); + }); + return { + directory, + stream, + }; +} +//# sourceMappingURL=create_stream.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/create_stream.js.map b/node_modules/@cucumber/cucumber/lib/formatter/create_stream.js.map new file mode 100644 index 00000000..034e171f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/create_stream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"create_stream.js","sourceRoot":"","sources":["../../src/formatter/create_stream.ts"],"names":[],"mappings":";;;;;AAMA,oCA4BC;AAlCD,0DAA4B;AAE5B,mCAA+B;AAC/B,+CAAsB;AAGf,KAAK,UAAU,YAAY,CAChC,MAAc,EACd,aAAyB,EACzB,GAAW,EACX,MAAe;IAEf,MAAM,cAAc,GAAG,mBAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAChD,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IAE9C,IAAI,CAAC;QACH,MAAM,IAAA,eAAM,EAAC,SAAS,CAAC,CAAA;IACzB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,wDAAwD,EAAE,CAAC,CAAC,CAAA;IAC1E,CAAC;IAED,MAAM,MAAM,GAAa,YAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE;QAClD,EAAE,EAAE,MAAM,YAAE,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC;KACvC,CAAC,CAAA;IAEF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;QAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC3B,aAAa,EAAE,CAAA;IACjB,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,SAAS;QACT,MAAM;KACP,CAAA;AACH,CAAC","sourcesContent":["import path from 'node:path'\nimport { Writable } from 'node:stream'\nimport { mkdirp } from 'mkdirp'\nimport fs from 'mz/fs'\nimport { ILogger } from '../environment'\n\nexport async function createStream(\n target: string,\n onStreamError: () => void,\n cwd: string,\n logger: ILogger\n) {\n const absoluteTarget = path.resolve(cwd, target)\n const directory = path.dirname(absoluteTarget)\n\n try {\n await mkdirp(directory)\n } catch (e) {\n logger.warn('Failed to ensure directory for formatter target exists', e)\n }\n\n const stream: Writable = fs.createWriteStream(null, {\n fd: await fs.open(absoluteTarget, 'w'),\n })\n\n stream.on('error', (error: Error) => {\n logger.error(error.message)\n onStreamError()\n })\n\n return {\n directory,\n stream,\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.d.ts new file mode 100644 index 00000000..1e47c298 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.d.ts @@ -0,0 +1 @@ +export declare function findClassOrPlugin(imported: any): any; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.js b/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.js new file mode 100644 index 00000000..c6a08461 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.findClassOrPlugin = findClassOrPlugin; +const value_checker_1 = require("../value_checker"); +function findClassOrPlugin(imported) { + return findRecursive(imported, 3); +} +function findRecursive(thing, depth) { + if ((0, value_checker_1.doesNotHaveValue)(thing)) { + return null; + } + if (typeof thing === 'function') { + return thing; + } + if (typeof thing === 'object' && thing.type === 'formatter') { + return thing; + } + depth--; + if (depth > 0) { + return findRecursive(thing.default, depth); + } + return null; +} +//# sourceMappingURL=find_class_or_plugin.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.js.map b/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.js.map new file mode 100644 index 00000000..2ccd24db --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/find_class_or_plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"find_class_or_plugin.js","sourceRoot":"","sources":["../../src/formatter/find_class_or_plugin.ts"],"names":[],"mappings":";;AAEA,8CAEC;AAJD,oDAAmD;AAEnD,SAAgB,iBAAiB,CAAC,QAAa;IAC7C,OAAO,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;AACnC,CAAC;AAED,SAAS,aAAa,CAAC,KAAU,EAAE,KAAa;IAC9C,IAAI,IAAA,gCAAgB,EAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO,KAAK,CAAA;IACd,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC5D,OAAO,KAAK,CAAA;IACd,CAAC;IACD,KAAK,EAAE,CAAA;IACP,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC5C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { doesNotHaveValue } from '../value_checker'\n\nexport function findClassOrPlugin(imported: any) {\n return findRecursive(imported, 3)\n}\n\nfunction findRecursive(thing: any, depth: number): any {\n if (doesNotHaveValue(thing)) {\n return null\n }\n if (typeof thing === 'function') {\n return thing\n }\n if (typeof thing === 'object' && thing.type === 'formatter') {\n return thing\n }\n depth--\n if (depth > 0) {\n return findRecursive(thing.default, depth)\n }\n return null\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.d.ts new file mode 100644 index 00000000..83ef29c8 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.d.ts @@ -0,0 +1,13 @@ +import { Writable } from 'node:stream'; +import { TestStepResultStatus } from '@cucumber/messages'; +export type IColorFn = (text: string) => string; +export interface IColorFns { + forStatus: (status: TestStepResultStatus) => IColorFn; + location: IColorFn; + tag: IColorFn; + diffAdded: IColorFn; + diffRemoved: IColorFn; + errorMessage: IColorFn; + errorStack: IColorFn; +} +export default function getColorFns(stream: Writable, env: NodeJS.ProcessEnv, enabled?: boolean): IColorFns; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.js b/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.js new file mode 100644 index 00000000..9f1795ce --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.js @@ -0,0 +1,56 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = getColorFns; +const chalk_1 = __importDefault(require("chalk")); +const supports_color_1 = require("supports-color"); +const value_checker_1 = require("../value_checker"); +function getColorFns(stream, env, enabled) { + const support = detectSupport(stream, env, enabled); + if (support) { + const chalkInstance = new chalk_1.default.Instance(support); + return { + forStatus(status) { + return { + AMBIGUOUS: chalkInstance.red.bind(chalk_1.default), + FAILED: chalkInstance.red.bind(chalk_1.default), + PASSED: chalkInstance.green.bind(chalk_1.default), + PENDING: chalkInstance.yellow.bind(chalk_1.default), + SKIPPED: chalkInstance.cyan.bind(chalk_1.default), + UNDEFINED: chalkInstance.yellow.bind(chalk_1.default), + UNKNOWN: chalkInstance.yellow.bind(chalk_1.default), + }[status]; + }, + location: chalkInstance.gray.bind(chalk_1.default), + tag: chalkInstance.cyan.bind(chalk_1.default), + diffAdded: chalkInstance.green.bind(chalk_1.default), + diffRemoved: chalkInstance.red.bind(chalk_1.default), + errorMessage: chalkInstance.red.bind(chalk_1.default), + errorStack: chalkInstance.grey.bind(chalk_1.default), + }; + } + else { + return { + forStatus(_status) { + return (x) => x; + }, + location: (x) => x, + tag: (x) => x, + diffAdded: (x) => x, + diffRemoved: (x) => x, + errorMessage: (x) => x, + errorStack: (x) => x, + }; + } +} +function detectSupport(stream, env, enabled) { + const support = (0, supports_color_1.supportsColor)(stream); + // if we find FORCE_COLOR, we can let the supports-color library handle that + if ('FORCE_COLOR' in env || (0, value_checker_1.doesNotHaveValue)(enabled)) { + return support; + } + return enabled ? support || { level: 1 } : false; +} +//# sourceMappingURL=get_color_fns.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.js.map b/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.js.map new file mode 100644 index 00000000..2c59cb6a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/get_color_fns.js.map @@ -0,0 +1 @@ +{"version":3,"file":"get_color_fns.js","sourceRoot":"","sources":["../../src/formatter/get_color_fns.ts"],"names":[],"mappings":";;;;;AAkBA,8BAwCC;AAzDD,kDAAyB;AACzB,mDAAyD;AAEzD,oDAAmD;AAcnD,SAAwB,WAAW,CACjC,MAAgB,EAChB,GAAsB,EACtB,OAAiB;IAEjB,MAAM,OAAO,GAAc,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;IAC9D,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,aAAa,GAAG,IAAI,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QACjD,OAAO;YACL,SAAS,CAAC,MAA4B;gBACpC,OAAO;oBACL,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC;oBACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,eAAK,CAAC;oBACrC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,eAAK,CAAC;oBACvC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,eAAK,CAAC;oBACzC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI,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E,IAAI,aAAa,IAAI,GAAG,IAAI,IAAA,gCAAgB,EAAC,OAAO,CAAC,EAAE,CAAC;QACtD,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;AAClD,CAAC","sourcesContent":["import { Writable } from 'node:stream'\nimport chalk from 'chalk'\nimport { ColorInfo, supportsColor } from 'supports-color'\nimport { TestStepResultStatus } from '@cucumber/messages'\nimport { doesNotHaveValue } from '../value_checker'\n\nexport type IColorFn = (text: string) => string\n\nexport interface IColorFns {\n forStatus: (status: TestStepResultStatus) => IColorFn\n location: IColorFn\n tag: IColorFn\n diffAdded: IColorFn\n diffRemoved: IColorFn\n errorMessage: IColorFn\n errorStack: IColorFn\n}\n\nexport default function getColorFns(\n stream: Writable,\n env: NodeJS.ProcessEnv,\n enabled?: boolean\n): IColorFns {\n const support: ColorInfo = detectSupport(stream, env, enabled)\n if (support) {\n const chalkInstance = new chalk.Instance(support)\n return {\n forStatus(status: TestStepResultStatus) {\n return {\n AMBIGUOUS: chalkInstance.red.bind(chalk),\n FAILED: chalkInstance.red.bind(chalk),\n PASSED: chalkInstance.green.bind(chalk),\n PENDING: chalkInstance.yellow.bind(chalk),\n SKIPPED: chalkInstance.cyan.bind(chalk),\n UNDEFINED: chalkInstance.yellow.bind(chalk),\n UNKNOWN: chalkInstance.yellow.bind(chalk),\n }[status]\n },\n location: chalkInstance.gray.bind(chalk),\n tag: chalkInstance.cyan.bind(chalk),\n diffAdded: chalkInstance.green.bind(chalk),\n diffRemoved: chalkInstance.red.bind(chalk),\n errorMessage: chalkInstance.red.bind(chalk),\n errorStack: chalkInstance.grey.bind(chalk),\n }\n } else {\n return {\n forStatus(_status: TestStepResultStatus) {\n return (x) => x\n },\n location: (x) => x,\n tag: (x) => x,\n diffAdded: (x) => x,\n diffRemoved: (x) => x,\n errorMessage: (x) => x,\n errorStack: (x) => x,\n }\n }\n}\n\nfunction detectSupport(\n stream: Writable,\n env: NodeJS.ProcessEnv,\n enabled?: boolean\n): ColorInfo {\n const support: ColorInfo = supportsColor(stream)\n // if we find FORCE_COLOR, we can let the supports-color library handle that\n if ('FORCE_COLOR' in env || doesNotHaveValue(enabled)) {\n return support\n }\n return enabled ? support || { level: 1 } : false\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.d.ts new file mode 100644 index 00000000..72a896d0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.d.ts @@ -0,0 +1,2 @@ +import { Duration } from '@cucumber/messages'; +export declare function durationToNanoseconds(duration: Duration): number; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.js new file mode 100644 index 00000000..1916f7e8 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.durationToNanoseconds = durationToNanoseconds; +const NANOS_IN_SECOND = 1_000_000_000; +function durationToNanoseconds(duration) { + return Math.floor(duration.seconds * NANOS_IN_SECOND + duration.nanos); +} +//# sourceMappingURL=duration_helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.js.map new file mode 100644 index 00000000..f513a80a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/duration_helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"duration_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/duration_helpers.ts"],"names":[],"mappings":";;AAIA,sDAEC;AAJD,MAAM,eAAe,GAAG,aAAa,CAAA;AAErC,SAAgB,qBAAqB,CAAC,QAAkB;IACtD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,GAAG,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;AACxE,CAAC","sourcesContent":["import { Duration } from '@cucumber/messages'\n\nconst NANOS_IN_SECOND = 1_000_000_000\n\nexport function durationToNanoseconds(duration: Duration): number {\n return Math.floor(duration.seconds * NANOS_IN_SECOND + duration.nanos)\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.d.ts new file mode 100644 index 00000000..26e75557 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.d.ts @@ -0,0 +1,29 @@ +import { EventEmitter } from 'node:events'; +import * as messages from '@cucumber/messages'; +export interface ITestCaseAttempt { + attempt: number; + willBeRetried: boolean; + gherkinDocument: messages.GherkinDocument; + pickle: messages.Pickle; + stepAttachments: Record; + stepResults: Record; + testCase: messages.TestCase; + worstTestStepResult: messages.TestStepResult; +} +export default class EventDataCollector { + private gherkinDocumentMap; + private pickleMap; + private testCaseMap; + private testCaseAttemptDataMap; + readonly undefinedParameterTypes: messages.UndefinedParameterType[]; + constructor(eventBroadcaster: EventEmitter); + getGherkinDocument(uri: string): messages.GherkinDocument; + getPickle(pickleId: string): messages.Pickle; + getTestCaseAttempts(): ITestCaseAttempt[]; + getTestCaseAttempt(testCaseStartedId: string): ITestCaseAttempt; + parseEnvelope(envelope: messages.Envelope): void; + private initTestCaseAttempt; + storeAttachment(attachment: messages.Attachment): void; + storeTestStepResult({ testCaseStartedId, testStepId, testStepResult, }: messages.TestStepFinished): void; + storeTestCaseResult({ testCaseStartedId, willBeRetried, }: messages.TestCaseFinished): void; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.js new file mode 100644 index 00000000..dd1df65c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.js @@ -0,0 +1,135 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const messages = __importStar(require("@cucumber/messages")); +const value_checker_1 = require("../../value_checker"); +class EventDataCollector { + gherkinDocumentMap = {}; + pickleMap = {}; + testCaseMap = {}; + testCaseAttemptDataMap = {}; + undefinedParameterTypes = []; + constructor(eventBroadcaster) { + eventBroadcaster.on('envelope', this.parseEnvelope.bind(this)); + } + getGherkinDocument(uri) { + return this.gherkinDocumentMap[uri]; + } + getPickle(pickleId) { + return this.pickleMap[pickleId]; + } + getTestCaseAttempts() { + return Object.keys(this.testCaseAttemptDataMap).map((testCaseStartedId) => { + return this.getTestCaseAttempt(testCaseStartedId); + }); + } + getTestCaseAttempt(testCaseStartedId) { + const testCaseAttemptData = this.testCaseAttemptDataMap[testCaseStartedId]; + const testCase = this.testCaseMap[testCaseAttemptData.testCaseId]; + const pickle = this.pickleMap[testCase.pickleId]; + return { + gherkinDocument: this.gherkinDocumentMap[pickle.uri], + pickle, + testCase, + attempt: testCaseAttemptData.attempt, + willBeRetried: testCaseAttemptData.willBeRetried, + stepAttachments: testCaseAttemptData.stepAttachments, + stepResults: testCaseAttemptData.stepResults, + worstTestStepResult: testCaseAttemptData.worstTestStepResult, + }; + } + parseEnvelope(envelope) { + if ((0, value_checker_1.doesHaveValue)(envelope.gherkinDocument)) { + this.gherkinDocumentMap[envelope.gherkinDocument.uri] = + envelope.gherkinDocument; + } + else if ((0, value_checker_1.doesHaveValue)(envelope.pickle)) { + this.pickleMap[envelope.pickle.id] = envelope.pickle; + } + else if ((0, value_checker_1.doesHaveValue)(envelope.undefinedParameterType)) { + this.undefinedParameterTypes.push(envelope.undefinedParameterType); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testCase)) { + this.testCaseMap[envelope.testCase.id] = envelope.testCase; + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testCaseStarted)) { + this.initTestCaseAttempt(envelope.testCaseStarted); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.attachment)) { + this.storeAttachment(envelope.attachment); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testStepFinished)) { + this.storeTestStepResult(envelope.testStepFinished); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testCaseFinished)) { + this.storeTestCaseResult(envelope.testCaseFinished); + } + } + initTestCaseAttempt(testCaseStarted) { + this.testCaseAttemptDataMap[testCaseStarted.id] = { + attempt: testCaseStarted.attempt, + willBeRetried: false, + testCaseId: testCaseStarted.testCaseId, + stepAttachments: {}, + stepResults: {}, + worstTestStepResult: { + duration: { seconds: 0, nanos: 0 }, + status: messages.TestStepResultStatus.UNKNOWN, + }, + }; + } + storeAttachment(attachment) { + const { testCaseStartedId, testStepId } = attachment; + if ((0, value_checker_1.doesHaveValue)(testCaseStartedId) && (0, value_checker_1.doesHaveValue)(testStepId)) { + const { stepAttachments } = this.testCaseAttemptDataMap[testCaseStartedId]; + if ((0, value_checker_1.doesNotHaveValue)(stepAttachments[testStepId])) { + stepAttachments[testStepId] = []; + } + stepAttachments[testStepId].push(attachment); + } + } + storeTestStepResult({ testCaseStartedId, testStepId, testStepResult, }) { + this.testCaseAttemptDataMap[testCaseStartedId].stepResults[testStepId] = + testStepResult; + } + storeTestCaseResult({ testCaseStartedId, willBeRetried, }) { + const stepResults = Object.values(this.testCaseAttemptDataMap[testCaseStartedId].stepResults); + this.testCaseAttemptDataMap[testCaseStartedId].worstTestStepResult = + messages.getWorstTestStepResult(stepResults); + this.testCaseAttemptDataMap[testCaseStartedId].willBeRetried = willBeRetried; + } +} +exports.default = EventDataCollector; +//# sourceMappingURL=event_data_collector.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.js.map new file mode 100644 index 00000000..a05c7dc7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/event_data_collector.js.map @@ -0,0 +1 @@ +{"version":3,"file":"event_data_collector.js","sourceRoot":"","sources":["../../../src/formatter/helpers/event_data_collector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6DAA8C;AAC9C,uDAAqE;AAsBrE,MAAqB,kBAAkB;IAC7B,kBAAkB,GAA6C,EAAE,CAAA;IACjE,SAAS,GAAoC,EAAE,CAAA;IAC/C,WAAW,GAAsC,EAAE,CAAA;IACnD,sBAAsB,GAAyC,EAAE,CAAA;IAChE,uBAAuB,GAAsC,EAAE,CAAA;IAExE,YAAY,gBAA8B;QACxC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAChE,CAAC;IAED,kBAAkB,CAAC,GAAW;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CAAC,CAAC,aAAa,GAAG,aAAa,CAAA;IAC9E,CAAC;CACF;AA3GD,qCA2GC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport * as messages from '@cucumber/messages'\nimport { doesHaveValue, doesNotHaveValue } from '../../value_checker'\n\ninterface ITestCaseAttemptData {\n attempt: number\n willBeRetried: boolean\n testCaseId: string\n stepAttachments: Record\n stepResults: Record\n worstTestStepResult: messages.TestStepResult\n}\n\nexport interface ITestCaseAttempt {\n attempt: number\n willBeRetried: boolean\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n stepAttachments: Record\n stepResults: Record\n testCase: messages.TestCase\n worstTestStepResult: messages.TestStepResult\n}\n\nexport default class EventDataCollector {\n private gherkinDocumentMap: Record = {}\n private pickleMap: Record = {}\n private testCaseMap: Record = {}\n private testCaseAttemptDataMap: Record = {}\n readonly undefinedParameterTypes: messages.UndefinedParameterType[] = []\n\n constructor(eventBroadcaster: EventEmitter) {\n eventBroadcaster.on('envelope', this.parseEnvelope.bind(this))\n }\n\n getGherkinDocument(uri: string): messages.GherkinDocument {\n return this.gherkinDocumentMap[uri]\n }\n\n getPickle(pickleId: string): messages.Pickle {\n return this.pickleMap[pickleId]\n }\n\n getTestCaseAttempts(): ITestCaseAttempt[] {\n return Object.keys(this.testCaseAttemptDataMap).map((testCaseStartedId) => {\n return this.getTestCaseAttempt(testCaseStartedId)\n })\n }\n\n getTestCaseAttempt(testCaseStartedId: string): ITestCaseAttempt {\n const testCaseAttemptData = this.testCaseAttemptDataMap[testCaseStartedId]\n const testCase = this.testCaseMap[testCaseAttemptData.testCaseId]\n const pickle = this.pickleMap[testCase.pickleId]\n return {\n gherkinDocument: this.gherkinDocumentMap[pickle.uri],\n pickle,\n testCase,\n attempt: testCaseAttemptData.attempt,\n willBeRetried: testCaseAttemptData.willBeRetried,\n stepAttachments: testCaseAttemptData.stepAttachments,\n stepResults: testCaseAttemptData.stepResults,\n worstTestStepResult: testCaseAttemptData.worstTestStepResult,\n }\n }\n\n parseEnvelope(envelope: messages.Envelope): void {\n if (doesHaveValue(envelope.gherkinDocument)) {\n this.gherkinDocumentMap[envelope.gherkinDocument.uri] =\n envelope.gherkinDocument\n } else if (doesHaveValue(envelope.pickle)) {\n this.pickleMap[envelope.pickle.id] = envelope.pickle\n } else if (doesHaveValue(envelope.undefinedParameterType)) {\n this.undefinedParameterTypes.push(envelope.undefinedParameterType)\n } else if (doesHaveValue(envelope.testCase)) {\n this.testCaseMap[envelope.testCase.id] = envelope.testCase\n } else if (doesHaveValue(envelope.testCaseStarted)) {\n this.initTestCaseAttempt(envelope.testCaseStarted)\n } else if (doesHaveValue(envelope.attachment)) {\n this.storeAttachment(envelope.attachment)\n } else if (doesHaveValue(envelope.testStepFinished)) {\n this.storeTestStepResult(envelope.testStepFinished)\n } else if (doesHaveValue(envelope.testCaseFinished)) {\n this.storeTestCaseResult(envelope.testCaseFinished)\n }\n }\n\n private initTestCaseAttempt(testCaseStarted: messages.TestCaseStarted): void {\n this.testCaseAttemptDataMap[testCaseStarted.id] = {\n attempt: testCaseStarted.attempt,\n willBeRetried: false,\n testCaseId: testCaseStarted.testCaseId,\n stepAttachments: {},\n stepResults: {},\n worstTestStepResult: {\n duration: { seconds: 0, nanos: 0 },\n status: messages.TestStepResultStatus.UNKNOWN,\n },\n }\n }\n\n storeAttachment(attachment: messages.Attachment): void {\n const { testCaseStartedId, testStepId } = attachment\n if (doesHaveValue(testCaseStartedId) && doesHaveValue(testStepId)) {\n const { stepAttachments } = this.testCaseAttemptDataMap[testCaseStartedId]\n if (doesNotHaveValue(stepAttachments[testStepId])) {\n stepAttachments[testStepId] = []\n }\n stepAttachments[testStepId].push(attachment)\n }\n }\n\n storeTestStepResult({\n testCaseStartedId,\n testStepId,\n testStepResult,\n }: messages.TestStepFinished): void {\n this.testCaseAttemptDataMap[testCaseStartedId].stepResults[testStepId] =\n testStepResult\n }\n\n storeTestCaseResult({\n testCaseStartedId,\n willBeRetried,\n }: messages.TestCaseFinished): void {\n const stepResults = Object.values(\n this.testCaseAttemptDataMap[testCaseStartedId].stepResults\n )\n this.testCaseAttemptDataMap[testCaseStartedId].worstTestStepResult =\n messages.getWorstTestStepResult(stepResults)\n this.testCaseAttemptDataMap[testCaseStartedId].willBeRetried = willBeRetried\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.d.ts new file mode 100644 index 00000000..e93f0c14 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.d.ts @@ -0,0 +1,5 @@ +import Formatter from '../.'; +declare const Formatters: { + getFormatters(): Record; +}; +export default Formatters; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.js new file mode 100644 index 00000000..1c6454a5 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.js @@ -0,0 +1,29 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const json_formatter_1 = __importDefault(require("../json_formatter")); +const progress_bar_formatter_1 = __importDefault(require("../progress_bar_formatter")); +const progress_formatter_1 = __importDefault(require("../progress_formatter")); +const rerun_formatter_1 = __importDefault(require("../rerun_formatter")); +const snippets_formatter_1 = __importDefault(require("../snippets_formatter")); +const summary_formatter_1 = __importDefault(require("../summary_formatter")); +const usage_formatter_1 = __importDefault(require("../usage_formatter")); +const usage_json_formatter_1 = __importDefault(require("../usage_json_formatter")); +const Formatters = { + getFormatters() { + return { + json: json_formatter_1.default, + progress: progress_formatter_1.default, + 'progress-bar': progress_bar_formatter_1.default, + rerun: rerun_formatter_1.default, + snippets: snippets_formatter_1.default, + summary: summary_formatter_1.default, + usage: usage_formatter_1.default, + 'usage-json': usage_json_formatter_1.default, + }; + }, +}; +exports.default = Formatters; +//# sourceMappingURL=formatters.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.js.map new file mode 100644 index 00000000..67e6ec7d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/formatters.js.map @@ -0,0 +1 @@ +{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/formatter/helpers/formatters.ts"],"names":[],"mappings":";;;;;AACA,uEAA6C;AAC7C,uFAA4D;AAC5D,+EAAqD;AACrD,yEAA+C;AAC/C,+EAAqD;AACrD,6EAAmD;AACnD,yEAA+C;AAC/C,mFAAwD;AAExD,MAAM,UAAU,GAAG;IACjB,aAAa;QACX,OAAO;YACL,IAAI,EAAE,wBAAa;YACnB,QAAQ,EAAE,4BAAiB;YAC3B,cAAc,EAAE,gCAAoB;YACpC,KAAK,EAAE,yBAAc;YACrB,QAAQ,EAAE,4BAAiB;YAC3B,OAAO,EAAE,2BAAgB;YACzB,KAAK,EAAE,yBAAc;YACrB,YAAY,EAAE,8BAAkB;SACjC,CAAA;IACH,CAAC;CACF,CAAA;AAED,kBAAe,UAAU,CAAA","sourcesContent":["import Formatter from '../.'\nimport JsonFormatter from '../json_formatter'\nimport ProgressBarFormatter from '../progress_bar_formatter'\nimport ProgressFormatter from '../progress_formatter'\nimport RerunFormatter from '../rerun_formatter'\nimport SnippetsFormatter from '../snippets_formatter'\nimport SummaryFormatter from '../summary_formatter'\nimport UsageFormatter from '../usage_formatter'\nimport UsageJsonFormatter from '../usage_json_formatter'\n\nconst Formatters = {\n getFormatters(): Record {\n return {\n json: JsonFormatter,\n progress: ProgressFormatter,\n 'progress-bar': ProgressBarFormatter,\n rerun: RerunFormatter,\n snippets: SnippetsFormatter,\n summary: SummaryFormatter,\n usage: UsageFormatter,\n 'usage-json': UsageJsonFormatter,\n }\n },\n}\n\nexport default Formatters\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.d.ts new file mode 100644 index 00000000..ddf50837 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.d.ts @@ -0,0 +1,5 @@ +import * as messages from '@cucumber/messages'; +export declare function getGherkinStepMap(gherkinDocument: messages.GherkinDocument): Record; +export declare function getGherkinScenarioMap(gherkinDocument: messages.GherkinDocument): Record; +export declare function getGherkinExampleRuleMap(gherkinDocument: messages.GherkinDocument): Record; +export declare function getGherkinScenarioLocationMap(gherkinDocument: messages.GherkinDocument): Record; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.js new file mode 100644 index 00000000..8b42215d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGherkinStepMap = getGherkinStepMap; +exports.getGherkinScenarioMap = getGherkinScenarioMap; +exports.getGherkinExampleRuleMap = getGherkinExampleRuleMap; +exports.getGherkinScenarioLocationMap = getGherkinScenarioLocationMap; +const value_checker_1 = require("../../value_checker"); +function getGherkinStepMap(gherkinDocument) { + const result = {}; + gherkinDocument.feature.children + .map(extractStepContainers) + .flat() + .forEach((x) => x.steps.forEach((step) => (result[step.id] = step))); + return result; +} +function extractStepContainers(child) { + if ((0, value_checker_1.doesHaveValue)(child.background)) { + return [child.background]; + } + else if ((0, value_checker_1.doesHaveValue)(child.rule)) { + return child.rule.children.map((ruleChild) => (0, value_checker_1.doesHaveValue)(ruleChild.background) + ? ruleChild.background + : ruleChild.scenario); + } + return [child.scenario]; +} +function getGherkinScenarioMap(gherkinDocument) { + const result = {}; + gherkinDocument.feature.children + .map((child) => { + if ((0, value_checker_1.doesHaveValue)(child.rule)) { + return child.rule.children; + } + return [child]; + }) + .flat() + .forEach((x) => { + if (x.scenario != null) { + result[x.scenario.id] = x.scenario; + } + }); + return result; +} +function getGherkinExampleRuleMap(gherkinDocument) { + const result = {}; + gherkinDocument.feature.children + .filter((x) => x.rule != null) + .forEach((x) => x.rule.children + .filter((child) => (0, value_checker_1.doesHaveValue)(child.scenario)) + .forEach((child) => (result[child.scenario.id] = x.rule))); + return result; +} +function getGherkinScenarioLocationMap(gherkinDocument) { + const locationMap = {}; + const scenarioMap = getGherkinScenarioMap(gherkinDocument); + Object.keys(scenarioMap).forEach((id) => { + const scenario = scenarioMap[id]; + locationMap[id] = scenario.location; + if ((0, value_checker_1.doesHaveValue)(scenario.examples)) { + scenario.examples.forEach((x) => x.tableBody.forEach((tableRow) => (locationMap[tableRow.id] = tableRow.location))); + } + }); + return locationMap; +} +//# sourceMappingURL=gherkin_document_parser.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.js.map new file mode 100644 index 00000000..8a52dd35 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/gherkin_document_parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gherkin_document_parser.js","sourceRoot":"","sources":["../../../src/formatter/helpers/gherkin_document_parser.ts"],"names":[],"mappings":";;AAGA,8CAWC;AAiBD,sDAkBC;AAED,4DAYC;AAED,sEAkBC;AAlFD,uDAAmD;AAEnD,SAAgB,iBAAiB,CAC/B,eAAyC;IAEzC,MAAM,MAAM,GAAkC,EAAE,CAAA;IAChD,eAAe,CAAC,OAAO,CAAC,QAAQ;SAC7B,GAAG,CAAC,qBAAqB,CAAC;SAC1B,IAAI,EAAE;SACN,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CACb,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAmB,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAA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pB,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue } from '../../value_checker'\n\nexport function getGherkinStepMap(\n gherkinDocument: messages.GherkinDocument\n): Record {\n const result: Record = {}\n gherkinDocument.feature.children\n .map(extractStepContainers)\n .flat()\n .forEach((x) =>\n x.steps.forEach((step: messages.Step) => (result[step.id] = step))\n )\n return result\n}\n\nfunction extractStepContainers(\n child: messages.FeatureChild\n): Array {\n if (doesHaveValue(child.background)) {\n return [child.background]\n } else if (doesHaveValue(child.rule)) {\n return child.rule.children.map((ruleChild) =>\n doesHaveValue(ruleChild.background)\n ? ruleChild.background\n : ruleChild.scenario\n )\n }\n return [child.scenario]\n}\n\nexport function getGherkinScenarioMap(\n gherkinDocument: messages.GherkinDocument\n): Record {\n const result: Record = {}\n gherkinDocument.feature.children\n .map((child: messages.FeatureChild) => {\n if (doesHaveValue(child.rule)) {\n return child.rule.children\n }\n return [child]\n })\n .flat()\n .forEach((x) => {\n if (x.scenario != null) {\n result[x.scenario.id] = x.scenario\n }\n })\n return result\n}\n\nexport function getGherkinExampleRuleMap(\n gherkinDocument: messages.GherkinDocument\n): Record {\n const result: Record = {}\n gherkinDocument.feature.children\n .filter((x) => x.rule != null)\n .forEach((x) =>\n x.rule.children\n .filter((child) => doesHaveValue(child.scenario))\n .forEach((child) => (result[child.scenario.id] = x.rule))\n )\n return result\n}\n\nexport function getGherkinScenarioLocationMap(\n gherkinDocument: messages.GherkinDocument\n): Record {\n const locationMap: Record = {}\n const scenarioMap: Record =\n getGherkinScenarioMap(gherkinDocument)\n Object.keys(scenarioMap).forEach((id) => {\n const scenario = scenarioMap[id]\n locationMap[id] = scenario.location\n if (doesHaveValue(scenario.examples)) {\n scenario.examples.forEach((x) =>\n x.tableBody.forEach(\n (tableRow) => (locationMap[tableRow.id] = tableRow.location)\n )\n )\n }\n })\n return locationMap\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.d.ts new file mode 100644 index 00000000..52958260 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.d.ts @@ -0,0 +1,10 @@ +import * as GherkinDocumentParser from './gherkin_document_parser'; +import * as PickleParser from './pickle_parser'; +export { parseTestCaseAttempt } from './test_case_attempt_parser'; +export { default as EventDataCollector } from './event_data_collector'; +export { KeywordType, getStepKeywordType } from './keyword_type'; +export { formatIssue, isWarning, isFailure, isIssue } from './issue_helpers'; +export { formatLocation } from './location_helpers'; +export { formatSummary } from './summary_helpers'; +export { getUsage } from './usage_helpers'; +export { GherkinDocumentParser, PickleParser }; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.js new file mode 100644 index 00000000..26fde02e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.js @@ -0,0 +1,62 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PickleParser = exports.GherkinDocumentParser = exports.getUsage = exports.formatSummary = exports.formatLocation = exports.isIssue = exports.isFailure = exports.isWarning = exports.formatIssue = exports.getStepKeywordType = exports.KeywordType = exports.EventDataCollector = exports.parseTestCaseAttempt = void 0; +const GherkinDocumentParser = __importStar(require("./gherkin_document_parser")); +exports.GherkinDocumentParser = GherkinDocumentParser; +const PickleParser = __importStar(require("./pickle_parser")); +exports.PickleParser = PickleParser; +var test_case_attempt_parser_1 = require("./test_case_attempt_parser"); +Object.defineProperty(exports, "parseTestCaseAttempt", { enumerable: true, get: function () { return test_case_attempt_parser_1.parseTestCaseAttempt; } }); +var event_data_collector_1 = require("./event_data_collector"); +Object.defineProperty(exports, "EventDataCollector", { enumerable: true, get: function () { return __importDefault(event_data_collector_1).default; } }); +var keyword_type_1 = require("./keyword_type"); +Object.defineProperty(exports, "KeywordType", { enumerable: true, get: function () { return keyword_type_1.KeywordType; } }); +Object.defineProperty(exports, "getStepKeywordType", { enumerable: true, get: function () { return keyword_type_1.getStepKeywordType; } }); +var issue_helpers_1 = require("./issue_helpers"); +Object.defineProperty(exports, "formatIssue", { enumerable: true, get: function () { return issue_helpers_1.formatIssue; } }); +Object.defineProperty(exports, "isWarning", { enumerable: true, get: function () { return issue_helpers_1.isWarning; } }); +Object.defineProperty(exports, "isFailure", { enumerable: true, get: function () { return issue_helpers_1.isFailure; } }); +Object.defineProperty(exports, "isIssue", { enumerable: true, get: function () { return issue_helpers_1.isIssue; } }); +var location_helpers_1 = require("./location_helpers"); +Object.defineProperty(exports, "formatLocation", { enumerable: true, get: function () { return location_helpers_1.formatLocation; } }); +var summary_helpers_1 = require("./summary_helpers"); +Object.defineProperty(exports, "formatSummary", { enumerable: true, get: function () { return summary_helpers_1.formatSummary; } }); +var usage_helpers_1 = require("./usage_helpers"); +Object.defineProperty(exports, "getUsage", { enumerable: true, get: function () { return usage_helpers_1.getUsage; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.js.map new file mode 100644 index 00000000..d8328572 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formatter/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAAkE;AAUzD,sDAAqB;AAT9B,8DAA+C;AASf,oCAAY;AAP5C,uEAAiE;AAAxD,gIAAA,oBAAoB,OAAA;AAC7B,+DAAsE;AAA7D,2IAAA,OAAO,OAAsB;AACtC,+CAAgE;AAAvD,2GAAA,WAAW,OAAA;AAAE,kHAAA,kBAAkB,OAAA;AACxC,iDAA4E;AAAnE,4GAAA,WAAW,OAAA;AAAE,0GAAA,SAAS,OAAA;AAAE,0GAAA,SAAS,OAAA;AAAE,wGAAA,OAAO,OAAA;AACnD,uDAAmD;AAA1C,kHAAA,cAAc,OAAA;AACvB,qDAAiD;AAAxC,gHAAA,aAAa,OAAA;AACtB,iDAA0C;AAAjC,yGAAA,QAAQ,OAAA","sourcesContent":["import * as GherkinDocumentParser from './gherkin_document_parser'\nimport * as PickleParser from './pickle_parser'\n\nexport { parseTestCaseAttempt } from './test_case_attempt_parser'\nexport { default as EventDataCollector } from './event_data_collector'\nexport { KeywordType, getStepKeywordType } from './keyword_type'\nexport { formatIssue, isWarning, isFailure, isIssue } from './issue_helpers'\nexport { formatLocation } from './location_helpers'\nexport { formatSummary } from './summary_helpers'\nexport { getUsage } from './usage_helpers'\nexport { GherkinDocumentParser, PickleParser }\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.d.ts new file mode 100644 index 00000000..3c6c3fd6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.d.ts @@ -0,0 +1,19 @@ +import * as messages from '@cucumber/messages'; +import { IColorFns } from '../get_color_fns'; +import StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'; +import { SupportCodeLibrary } from '../../support_code_library_builder/types'; +import { ITestCaseAttempt } from './event_data_collector'; +export declare function isFailure(result: messages.TestStepResult, willBeRetried?: boolean): boolean; +export declare function isWarning(result: messages.TestStepResult, willBeRetried?: boolean): boolean; +export declare function isIssue(result: messages.TestStepResult): boolean; +export interface IFormatIssueRequest { + colorFns: IColorFns; + number: number; + snippetBuilder: StepDefinitionSnippetBuilder; + testCaseAttempt: ITestCaseAttempt; + supportCodeLibrary: SupportCodeLibrary; + printAttachments?: boolean; +} +export declare function formatIssue({ colorFns, number, snippetBuilder, testCaseAttempt, supportCodeLibrary, printAttachments, }: IFormatIssueRequest): string; +export declare function formatUndefinedParameterTypes(undefinedParameterTypes: messages.UndefinedParameterType[]): string; +export declare function formatUndefinedParameterType(parameterType: messages.UndefinedParameterType): string; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.js new file mode 100644 index 00000000..e06ed656 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.js @@ -0,0 +1,58 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isFailure = isFailure; +exports.isWarning = isWarning; +exports.isIssue = isIssue; +exports.formatIssue = formatIssue; +exports.formatUndefinedParameterTypes = formatUndefinedParameterTypes; +exports.formatUndefinedParameterType = formatUndefinedParameterType; +const indent_string_1 = __importDefault(require("indent-string")); +const test_case_attempt_formatter_1 = require("./test_case_attempt_formatter"); +function isFailure(result, willBeRetried = false) { + return (result.status === 'AMBIGUOUS' || + result.status === 'UNDEFINED' || + (result.status === 'FAILED' && !willBeRetried)); +} +function isWarning(result, willBeRetried = false) { + return (result.status === 'PENDING' || (result.status === 'FAILED' && willBeRetried)); +} +function isIssue(result) { + return isFailure(result) || isWarning(result); +} +function formatIssue({ colorFns, number, snippetBuilder, testCaseAttempt, supportCodeLibrary, printAttachments = true, }) { + const prefix = `${number.toString()}) `; + const formattedTestCaseAttempt = (0, test_case_attempt_formatter_1.formatTestCaseAttempt)({ + colorFns, + snippetBuilder, + testCaseAttempt, + supportCodeLibrary, + printAttachments, + }); + const lines = formattedTestCaseAttempt.split('\n'); + const updatedLines = lines.map((line, index) => { + if (index === 0) { + return `${prefix}${line}`; + } + return (0, indent_string_1.default)(line, prefix.length); + }); + return updatedLines.join('\n'); +} +function formatUndefinedParameterTypes(undefinedParameterTypes) { + const output = [`Undefined parameter types:\n\n`]; + const withLatest = {}; + undefinedParameterTypes.forEach((parameterType) => { + withLatest[parameterType.name] = parameterType; + }); + output.push(Object.values(withLatest) + .map((parameterType) => `- ${formatUndefinedParameterType(parameterType)}`) + .join('\n')); + output.push('\n\n'); + return output.join(''); +} +function formatUndefinedParameterType(parameterType) { + return `"${parameterType.name}" e.g. \`${parameterType.expression}\``; +} +//# sourceMappingURL=issue_helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.js.map new file mode 100644 index 00000000..947882ef --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/issue_helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"issue_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/issue_helpers.ts"],"names":[],"mappings":";;;;;AAQA,8BASC;AAED,8BAOC;AAED,0BAEC;AAWD,kCAwBC;AAED,sEAiBC;AAED,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C,CAAA;IACF,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAChC,CAAC;AAED,SAAgB,6BAA6B,CAC3C,uBAA0D;IAE1D,MAAM,MAAM,GAAG,CAAC,gCAAgC,CAAC,CAAA;IACjD,MAAM,UAAU,GAAoD,EAAE,CAAA;IACtE,uBAAuB,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;QAChD,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,aAAa,CAAA;IAChD,CAAC,CAAC,CAAA;IACF,MAAM,CAAC,IAAI,CACT,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;SACtB,GAAG,CACF,CAAC,aAAa,EAAE,EAAE,CAAC,KAAK,4BAA4B,CAAC,aAAa,CAAC,EAAE,CACtE;SACA,IAAI,CAAC,IAAI,CAAC,CACd,CAAA;IACD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACnB,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxB,CAAC;AAED,SAAgB,4BAA4B,CAC1C,aAA8C;IAE9C,OAAO,IAAI,aAAa,CAAC,IAAI,YAAY,aAAa,CAAC,UAAU,IAAI,CAAA;AACvE,CAAC","sourcesContent":["import indentString from 'indent-string'\nimport * as messages from '@cucumber/messages'\nimport { IColorFns } from '../get_color_fns'\nimport StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { formatTestCaseAttempt } from './test_case_attempt_formatter'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nexport function isFailure(\n result: messages.TestStepResult,\n willBeRetried: boolean = false\n): boolean {\n return (\n result.status === 'AMBIGUOUS' ||\n result.status === 'UNDEFINED' ||\n (result.status === 'FAILED' && !willBeRetried)\n )\n}\n\nexport function isWarning(\n result: messages.TestStepResult,\n willBeRetried: boolean = false\n): boolean {\n return (\n result.status === 'PENDING' || (result.status === 'FAILED' && willBeRetried)\n )\n}\n\nexport function isIssue(result: messages.TestStepResult): boolean {\n return isFailure(result) || isWarning(result)\n}\n\nexport interface IFormatIssueRequest {\n colorFns: IColorFns\n number: number\n snippetBuilder: StepDefinitionSnippetBuilder\n testCaseAttempt: ITestCaseAttempt\n supportCodeLibrary: SupportCodeLibrary\n printAttachments?: boolean\n}\n\nexport function formatIssue({\n colorFns,\n number,\n snippetBuilder,\n testCaseAttempt,\n supportCodeLibrary,\n printAttachments = true,\n}: IFormatIssueRequest): string {\n const prefix = `${number.toString()}) `\n const formattedTestCaseAttempt = formatTestCaseAttempt({\n colorFns,\n snippetBuilder,\n testCaseAttempt,\n supportCodeLibrary,\n printAttachments,\n })\n const lines = formattedTestCaseAttempt.split('\\n')\n const updatedLines = lines.map((line, index) => {\n if (index === 0) {\n return `${prefix}${line}`\n }\n return indentString(line, prefix.length)\n })\n return updatedLines.join('\\n')\n}\n\nexport function formatUndefinedParameterTypes(\n undefinedParameterTypes: messages.UndefinedParameterType[]\n): string {\n const output = [`Undefined parameter types:\\n\\n`]\n const withLatest: Record = {}\n undefinedParameterTypes.forEach((parameterType) => {\n withLatest[parameterType.name] = parameterType\n })\n output.push(\n Object.values(withLatest)\n .map(\n (parameterType) => `- ${formatUndefinedParameterType(parameterType)}`\n )\n .join('\\n')\n )\n output.push('\\n\\n')\n return output.join('')\n}\n\nexport function formatUndefinedParameterType(\n parameterType: messages.UndefinedParameterType\n): string {\n return `\"${parameterType.name}\" e.g. \\`${parameterType.expression}\\``\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.d.ts new file mode 100644 index 00000000..e38f64eb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.d.ts @@ -0,0 +1,11 @@ +export declare enum KeywordType { + Precondition = "precondition", + Event = "event", + Outcome = "outcome" +} +export interface IGetStepKeywordTypeOptions { + keyword: string; + language: string; + previousKeywordType?: KeywordType; +} +export declare function getStepKeywordType({ keyword, language, previousKeywordType, }: IGetStepKeywordTypeOptions): KeywordType; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.js new file mode 100644 index 00000000..2ebf06c7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.KeywordType = void 0; +exports.getStepKeywordType = getStepKeywordType; +const gherkin_1 = require("@cucumber/gherkin"); +const value_checker_1 = require("../../value_checker"); +var KeywordType; +(function (KeywordType) { + KeywordType["Precondition"] = "precondition"; + KeywordType["Event"] = "event"; + KeywordType["Outcome"] = "outcome"; +})(KeywordType || (exports.KeywordType = KeywordType = {})); +function getStepKeywordType({ keyword, language, previousKeywordType, }) { + const dialect = gherkin_1.dialects[language]; + const stepKeywords = ['given', 'when', 'then', 'and', 'but']; + const type = stepKeywords.find((key) => dialect[key].includes(keyword)); + switch (type) { + case 'when': + return KeywordType.Event; + case 'then': + return KeywordType.Outcome; + case 'and': + case 'but': + if ((0, value_checker_1.doesHaveValue)(previousKeywordType)) { + return previousKeywordType; + } + // fallthrough + default: + return KeywordType.Precondition; + } +} +//# sourceMappingURL=keyword_type.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.js.map new file mode 100644 index 00000000..8a436f05 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/keyword_type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"keyword_type.js","sourceRoot":"","sources":["../../../src/formatter/helpers/keyword_type.ts"],"names":[],"mappings":";;;AAeA,gDAsBC;AArCD,+CAAqD;AACrD,uDAAmD;AAEnD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4CAA6B,CAAA;IAC7B,8BAAe,CAAA;IACf,kCAAmB,CAAA;AACrB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAQD,SAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,mBAAmB,GACQ;IAC3B,MAAM,OAAO,GAAY,kBAAQ,CAAC,QAAQ,CAAC,CAAA;IAC3C,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IACrE,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;IACvE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,KAAK,CAAA;QAC1B,KAAK,MAAM;YACT,OAAO,WAAW,CAAC,OAAO,CAAA;QAC5B,KAAK,KAAK,CAAC;QACX,KAAK,KAAK;YACR,IAAI,IAAA,6BAAa,EAAC,mBAAmB,CAAC,EAAE,CAAC;gBACvC,OAAO,mBAAmB,CAAA;YAC5B,CAAC;QACH,cAAc;QACd;YACE,OAAO,WAAW,CAAC,YAAY,CAAA;IACnC,CAAC;AACH,CAAC","sourcesContent":["import { Dialect, dialects } from '@cucumber/gherkin'\nimport { doesHaveValue } from '../../value_checker'\n\nexport enum KeywordType {\n Precondition = 'precondition',\n Event = 'event',\n Outcome = 'outcome',\n}\n\nexport interface IGetStepKeywordTypeOptions {\n keyword: string\n language: string\n previousKeywordType?: KeywordType\n}\n\nexport function getStepKeywordType({\n keyword,\n language,\n previousKeywordType,\n}: IGetStepKeywordTypeOptions): KeywordType {\n const dialect: Dialect = dialects[language]\n const stepKeywords = ['given', 'when', 'then', 'and', 'but'] as const\n const type = stepKeywords.find((key) => dialect[key].includes(keyword))\n switch (type) {\n case 'when':\n return KeywordType.Event\n case 'then':\n return KeywordType.Outcome\n case 'and':\n case 'but':\n if (doesHaveValue(previousKeywordType)) {\n return previousKeywordType\n }\n // fallthrough\n default:\n return KeywordType.Precondition\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.d.ts new file mode 100644 index 00000000..4936e2de --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.d.ts @@ -0,0 +1,2 @@ +import { ILineAndUri } from '../../types'; +export declare function formatLocation(obj: ILineAndUri, cwd?: string): string; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.js new file mode 100644 index 00000000..1759c508 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.js @@ -0,0 +1,16 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatLocation = formatLocation; +const node_path_1 = __importDefault(require("node:path")); +const value_checker_1 = require("../../value_checker"); +function formatLocation(obj, cwd) { + let uri = obj.uri; + if ((0, value_checker_1.doesHaveValue)(cwd)) { + uri = node_path_1.default.relative(cwd, uri); + } + return `${uri}:${obj.line.toString()}`; +} +//# sourceMappingURL=location_helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.js.map new file mode 100644 index 00000000..624373ab --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/location_helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"location_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/location_helpers.ts"],"names":[],"mappings":";;;;;AAIA,wCAMC;AAVD,0DAA4B;AAC5B,uDAAmD;AAGnD,SAAgB,cAAc,CAAC,GAAgB,EAAE,GAAY;IAC3D,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;IACjB,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,EAAE,CAAC;QACvB,GAAG,GAAG,mBAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC/B,CAAC;IACD,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAA;AACxC,CAAC","sourcesContent":["import path from 'node:path'\nimport { doesHaveValue } from '../../value_checker'\nimport { ILineAndUri } from '../../types'\n\nexport function formatLocation(obj: ILineAndUri, cwd?: string): string {\n let uri = obj.uri\n if (doesHaveValue(cwd)) {\n uri = path.relative(cwd, uri)\n }\n return `${uri}:${obj.line.toString()}`\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.d.ts new file mode 100644 index 00000000..1deedcb0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.d.ts @@ -0,0 +1,17 @@ +import * as messages from '@cucumber/messages'; +export interface IGetPickleLocationRequest { + gherkinDocument: messages.GherkinDocument; + pickle: messages.Pickle; +} +export interface IGetStepKeywordRequest { + pickleStep: messages.PickleStep; + gherkinStepMap: Record; +} +export interface IGetScenarioDescriptionRequest { + pickle: messages.Pickle; + gherkinScenarioMap: Record; +} +export declare function getScenarioDescription({ pickle, gherkinScenarioMap, }: IGetScenarioDescriptionRequest): string; +export declare function getStepKeyword({ pickleStep, gherkinStepMap, }: IGetStepKeywordRequest): string; +export declare function getPickleStepMap(pickle: messages.Pickle): Record; +export declare function getPickleLocation({ gherkinDocument, pickle, }: IGetPickleLocationRequest): messages.Location; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.js new file mode 100644 index 00000000..ecf6bfdb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getScenarioDescription = getScenarioDescription; +exports.getStepKeyword = getStepKeyword; +exports.getPickleStepMap = getPickleStepMap; +exports.getPickleLocation = getPickleLocation; +const gherkin_document_parser_1 = require("./gherkin_document_parser"); +function getScenarioDescription({ pickle, gherkinScenarioMap, }) { + return pickle.astNodeIds + .map((id) => gherkinScenarioMap[id]) + .filter((x) => x != null)[0].description; +} +function getStepKeyword({ pickleStep, gherkinStepMap, }) { + return pickleStep.astNodeIds + .map((id) => gherkinStepMap[id]) + .filter((x) => x != null)[0].keyword; +} +function getPickleStepMap(pickle) { + const result = {}; + pickle.steps.forEach((pickleStep) => (result[pickleStep.id] = pickleStep)); + return result; +} +function getPickleLocation({ gherkinDocument, pickle, }) { + const gherkinScenarioLocationMap = (0, gherkin_document_parser_1.getGherkinScenarioLocationMap)(gherkinDocument); + return gherkinScenarioLocationMap[pickle.astNodeIds[pickle.astNodeIds.length - 1]]; +} +//# sourceMappingURL=pickle_parser.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.js.map new file mode 100644 index 00000000..bbe741f5 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/pickle_parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pickle_parser.js","sourceRoot":"","sources":["../../../src/formatter/helpers/pickle_parser.ts"],"names":[],"mappings":";;AAkBA,wDAOC;AAED,wCAOC;AAED,4CAMC;AAED,8CASC;AApDD,uEAAyE;AAiBzE,SAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,kBAAkB,GACa;IAC/B,OAAO,MAAM,CAAC,UAAU;SACrB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;SACnC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAA;AAC5C,CAAC;AAED,SAAgB,cAAc,CAAC,EAC7B,UAAU,EACV,cAAc,GACS;IACvB,OAAO,UAAU,CAAC,UAAU;SACzB,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;SAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;AACxC,CAAC;AAED,SAAgB,gBAAgB,CAC9B,MAAuB;IAEvB,MAAM,MAAM,GAAwC,EAAE,CAAA;IACtD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAA;IAC1E,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAgB,iBAAiB,CAAC,EAChC,eAAe,EACf,MAAM,GACoB;IAC1B,MAAM,0BAA0B,GAC9B,IAAA,uDAA6B,EAAC,eAAe,CAAC,CAAA;IAChD,OAAO,0BAA0B,CAC/B,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAChD,CAAA;AACH,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { getGherkinScenarioLocationMap } from './gherkin_document_parser'\n\nexport interface IGetPickleLocationRequest {\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n}\n\nexport interface IGetStepKeywordRequest {\n pickleStep: messages.PickleStep\n gherkinStepMap: Record\n}\n\nexport interface IGetScenarioDescriptionRequest {\n pickle: messages.Pickle\n gherkinScenarioMap: Record\n}\n\nexport function getScenarioDescription({\n pickle,\n gherkinScenarioMap,\n}: IGetScenarioDescriptionRequest): string {\n return pickle.astNodeIds\n .map((id) => gherkinScenarioMap[id])\n .filter((x) => x != null)[0].description\n}\n\nexport function getStepKeyword({\n pickleStep,\n gherkinStepMap,\n}: IGetStepKeywordRequest): string {\n return pickleStep.astNodeIds\n .map((id) => gherkinStepMap[id])\n .filter((x) => x != null)[0].keyword\n}\n\nexport function getPickleStepMap(\n pickle: messages.Pickle\n): Record {\n const result: Record = {}\n pickle.steps.forEach((pickleStep) => (result[pickleStep.id] = pickleStep))\n return result\n}\n\nexport function getPickleLocation({\n gherkinDocument,\n pickle,\n}: IGetPickleLocationRequest): messages.Location {\n const gherkinScenarioLocationMap =\n getGherkinScenarioLocationMap(gherkinDocument)\n return gherkinScenarioLocationMap[\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n ]\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.d.ts new file mode 100644 index 00000000..6fc23cc4 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.d.ts @@ -0,0 +1,2 @@ +import * as messages from '@cucumber/messages'; +export declare function formatStepArgument(arg: messages.PickleStepArgument): string; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.js new file mode 100644 index 00000000..560b9438 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.js @@ -0,0 +1,47 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatStepArgument = formatStepArgument; +const cli_table3_1 = __importDefault(require("cli-table3")); +const step_arguments_1 = require("../../step_arguments"); +function formatDataTable(dataTable) { + const table = new cli_table3_1.default({ + chars: { + bottom: '', + 'bottom-left': '', + 'bottom-mid': '', + 'bottom-right': '', + left: '|', + 'left-mid': '', + mid: '', + 'mid-mid': '', + middle: '|', + right: '|', + 'right-mid': '', + top: '', + 'top-left': '', + 'top-mid': '', + 'top-right': '', + }, + style: { + border: [], + 'padding-left': 1, + 'padding-right': 1, + }, + }); + const rows = dataTable.rows.map((row) => row.cells.map((cell) => cell.value.replace(/\\/g, '\\\\').replace(/\n/g, '\\n'))); + table.push(...rows); + return table.toString(); +} +function formatDocString(docString) { + return `"""\n${docString.content}\n"""`; +} +function formatStepArgument(arg) { + return (0, step_arguments_1.parseStepArgument)(arg, { + dataTable: formatDataTable, + docString: formatDocString, + }); +} +//# sourceMappingURL=step_argument_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.js.map new file mode 100644 index 00000000..038c1024 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/step_argument_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"step_argument_formatter.js","sourceRoot":"","sources":["../../../src/formatter/helpers/step_argument_formatter.ts"],"names":[],"mappings":";;;;;AA0CA,gDAKC;AA/CD,4DAA8B;AAE9B,yDAAwD;AAExD,SAAS,eAAe,CAAC,SAA+B;IACtD,MAAM,KAAK,GAAG,IAAI,oBAAK,CAAC;QACtB,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,aAAa,EAAE,EAAE;YACjB,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,EAAE;YAClB,IAAI,EAAE,GAAG;YACT,UAAU,EAAE,EAAE;YACd,GAAG,EAAE,EAAE;YACP,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,GAAG;YACX,KAAK,EAAE,GAAG;YACV,WAAW,EAAE,EAAE;YACf,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,EAAE;SAChB;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,CAAC;SACnB;KACF,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACtC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CACxD,CACF,CAAA;IACD,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;IACnB,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;AACzB,CAAC;AAED,SAAS,eAAe,CAAC,SAAmC;IAC1D,OAAO,QAAQ,SAAS,CAAC,OAAO,OAAO,CAAA;AACzC,CAAC;AAED,SAAgB,kBAAkB,CAAC,GAAgC;IACjE,OAAO,IAAA,kCAAiB,EAAC,GAAG,EAAE;QAC5B,SAAS,EAAE,eAAe;QAC1B,SAAS,EAAE,eAAe;KAC3B,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import Table from 'cli-table3'\nimport * as messages from '@cucumber/messages'\nimport { parseStepArgument } from '../../step_arguments'\n\nfunction formatDataTable(dataTable: messages.PickleTable): string {\n const table = new Table({\n chars: {\n bottom: '',\n 'bottom-left': '',\n 'bottom-mid': '',\n 'bottom-right': '',\n left: '|',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n middle: '|',\n right: '|',\n 'right-mid': '',\n top: '',\n 'top-left': '',\n 'top-mid': '',\n 'top-right': '',\n },\n style: {\n border: [],\n 'padding-left': 1,\n 'padding-right': 1,\n },\n })\n const rows = dataTable.rows.map((row) =>\n row.cells.map((cell) =>\n cell.value.replace(/\\\\/g, '\\\\\\\\').replace(/\\n/g, '\\\\n')\n )\n )\n table.push(...rows)\n return table.toString()\n}\n\nfunction formatDocString(docString: messages.PickleDocString): string {\n return `\"\"\"\\n${docString.content}\\n\"\"\"`\n}\n\nexport function formatStepArgument(arg: messages.PickleStepArgument): string {\n return parseStepArgument(arg, {\n dataTable: formatDataTable,\n docString: formatDocString,\n })\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.d.ts new file mode 100644 index 00000000..60f11e98 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.d.ts @@ -0,0 +1,9 @@ +import * as messages from '@cucumber/messages'; +import { IColorFns } from '../get_color_fns'; +import { ITestCaseAttempt } from './event_data_collector'; +export interface IFormatSummaryRequest { + colorFns: IColorFns; + testCaseAttempts: ITestCaseAttempt[]; + testRunDuration: messages.Duration; +} +export declare function formatSummary({ colorFns, testCaseAttempts, testRunDuration, }: IFormatSummaryRequest): string; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.js new file mode 100644 index 00000000..74fe84f6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.js @@ -0,0 +1,106 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatSummary = formatSummary; +const messages = __importStar(require("@cucumber/messages")); +const luxon_1 = require("luxon"); +const value_checker_1 = require("../../value_checker"); +const STATUS_REPORT_ORDER = [ + messages.TestStepResultStatus.FAILED, + messages.TestStepResultStatus.AMBIGUOUS, + messages.TestStepResultStatus.UNDEFINED, + messages.TestStepResultStatus.PENDING, + messages.TestStepResultStatus.SKIPPED, + messages.TestStepResultStatus.PASSED, + messages.TestStepResultStatus.UNKNOWN, +]; +function formatSummary({ colorFns, testCaseAttempts, testRunDuration, }) { + const testCaseResults = []; + const testStepResults = []; + let totalStepDuration = messages.TimeConversion.millisecondsToDuration(0); + testCaseAttempts.forEach(({ testCase, willBeRetried, worstTestStepResult, stepResults }) => { + Object.values(stepResults).forEach((stepResult) => { + totalStepDuration = messages.TimeConversion.addDurations(totalStepDuration, stepResult.duration); + }); + if (!willBeRetried) { + testCaseResults.push(worstTestStepResult); + testCase.testSteps.forEach((testStep) => { + if ((0, value_checker_1.doesHaveValue)(testStep.pickleStepId)) { + testStepResults.push(stepResults[testStep.id]); + } + }); + } + }); + const scenarioSummary = getCountSummary({ + colorFns, + objects: testCaseResults, + type: 'scenario', + }); + const stepSummary = getCountSummary({ + colorFns, + objects: testStepResults, + type: 'step', + }); + const durationSummary = `${getDurationSummary(testRunDuration)} (executing steps: ${getDurationSummary(totalStepDuration)})\n`; + return [scenarioSummary, stepSummary, durationSummary].join('\n'); +} +function getCountSummary({ colorFns, objects, type, }) { + const counts = {}; + STATUS_REPORT_ORDER.forEach((x) => (counts[x] = 0)); + objects.forEach((x) => (counts[x.status] += 1)); + const total = Object.values(counts).reduce((acc, x) => acc + x, 0); + let text = `${total.toString()} ${type}${total === 1 ? '' : 's'}`; + if (total > 0) { + const details = []; + STATUS_REPORT_ORDER.forEach((status) => { + if (counts[status] > 0) { + details.push(colorFns.forStatus(status)(`${counts[status].toString()} ${status.toLowerCase()}`)); + } + }); + text += ` (${details.join(', ')})`; + } + return text; +} +function getDurationSummary(durationMsg) { + const start = new Date(0); + const end = new Date(messages.TimeConversion.durationToMilliseconds(durationMsg)); + const duration = luxon_1.Interval.fromDateTimes(start, end).toDuration([ + 'minutes', + 'seconds', + 'milliseconds', + ]); + return duration.toFormat("m'm'ss.SSS's'"); +} +//# sourceMappingURL=summary_helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.js.map new file mode 100644 index 00000000..ab384f70 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/summary_helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"summary_helpers.js","sourceRoot":"","sources":["../../../src/formatter/helpers/summary_helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,sCAwCC;AA9DD,6DAA8C;AAC9C,iCAAgC;AAEhC,uDAAmD;AAGnD,MAAM,mBAAmB,GAAG;IAC1B,QAAQ,CAAC,oBAAoB,CAAC,MAAM;IACpC,QAAQ,CAAC,oBAAoB,CAAC,SAAS;IACvC,QAAQ,CAAC,oBAAoB,CAAC,SAAS;IACvC,QAAQ,CAAC,oBAAoB,CAAC,OAAO;IACrC,QAAQ,CAAC,oBAAoB,CAAC,OAAO;IACrC,QAAQ,CAAC,oBAAoB,CAAC,MAAM;IACpC,QAAQ,CAAC,oBAAoB,CAAC,OAAO;CACtC,CAAA;AAQD,SAAgB,aAAa,CAAC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C,GAAG,CAAA;IACpC,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,kBAAkB,CAAC,WAA8B;IACxD,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAA;IACzB,MAAM,GAAG,GAAG,IAAI,IAAI,CAClB,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAC5D,CAAA;IACD,MAAM,QAAQ,GAAG,gBAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC;QAC7D,SAAS;QACT,SAAS;QACT,cAAc;KACf,CAAC,CAAA;IACF,OAAO,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;AAC3C,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { Interval } from 'luxon'\nimport { IColorFns } from '../get_color_fns'\nimport { doesHaveValue } from '../../value_checker'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nconst STATUS_REPORT_ORDER = [\n messages.TestStepResultStatus.FAILED,\n messages.TestStepResultStatus.AMBIGUOUS,\n messages.TestStepResultStatus.UNDEFINED,\n messages.TestStepResultStatus.PENDING,\n messages.TestStepResultStatus.SKIPPED,\n messages.TestStepResultStatus.PASSED,\n messages.TestStepResultStatus.UNKNOWN,\n]\n\nexport interface IFormatSummaryRequest {\n colorFns: IColorFns\n testCaseAttempts: ITestCaseAttempt[]\n testRunDuration: messages.Duration\n}\n\nexport function formatSummary({\n colorFns,\n testCaseAttempts,\n testRunDuration,\n}: IFormatSummaryRequest): string {\n const testCaseResults: messages.TestStepResult[] = []\n const testStepResults: messages.TestStepResult[] = []\n let totalStepDuration = messages.TimeConversion.millisecondsToDuration(0)\n testCaseAttempts.forEach(\n ({ testCase, willBeRetried, worstTestStepResult, stepResults }) => {\n Object.values(stepResults).forEach((stepResult) => {\n totalStepDuration = messages.TimeConversion.addDurations(\n totalStepDuration,\n stepResult.duration\n )\n })\n if (!willBeRetried) {\n testCaseResults.push(worstTestStepResult)\n testCase.testSteps.forEach((testStep) => {\n if (doesHaveValue(testStep.pickleStepId)) {\n testStepResults.push(stepResults[testStep.id])\n }\n })\n }\n }\n )\n const scenarioSummary = getCountSummary({\n colorFns,\n objects: testCaseResults,\n type: 'scenario',\n })\n const stepSummary = getCountSummary({\n colorFns,\n objects: testStepResults,\n type: 'step',\n })\n const durationSummary = `${getDurationSummary(\n testRunDuration\n )} (executing steps: ${getDurationSummary(totalStepDuration)})\\n`\n return [scenarioSummary, stepSummary, durationSummary].join('\\n')\n}\n\ninterface IGetCountSummaryRequest {\n colorFns: IColorFns\n objects: messages.TestStepResult[]\n type: string\n}\n\nfunction getCountSummary({\n colorFns,\n objects,\n type,\n}: IGetCountSummaryRequest): string {\n const counts: Record = {}\n STATUS_REPORT_ORDER.forEach((x) => (counts[x] = 0))\n objects.forEach((x) => (counts[x.status] += 1))\n const total = Object.values(counts).reduce((acc, x) => acc + x, 0)\n let text = `${total.toString()} ${type}${total === 1 ? '' : 's'}`\n if (total > 0) {\n const details: string[] = []\n STATUS_REPORT_ORDER.forEach((status) => {\n if (counts[status] > 0) {\n details.push(\n colorFns.forStatus(status)(\n `${counts[status].toString()} ${status.toLowerCase()}`\n )\n )\n }\n })\n text += ` (${details.join(', ')})`\n }\n return text\n}\n\nfunction getDurationSummary(durationMsg: messages.Duration): string {\n const start = new Date(0)\n const end = new Date(\n messages.TimeConversion.durationToMilliseconds(durationMsg)\n )\n const duration = Interval.fromDateTimes(start, end).toDuration([\n 'minutes',\n 'seconds',\n 'milliseconds',\n ])\n return duration.toFormat(\"m'm'ss.SSS's'\")\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.d.ts new file mode 100644 index 00000000..1f664b0a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.d.ts @@ -0,0 +1,12 @@ +import { IColorFns } from '../get_color_fns'; +import StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'; +import { SupportCodeLibrary } from '../../support_code_library_builder/types'; +import { ITestCaseAttempt } from './event_data_collector'; +export interface IFormatTestCaseAttemptRequest { + colorFns: IColorFns; + testCaseAttempt: ITestCaseAttempt; + snippetBuilder: StepDefinitionSnippetBuilder; + supportCodeLibrary: SupportCodeLibrary; + printAttachments?: boolean; +} +export declare function formatTestCaseAttempt({ colorFns, snippetBuilder, supportCodeLibrary, testCaseAttempt, printAttachments, }: IFormatTestCaseAttemptRequest): string; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.js new file mode 100644 index 00000000..d28ab2eb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.js @@ -0,0 +1,123 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatTestCaseAttempt = formatTestCaseAttempt; +const indent_string_1 = __importDefault(require("indent-string")); +const messages = __importStar(require("@cucumber/messages")); +const figures_1 = __importDefault(require("figures")); +const value_checker_1 = require("../../value_checker"); +const location_helpers_1 = require("./location_helpers"); +const test_case_attempt_parser_1 = require("./test_case_attempt_parser"); +const step_argument_formatter_1 = require("./step_argument_formatter"); +const CHARACTERS = new Map([ + [messages.TestStepResultStatus.AMBIGUOUS, figures_1.default.cross], + [messages.TestStepResultStatus.FAILED, figures_1.default.cross], + [messages.TestStepResultStatus.PASSED, figures_1.default.tick], + [messages.TestStepResultStatus.PENDING, '?'], + [messages.TestStepResultStatus.SKIPPED, '-'], + [messages.TestStepResultStatus.UNDEFINED, '?'], +]); +function getStepMessage(testStep) { + switch (testStep.result.status) { + case messages.TestStepResultStatus.AMBIGUOUS: + case messages.TestStepResultStatus.FAILED: + return testStep.result.message; + case messages.TestStepResultStatus.UNDEFINED: + return `${'Undefined. Implement with the following snippet:' + '\n\n'}${(0, indent_string_1.default)(testStep.snippet, 2)}\n`; + case messages.TestStepResultStatus.PENDING: + return 'Pending'; + } + return ''; +} +function formatStep({ colorFns, testStep, printAttachments, }) { + const { name, result: { status }, actionLocation, attachments, } = testStep; + const colorFn = colorFns.forStatus(status); + const identifier = testStep.keyword + (0, value_checker_1.valueOrDefault)(testStep.text, ''); + let text = colorFn(`${CHARACTERS.get(status)} ${identifier}`); + if ((0, value_checker_1.doesHaveValue)(name)) { + text += colorFn(` (${name})`); + } + if ((0, value_checker_1.doesHaveValue)(actionLocation)) { + text += ` # ${colorFns.location((0, location_helpers_1.formatLocation)(actionLocation))}`; + } + text += '\n'; + if ((0, value_checker_1.doesHaveValue)(testStep.argument)) { + const argumentsText = (0, step_argument_formatter_1.formatStepArgument)(testStep.argument); + text += (0, indent_string_1.default)(`${colorFn(argumentsText)}\n`, 4); + } + if ((0, value_checker_1.valueOrDefault)(printAttachments, true)) { + attachments.forEach(({ body, mediaType, fileName }) => { + let message = ''; + if (mediaType === 'text/plain') { + message = `: ${body}`; + } + else if (fileName) { + message = `: ${fileName}`; + } + text += (0, indent_string_1.default)(`Attachment (${mediaType})${message}\n`, 4); + }); + } + const message = getStepMessage(testStep); + if (message !== '') { + text += `${(0, indent_string_1.default)(colorFn(message), 4)}\n`; + } + return text; +} +function formatTestCaseAttempt({ colorFns, snippetBuilder, supportCodeLibrary, testCaseAttempt, printAttachments, }) { + const parsed = (0, test_case_attempt_parser_1.parseTestCaseAttempt)({ + snippetBuilder, + testCaseAttempt, + supportCodeLibrary, + }); + let text = `Scenario: ${parsed.testCase.name}`; + text += getAttemptText(parsed.testCase.attempt, testCaseAttempt.willBeRetried); + text += ` # ${colorFns.location((0, location_helpers_1.formatLocation)(parsed.testCase.sourceLocation))}\n`; + parsed.testSteps.forEach((testStep) => { + text += formatStep({ colorFns, testStep, printAttachments }); + }); + return `${text}\n`; +} +function getAttemptText(attempt, willBeRetried) { + if (attempt > 0 || willBeRetried) { + const numberStr = (attempt + 1).toString(); + const retriedStr = willBeRetried ? ', retried' : ''; + return ` (attempt ${numberStr}${retriedStr})`; + } + return ''; +} +//# sourceMappingURL=test_case_attempt_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.js.map new file mode 100644 index 00000000..bd77e4c4 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_case_attempt_formatter.js","sourceRoot":"","sources":["../../../src/formatter/helpers/test_case_attempt_formatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C7D,IAAI,OAAO,GAAG,CAAC,IAAI,aAAa,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;QAC1C,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAA;QACnD,OAAO,aAAa,SAAS,GAAG,UAAU,GAAG,CAAA;IAC/C,CAAC;IACD,OAAO,EAAE,CAAA;AACX,CAAC","sourcesContent":["import indentString from 'indent-string'\nimport * as messages from '@cucumber/messages'\nimport figures from 'figures'\nimport { IColorFns } from '../get_color_fns'\nimport { doesHaveValue, valueOrDefault } from '../../value_checker'\nimport StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { formatLocation } from './location_helpers'\nimport {\n IParsedTestStep,\n parseTestCaseAttempt,\n} from './test_case_attempt_parser'\nimport { formatStepArgument } from './step_argument_formatter'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nconst CHARACTERS: Map = new Map([\n [messages.TestStepResultStatus.AMBIGUOUS, figures.cross],\n [messages.TestStepResultStatus.FAILED, figures.cross],\n [messages.TestStepResultStatus.PASSED, figures.tick],\n [messages.TestStepResultStatus.PENDING, '?'],\n [messages.TestStepResultStatus.SKIPPED, '-'],\n [messages.TestStepResultStatus.UNDEFINED, '?'],\n])\n\nfunction getStepMessage(testStep: IParsedTestStep): string {\n switch (testStep.result.status) {\n case messages.TestStepResultStatus.AMBIGUOUS:\n case messages.TestStepResultStatus.FAILED:\n return testStep.result.message\n case messages.TestStepResultStatus.UNDEFINED:\n return `${\n 'Undefined. Implement with the following snippet:' + '\\n\\n'\n }${indentString(testStep.snippet, 2)}\\n`\n case messages.TestStepResultStatus.PENDING:\n return 'Pending'\n }\n return ''\n}\n\ninterface IFormatStepRequest {\n colorFns: IColorFns\n testStep: IParsedTestStep\n printAttachments?: boolean\n}\n\nfunction formatStep({\n colorFns,\n testStep,\n printAttachments,\n}: IFormatStepRequest): string {\n const {\n name,\n result: { status },\n actionLocation,\n attachments,\n } = testStep\n const colorFn = colorFns.forStatus(status)\n const identifier = testStep.keyword + valueOrDefault(testStep.text, '')\n let text = colorFn(`${CHARACTERS.get(status)} ${identifier}`)\n if (doesHaveValue(name)) {\n text += colorFn(` (${name})`)\n }\n if (doesHaveValue(actionLocation)) {\n text += ` # ${colorFns.location(formatLocation(actionLocation))}`\n }\n text += '\\n'\n if (doesHaveValue(testStep.argument)) {\n const argumentsText = formatStepArgument(testStep.argument)\n text += indentString(`${colorFn(argumentsText)}\\n`, 4)\n }\n if (valueOrDefault(printAttachments, true)) {\n attachments.forEach(({ body, mediaType, fileName }) => {\n let message = ''\n if (mediaType === 'text/plain') {\n message = `: ${body}`\n } else if (fileName) {\n message = `: ${fileName}`\n }\n text += indentString(`Attachment (${mediaType})${message}\\n`, 4)\n })\n }\n const message = getStepMessage(testStep)\n if (message !== '') {\n text += `${indentString(colorFn(message), 4)}\\n`\n }\n return text\n}\n\nexport interface IFormatTestCaseAttemptRequest {\n colorFns: IColorFns\n testCaseAttempt: ITestCaseAttempt\n snippetBuilder: StepDefinitionSnippetBuilder\n supportCodeLibrary: SupportCodeLibrary\n printAttachments?: boolean\n}\n\nexport function formatTestCaseAttempt({\n colorFns,\n snippetBuilder,\n supportCodeLibrary,\n testCaseAttempt,\n printAttachments,\n}: IFormatTestCaseAttemptRequest): string {\n const parsed = parseTestCaseAttempt({\n snippetBuilder,\n testCaseAttempt,\n supportCodeLibrary,\n })\n let text = `Scenario: ${parsed.testCase.name}`\n text += getAttemptText(parsed.testCase.attempt, testCaseAttempt.willBeRetried)\n text += ` # ${colorFns.location(\n formatLocation(parsed.testCase.sourceLocation)\n )}\\n`\n parsed.testSteps.forEach((testStep) => {\n text += formatStep({ colorFns, testStep, printAttachments })\n })\n return `${text}\\n`\n}\n\nfunction getAttemptText(attempt: number, willBeRetried: boolean): string {\n if (attempt > 0 || willBeRetried) {\n const numberStr = (attempt + 1).toString()\n const retriedStr = willBeRetried ? ', retried' : ''\n return ` (attempt ${numberStr}${retriedStr})`\n }\n return ''\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.d.ts new file mode 100644 index 00000000..50bcef01 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.d.ts @@ -0,0 +1,32 @@ +import * as messages from '@cucumber/messages'; +import StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'; +import { SupportCodeLibrary } from '../../support_code_library_builder/types'; +import { ILineAndUri } from '../../types'; +import { ITestCaseAttempt } from './event_data_collector'; +export interface IParsedTestStep { + actionLocation?: ILineAndUri; + argument?: messages.PickleStepArgument; + attachments: messages.Attachment[]; + keyword: string; + name?: string; + result: messages.TestStepResult; + snippet?: string; + sourceLocation?: ILineAndUri; + text?: string; +} +export interface IParsedTestCase { + attempt: number; + name: string; + sourceLocation?: ILineAndUri; + worstTestStepResult: messages.TestStepResult; +} +export interface IParsedTestCaseAttempt { + testCase: IParsedTestCase; + testSteps: IParsedTestStep[]; +} +export interface IParseTestCaseAttemptRequest { + testCaseAttempt: ITestCaseAttempt; + snippetBuilder: StepDefinitionSnippetBuilder; + supportCodeLibrary: SupportCodeLibrary; +} +export declare function parseTestCaseAttempt({ testCaseAttempt, snippetBuilder, supportCodeLibrary, }: IParseTestCaseAttemptRequest): IParsedTestCaseAttempt; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.js new file mode 100644 index 00000000..2987c4b6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.js @@ -0,0 +1,144 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseTestCaseAttempt = parseTestCaseAttempt; +const messages = __importStar(require("@cucumber/messages")); +const messages_1 = require("@cucumber/messages"); +const value_checker_1 = require("../../value_checker"); +const keyword_type_1 = require("./keyword_type"); +const gherkin_document_parser_1 = require("./gherkin_document_parser"); +const pickle_parser_1 = require("./pickle_parser"); +function parseStep({ isBeforeHook, gherkinStepMap, keyword, keywordType, pickleStep, pickleUri, snippetBuilder, supportCodeLibrary, testStep, testStepResult, testStepAttachments, }) { + const out = { + attachments: testStepAttachments, + keyword: (0, value_checker_1.doesHaveValue)(testStep.pickleStepId) + ? keyword + : isBeforeHook + ? 'Before' + : 'After', + result: testStepResult, + }; + if ((0, value_checker_1.doesHaveValue)(testStep.hookId)) { + let hookDefinition; + if (isBeforeHook) { + hookDefinition = supportCodeLibrary.beforeTestCaseHookDefinitions.find((x) => x.id === testStep.hookId); + } + else { + hookDefinition = supportCodeLibrary.afterTestCaseHookDefinitions.find((x) => x.id === testStep.hookId); + } + out.actionLocation = { + uri: hookDefinition.uri, + line: hookDefinition.line, + }; + out.name = hookDefinition.name; + } + if ((0, value_checker_1.doesHaveValue)(testStep.stepDefinitionIds) && + testStep.stepDefinitionIds.length === 1) { + const stepDefinition = supportCodeLibrary.stepDefinitions.find((x) => x.id === testStep.stepDefinitionIds[0]); + out.actionLocation = { + uri: stepDefinition.uri, + line: stepDefinition.line, + }; + } + if ((0, value_checker_1.doesHaveValue)(testStep.pickleStepId)) { + out.sourceLocation = { + uri: pickleUri, + line: gherkinStepMap[pickleStep.astNodeIds[0]].location.line, + }; + out.text = pickleStep.text; + if ((0, value_checker_1.doesHaveValue)(pickleStep.argument)) { + out.argument = pickleStep.argument; + } + } + if (testStepResult.status === messages.TestStepResultStatus.UNDEFINED) { + out.snippet = snippetBuilder.build({ keywordType, pickleStep }); + } + return out; +} +// Converts a testCaseAttempt into a json object with all data needed for +// displaying it in a pretty format +function parseTestCaseAttempt({ testCaseAttempt, snippetBuilder, supportCodeLibrary, }) { + const { testCase, pickle, gherkinDocument } = testCaseAttempt; + const gherkinStepMap = (0, gherkin_document_parser_1.getGherkinStepMap)(gherkinDocument); + const gherkinScenarioLocationMap = (0, gherkin_document_parser_1.getGherkinScenarioLocationMap)(gherkinDocument); + const pickleStepMap = (0, pickle_parser_1.getPickleStepMap)(pickle); + const relativePickleUri = pickle.uri; + const parsedTestCase = { + attempt: testCaseAttempt.attempt, + name: pickle.name, + sourceLocation: { + uri: relativePickleUri, + line: gherkinScenarioLocationMap[pickle.astNodeIds[pickle.astNodeIds.length - 1]].line, + }, + worstTestStepResult: testCaseAttempt.worstTestStepResult, + }; + const parsedTestSteps = []; + let isBeforeHook = true; + let previousKeywordType = keyword_type_1.KeywordType.Precondition; + testCase.testSteps.forEach((testStep) => { + const testStepResult = testCaseAttempt.stepResults[testStep.id] || new messages_1.TestStepResult(); + isBeforeHook = isBeforeHook && (0, value_checker_1.doesHaveValue)(testStep.hookId); + let keyword, keywordType, pickleStep; + if ((0, value_checker_1.doesHaveValue)(testStep.pickleStepId)) { + pickleStep = pickleStepMap[testStep.pickleStepId]; + keyword = (0, pickle_parser_1.getStepKeyword)({ pickleStep, gherkinStepMap }); + keywordType = (0, keyword_type_1.getStepKeywordType)({ + keyword, + language: gherkinDocument.feature.language, + previousKeywordType, + }); + } + const parsedStep = parseStep({ + isBeforeHook, + gherkinStepMap, + keyword, + keywordType, + pickleStep, + pickleUri: relativePickleUri, + snippetBuilder, + supportCodeLibrary, + testStep, + testStepResult, + testStepAttachments: (0, value_checker_1.valueOrDefault)(testCaseAttempt.stepAttachments[testStep.id], []), + }); + parsedTestSteps.push(parsedStep); + previousKeywordType = keywordType; + }); + return { + testCase: parsedTestCase, + testSteps: parsedTestSteps, + }; +} +//# sourceMappingURL=test_case_attempt_parser.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.js.map new file mode 100644 index 00000000..672d7c38 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/test_case_attempt_parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_case_attempt_parser.js","sourceRoot":"","sources":["../../../src/formatter/helpers/test_case_attempt_parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIA,oDAiEC;AAjMD,6DAA8C;AAC9C,iDAAmD;AAGnD,uDAAmE;AAGnE,iDAAgE;AAChE,uEAGkC;AAClC,mDAAkE;AAyClE,SAAS,SAAS,CAAC,EACjB,YAAY,EACZ,cAAc,EACd,OAAO,EACP,WAAW,EACX,UAAU,EACV,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,mBAAmB,GACD;IAClB,MAAM,GAAG,GAAoB;QAC3B,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,IAAA,6B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AC,IAAI,CAAC,UAAU,CAAC,CAAA;QAChC,mBAAmB,GAAG,WAAW,CAAA;IACnC,CAAC,CAAC,CAAA;IACF,OAAO;QACL,QAAQ,EAAE,cAAc;QACxB,SAAS,EAAE,eAAe;KAC3B,CAAA;AACH,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { TestStepResult } from '@cucumber/messages'\nimport StepDefinitionSnippetBuilder from '../step_definition_snippet_builder'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { doesHaveValue, valueOrDefault } from '../../value_checker'\nimport TestCaseHookDefinition from '../../models/test_case_hook_definition'\nimport { ILineAndUri } from '../../types'\nimport { getStepKeywordType, KeywordType } from './keyword_type'\nimport {\n getGherkinScenarioLocationMap,\n getGherkinStepMap,\n} from './gherkin_document_parser'\nimport { getPickleStepMap, getStepKeyword } from './pickle_parser'\nimport { ITestCaseAttempt } from './event_data_collector'\n\nexport interface IParsedTestStep {\n actionLocation?: ILineAndUri\n argument?: messages.PickleStepArgument\n attachments: messages.Attachment[]\n keyword: string\n name?: string\n result: messages.TestStepResult\n snippet?: string\n sourceLocation?: ILineAndUri\n text?: string\n}\n\nexport interface IParsedTestCase {\n attempt: number\n name: string\n sourceLocation?: ILineAndUri\n worstTestStepResult: messages.TestStepResult\n}\n\nexport interface IParsedTestCaseAttempt {\n testCase: IParsedTestCase\n testSteps: IParsedTestStep[]\n}\n\ninterface IParseStepRequest {\n isBeforeHook: boolean\n gherkinStepMap: Record\n keyword: string\n keywordType: KeywordType\n pickleStep: messages.PickleStep\n pickleUri: string\n snippetBuilder: StepDefinitionSnippetBuilder\n supportCodeLibrary: SupportCodeLibrary\n testStep: messages.TestStep\n testStepResult: messages.TestStepResult\n testStepAttachments: messages.Attachment[]\n}\n\nfunction parseStep({\n isBeforeHook,\n gherkinStepMap,\n keyword,\n keywordType,\n pickleStep,\n pickleUri,\n snippetBuilder,\n supportCodeLibrary,\n testStep,\n testStepResult,\n testStepAttachments,\n}: IParseStepRequest): IParsedTestStep {\n const out: IParsedTestStep = {\n attachments: testStepAttachments,\n keyword: doesHaveValue(testStep.pickleStepId)\n ? keyword\n : isBeforeHook\n ? 'Before'\n : 'After',\n result: testStepResult,\n }\n if (doesHaveValue(testStep.hookId)) {\n let hookDefinition: TestCaseHookDefinition\n if (isBeforeHook) {\n hookDefinition = supportCodeLibrary.beforeTestCaseHookDefinitions.find(\n (x) => x.id === testStep.hookId\n )\n } else {\n hookDefinition = supportCodeLibrary.afterTestCaseHookDefinitions.find(\n (x) => x.id === testStep.hookId\n )\n }\n out.actionLocation = {\n uri: hookDefinition.uri,\n line: hookDefinition.line,\n }\n out.name = hookDefinition.name\n }\n if (\n doesHaveValue(testStep.stepDefinitionIds) &&\n testStep.stepDefinitionIds.length === 1\n ) {\n const stepDefinition = supportCodeLibrary.stepDefinitions.find(\n (x) => x.id === testStep.stepDefinitionIds[0]\n )\n out.actionLocation = {\n uri: stepDefinition.uri,\n line: stepDefinition.line,\n }\n }\n if (doesHaveValue(testStep.pickleStepId)) {\n out.sourceLocation = {\n uri: pickleUri,\n line: gherkinStepMap[pickleStep.astNodeIds[0]].location.line,\n }\n out.text = pickleStep.text\n if (doesHaveValue(pickleStep.argument)) {\n out.argument = pickleStep.argument\n }\n }\n if (testStepResult.status === messages.TestStepResultStatus.UNDEFINED) {\n out.snippet = snippetBuilder.build({ keywordType, pickleStep })\n }\n return out\n}\n\nexport interface IParseTestCaseAttemptRequest {\n testCaseAttempt: ITestCaseAttempt\n snippetBuilder: StepDefinitionSnippetBuilder\n supportCodeLibrary: SupportCodeLibrary\n}\n\n// Converts a testCaseAttempt into a json object with all data needed for\n// displaying it in a pretty format\nexport function parseTestCaseAttempt({\n testCaseAttempt,\n snippetBuilder,\n supportCodeLibrary,\n}: IParseTestCaseAttemptRequest): IParsedTestCaseAttempt {\n const { testCase, pickle, gherkinDocument } = testCaseAttempt\n const gherkinStepMap = getGherkinStepMap(gherkinDocument)\n const gherkinScenarioLocationMap =\n getGherkinScenarioLocationMap(gherkinDocument)\n const pickleStepMap = getPickleStepMap(pickle)\n const relativePickleUri = pickle.uri\n const parsedTestCase: IParsedTestCase = {\n attempt: testCaseAttempt.attempt,\n name: pickle.name,\n sourceLocation: {\n uri: relativePickleUri,\n line: gherkinScenarioLocationMap[\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n ].line,\n },\n worstTestStepResult: testCaseAttempt.worstTestStepResult,\n }\n const parsedTestSteps: IParsedTestStep[] = []\n let isBeforeHook = true\n let previousKeywordType = KeywordType.Precondition\n\n testCase.testSteps.forEach((testStep) => {\n const testStepResult =\n testCaseAttempt.stepResults[testStep.id] || new TestStepResult()\n\n isBeforeHook = isBeforeHook && doesHaveValue(testStep.hookId)\n\n let keyword, keywordType, pickleStep\n if (doesHaveValue(testStep.pickleStepId)) {\n pickleStep = pickleStepMap[testStep.pickleStepId]\n keyword = getStepKeyword({ pickleStep, gherkinStepMap })\n keywordType = getStepKeywordType({\n keyword,\n language: gherkinDocument.feature.language,\n previousKeywordType,\n })\n }\n const parsedStep = parseStep({\n isBeforeHook,\n gherkinStepMap,\n keyword,\n keywordType,\n pickleStep,\n pickleUri: relativePickleUri,\n snippetBuilder,\n supportCodeLibrary,\n testStep,\n testStepResult,\n testStepAttachments: valueOrDefault(\n testCaseAttempt.stepAttachments[testStep.id],\n []\n ),\n })\n parsedTestSteps.push(parsedStep)\n previousKeywordType = keywordType\n })\n return {\n testCase: parsedTestCase,\n testSteps: parsedTestSteps,\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.d.ts new file mode 100644 index 00000000..5463d6e8 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.d.ts @@ -0,0 +1,23 @@ +import * as messages from '@cucumber/messages'; +import StepDefinition from '../../../models/step_definition'; +import EventDataCollector from '../event_data_collector'; +export interface IUsageMatch { + duration?: messages.Duration; + line: number; + text: string; + uri: string; +} +export interface IUsage { + code: string; + line: number; + matches: IUsageMatch[]; + meanDuration?: messages.Duration; + pattern: string; + patternType: string; + uri: string; +} +export interface IGetUsageRequest { + eventDataCollector: EventDataCollector; + stepDefinitions: StepDefinition[]; +} +export declare function getUsage({ stepDefinitions, eventDataCollector, }: IGetUsageRequest): IUsage[]; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.js b/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.js new file mode 100644 index 00000000..3e60f676 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.js @@ -0,0 +1,120 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getUsage = getUsage; +const messages = __importStar(require("@cucumber/messages")); +const pickle_parser_1 = require("../pickle_parser"); +const gherkin_document_parser_1 = require("../gherkin_document_parser"); +const value_checker_1 = require("../../../value_checker"); +function buildEmptyMapping(stepDefinitions) { + const mapping = {}; + stepDefinitions.forEach((stepDefinition) => { + mapping[stepDefinition.id] = { + code: stepDefinition.unwrappedCode.toString(), + line: stepDefinition.line, + pattern: stepDefinition.expression.source, + patternType: stepDefinition.expression.constructor.name, + matches: [], + uri: stepDefinition.uri, + }; + }); + return mapping; +} +const unexecutedStatuses = [ + messages.TestStepResultStatus.AMBIGUOUS, + messages.TestStepResultStatus.SKIPPED, + messages.TestStepResultStatus.UNDEFINED, +]; +function buildMapping({ stepDefinitions, eventDataCollector, }) { + const mapping = buildEmptyMapping(stepDefinitions); + eventDataCollector.getTestCaseAttempts().forEach((testCaseAttempt) => { + const pickleStepMap = (0, pickle_parser_1.getPickleStepMap)(testCaseAttempt.pickle); + const gherkinStepMap = (0, gherkin_document_parser_1.getGherkinStepMap)(testCaseAttempt.gherkinDocument); + testCaseAttempt.testCase.testSteps.forEach((testStep) => { + if ((0, value_checker_1.doesHaveValue)(testStep.pickleStepId) && + testStep.stepDefinitionIds.length === 1) { + const stepDefinitionId = testStep.stepDefinitionIds[0]; + const pickleStep = pickleStepMap[testStep.pickleStepId]; + const gherkinStep = gherkinStepMap[pickleStep.astNodeIds[0]]; + const match = { + line: gherkinStep.location.line, + text: pickleStep.text, + uri: testCaseAttempt.pickle.uri, + }; + const { duration, status } = testCaseAttempt.stepResults[testStep.id]; + if (!unexecutedStatuses.includes(status) && (0, value_checker_1.doesHaveValue)(duration)) { + match.duration = duration; + } + if ((0, value_checker_1.doesHaveValue)(mapping[stepDefinitionId])) { + mapping[stepDefinitionId].matches.push(match); + } + } + }); + }); + return mapping; +} +function normalizeDuration(duration) { + if (duration == null) { + return Number.MIN_SAFE_INTEGER; + } + return messages.TimeConversion.durationToMilliseconds(duration); +} +function buildResult(mapping) { + return Object.keys(mapping) + .map((stepDefinitionId) => { + const { matches, ...rest } = mapping[stepDefinitionId]; + const sortedMatches = matches.sort((a, b) => { + if (a.duration === b.duration) { + return a.text < b.text ? -1 : 1; + } + return normalizeDuration(b.duration) - normalizeDuration(a.duration); + }); + const result = { matches: sortedMatches, ...rest }; + const durations = matches + .filter((m) => m.duration != null) + .map((m) => m.duration); + if (durations.length > 0) { + const totalMilliseconds = durations.reduce((acc, x) => acc + messages.TimeConversion.durationToMilliseconds(x), 0); + result.meanDuration = messages.TimeConversion.millisecondsToDuration(totalMilliseconds / durations.length); + } + return result; + }) + .sort((a, b) => normalizeDuration(b.meanDuration) - normalizeDuration(a.meanDuration)); +} +function getUsage({ stepDefinitions, eventDataCollector, }) { + const mapping = buildMapping({ stepDefinitions, eventDataCollector }); + return buildResult(mapping); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.js.map b/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.js.map new file mode 100644 index 00000000..52ece834 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/helpers/usage_helpers/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/formatter/helpers/usage_helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4HA,4BAMC;AAlID,6DAA8C;AAC9C,oDAAmD;AACnD,wEAA8D;AAE9D,0DAAsD;AAyBtD,SAAS,iBAAiB,CACxB,eAAiC;IAEjC,MAAM,OAAO,GAA2B,EAAE,CAAA;IAC1C,eAAe,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;QACzC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC,GAAG;YAC3B,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC,QAAQ,EAAE;YAC7C,IAAI,EAAE,cAAc,CAAC,IAAI;YACzB,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,MAAM;YACzC,WAAW,EAAE,cAAc,CAAC,UAAU,C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le_parser'\nimport { getGherkinStepMap } from '../gherkin_document_parser'\nimport StepDefinition from '../../../models/step_definition'\nimport { doesHaveValue } from '../../../value_checker'\nimport EventDataCollector from '../event_data_collector'\n\nexport interface IUsageMatch {\n duration?: messages.Duration\n line: number\n text: string\n uri: string\n}\n\nexport interface IUsage {\n code: string\n line: number\n matches: IUsageMatch[]\n meanDuration?: messages.Duration\n pattern: string\n patternType: string\n uri: string\n}\n\nexport interface IGetUsageRequest {\n eventDataCollector: EventDataCollector\n stepDefinitions: StepDefinition[]\n}\n\nfunction buildEmptyMapping(\n stepDefinitions: StepDefinition[]\n): Record {\n const mapping: Record = {}\n stepDefinitions.forEach((stepDefinition) => {\n mapping[stepDefinition.id] = {\n code: stepDefinition.unwrappedCode.toString(),\n line: stepDefinition.line,\n pattern: stepDefinition.expression.source,\n patternType: stepDefinition.expression.constructor.name,\n matches: [],\n uri: stepDefinition.uri,\n }\n })\n return mapping\n}\n\nconst unexecutedStatuses: readonly messages.TestStepResultStatus[] = [\n messages.TestStepResultStatus.AMBIGUOUS,\n messages.TestStepResultStatus.SKIPPED,\n messages.TestStepResultStatus.UNDEFINED,\n]\n\nfunction buildMapping({\n stepDefinitions,\n eventDataCollector,\n}: IGetUsageRequest): Record {\n const mapping = buildEmptyMapping(stepDefinitions)\n eventDataCollector.getTestCaseAttempts().forEach((testCaseAttempt) => {\n const pickleStepMap = getPickleStepMap(testCaseAttempt.pickle)\n const gherkinStepMap = getGherkinStepMap(testCaseAttempt.gherkinDocument)\n testCaseAttempt.testCase.testSteps.forEach((testStep) => {\n if (\n doesHaveValue(testStep.pickleStepId) &&\n testStep.stepDefinitionIds.length === 1\n ) {\n const stepDefinitionId = testStep.stepDefinitionIds[0]\n const pickleStep = pickleStepMap[testStep.pickleStepId]\n const gherkinStep = gherkinStepMap[pickleStep.astNodeIds[0]]\n const match: IUsageMatch = {\n line: gherkinStep.location.line,\n text: pickleStep.text,\n uri: testCaseAttempt.pickle.uri,\n }\n const { duration, status } = testCaseAttempt.stepResults[testStep.id]\n if (!unexecutedStatuses.includes(status) && doesHaveValue(duration)) {\n match.duration = duration\n }\n if (doesHaveValue(mapping[stepDefinitionId])) {\n mapping[stepDefinitionId].matches.push(match)\n }\n }\n })\n })\n return mapping\n}\n\nfunction normalizeDuration(duration?: messages.Duration): number {\n if (duration == null) {\n return Number.MIN_SAFE_INTEGER\n }\n return messages.TimeConversion.durationToMilliseconds(duration)\n}\n\nfunction buildResult(mapping: Record): IUsage[] {\n return Object.keys(mapping)\n .map((stepDefinitionId) => {\n const { matches, ...rest } = mapping[stepDefinitionId]\n const sortedMatches = matches.sort((a: IUsageMatch, b: IUsageMatch) => {\n if (a.duration === b.duration) {\n return a.text < b.text ? -1 : 1\n }\n return normalizeDuration(b.duration) - normalizeDuration(a.duration)\n })\n const result = { matches: sortedMatches, ...rest }\n const durations: messages.Duration[] = matches\n .filter((m) => m.duration != null)\n .map((m) => m.duration)\n if (durations.length > 0) {\n const totalMilliseconds = durations.reduce(\n (acc, x) => acc + messages.TimeConversion.durationToMilliseconds(x),\n 0\n )\n result.meanDuration = messages.TimeConversion.millisecondsToDuration(\n totalMilliseconds / durations.length\n )\n }\n return result\n })\n .sort(\n (a: IUsage, b: IUsage) =>\n normalizeDuration(b.meanDuration) - normalizeDuration(a.meanDuration)\n )\n}\n\nexport function getUsage({\n stepDefinitions,\n eventDataCollector,\n}: IGetUsageRequest): IUsage[] {\n const mapping = buildMapping({ stepDefinitions, eventDataCollector })\n return buildResult(mapping)\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/import_code.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/import_code.d.ts new file mode 100644 index 00000000..bff1096e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/import_code.d.ts @@ -0,0 +1 @@ +export declare function importCode(specifier: string, cwd: string): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/import_code.js b/node_modules/@cucumber/cucumber/lib/formatter/import_code.js new file mode 100644 index 00000000..3158a235 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/import_code.js @@ -0,0 +1,26 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.importCode = importCode; +const node_url_1 = require("node:url"); +const node_path_1 = __importDefault(require("node:path")); +async function importCode(specifier, cwd) { + try { + let normalized = specifier; + if (specifier.startsWith('.')) { + normalized = (0, node_url_1.pathToFileURL)(node_path_1.default.resolve(cwd, specifier)); + } + else if (specifier.startsWith('file://')) { + normalized = new URL(specifier); + } + return await import(normalized.toString()); + } + catch (e) { + throw new Error(`Failed to import formatter ${specifier}`, { + cause: e, + }); + } +} +//# sourceMappingURL=import_code.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/import_code.js.map b/node_modules/@cucumber/cucumber/lib/formatter/import_code.js.map new file mode 100644 index 00000000..73517e21 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/import_code.js.map @@ -0,0 +1 @@ +{"version":3,"file":"import_code.js","sourceRoot":"","sources":["../../src/formatter/import_code.ts"],"names":[],"mappings":";;;;;AAGA,gCAcC;AAjBD,uCAAwC;AACxC,0DAA4B;AAErB,KAAK,UAAU,UAAU,CAAC,SAAiB,EAAE,GAAW;IAC7D,IAAI,CAAC;QACH,IAAI,UAAU,GAAiB,SAAS,CAAA;QACxC,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,UAAU,GAAG,IAAA,wBAAa,EAAC,mBAAI,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAA;QAC1D,CAAC;aAAM,IAAI,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3C,UAAU,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAA;QACjC,CAAC;QACD,OAAO,MAAM,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,8BAA8B,SAAS,EAAE,EAAE;YACzD,KAAK,EAAE,CAAC;SACT,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { pathToFileURL } from 'node:url'\nimport path from 'node:path'\n\nexport async function importCode(specifier: string, cwd: string): Promise {\n try {\n let normalized: URL | string = specifier\n if (specifier.startsWith('.')) {\n normalized = pathToFileURL(path.resolve(cwd, specifier))\n } else if (specifier.startsWith('file://')) {\n normalized = new URL(specifier)\n }\n return await import(normalized.toString())\n } catch (e) {\n throw new Error(`Failed to import formatter ${specifier}`, {\n cause: e,\n })\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/index.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/index.d.ts new file mode 100644 index 00000000..cdb4d094 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/index.d.ts @@ -0,0 +1,55 @@ +import { Writable } from 'node:stream'; +import { EventEmitter } from 'node:events'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +import { FormatterPlugin } from '../plugin'; +import { IColorFns } from './get_color_fns'; +import { EventDataCollector } from './helpers'; +import StepDefinitionSnippetBuilder from './step_definition_snippet_builder'; +import { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'; +export interface FormatRerunOptions { + separator?: string; +} +export interface FormatOptions { + /** + * @deprecated use `FORCE_COLOR` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md + */ + colorsEnabled?: boolean; + html?: { + externalAttachments?: boolean | ReadonlyArray; + }; + rerun?: FormatRerunOptions; + snippetInterface?: SnippetInterface; + snippetSyntax?: string; + printAttachments?: boolean; + [customKey: string]: any; +} +export type FormatterImplementation = typeof Formatter | FormatterPlugin; +export type IFormatterStream = Writable; +export type IFormatterLogFn = (buffer: string | Uint8Array) => void; +export type IFormatterCleanupFn = () => Promise; +export interface IFormatterOptions { + colorFns: IColorFns; + cwd: string; + eventBroadcaster: EventEmitter; + eventDataCollector: EventDataCollector; + log: IFormatterLogFn; + parsedArgvOptions: FormatOptions; + snippetBuilder: StepDefinitionSnippetBuilder; + stream: Writable; + cleanup: IFormatterCleanupFn; + supportCodeLibrary: SupportCodeLibrary; +} +export default class Formatter { + protected colorFns: IColorFns; + protected cwd: string; + protected eventDataCollector: EventDataCollector; + protected log: IFormatterLogFn; + protected snippetBuilder: StepDefinitionSnippetBuilder; + protected stream: Writable; + protected supportCodeLibrary: SupportCodeLibrary; + protected printAttachments: boolean; + private readonly cleanup; + static readonly documentation: string; + constructor(options: IFormatterOptions); + finished(): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/index.js b/node_modules/@cucumber/cucumber/lib/formatter/index.js new file mode 100644 index 00000000..a80e3f60 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/index.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const value_checker_1 = require("../value_checker"); +class Formatter { + colorFns; + cwd; + eventDataCollector; + log; + snippetBuilder; + stream; + supportCodeLibrary; + printAttachments; + cleanup; + static documentation; + constructor(options) { + this.colorFns = options.colorFns; + this.cwd = options.cwd; + this.eventDataCollector = options.eventDataCollector; + this.log = options.log; + this.snippetBuilder = options.snippetBuilder; + this.stream = options.stream; + this.supportCodeLibrary = options.supportCodeLibrary; + this.cleanup = options.cleanup; + this.printAttachments = (0, value_checker_1.valueOrDefault)(options.parsedArgvOptions.printAttachments, true); + } + async finished() { + await this.cleanup(); + } +} +exports.default = Formatter; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/index.js.map b/node_modules/@cucumber/cucumber/lib/formatter/index.js.map new file mode 100644 index 00000000..f330f734 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formatter/index.ts"],"names":[],"mappings":";;AAGA,oDAAiD;AA4CjD,MAAqB,SAAS;IAClB,QAAQ,CAAW;IACnB,GAAG,CAAQ;IACX,kBAAkB,CAAoB;IACtC,GAAG,CAAiB;IACpB,cAAc,CAA8B;IAC5C,MAAM,CAAU;IAChB,kBAAkB,CAAoB;IACtC,gBAAgB,CAAS;IAClB,OAAO,CAAqB;IAC7C,MAAM,CAAU,aAAa,CAAQ;IAErC,YAAY,OAA0B;QACpC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QAChC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACtB,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;QACpD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACtB,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAA;QAC5C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;QAC5B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAC9B,IAAI,CAAC,gBAAgB,GAAG,IAAA,8BAAc,EACpC,OAAO,CAAC,iBAAiB,CAAC,gBAAgB,EAC1C,IAAI,CACL,CAAA;IACH,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,OAAO,EAAE,CAAA;IACtB,CAAC;CACF;AA9BD,4BA8BC","sourcesContent":["import { Writable } from 'node:stream'\nimport { EventEmitter } from 'node:events'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport { valueOrDefault } from '../value_checker'\nimport { FormatterPlugin } from '../plugin'\nimport { IColorFns } from './get_color_fns'\nimport { EventDataCollector } from './helpers'\nimport StepDefinitionSnippetBuilder from './step_definition_snippet_builder'\nimport { SnippetInterface } from './step_definition_snippet_builder/snippet_syntax'\n\nexport interface FormatRerunOptions {\n separator?: string\n}\n\nexport interface FormatOptions {\n /**\n * @deprecated use `FORCE_COLOR` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md\n */\n colorsEnabled?: boolean\n html?: {\n externalAttachments?: boolean | ReadonlyArray\n }\n rerun?: FormatRerunOptions\n snippetInterface?: SnippetInterface\n snippetSyntax?: string\n printAttachments?: boolean\n [customKey: string]: any\n}\n\nexport type FormatterImplementation = typeof Formatter | FormatterPlugin\nexport type IFormatterStream = Writable\nexport type IFormatterLogFn = (buffer: string | Uint8Array) => void\nexport type IFormatterCleanupFn = () => Promise\n\nexport interface IFormatterOptions {\n colorFns: IColorFns\n cwd: string\n eventBroadcaster: EventEmitter\n eventDataCollector: EventDataCollector\n log: IFormatterLogFn\n parsedArgvOptions: FormatOptions\n snippetBuilder: StepDefinitionSnippetBuilder\n stream: Writable\n cleanup: IFormatterCleanupFn\n supportCodeLibrary: SupportCodeLibrary\n}\n\nexport default class Formatter {\n protected colorFns: IColorFns\n protected cwd: string\n protected eventDataCollector: EventDataCollector\n protected log: IFormatterLogFn\n protected snippetBuilder: StepDefinitionSnippetBuilder\n protected stream: Writable\n protected supportCodeLibrary: SupportCodeLibrary\n protected printAttachments: boolean\n private readonly cleanup: IFormatterCleanupFn\n static readonly documentation: string\n\n constructor(options: IFormatterOptions) {\n this.colorFns = options.colorFns\n this.cwd = options.cwd\n this.eventDataCollector = options.eventDataCollector\n this.log = options.log\n this.snippetBuilder = options.snippetBuilder\n this.stream = options.stream\n this.supportCodeLibrary = options.supportCodeLibrary\n this.cleanup = options.cleanup\n this.printAttachments = valueOrDefault(\n options.parsedArgvOptions.printAttachments,\n true\n )\n }\n\n async finished(): Promise {\n await this.cleanup()\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.d.ts new file mode 100644 index 00000000..7083a929 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.d.ts @@ -0,0 +1,78 @@ +import * as messages from '@cucumber/messages'; +import Formatter, { IFormatterOptions } from './'; +export interface IJsonFeature { + description: string; + elements: IJsonScenario[]; + id: string; + keyword: string; + line: number; + name: string; + tags: IJsonTag[]; + uri: string; +} +export interface IJsonScenario { + description: string; + id: string; + keyword: string; + line: number; + name: string; + steps: IJsonStep[]; + tags: IJsonTag[]; + type: string; +} +export interface IJsonStep { + arguments?: any; + embeddings?: any; + hidden?: boolean; + keyword?: string; + line?: number; + match?: any; + name?: string; + result?: any; +} +export interface IJsonTag { + name: string; + line: number; +} +interface IBuildJsonFeatureOptions { + feature: messages.Feature; + elements: IJsonScenario[]; + uri: string; +} +interface IBuildJsonScenarioOptions { + feature: messages.Feature; + gherkinScenarioMap: Record; + gherkinExampleRuleMap: Record; + gherkinScenarioLocationMap: Record; + pickle: messages.Pickle; + steps: IJsonStep[]; +} +interface IBuildJsonStepOptions { + isBeforeHook: boolean; + gherkinStepMap: Record; + pickleStepMap: Record; + testStep: messages.TestStep; + testStepAttachments: messages.Attachment[]; + testStepResult: messages.TestStepResult; +} +export default class JsonFormatter extends Formatter { + static readonly documentation: string; + constructor(options: IFormatterOptions); + convertNameToId(obj: messages.Feature | messages.Pickle): string; + formatDataTable(dataTable: messages.PickleTable): any; + formatDocString(docString: messages.PickleDocString, gherkinStep: messages.Step): any; + formatStepArgument(stepArgument: messages.PickleStepArgument, gherkinStep: messages.Step): any; + onTestRunFinished(): void; + getFeatureData({ feature, elements, uri, }: IBuildJsonFeatureOptions): IJsonFeature; + getScenarioData({ feature, gherkinScenarioLocationMap, gherkinExampleRuleMap, gherkinScenarioMap, pickle, steps, }: IBuildJsonScenarioOptions): IJsonScenario; + private formatScenarioId; + getStepData({ isBeforeHook, gherkinStepMap, pickleStepMap, testStep, testStepAttachments, testStepResult, }: IBuildJsonStepOptions): IJsonStep; + getFeatureTags(feature: messages.Feature): IJsonTag[]; + getScenarioTags({ feature, pickle, gherkinScenarioMap, }: { + feature: messages.Feature; + pickle: messages.Pickle; + gherkinScenarioMap: Record; + }): IJsonTag[]; + private getScenarioTag; +} +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js new file mode 100644 index 00000000..ff2191e0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js @@ -0,0 +1,242 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const messages = __importStar(require("@cucumber/messages")); +const value_checker_1 = require("../value_checker"); +const step_arguments_1 = require("../step_arguments"); +const helpers_1 = require("./helpers"); +const gherkin_document_parser_1 = require("./helpers/gherkin_document_parser"); +const duration_helpers_1 = require("./helpers/duration_helpers"); +const _1 = __importDefault(require("./")); +const { getGherkinStepMap, getGherkinScenarioMap } = helpers_1.GherkinDocumentParser; +const { getScenarioDescription, getPickleStepMap, getStepKeyword } = helpers_1.PickleParser; +class JsonFormatter extends _1.default { + static documentation = 'Prints the feature as JSON. The JSON format is in maintenance mode. Please consider using the message formatter with the standalone json-formatter (https://github.com/cucumber/json-formatter).'; + constructor(options) { + super(options); + options.eventBroadcaster.on('envelope', (envelope) => { + if ((0, value_checker_1.doesHaveValue)(envelope.testRunFinished)) { + this.onTestRunFinished(); + } + }); + } + convertNameToId(obj) { + return obj.name.replace(/ /g, '-').toLowerCase(); + } + formatDataTable(dataTable) { + return { + rows: dataTable.rows.map((row) => ({ + cells: row.cells.map((x) => x.value), + })), + }; + } + formatDocString(docString, gherkinStep) { + return { + content: docString.content, + line: gherkinStep.docString.location.line, + }; + } + formatStepArgument(stepArgument, gherkinStep) { + if ((0, value_checker_1.doesNotHaveValue)(stepArgument)) { + return []; + } + return [ + (0, step_arguments_1.parseStepArgument)(stepArgument, { + dataTable: (dataTable) => this.formatDataTable(dataTable), + docString: (docString) => this.formatDocString(docString, gherkinStep), + }), + ]; + } + onTestRunFinished() { + const groupedTestCaseAttempts = {}; + this.eventDataCollector + .getTestCaseAttempts() + .forEach((testCaseAttempt) => { + if (!testCaseAttempt.willBeRetried) { + const uri = testCaseAttempt.pickle.uri; + if ((0, value_checker_1.doesNotHaveValue)(groupedTestCaseAttempts[uri])) { + groupedTestCaseAttempts[uri] = []; + } + groupedTestCaseAttempts[uri].push(testCaseAttempt); + } + }); + const features = Object.keys(groupedTestCaseAttempts).map((uri) => { + const group = groupedTestCaseAttempts[uri]; + const { gherkinDocument } = group[0]; + const gherkinStepMap = getGherkinStepMap(gherkinDocument); + const gherkinScenarioMap = getGherkinScenarioMap(gherkinDocument); + const gherkinExampleRuleMap = (0, gherkin_document_parser_1.getGherkinExampleRuleMap)(gherkinDocument); + const gherkinScenarioLocationMap = (0, gherkin_document_parser_1.getGherkinScenarioLocationMap)(gherkinDocument); + const elements = group.map((testCaseAttempt) => { + const { pickle } = testCaseAttempt; + const pickleStepMap = getPickleStepMap(pickle); + let isBeforeHook = true; + const steps = testCaseAttempt.testCase.testSteps.map((testStep) => { + isBeforeHook = isBeforeHook && !(0, value_checker_1.doesHaveValue)(testStep.pickleStepId); + return this.getStepData({ + isBeforeHook, + gherkinStepMap, + pickleStepMap, + testStep, + testStepAttachments: testCaseAttempt.stepAttachments[testStep.id], + testStepResult: testCaseAttempt.stepResults[testStep.id], + }); + }); + return this.getScenarioData({ + feature: gherkinDocument.feature, + gherkinScenarioLocationMap, + gherkinExampleRuleMap, + gherkinScenarioMap, + pickle, + steps, + }); + }); + return this.getFeatureData({ + feature: gherkinDocument.feature, + elements, + uri, + }); + }); + this.log(JSON.stringify(features, null, 2)); + } + getFeatureData({ feature, elements, uri, }) { + return { + description: feature.description, + elements, + id: this.convertNameToId(feature), + line: feature.location.line, + keyword: feature.keyword, + name: feature.name, + tags: this.getFeatureTags(feature), + uri, + }; + } + getScenarioData({ feature, gherkinScenarioLocationMap, gherkinExampleRuleMap, gherkinScenarioMap, pickle, steps, }) { + const description = getScenarioDescription({ + pickle, + gherkinScenarioMap, + }); + return { + description, + id: this.formatScenarioId({ feature, pickle, gherkinExampleRuleMap }), + keyword: gherkinScenarioMap[pickle.astNodeIds[0]].keyword, + line: gherkinScenarioLocationMap[pickle.astNodeIds[pickle.astNodeIds.length - 1]].line, + name: pickle.name, + steps, + tags: this.getScenarioTags({ feature, pickle, gherkinScenarioMap }), + type: 'scenario', + }; + } + formatScenarioId({ feature, pickle, gherkinExampleRuleMap, }) { + let parts; + const rule = gherkinExampleRuleMap[pickle.astNodeIds[0]]; + if ((0, value_checker_1.doesHaveValue)(rule)) { + parts = [feature, rule, pickle]; + } + else { + parts = [feature, pickle]; + } + return parts.map((part) => this.convertNameToId(part)).join(';'); + } + getStepData({ isBeforeHook, gherkinStepMap, pickleStepMap, testStep, testStepAttachments, testStepResult, }) { + const data = {}; + if ((0, value_checker_1.doesHaveValue)(testStep.pickleStepId)) { + const pickleStep = pickleStepMap[testStep.pickleStepId]; + data.arguments = this.formatStepArgument(pickleStep.argument, gherkinStepMap[pickleStep.astNodeIds[0]]); + data.keyword = getStepKeyword({ pickleStep, gherkinStepMap }); + data.line = gherkinStepMap[pickleStep.astNodeIds[0]].location.line; + data.name = pickleStep.text; + } + else { + data.keyword = isBeforeHook ? 'Before' : 'After'; + data.hidden = true; + } + if ((0, value_checker_1.doesHaveValue)(testStep.stepDefinitionIds) && + testStep.stepDefinitionIds.length === 1) { + const stepDefinition = this.supportCodeLibrary.stepDefinitions.find((s) => s.id === testStep.stepDefinitionIds[0]); + data.match = { location: (0, helpers_1.formatLocation)(stepDefinition) }; + } + const { message, status } = testStepResult; + data.result = { + status: messages.TestStepResultStatus[status].toLowerCase(), + }; + if ((0, value_checker_1.doesHaveValue)(testStepResult.duration)) { + data.result.duration = (0, duration_helpers_1.durationToNanoseconds)(testStepResult.duration); + } + if (status === messages.TestStepResultStatus.FAILED && + (0, value_checker_1.doesHaveValue)(message)) { + data.result.error_message = message; + } + if (testStepAttachments?.length > 0) { + data.embeddings = testStepAttachments.map((attachment) => ({ + data: attachment.contentEncoding === + messages.AttachmentContentEncoding.IDENTITY + ? Buffer.from(attachment.body).toString('base64') + : attachment.body, + mime_type: attachment.mediaType, + })); + } + return data; + } + getFeatureTags(feature) { + return feature.tags.map((tagData) => ({ + name: tagData.name, + line: tagData.location.line, + })); + } + getScenarioTags({ feature, pickle, gherkinScenarioMap, }) { + const scenario = gherkinScenarioMap[pickle.astNodeIds[0]]; + return pickle.tags.map((tagData) => this.getScenarioTag(tagData, feature, scenario)); + } + getScenarioTag(tagData, feature, scenario) { + const byAstNodeId = (tag) => tag.id === tagData.astNodeId; + const flatten = (acc, val) => acc.concat(val); + const tag = feature.tags.find(byAstNodeId) || + scenario.tags.find(byAstNodeId) || + scenario.examples + .map((e) => e.tags) + .reduce(flatten, []) + .find(byAstNodeId); + return { + name: tagData.name, + line: tag?.location?.line, + }; + } +} +exports.default = JsonFormatter; +//# sourceMappingURL=json_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js.map new file mode 100644 index 00000000..e1ce3ff4 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/json_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"json_formatter.js","sourceRoot":"","sources":["../../src/formatter/json_formatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA8C;AAC9C,oDAAkE;AAClE,sDAAqD;AACrD,uCAA+E;AAC/E,+EAG0C;AAE1C,iEAAkE;AAClE,0CAAiD;AAEjD,MAAM,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,GAAG,+BAAqB,CAAA;AAE1E,MAAM,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAChE,sBAAY,CAAA;AAoEd,MAAqB,aAAc,SAAQ,UAAS;IAC3C,MAAM,CAAU,aAAa,GAClC,kMAAkM,CAAA;IAEpM,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAA2B,EAAE,EAAE;YACtE,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,iBAAiB,EAAE,CAAA;YAC1B,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,eAAe,CAAC,GAAuC;QACrD,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAA;IAClD,CAAC;IAED,eAAe,CAAC,SAA+B;QAC7C,OAAO;YACL,IAAI,E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,EAAE,CACjD,GAAG,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAA;QAC9B,MAAM,OAAO,GAAG,CACd,GAAmB,EACnB,GAAmB,EACH,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEpC,MAAM,GAAG,GACP,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;YAC/B,QAAQ,CAAC,QAAQ;iBACd,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;iBAClB,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;iBACnB,IAAI,CAAC,WAAW,CAAC,CAAA;QAEtB,OAAO;YACL,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI;SAC1B,CAAA;IACH,CAAC;;AA/QH,gCAgRC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue, doesNotHaveValue } from '../value_checker'\nimport { parseStepArgument } from '../step_arguments'\nimport { formatLocation, GherkinDocumentParser, PickleParser } from './helpers'\nimport {\n getGherkinExampleRuleMap,\n getGherkinScenarioLocationMap,\n} from './helpers/gherkin_document_parser'\nimport { ITestCaseAttempt } from './helpers/event_data_collector'\nimport { durationToNanoseconds } from './helpers/duration_helpers'\nimport Formatter, { IFormatterOptions } from './'\n\nconst { getGherkinStepMap, getGherkinScenarioMap } = GherkinDocumentParser\n\nconst { getScenarioDescription, getPickleStepMap, getStepKeyword } =\n PickleParser\n\nexport interface IJsonFeature {\n description: string\n elements: IJsonScenario[]\n id: string\n keyword: string\n line: number\n name: string\n tags: IJsonTag[]\n uri: string\n}\n\nexport interface IJsonScenario {\n description: string\n id: string\n keyword: string\n line: number\n name: string\n steps: IJsonStep[]\n tags: IJsonTag[]\n type: string\n}\n\nexport interface IJsonStep {\n arguments?: any // TODO\n embeddings?: any // TODO\n hidden?: boolean\n keyword?: string // TODO, not optional\n line?: number\n match?: any // TODO\n name?: string\n result?: any // TODO\n}\n\nexport interface IJsonTag {\n name: string\n line: number\n}\n\ninterface IBuildJsonFeatureOptions {\n feature: messages.Feature\n elements: IJsonScenario[]\n uri: string\n}\n\ninterface IBuildJsonScenarioOptions {\n feature: messages.Feature\n gherkinScenarioMap: Record\n gherkinExampleRuleMap: Record\n gherkinScenarioLocationMap: Record\n pickle: messages.Pickle\n steps: IJsonStep[]\n}\n\ninterface IBuildJsonStepOptions {\n isBeforeHook: boolean\n gherkinStepMap: Record\n pickleStepMap: Record\n testStep: messages.TestStep\n testStepAttachments: messages.Attachment[]\n testStepResult: messages.TestStepResult\n}\n\ninterface UriToTestCaseAttemptsMap {\n [uri: string]: ITestCaseAttempt[]\n}\n\nexport default class JsonFormatter extends Formatter {\n public static readonly documentation: string =\n 'Prints the feature as JSON. The JSON format is in maintenance mode. Please consider using the message formatter with the standalone json-formatter (https://github.com/cucumber/json-formatter).'\n\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', (envelope: messages.Envelope) => {\n if (doesHaveValue(envelope.testRunFinished)) {\n this.onTestRunFinished()\n }\n })\n }\n\n convertNameToId(obj: messages.Feature | messages.Pickle): string {\n return obj.name.replace(/ /g, '-').toLowerCase()\n }\n\n formatDataTable(dataTable: messages.PickleTable): any {\n return {\n rows: dataTable.rows.map((row) => ({\n cells: row.cells.map((x) => x.value),\n })),\n }\n }\n\n formatDocString(\n docString: messages.PickleDocString,\n gherkinStep: messages.Step\n ): any {\n return {\n content: docString.content,\n line: gherkinStep.docString.location.line,\n }\n }\n\n formatStepArgument(\n stepArgument: messages.PickleStepArgument,\n gherkinStep: messages.Step\n ): any {\n if (doesNotHaveValue(stepArgument)) {\n return []\n }\n return [\n parseStepArgument(stepArgument, {\n dataTable: (dataTable) => this.formatDataTable(dataTable),\n docString: (docString) => this.formatDocString(docString, gherkinStep),\n }),\n ]\n }\n\n onTestRunFinished(): void {\n const groupedTestCaseAttempts: UriToTestCaseAttemptsMap = {}\n this.eventDataCollector\n .getTestCaseAttempts()\n .forEach((testCaseAttempt: ITestCaseAttempt) => {\n if (!testCaseAttempt.willBeRetried) {\n const uri = testCaseAttempt.pickle.uri\n if (doesNotHaveValue(groupedTestCaseAttempts[uri])) {\n groupedTestCaseAttempts[uri] = []\n }\n groupedTestCaseAttempts[uri].push(testCaseAttempt)\n }\n })\n const features = Object.keys(groupedTestCaseAttempts).map((uri) => {\n const group = groupedTestCaseAttempts[uri]\n const { gherkinDocument } = group[0]\n const gherkinStepMap = getGherkinStepMap(gherkinDocument)\n const gherkinScenarioMap = getGherkinScenarioMap(gherkinDocument)\n const gherkinExampleRuleMap = getGherkinExampleRuleMap(gherkinDocument)\n const gherkinScenarioLocationMap =\n getGherkinScenarioLocationMap(gherkinDocument)\n const elements = group.map((testCaseAttempt: ITestCaseAttempt) => {\n const { pickle } = testCaseAttempt\n const pickleStepMap = getPickleStepMap(pickle)\n let isBeforeHook = true\n const steps = testCaseAttempt.testCase.testSteps.map((testStep) => {\n isBeforeHook = isBeforeHook && !doesHaveValue(testStep.pickleStepId)\n return this.getStepData({\n isBeforeHook,\n gherkinStepMap,\n pickleStepMap,\n testStep,\n testStepAttachments: testCaseAttempt.stepAttachments[testStep.id],\n testStepResult: testCaseAttempt.stepResults[testStep.id],\n })\n })\n return this.getScenarioData({\n feature: gherkinDocument.feature,\n gherkinScenarioLocationMap,\n gherkinExampleRuleMap,\n gherkinScenarioMap,\n pickle,\n steps,\n })\n })\n return this.getFeatureData({\n feature: gherkinDocument.feature,\n elements,\n uri,\n })\n })\n this.log(JSON.stringify(features, null, 2))\n }\n\n getFeatureData({\n feature,\n elements,\n uri,\n }: IBuildJsonFeatureOptions): IJsonFeature {\n return {\n description: feature.description,\n elements,\n id: this.convertNameToId(feature),\n line: feature.location.line,\n keyword: feature.keyword,\n name: feature.name,\n tags: this.getFeatureTags(feature),\n uri,\n }\n }\n\n getScenarioData({\n feature,\n gherkinScenarioLocationMap,\n gherkinExampleRuleMap,\n gherkinScenarioMap,\n pickle,\n steps,\n }: IBuildJsonScenarioOptions): IJsonScenario {\n const description = getScenarioDescription({\n pickle,\n gherkinScenarioMap,\n })\n return {\n description,\n id: this.formatScenarioId({ feature, pickle, gherkinExampleRuleMap }),\n keyword: gherkinScenarioMap[pickle.astNodeIds[0]].keyword,\n line: gherkinScenarioLocationMap[\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n ].line,\n name: pickle.name,\n steps,\n tags: this.getScenarioTags({ feature, pickle, gherkinScenarioMap }),\n type: 'scenario',\n }\n }\n\n private formatScenarioId({\n feature,\n pickle,\n gherkinExampleRuleMap,\n }: {\n feature: messages.Feature\n pickle: messages.Pickle\n gherkinExampleRuleMap: Record\n }): string {\n let parts: any[]\n const rule = gherkinExampleRuleMap[pickle.astNodeIds[0]]\n if (doesHaveValue(rule)) {\n parts = [feature, rule, pickle]\n } else {\n parts = [feature, pickle]\n }\n return parts.map((part) => this.convertNameToId(part)).join(';')\n }\n\n getStepData({\n isBeforeHook,\n gherkinStepMap,\n pickleStepMap,\n testStep,\n testStepAttachments,\n testStepResult,\n }: IBuildJsonStepOptions): IJsonStep {\n const data: IJsonStep = {}\n if (doesHaveValue(testStep.pickleStepId)) {\n const pickleStep = pickleStepMap[testStep.pickleStepId]\n data.arguments = this.formatStepArgument(\n pickleStep.argument,\n gherkinStepMap[pickleStep.astNodeIds[0]]\n )\n data.keyword = getStepKeyword({ pickleStep, gherkinStepMap })\n data.line = gherkinStepMap[pickleStep.astNodeIds[0]].location.line\n data.name = pickleStep.text\n } else {\n data.keyword = isBeforeHook ? 'Before' : 'After'\n data.hidden = true\n }\n if (\n doesHaveValue(testStep.stepDefinitionIds) &&\n testStep.stepDefinitionIds.length === 1\n ) {\n const stepDefinition = this.supportCodeLibrary.stepDefinitions.find(\n (s) => s.id === testStep.stepDefinitionIds[0]\n )\n data.match = { location: formatLocation(stepDefinition) }\n }\n const { message, status } = testStepResult\n data.result = {\n status: messages.TestStepResultStatus[status].toLowerCase(),\n }\n if (doesHaveValue(testStepResult.duration)) {\n data.result.duration = durationToNanoseconds(testStepResult.duration)\n }\n if (\n status === messages.TestStepResultStatus.FAILED &&\n doesHaveValue(message)\n ) {\n data.result.error_message = message\n }\n if (testStepAttachments?.length > 0) {\n data.embeddings = testStepAttachments.map((attachment) => ({\n data:\n attachment.contentEncoding ===\n messages.AttachmentContentEncoding.IDENTITY\n ? Buffer.from(attachment.body).toString('base64')\n : attachment.body,\n mime_type: attachment.mediaType,\n }))\n }\n return data\n }\n\n getFeatureTags(feature: messages.Feature): IJsonTag[] {\n return feature.tags.map((tagData) => ({\n name: tagData.name,\n line: tagData.location.line,\n }))\n }\n\n getScenarioTags({\n feature,\n pickle,\n gherkinScenarioMap,\n }: {\n feature: messages.Feature\n pickle: messages.Pickle\n gherkinScenarioMap: Record\n }): IJsonTag[] {\n const scenario = gherkinScenarioMap[pickle.astNodeIds[0]]\n\n return pickle.tags.map(\n (tagData: messages.PickleTag): IJsonTag =>\n this.getScenarioTag(tagData, feature, scenario)\n )\n }\n\n private getScenarioTag(\n tagData: messages.PickleTag,\n feature: messages.Feature,\n scenario: messages.Scenario\n ): IJsonTag {\n const byAstNodeId = (tag: messages.Tag): boolean =>\n tag.id === tagData.astNodeId\n const flatten = (\n acc: messages.Tag[],\n val: messages.Tag[]\n ): messages.Tag[] => acc.concat(val)\n\n const tag =\n feature.tags.find(byAstNodeId) ||\n scenario.tags.find(byAstNodeId) ||\n scenario.examples\n .map((e) => e.tags)\n .reduce(flatten, [])\n .find(byAstNodeId)\n\n return {\n name: tagData.name,\n line: tag?.location?.line,\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.d.ts new file mode 100644 index 00000000..1c91a23c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.d.ts @@ -0,0 +1,18 @@ +import ProgressBar from 'progress'; +import * as messages from '@cucumber/messages'; +import Formatter, { IFormatterOptions } from './'; +export default class ProgressBarFormatter extends Formatter { + private numberOfSteps; + private testRunStarted; + private issueCount; + progressBar: ProgressBar; + static readonly documentation: string; + constructor(options: IFormatterOptions); + incrementStepCount(pickleId: string): void; + initializeProgressBar(): void; + logProgress({ testStepId, testCaseStartedId, }: messages.TestStepFinished): void; + logUndefinedParametertype(parameterType: messages.UndefinedParameterType): void; + logErrorIfNeeded(testCaseFinished: messages.TestCaseFinished): void; + logSummary(testRunFinished: messages.TestRunFinished): void; + parseEnvelope(envelope: messages.Envelope): void; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.js new file mode 100644 index 00000000..a79125de --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.js @@ -0,0 +1,103 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const progress_1 = __importDefault(require("progress")); +const value_checker_1 = require("../value_checker"); +const time_1 = require("../time"); +const issue_helpers_1 = require("./helpers/issue_helpers"); +const helpers_1 = require("./helpers"); +const _1 = __importDefault(require("./")); +// Inspired by https://github.com/thekompanee/fuubar and https://github.com/martinciu/fuubar-cucumber +class ProgressBarFormatter extends _1.default { + numberOfSteps; + testRunStarted; + issueCount; + progressBar; + static documentation = 'Similar to the Progress Formatter, but provides a real-time updating progress bar based on the total number of steps to be executed in the test run'; + constructor(options) { + super(options); + options.eventBroadcaster.on('envelope', this.parseEnvelope.bind(this)); + this.numberOfSteps = 0; + this.issueCount = 0; + } + incrementStepCount(pickleId) { + const pickle = this.eventDataCollector.getPickle(pickleId); + this.numberOfSteps += pickle.steps.length; + } + initializeProgressBar() { + if ((0, value_checker_1.doesHaveValue)(this.progressBar)) { + return; + } + this.progressBar = new progress_1.default(':current/:total steps [:bar] ', { + clear: true, + incomplete: ' ', + stream: this.stream, + total: this.numberOfSteps, + width: (0, value_checker_1.valueOrDefault)(this.stream.columns, 80), + }); + } + logProgress({ testStepId, testCaseStartedId, }) { + const { testCase } = this.eventDataCollector.getTestCaseAttempt(testCaseStartedId); + const testStep = testCase.testSteps.find((s) => s.id === testStepId); + if ((0, value_checker_1.doesHaveValue)(testStep.pickleStepId)) { + this.progressBar.tick(); + } + } + logUndefinedParametertype(parameterType) { + this.log(`Undefined parameter type: ${(0, issue_helpers_1.formatUndefinedParameterType)(parameterType)}\n`); + } + logErrorIfNeeded(testCaseFinished) { + const { worstTestStepResult } = this.eventDataCollector.getTestCaseAttempt(testCaseFinished.testCaseStartedId); + if ((0, helpers_1.isIssue)(worstTestStepResult)) { + this.issueCount += 1; + const testCaseAttempt = this.eventDataCollector.getTestCaseAttempt(testCaseFinished.testCaseStartedId); + this.progressBar.interrupt((0, helpers_1.formatIssue)({ + colorFns: this.colorFns, + number: this.issueCount, + snippetBuilder: this.snippetBuilder, + supportCodeLibrary: this.supportCodeLibrary, + testCaseAttempt, + printAttachments: this.printAttachments, + })); + if (testCaseFinished.willBeRetried) { + const stepsToRetry = testCaseAttempt.pickle.steps.length; + this.progressBar.tick(-stepsToRetry); + } + } + } + logSummary(testRunFinished) { + const testRunDuration = (0, time_1.durationBetweenTimestamps)(this.testRunStarted.timestamp, testRunFinished.timestamp); + this.log((0, helpers_1.formatSummary)({ + colorFns: this.colorFns, + testCaseAttempts: this.eventDataCollector.getTestCaseAttempts(), + testRunDuration, + })); + } + parseEnvelope(envelope) { + if ((0, value_checker_1.doesHaveValue)(envelope.undefinedParameterType)) { + this.logUndefinedParametertype(envelope.undefinedParameterType); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testCase)) { + this.incrementStepCount(envelope.testCase.pickleId); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testStepStarted)) { + this.initializeProgressBar(); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testStepFinished)) { + this.logProgress(envelope.testStepFinished); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testCaseFinished)) { + this.logErrorIfNeeded(envelope.testCaseFinished); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testRunStarted)) { + this.testRunStarted = envelope.testRunStarted; + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testRunFinished)) { + this.logSummary(envelope.testRunFinished); + } + } +} +exports.default = ProgressBarFormatter; +//# sourceMappingURL=progress_bar_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.js.map new file mode 100644 index 00000000..e43ca245 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/progress_bar_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"progress_bar_formatter.js","sourceRoot":"","sources":["../../src/formatter/progress_bar_formatter.ts"],"names":[],"mappings":";;;;;AACA,wDAAkC;AAElC,oDAAgE;AAChE,kCAAmD;AACnD,2DAAsE;AACtE,uCAA+D;AAC/D,0CAAiD;AAEjD,qGAAqG;AACrG,MAAqB,oBAAqB,SAAQ,UAAS;IACjD,aAAa,CAAQ;IACrB,cAAc,CAAyB;IACvC,UAAU,CAAQ;IACnB,WAAW,CAAa;IACxB,MAAM,CAAU,aAAa,GAClC,qJAAqJ,CAAA;IAEvJ,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QACtE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAA;IACrB,CAAC;IAED,kBAAkB,CAAC,QAAgB;QACjC,MAAM,MAAM,G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,6BAAa,EAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5C,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QACrD,CAAC;aAAM,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACnD,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAC9B,CAAC;aAAM,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACpD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAA;QAC7C,CAAC;aAAM,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACpD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAA;QAClD,CAAC;aAAM,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YAClD,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAA;QAC/C,CAAC;aAAM,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACnD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC;;AA/GH,uCAgHC","sourcesContent":["import { WriteStream as TtyWriteStream } from 'node:tty'\nimport ProgressBar from 'progress'\nimport * as messages from '@cucumber/messages'\nimport { doesHaveValue, valueOrDefault } from '../value_checker'\nimport { durationBetweenTimestamps } from '../time'\nimport { formatUndefinedParameterType } from './helpers/issue_helpers'\nimport { formatIssue, formatSummary, isIssue } from './helpers'\nimport Formatter, { IFormatterOptions } from './'\n\n// Inspired by https://github.com/thekompanee/fuubar and https://github.com/martinciu/fuubar-cucumber\nexport default class ProgressBarFormatter extends Formatter {\n private numberOfSteps: number\n private testRunStarted: messages.TestRunStarted\n private issueCount: number\n public progressBar: ProgressBar\n public static readonly documentation: string =\n 'Similar to the Progress Formatter, but provides a real-time updating progress bar based on the total number of steps to be executed in the test run'\n\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', this.parseEnvelope.bind(this))\n this.numberOfSteps = 0\n this.issueCount = 0\n }\n\n incrementStepCount(pickleId: string): void {\n const pickle = this.eventDataCollector.getPickle(pickleId)\n this.numberOfSteps += pickle.steps.length\n }\n\n initializeProgressBar(): void {\n if (doesHaveValue(this.progressBar)) {\n return\n }\n this.progressBar = new ProgressBar(':current/:total steps [:bar] ', {\n clear: true,\n incomplete: ' ',\n stream: this.stream,\n total: this.numberOfSteps,\n width: valueOrDefault((this.stream as TtyWriteStream).columns, 80),\n })\n }\n\n logProgress({\n testStepId,\n testCaseStartedId,\n }: messages.TestStepFinished): void {\n const { testCase } =\n this.eventDataCollector.getTestCaseAttempt(testCaseStartedId)\n const testStep = testCase.testSteps.find((s) => s.id === testStepId)\n if (doesHaveValue(testStep.pickleStepId)) {\n this.progressBar.tick()\n }\n }\n\n logUndefinedParametertype(\n parameterType: messages.UndefinedParameterType\n ): void {\n this.log(\n `Undefined parameter type: ${formatUndefinedParameterType(\n parameterType\n )}\\n`\n )\n }\n\n logErrorIfNeeded(testCaseFinished: messages.TestCaseFinished): void {\n const { worstTestStepResult } = this.eventDataCollector.getTestCaseAttempt(\n testCaseFinished.testCaseStartedId\n )\n if (isIssue(worstTestStepResult)) {\n this.issueCount += 1\n const testCaseAttempt = this.eventDataCollector.getTestCaseAttempt(\n testCaseFinished.testCaseStartedId\n )\n this.progressBar.interrupt(\n formatIssue({\n colorFns: this.colorFns,\n number: this.issueCount,\n snippetBuilder: this.snippetBuilder,\n supportCodeLibrary: this.supportCodeLibrary,\n testCaseAttempt,\n printAttachments: this.printAttachments,\n })\n )\n if (testCaseFinished.willBeRetried) {\n const stepsToRetry = testCaseAttempt.pickle.steps.length\n this.progressBar.tick(-stepsToRetry)\n }\n }\n }\n\n logSummary(testRunFinished: messages.TestRunFinished): void {\n const testRunDuration = durationBetweenTimestamps(\n this.testRunStarted.timestamp,\n testRunFinished.timestamp\n )\n this.log(\n formatSummary({\n colorFns: this.colorFns,\n testCaseAttempts: this.eventDataCollector.getTestCaseAttempts(),\n testRunDuration,\n })\n )\n }\n\n parseEnvelope(envelope: messages.Envelope): void {\n if (doesHaveValue(envelope.undefinedParameterType)) {\n this.logUndefinedParametertype(envelope.undefinedParameterType)\n } else if (doesHaveValue(envelope.testCase)) {\n this.incrementStepCount(envelope.testCase.pickleId)\n } else if (doesHaveValue(envelope.testStepStarted)) {\n this.initializeProgressBar()\n } else if (doesHaveValue(envelope.testStepFinished)) {\n this.logProgress(envelope.testStepFinished)\n } else if (doesHaveValue(envelope.testCaseFinished)) {\n this.logErrorIfNeeded(envelope.testCaseFinished)\n } else if (doesHaveValue(envelope.testRunStarted)) {\n this.testRunStarted = envelope.testRunStarted\n } else if (doesHaveValue(envelope.testRunFinished)) {\n this.logSummary(envelope.testRunFinished)\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.d.ts new file mode 100644 index 00000000..c2b1fb64 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.d.ts @@ -0,0 +1,9 @@ +import * as messages from '@cucumber/messages'; +import SummaryFormatter from './summary_formatter'; +import { IFormatterOptions } from './index'; +import ITestStepFinished = messages.TestStepFinished; +export default class ProgressFormatter extends SummaryFormatter { + static readonly documentation: string; + constructor(options: IFormatterOptions); + logProgress({ testStepResult: { status } }: ITestStepFinished): void; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.js new file mode 100644 index 00000000..64903c46 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.js @@ -0,0 +1,69 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const messages = __importStar(require("@cucumber/messages")); +const value_checker_1 = require("../value_checker"); +const summary_formatter_1 = __importDefault(require("./summary_formatter")); +const STATUS_CHARACTER_MAPPING = new Map([ + [messages.TestStepResultStatus.AMBIGUOUS, 'A'], + [messages.TestStepResultStatus.FAILED, 'F'], + [messages.TestStepResultStatus.PASSED, '.'], + [messages.TestStepResultStatus.PENDING, 'P'], + [messages.TestStepResultStatus.SKIPPED, '-'], + [messages.TestStepResultStatus.UNDEFINED, 'U'], +]); +class ProgressFormatter extends summary_formatter_1.default { + static documentation = 'Prints one character per scenario.'; + constructor(options) { + options.eventBroadcaster.on('envelope', (envelope) => { + if ((0, value_checker_1.doesHaveValue)(envelope.testRunFinished)) { + this.log('\n\n'); + } + else if ((0, value_checker_1.doesHaveValue)(envelope.testStepFinished)) { + this.logProgress(envelope.testStepFinished); + } + }); + super(options); + } + logProgress({ testStepResult: { status } }) { + const character = this.colorFns.forStatus(status)(STATUS_CHARACTER_MAPPING.get(status)); + this.log(character); + } +} +exports.default = ProgressFormatter; +//# sourceMappingURL=progress_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.js.map new file mode 100644 index 00000000..f998573e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/progress_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"progress_formatter.js","sourceRoot":"","sources":["../../src/formatter/progress_formatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA8C;AAC9C,oDAAgD;AAChD,4EAAkD;AAKlD,MAAM,wBAAwB,GAC5B,IAAI,GAAG,CAAC;IACN,CAAC,QAAQ,CAAC,oBAAoB,CAAC,SAAS,EAAE,GAAG,CAAC;IAC9C,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3C,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3C,CAAC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC;IAC5C,CAAC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC;IAC5C,CAAC,QAAQ,CAAC,oBAAoB,CAAC,SAAS,EAAE,GAAG,CAAC;CAC/C,CAAC,CAAA;AAEJ,MAAqB,iBAAkB,SAAQ,2BAAgB;IACtD,MAAM,CAAU,aAAa,GAClC,oCAAoC,CAAA;IAEtC,YAAY,OAA0B;QACpC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAAmB,EAAE,EAAE;YAC9D,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAClB,CAAC;iBAAM,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACpD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAA;YAC7C,CAAC;QACH,CAAC,CAAC,CAAA;QACF,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;IAED,WAAW,CAAC,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,EAAqB;QAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAC/C,wBAAwB,CAAC,GAAG,CAAC,MAAM,CAAC,CACrC,CAAA;QACD,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACrB,CAAC;;AApBH,oCAqBC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue } from '../value_checker'\nimport SummaryFormatter from './summary_formatter'\nimport { IFormatterOptions } from './index'\nimport IEnvelope = messages.Envelope\nimport ITestStepFinished = messages.TestStepFinished\n\nconst STATUS_CHARACTER_MAPPING: Map =\n new Map([\n [messages.TestStepResultStatus.AMBIGUOUS, 'A'],\n [messages.TestStepResultStatus.FAILED, 'F'],\n [messages.TestStepResultStatus.PASSED, '.'],\n [messages.TestStepResultStatus.PENDING, 'P'],\n [messages.TestStepResultStatus.SKIPPED, '-'],\n [messages.TestStepResultStatus.UNDEFINED, 'U'],\n ])\n\nexport default class ProgressFormatter extends SummaryFormatter {\n public static readonly documentation: string =\n 'Prints one character per scenario.'\n\n constructor(options: IFormatterOptions) {\n options.eventBroadcaster.on('envelope', (envelope: IEnvelope) => {\n if (doesHaveValue(envelope.testRunFinished)) {\n this.log('\\n\\n')\n } else if (doesHaveValue(envelope.testStepFinished)) {\n this.logProgress(envelope.testStepFinished)\n }\n })\n super(options)\n }\n\n logProgress({ testStepResult: { status } }: ITestStepFinished): void {\n const character = this.colorFns.forStatus(status)(\n STATUS_CHARACTER_MAPPING.get(status)\n )\n this.log(character)\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.d.ts new file mode 100644 index 00000000..96474e27 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.d.ts @@ -0,0 +1,13 @@ +import Formatter, { IFormatterOptions } from './'; +interface UriToLinesMap { + [uri: string]: number[]; +} +export default class RerunFormatter extends Formatter { + protected readonly separator: string; + static readonly documentation: string; + constructor(options: IFormatterOptions); + getFailureMap(): UriToLinesMap; + formatFailedTestCases(): string; + logFailedTestCases(): void; +} +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.js new file mode 100644 index 00000000..c019fa8f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.js @@ -0,0 +1,91 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const messages = __importStar(require("@cucumber/messages")); +const value_checker_1 = require("../value_checker"); +const gherkin_document_parser_1 = require("./helpers/gherkin_document_parser"); +const _1 = __importDefault(require("./")); +const DEFAULT_SEPARATOR = '\n'; +function isFailedAttempt(worstTestStepResult) { + return worstTestStepResult.status !== messages.TestStepResultStatus.PASSED; +} +class RerunFormatter extends _1.default { + separator; + static documentation = 'Prints failing files with line numbers.'; + constructor(options) { + super(options); + options.eventBroadcaster.on('envelope', (envelope) => { + if ((0, value_checker_1.doesHaveValue)(envelope.testRunFinished)) { + this.logFailedTestCases(); + } + }); + const rerunOptions = (0, value_checker_1.valueOrDefault)(options.parsedArgvOptions.rerun, {}); + this.separator = (0, value_checker_1.valueOrDefault)(rerunOptions.separator, DEFAULT_SEPARATOR); + } + getFailureMap() { + const mapping = {}; + this.eventDataCollector + .getTestCaseAttempts() + .forEach(({ gherkinDocument, pickle, worstTestStepResult, willBeRetried }) => { + if (isFailedAttempt(worstTestStepResult) && !willBeRetried) { + const relativeUri = pickle.uri; + const line = (0, gherkin_document_parser_1.getGherkinScenarioLocationMap)(gherkinDocument)[pickle.astNodeIds[pickle.astNodeIds.length - 1]].line; + if ((0, value_checker_1.doesNotHaveValue)(mapping[relativeUri])) { + mapping[relativeUri] = []; + } + mapping[relativeUri].push(line); + } + }); + return mapping; + } + formatFailedTestCases() { + const mapping = this.getFailureMap(); + return Object.keys(mapping) + .map((uri) => { + const lines = mapping[uri]; + return `${uri}:${lines.join(':')}`; + }) + .join(this.separator); + } + logFailedTestCases() { + const failedTestCases = this.formatFailedTestCases(); + this.log(failedTestCases); + } +} +exports.default = RerunFormatter; +//# sourceMappingURL=rerun_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.js.map new file mode 100644 index 00000000..5b373766 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/rerun_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rerun_formatter.js","sourceRoot":"","sources":["../../src/formatter/rerun_formatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA8C;AAC9C,oDAIyB;AACzB,+EAAiF;AACjF,0CAAiD;AAEjD,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAM9B,SAAS,eAAe,CAAC,mBAA4C;IACnE,OAAO,mBAAmB,CAAC,MAAM,KAAK,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAA;AAC5E,CAAC;AAED,MAAqB,cAAe,SAAQ,UAAS;IAChC,SAAS,CAAQ;IAC7B,MAAM,CAAU,aAAa,GAClC,yCAAyC,CAAA;IAE3C,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAA2B,EAAE,EAAE;YACtE,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,kBAAkB,EAAE,CAAA;YAC3B,CAAC;QACH,CAAC,CAAC,CAAA;QACF,MAAM,YAAY,GAAG,IAAA,8BAAc,EAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QACxE,IAAI,CAAC,SAAS,GAAG,IAAA,8BAAc,EAAC,YAAY,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAA;IAC5E,CAAC;IAED,aAAa;QACX,MAAM,OAAO,GAAkB,EAAE,CAA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ucumber/messages'\nimport {\n doesHaveValue,\n doesNotHaveValue,\n valueOrDefault,\n} from '../value_checker'\nimport { getGherkinScenarioLocationMap } from './helpers/gherkin_document_parser'\nimport Formatter, { IFormatterOptions } from './'\n\nconst DEFAULT_SEPARATOR = '\\n'\n\ninterface UriToLinesMap {\n [uri: string]: number[]\n}\n\nfunction isFailedAttempt(worstTestStepResult: messages.TestStepResult) {\n return worstTestStepResult.status !== messages.TestStepResultStatus.PASSED\n}\n\nexport default class RerunFormatter extends Formatter {\n protected readonly separator: string\n public static readonly documentation: string =\n 'Prints failing files with line numbers.'\n\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', (envelope: messages.Envelope) => {\n if (doesHaveValue(envelope.testRunFinished)) {\n this.logFailedTestCases()\n }\n })\n const rerunOptions = valueOrDefault(options.parsedArgvOptions.rerun, {})\n this.separator = valueOrDefault(rerunOptions.separator, DEFAULT_SEPARATOR)\n }\n\n getFailureMap(): UriToLinesMap {\n const mapping: UriToLinesMap = {}\n this.eventDataCollector\n .getTestCaseAttempts()\n .forEach(\n ({ gherkinDocument, pickle, worstTestStepResult, willBeRetried }) => {\n if (isFailedAttempt(worstTestStepResult) && !willBeRetried) {\n const relativeUri = pickle.uri\n const line =\n getGherkinScenarioLocationMap(gherkinDocument)[\n pickle.astNodeIds[pickle.astNodeIds.length - 1]\n ].line\n if (doesNotHaveValue(mapping[relativeUri])) {\n mapping[relativeUri] = []\n }\n mapping[relativeUri].push(line)\n }\n }\n )\n\n return mapping\n }\n\n formatFailedTestCases(): string {\n const mapping = this.getFailureMap()\n\n return Object.keys(mapping)\n .map((uri) => {\n const lines = mapping[uri]\n return `${uri}:${lines.join(':')}`\n })\n .join(this.separator)\n }\n\n logFailedTestCases(): void {\n const failedTestCases = this.formatFailedTestCases()\n this.log(failedTestCases)\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.d.ts new file mode 100644 index 00000000..e268add1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.d.ts @@ -0,0 +1,2 @@ +import { FormatterImplementation } from './index'; +export declare function resolveImplementation(specifier: string, cwd: string): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.js b/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.js new file mode 100644 index 00000000..0712c774 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.js @@ -0,0 +1,27 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveImplementation = resolveImplementation; +const builtin_1 = __importDefault(require("./builtin")); +const import_code_1 = require("./import_code"); +const find_class_or_plugin_1 = require("./find_class_or_plugin"); +async function resolveImplementation(specifier, cwd) { + const fromBuiltin = builtin_1.default[specifier]; + if (fromBuiltin) { + if (typeof fromBuiltin !== 'string') { + return fromBuiltin; + } + else { + specifier = fromBuiltin; + } + } + const imported = await (0, import_code_1.importCode)(specifier, cwd); + const found = (0, find_class_or_plugin_1.findClassOrPlugin)(imported); + if (!found) { + throw new Error(`${specifier} does not export a function/class`); + } + return found; +} +//# sourceMappingURL=resolve_implementation.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.js.map b/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.js.map new file mode 100644 index 00000000..4dc73ab5 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve_implementation.js","sourceRoot":"","sources":["../../src/formatter/resolve_implementation.ts"],"names":[],"mappings":";;;;;AAKA,sDAkBC;AAvBD,wDAA+B;AAC/B,+CAA0C;AAC1C,iEAA0D;AAGnD,KAAK,UAAU,qBAAqB,CACzC,SAAiB,EACjB,GAAW;IAEX,MAAM,WAAW,GAAG,iBAAO,CAAC,SAAS,CAAC,CAAA;IACtC,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;YACpC,OAAO,WAAW,CAAA;QACpB,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,WAAW,CAAA;QACzB,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,IAAA,wBAAU,EAAC,SAAS,EAAE,GAAG,CAAC,CAAA;IACjD,MAAM,KAAK,GAAG,IAAA,wCAAiB,EAAC,QAAQ,CAAC,CAAA;IACzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,mCAAmC,CAAC,CAAA;IAClE,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC","sourcesContent":["import builtin from './builtin'\nimport { importCode } from './import_code'\nimport { findClassOrPlugin } from './find_class_or_plugin'\nimport { FormatterImplementation } from './index'\n\nexport async function resolveImplementation(\n specifier: string,\n cwd: string\n): Promise {\n const fromBuiltin = builtin[specifier]\n if (fromBuiltin) {\n if (typeof fromBuiltin !== 'string') {\n return fromBuiltin\n } else {\n specifier = fromBuiltin\n }\n }\n const imported = await importCode(specifier, cwd)\n const found = findClassOrPlugin(imported)\n if (!found) {\n throw new Error(`${specifier} does not export a function/class`)\n }\n return found\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.d.ts new file mode 100644 index 00000000..2b61762b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.d.ts @@ -0,0 +1,6 @@ +import Formatter, { IFormatterOptions } from './'; +export default class SnippetsFormatter extends Formatter { + static readonly documentation: string; + constructor(options: IFormatterOptions); + logSnippets(): void; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.js new file mode 100644 index 00000000..49933c70 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.js @@ -0,0 +1,71 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const messages = __importStar(require("@cucumber/messages")); +const value_checker_1 = require("../value_checker"); +const helpers_1 = require("./helpers"); +const _1 = __importDefault(require("./")); +class SnippetsFormatter extends _1.default { + static documentation = "The Snippets Formatter doesn't output anything regarding the test run; it just prints snippets to implement any undefined steps"; + constructor(options) { + super(options); + options.eventBroadcaster.on('envelope', (envelope) => { + if ((0, value_checker_1.doesHaveValue)(envelope.testRunFinished)) { + this.logSnippets(); + } + }); + } + logSnippets() { + const snippets = []; + this.eventDataCollector.getTestCaseAttempts().forEach((testCaseAttempt) => { + const parsed = (0, helpers_1.parseTestCaseAttempt)({ + snippetBuilder: this.snippetBuilder, + supportCodeLibrary: this.supportCodeLibrary, + testCaseAttempt, + }); + parsed.testSteps.forEach((testStep) => { + if (testStep.result.status === messages.TestStepResultStatus.UNDEFINED) { + snippets.push(testStep.snippet); + } + }); + }); + this.log(snippets.join('\n\n')); + } +} +exports.default = SnippetsFormatter; +//# sourceMappingURL=snippets_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.js.map new file mode 100644 index 00000000..93cce5cb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/snippets_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"snippets_formatter.js","sourceRoot":"","sources":["../../src/formatter/snippets_formatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA8C;AAC9C,oDAAgD;AAChD,uCAAgD;AAChD,0CAAiD;AAGjD,MAAqB,iBAAkB,SAAQ,UAAS;IAC/C,MAAM,CAAU,aAAa,GAClC,iIAAiI,CAAA;IAEnI,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAAmB,EAAE,EAAE;YAC9D,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,WAAW,EAAE,CAAA;YACpB,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,WAAW;QACT,MAAM,QAAQ,GAAa,EAAE,CAAA;QAC7B,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;YACxE,MAAM,MAAM,GAAG,IAAA,8BAAoB,EAAC;gBAClC,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;gBAC3C,eAAe;aAChB,CAAC,CAAA;YACF,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACpC,IACE,QAAQ,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,oBAAoB,CAAC,SAAS,EAClE,CAAC;oBACD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;gBACjC,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QACF,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IACjC,CAAC;;AA9BH,oCA+BC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue } from '../value_checker'\nimport { parseTestCaseAttempt } from './helpers'\nimport Formatter, { IFormatterOptions } from './'\nimport IEnvelope = messages.Envelope\n\nexport default class SnippetsFormatter extends Formatter {\n public static readonly documentation: string =\n \"The Snippets Formatter doesn't output anything regarding the test run; it just prints snippets to implement any undefined steps\"\n\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', (envelope: IEnvelope) => {\n if (doesHaveValue(envelope.testRunFinished)) {\n this.logSnippets()\n }\n })\n }\n\n logSnippets(): void {\n const snippets: string[] = []\n this.eventDataCollector.getTestCaseAttempts().forEach((testCaseAttempt) => {\n const parsed = parseTestCaseAttempt({\n snippetBuilder: this.snippetBuilder,\n supportCodeLibrary: this.supportCodeLibrary,\n testCaseAttempt,\n })\n parsed.testSteps.forEach((testStep) => {\n if (\n testStep.result.status === messages.TestStepResultStatus.UNDEFINED\n ) {\n snippets.push(testStep.snippet)\n }\n })\n })\n this.log(snippets.join('\\n\\n'))\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.d.ts new file mode 100644 index 00000000..c1bc5e81 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.d.ts @@ -0,0 +1,21 @@ +import { ParameterTypeRegistry } from '@cucumber/cucumber-expressions'; +import * as messages from '@cucumber/messages'; +import { KeywordType } from '../helpers'; +import { ISnippetSnytax } from './snippet_syntax'; +export interface INewStepDefinitionSnippetBuilderOptions { + snippetSyntax: ISnippetSnytax; + parameterTypeRegistry: ParameterTypeRegistry; +} +export interface IBuildRequest { + keywordType: KeywordType; + pickleStep: messages.PickleStep; +} +export default class StepDefinitionSnippetBuilder { + private readonly snippetSyntax; + private readonly cucumberExpressionGenerator; + constructor({ snippetSyntax, parameterTypeRegistry, }: INewStepDefinitionSnippetBuilderOptions); + build({ keywordType, pickleStep }: IBuildRequest): string; + buildMultiple({ keywordType, pickleStep }: IBuildRequest): string[]; + getFunctionName(keywordType: KeywordType): string; + getStepParameterNames(step: messages.PickleStep): string[]; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.js b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.js new file mode 100644 index 00000000..c08c8f18 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const cucumber_expressions_1 = require("@cucumber/cucumber-expressions"); +const helpers_1 = require("../helpers"); +const step_arguments_1 = require("../../step_arguments"); +const value_checker_1 = require("../../value_checker"); +class StepDefinitionSnippetBuilder { + snippetSyntax; + cucumberExpressionGenerator; + constructor({ snippetSyntax, parameterTypeRegistry, }) { + this.snippetSyntax = snippetSyntax; + this.cucumberExpressionGenerator = new cucumber_expressions_1.CucumberExpressionGenerator(() => parameterTypeRegistry.parameterTypes); + } + build({ keywordType, pickleStep }) { + const comment = 'Write code here that turns the phrase above into concrete actions'; + const functionName = this.getFunctionName(keywordType); + const generatedExpressions = this.cucumberExpressionGenerator.generateExpressions(pickleStep.text); + const stepParameterNames = this.getStepParameterNames(pickleStep); + return this.snippetSyntax.build({ + comment, + functionName, + generatedExpressions, + stepParameterNames, + }); + } + buildMultiple({ keywordType, pickleStep }) { + const comment = 'Write code here that turns the phrase above into concrete actions'; + const functionName = this.getFunctionName(keywordType); + const generatedExpressions = this.cucumberExpressionGenerator.generateExpressions(pickleStep.text); + const stepParameterNames = this.getStepParameterNames(pickleStep); + return generatedExpressions.map((generatedExpression) => { + return this.snippetSyntax.build({ + comment, + functionName, + generatedExpressions: [generatedExpression], + stepParameterNames, + }); + }); + } + getFunctionName(keywordType) { + switch (keywordType) { + case helpers_1.KeywordType.Event: + return 'When'; + case helpers_1.KeywordType.Outcome: + return 'Then'; + case helpers_1.KeywordType.Precondition: + return 'Given'; + } + } + getStepParameterNames(step) { + if ((0, value_checker_1.doesHaveValue)(step.argument)) { + const argumentName = (0, step_arguments_1.parseStepArgument)(step.argument, { + dataTable: () => 'dataTable', + docString: () => 'docString', + }); + return [argumentName]; + } + return []; + } +} +exports.default = StepDefinitionSnippetBuilder; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.js.map b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.js.map new file mode 100644 index 00000000..fa588455 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/formatter/step_definition_snippet_builder/index.ts"],"names":[],"mappings":";;AAAA,yEAGuC;AAEvC,wCAAwC;AACxC,yDAAwD;AACxD,uDAAmD;AAanD,MAAqB,4BAA4B;IAC9B,aAAa,CAAgB;IAC7B,2BAA2B,CAA6B;IAEzE,YAAY,EACV,aAAa,EACb,qBAAqB,GACmB;QACxC,IAAI,CAAC,aAAa,GAA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AC,KAAK;gBACpB,OAAO,MAAM,CAAA;YACf,KAAK,qBAAW,CAAC,OAAO;gBACtB,OAAO,MAAM,CAAA;YACf,KAAK,qBAAW,CAAC,YAAY;gBAC3B,OAAO,OAAO,CAAA;QAClB,CAAC;IACH,CAAC;IAED,qBAAqB,CAAC,IAAyB;QAC7C,IAAI,IAAA,6BAAa,EAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,MAAM,YAAY,GAAG,IAAA,kCAAiB,EAAC,IAAI,CAAC,QAAQ,EAAE;gBACpD,SAAS,EAAE,GAAG,EAAE,CAAC,WAAW;gBAC5B,SAAS,EAAE,GAAG,EAAE,CAAC,WAAW;aAC7B,CAAC,CAAA;YACF,OAAO,CAAC,YAAY,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;CACF;AAnED,+CAmEC","sourcesContent":["import {\n CucumberExpressionGenerator,\n ParameterTypeRegistry,\n} from '@cucumber/cucumber-expressions'\nimport * as messages from '@cucumber/messages'\nimport { KeywordType } from '../helpers'\nimport { parseStepArgument } from '../../step_arguments'\nimport { doesHaveValue } from '../../value_checker'\nimport { ISnippetSnytax } from './snippet_syntax'\n\nexport interface INewStepDefinitionSnippetBuilderOptions {\n snippetSyntax: ISnippetSnytax\n parameterTypeRegistry: ParameterTypeRegistry\n}\n\nexport interface IBuildRequest {\n keywordType: KeywordType\n pickleStep: messages.PickleStep\n}\n\nexport default class StepDefinitionSnippetBuilder {\n private readonly snippetSyntax: ISnippetSnytax\n private readonly cucumberExpressionGenerator: CucumberExpressionGenerator\n\n constructor({\n snippetSyntax,\n parameterTypeRegistry,\n }: INewStepDefinitionSnippetBuilderOptions) {\n this.snippetSyntax = snippetSyntax\n this.cucumberExpressionGenerator = new CucumberExpressionGenerator(\n () => parameterTypeRegistry.parameterTypes\n )\n }\n\n build({ keywordType, pickleStep }: IBuildRequest): string {\n const comment =\n 'Write code here that turns the phrase above into concrete actions'\n const functionName = this.getFunctionName(keywordType)\n const generatedExpressions =\n this.cucumberExpressionGenerator.generateExpressions(pickleStep.text)\n const stepParameterNames = this.getStepParameterNames(pickleStep)\n return this.snippetSyntax.build({\n comment,\n functionName,\n generatedExpressions,\n stepParameterNames,\n })\n }\n\n buildMultiple({ keywordType, pickleStep }: IBuildRequest): string[] {\n const comment =\n 'Write code here that turns the phrase above into concrete actions'\n const functionName = this.getFunctionName(keywordType)\n const generatedExpressions =\n this.cucumberExpressionGenerator.generateExpressions(pickleStep.text)\n const stepParameterNames = this.getStepParameterNames(pickleStep)\n return generatedExpressions.map((generatedExpression) => {\n return this.snippetSyntax.build({\n comment,\n functionName,\n generatedExpressions: [generatedExpression],\n stepParameterNames,\n })\n })\n }\n\n getFunctionName(keywordType: KeywordType): string {\n switch (keywordType) {\n case KeywordType.Event:\n return 'When'\n case KeywordType.Outcome:\n return 'Then'\n case KeywordType.Precondition:\n return 'Given'\n }\n }\n\n getStepParameterNames(step: messages.PickleStep): string[] {\n if (doesHaveValue(step.argument)) {\n const argumentName = parseStepArgument(step.argument, {\n dataTable: () => 'dataTable',\n docString: () => 'docString',\n })\n return [argumentName]\n }\n return []\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.d.ts new file mode 100644 index 00000000..172b1bc2 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.d.ts @@ -0,0 +1,7 @@ +import { ISnippetSnytax, ISnippetSyntaxBuildOptions, SnippetInterface } from './snippet_syntax'; +export default class JavaScriptSnippetSyntax implements ISnippetSnytax { + private readonly snippetInterface; + constructor(snippetInterface: SnippetInterface); + build({ comment, generatedExpressions, functionName, stepParameterNames, }: ISnippetSyntaxBuildOptions): string; + private escapeSpecialCharacters; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js new file mode 100644 index 00000000..670dcbc9 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const snippet_syntax_1 = require("./snippet_syntax"); +const CALLBACK_NAME = 'callback'; +class JavaScriptSnippetSyntax { + snippetInterface; + constructor(snippetInterface) { + this.snippetInterface = snippetInterface; + } + build({ comment, generatedExpressions, functionName, stepParameterNames, }) { + let functionKeyword = 'function '; + if (this.snippetInterface === snippet_syntax_1.SnippetInterface.AsyncAwait) { + functionKeyword = 'async ' + functionKeyword; + } + let implementation; + if (this.snippetInterface === snippet_syntax_1.SnippetInterface.Callback) { + implementation = `${CALLBACK_NAME}(null, 'pending');`; + } + else if (this.snippetInterface === snippet_syntax_1.SnippetInterface.Promise) { + implementation = "return Promise.resolve('pending');"; + } + else { + implementation = "return 'pending';"; + } + const definitionChoices = generatedExpressions.map((generatedExpression, index) => { + const prefix = index === 0 ? '' : '// '; + const allParameterNames = generatedExpression.parameterNames.concat(stepParameterNames); + if (this.snippetInterface === snippet_syntax_1.SnippetInterface.Callback) { + allParameterNames.push(CALLBACK_NAME); + } + return `${prefix + functionName}('${this.escapeSpecialCharacters(generatedExpression)}', ${functionKeyword}(${allParameterNames.join(', ')}) {\n`; + }); + return (`${definitionChoices.join('')} // ${comment}\n` + + ` ${implementation}\n` + + '});'); + } + escapeSpecialCharacters(generatedExpression) { + let source = generatedExpression.source; + // double up any backslashes because we're in a javascript string + source = source.replace(/\\/g, '\\\\'); + // escape any single quotes because that's our quote delimiter + source = source.replace(/'/g, "\\'"); + return source; + } +} +exports.default = JavaScriptSnippetSyntax; +//# sourceMappingURL=javascript_snippet_syntax.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map new file mode 100644 index 00000000..46b4179a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javascript_snippet_syntax.js","sourceRoot":"","sources":["../../../src/formatter/step_definition_snippet_builder/javascript_snippet_syntax.ts"],"names":[],"mappings":";;AACA,qDAIyB;AAEzB,MAAM,aAAa,GAAG,UAAU,CAAA;AAEhC,MAAqB,uBAAuB;IACzB,gBAAgB,CAAkB;IAEnD,YAAY,gBAAkC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAA;IAC1C,CAAC;IAED,KAAK,CAAC,EACJ,OAAO,EACP,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,GACS;QAC3B,IAAI,eAAe,GAAG,WAAW,CAAA;QACjC,IAAI,IAAI,CAAC,gBAAgB,KAAK,iCAAgB,CAAC,UAAU,EAAE,CAAC;YAC1D,eAAe,GAAG,QAAQ,GAAG,eAAe,CAAA;QAC9C,CAAC;QAED,IAAI,cAAsB,CAAA;QAC1B,IAAI,IAAI,CAAC,gBAAgB,KAAK,iCAAgB,CAAC,QAAQ,EAAE,CAAC;YACxD,cAAc,GAAG,GAAG,aAAa,oBAAoB,CAAA;QACvD,CAAC;aAAM,IAAI,IAAI,CAAC,gBAAgB,KAAK,iCAAgB,CAAC,OAAO,EAAE,CAAC;YAC9D,cAAc,GAAG,oCAAoC,CAAA;QACvD,CAAC;aAAM,CAAC;YACN,cAAc,GAAG,mBAAmB,CAAA;QACtC,CAAC;QAED,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,GAAG,CAChD,CAAC,mBAAmB,EAAE,KAAK,EAAE,EAAE;YAC7B,MAAM,MAAM,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;YACvC,MAAM,iBAAiB,GACrB,mBAAmB,CAAC,cAAc,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAA;YAC/D,IAAI,IAAI,CAAC,gBAAgB,KAAK,iCAAgB,CAAC,QAAQ,EAAE,CAAC;gBACxD,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;YACvC,CAAC;YACD,OAAO,GAAG,MAAM,GAAG,YAAY,KAAK,IAAI,CAAC,uBAAuB,CAC9D,mBAAmB,CACpB,MAAM,eAAe,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;QAC/D,CAAC,CACF,CAAA;QAED,OAAO,CACL,GAAG,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,OAAO,IAAI;YAChD,KAAK,cAAc,IAAI;YACvB,KAAK,CACN,CAAA;IACH,CAAC;IAEO,uBAAuB,CAAC,mBAAwC;QACtE,IAAI,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAA;QACvC,iEAAiE;QACjE,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACtC,8DAA8D;QAC9D,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACpC,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAxDD,0CAwDC","sourcesContent":["import { GeneratedExpression } from '@cucumber/cucumber-expressions'\nimport {\n ISnippetSnytax,\n ISnippetSyntaxBuildOptions,\n SnippetInterface,\n} from './snippet_syntax'\n\nconst CALLBACK_NAME = 'callback'\n\nexport default class JavaScriptSnippetSyntax implements ISnippetSnytax {\n private readonly snippetInterface: SnippetInterface\n\n constructor(snippetInterface: SnippetInterface) {\n this.snippetInterface = snippetInterface\n }\n\n build({\n comment,\n generatedExpressions,\n functionName,\n stepParameterNames,\n }: ISnippetSyntaxBuildOptions): string {\n let functionKeyword = 'function '\n if (this.snippetInterface === SnippetInterface.AsyncAwait) {\n functionKeyword = 'async ' + functionKeyword\n }\n\n let implementation: string\n if (this.snippetInterface === SnippetInterface.Callback) {\n implementation = `${CALLBACK_NAME}(null, 'pending');`\n } else if (this.snippetInterface === SnippetInterface.Promise) {\n implementation = \"return Promise.resolve('pending');\"\n } else {\n implementation = \"return 'pending';\"\n }\n\n const definitionChoices = generatedExpressions.map(\n (generatedExpression, index) => {\n const prefix = index === 0 ? '' : '// '\n const allParameterNames =\n generatedExpression.parameterNames.concat(stepParameterNames)\n if (this.snippetInterface === SnippetInterface.Callback) {\n allParameterNames.push(CALLBACK_NAME)\n }\n return `${prefix + functionName}('${this.escapeSpecialCharacters(\n generatedExpression\n )}', ${functionKeyword}(${allParameterNames.join(', ')}) {\\n`\n }\n )\n\n return (\n `${definitionChoices.join('')} // ${comment}\\n` +\n ` ${implementation}\\n` +\n '});'\n )\n }\n\n private escapeSpecialCharacters(generatedExpression: GeneratedExpression) {\n let source = generatedExpression.source\n // double up any backslashes because we're in a javascript string\n source = source.replace(/\\\\/g, '\\\\\\\\')\n // escape any single quotes because that's our quote delimiter\n source = source.replace(/'/g, \"\\\\'\")\n return source\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts new file mode 100644 index 00000000..53d7d025 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts @@ -0,0 +1,16 @@ +import { GeneratedExpression } from '@cucumber/cucumber-expressions'; +export declare enum SnippetInterface { + AsyncAwait = "async-await", + Callback = "callback", + Promise = "promise", + Synchronous = "synchronous" +} +export interface ISnippetSyntaxBuildOptions { + comment: string; + functionName: string; + generatedExpressions: readonly GeneratedExpression[]; + stepParameterNames: string[]; +} +export interface ISnippetSnytax { + build: (options: ISnippetSyntaxBuildOptions) => string; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.js b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.js new file mode 100644 index 00000000..2c59940b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SnippetInterface = void 0; +var SnippetInterface; +(function (SnippetInterface) { + SnippetInterface["AsyncAwait"] = "async-await"; + SnippetInterface["Callback"] = "callback"; + SnippetInterface["Promise"] = "promise"; + SnippetInterface["Synchronous"] = "synchronous"; +})(SnippetInterface || (exports.SnippetInterface = SnippetInterface = {})); +//# sourceMappingURL=snippet_syntax.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map new file mode 100644 index 00000000..f067aa40 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map @@ -0,0 +1 @@ +{"version":3,"file":"snippet_syntax.js","sourceRoot":"","sources":["../../../src/formatter/step_definition_snippet_builder/snippet_syntax.ts"],"names":[],"mappings":";;;AAEA,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,8CAA0B,CAAA;IAC1B,yCAAqB,CAAA;IACrB,uCAAmB,CAAA;IACnB,+CAA2B,CAAA;AAC7B,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B","sourcesContent":["import { GeneratedExpression } from '@cucumber/cucumber-expressions'\n\nexport enum SnippetInterface {\n AsyncAwait = 'async-await',\n Callback = 'callback',\n Promise = 'promise',\n Synchronous = 'synchronous',\n}\n\nexport interface ISnippetSyntaxBuildOptions {\n comment: string\n functionName: string\n generatedExpressions: readonly GeneratedExpression[]\n stepParameterNames: string[]\n}\n\nexport interface ISnippetSnytax {\n build: (options: ISnippetSyntaxBuildOptions) => string\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.d.ts new file mode 100644 index 00000000..e3288657 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.d.ts @@ -0,0 +1,14 @@ +import * as messages from '@cucumber/messages'; +import { ITestCaseAttempt } from './helpers/event_data_collector'; +import Formatter, { IFormatterOptions } from './'; +interface ILogIssuesRequest { + issues: ITestCaseAttempt[]; + title: string; +} +export default class SummaryFormatter extends Formatter { + static readonly documentation: string; + constructor(options: IFormatterOptions); + logSummary(testRunDuration: messages.Duration): void; + logIssues({ issues, title }: ILogIssuesRequest): void; +} +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.js new file mode 100644 index 00000000..e0fce672 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.js @@ -0,0 +1,68 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const value_checker_1 = require("../value_checker"); +const time_1 = require("../time"); +const helpers_1 = require("./helpers"); +const issue_helpers_1 = require("./helpers/issue_helpers"); +const _1 = __importDefault(require("./")); +class SummaryFormatter extends _1.default { + static documentation = 'Summary output of feature and scenarios'; + constructor(options) { + super(options); + let testRunStartedTimestamp; + options.eventBroadcaster.on('envelope', (envelope) => { + if ((0, value_checker_1.doesHaveValue)(envelope.testRunStarted)) { + testRunStartedTimestamp = envelope.testRunStarted.timestamp; + } + if ((0, value_checker_1.doesHaveValue)(envelope.testRunFinished)) { + const testRunFinishedTimestamp = envelope.testRunFinished.timestamp; + this.logSummary((0, time_1.durationBetweenTimestamps)(testRunStartedTimestamp, testRunFinishedTimestamp)); + } + }); + } + logSummary(testRunDuration) { + const failures = []; + const warnings = []; + const testCaseAttempts = this.eventDataCollector.getTestCaseAttempts(); + testCaseAttempts.forEach((testCaseAttempt) => { + if ((0, helpers_1.isFailure)(testCaseAttempt.worstTestStepResult, testCaseAttempt.willBeRetried)) { + failures.push(testCaseAttempt); + } + else if ((0, helpers_1.isWarning)(testCaseAttempt.worstTestStepResult, testCaseAttempt.willBeRetried)) { + warnings.push(testCaseAttempt); + } + }); + if (this.eventDataCollector.undefinedParameterTypes.length > 0) { + this.log((0, issue_helpers_1.formatUndefinedParameterTypes)(this.eventDataCollector.undefinedParameterTypes)); + } + if (failures.length > 0) { + this.logIssues({ issues: failures, title: 'Failures' }); + } + if (warnings.length > 0) { + this.logIssues({ issues: warnings, title: 'Warnings' }); + } + this.log((0, helpers_1.formatSummary)({ + colorFns: this.colorFns, + testCaseAttempts, + testRunDuration, + })); + } + logIssues({ issues, title }) { + this.log(`${title}:\n\n`); + issues.forEach((testCaseAttempt, index) => { + this.log((0, helpers_1.formatIssue)({ + colorFns: this.colorFns, + number: index + 1, + snippetBuilder: this.snippetBuilder, + supportCodeLibrary: this.supportCodeLibrary, + testCaseAttempt, + printAttachments: this.printAttachments, + })); + }); + } +} +exports.default = SummaryFormatter; +//# sourceMappingURL=summary_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.js.map new file mode 100644 index 00000000..3e3c06dd --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/summary_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"summary_formatter.js","sourceRoot":"","sources":["../../src/formatter/summary_formatter.ts"],"names":[],"mappings":";;;;;AACA,oDAAgD;AAChD,kCAAmD;AACnD,uCAA4E;AAE5E,2DAAuE;AACvE,0CAAiD;AAOjD,MAAqB,gBAAiB,SAAQ,UAAS;IAC9C,MAAM,CAAU,aAAa,GAClC,yCAAyC,CAAA;IAE3C,YAAY,OAA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N,IAAA,6CAA6B,EAC3B,IAAI,CAAC,kBAAkB,CAAC,uBAAuB,CAChD,CACF,CAAA;QACH,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAA;QACzD,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAA;QACzD,CAAC;QACD,IAAI,CAAC,GAAG,CACN,IAAA,uBAAa,EAAC;YACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,gBAAgB;YAChB,eAAe;SAChB,CAAC,CACH,CAAA;IACH,CAAC;IAED,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAqB;QAC5C,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,CAAA;QACzB,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,KAAK,EAAE,EAAE;YACxC,IAAI,CAAC,GAAG,CACN,IAAA,qBAAW,EAAC;gBACV,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,KAAK,GAAG,CAAC;gBACjB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;gBAC3C,eAAe;gBACf,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;aACxC,CAAC,CACH,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;;AAhFH,mCAiFC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue } from '../value_checker'\nimport { durationBetweenTimestamps } from '../time'\nimport { formatIssue, formatSummary, isFailure, isWarning } from './helpers'\nimport { ITestCaseAttempt } from './helpers/event_data_collector'\nimport { formatUndefinedParameterTypes } from './helpers/issue_helpers'\nimport Formatter, { IFormatterOptions } from './'\n\ninterface ILogIssuesRequest {\n issues: ITestCaseAttempt[]\n title: string\n}\n\nexport default class SummaryFormatter extends Formatter {\n public static readonly documentation: string =\n 'Summary output of feature and scenarios'\n\n constructor(options: IFormatterOptions) {\n super(options)\n let testRunStartedTimestamp: messages.Timestamp\n options.eventBroadcaster.on('envelope', (envelope: messages.Envelope) => {\n if (doesHaveValue(envelope.testRunStarted)) {\n testRunStartedTimestamp = envelope.testRunStarted.timestamp\n }\n if (doesHaveValue(envelope.testRunFinished)) {\n const testRunFinishedTimestamp = envelope.testRunFinished.timestamp\n this.logSummary(\n durationBetweenTimestamps(\n testRunStartedTimestamp,\n testRunFinishedTimestamp\n )\n )\n }\n })\n }\n\n logSummary(testRunDuration: messages.Duration): void {\n const failures: ITestCaseAttempt[] = []\n const warnings: ITestCaseAttempt[] = []\n const testCaseAttempts = this.eventDataCollector.getTestCaseAttempts()\n testCaseAttempts.forEach((testCaseAttempt) => {\n if (\n isFailure(\n testCaseAttempt.worstTestStepResult,\n testCaseAttempt.willBeRetried\n )\n ) {\n failures.push(testCaseAttempt)\n } else if (\n isWarning(\n testCaseAttempt.worstTestStepResult,\n testCaseAttempt.willBeRetried\n )\n ) {\n warnings.push(testCaseAttempt)\n }\n })\n if (this.eventDataCollector.undefinedParameterTypes.length > 0) {\n this.log(\n formatUndefinedParameterTypes(\n this.eventDataCollector.undefinedParameterTypes\n )\n )\n }\n if (failures.length > 0) {\n this.logIssues({ issues: failures, title: 'Failures' })\n }\n if (warnings.length > 0) {\n this.logIssues({ issues: warnings, title: 'Warnings' })\n }\n this.log(\n formatSummary({\n colorFns: this.colorFns,\n testCaseAttempts,\n testRunDuration,\n })\n )\n }\n\n logIssues({ issues, title }: ILogIssuesRequest): void {\n this.log(`${title}:\\n\\n`)\n issues.forEach((testCaseAttempt, index) => {\n this.log(\n formatIssue({\n colorFns: this.colorFns,\n number: index + 1,\n snippetBuilder: this.snippetBuilder,\n supportCodeLibrary: this.supportCodeLibrary,\n testCaseAttempt,\n printAttachments: this.printAttachments,\n })\n )\n })\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.d.ts new file mode 100644 index 00000000..517909a7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.d.ts @@ -0,0 +1,6 @@ +import Formatter, { IFormatterOptions } from './'; +export default class UsageFormatter extends Formatter { + static readonly documentation: string; + constructor(options: IFormatterOptions); + logUsage(): void; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.js new file mode 100644 index 00000000..28b5e948 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.js @@ -0,0 +1,108 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const cli_table3_1 = __importDefault(require("cli-table3")); +const messages = __importStar(require("@cucumber/messages")); +const value_checker_1 = require("../value_checker"); +const helpers_1 = require("./helpers"); +const _1 = __importDefault(require("./")); +class UsageFormatter extends _1.default { + static documentation = 'Prints where step definitions are used. The slowest step definitions (with duration) are listed first. If --dry-run is used the duration is not shown, and step definitions are sorted by filename instead.'; + constructor(options) { + super(options); + options.eventBroadcaster.on('envelope', (envelope) => { + if ((0, value_checker_1.doesHaveValue)(envelope.testRunFinished)) { + this.logUsage(); + } + }); + } + logUsage() { + const usage = (0, helpers_1.getUsage)({ + stepDefinitions: this.supportCodeLibrary.stepDefinitions, + eventDataCollector: this.eventDataCollector, + }); + if (usage.length === 0) { + this.log('No step definitions'); + return; + } + const table = new cli_table3_1.default({ + head: ['Pattern / Text', 'Duration', 'Location'], + style: { + border: [], + head: [], + }, + }); + usage.forEach(({ line, matches, meanDuration, pattern, patternType, uri }) => { + let formattedPattern = pattern; + if (patternType === 'RegularExpression') { + formattedPattern = '/' + formattedPattern + '/'; + } + const col1 = [formattedPattern]; + const col2 = []; + if (matches.length > 0) { + if ((0, value_checker_1.doesHaveValue)(meanDuration)) { + col2.push(`${messages.TimeConversion.durationToMilliseconds(meanDuration).toFixed(2)}ms`); + } + else { + col2.push('-'); + } + } + else { + col2.push('UNUSED'); + } + const col3 = [(0, helpers_1.formatLocation)({ line, uri })]; + matches.slice(0, 5).forEach((match) => { + col1.push(` ${match.text}`); + if ((0, value_checker_1.doesHaveValue)(match.duration)) { + col2.push(`${messages.TimeConversion.durationToMilliseconds(match.duration).toFixed(2)}ms`); + } + else { + col2.push('-'); + } + col3.push((0, helpers_1.formatLocation)(match)); + }); + if (matches.length > 5) { + col1.push(` ${(matches.length - 5).toString()} more`); + } + table.push([col1.join('\n'), col2.join('\n'), col3.join('\n')]); + }); + this.log(`${table.toString()}\n`); + } +} +exports.default = UsageFormatter; +//# sourceMappingURL=usage_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.js.map new file mode 100644 index 00000000..ba17e044 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/usage_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"usage_formatter.js","sourceRoot":"","sources":["../../src/formatter/usage_formatter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8B;AAC9B,6DAA8C;AAC9C,oDAAgD;AAChD,uCAAoD;AACpD,0CAAiD;AAGjD,MAAqB,cAAe,SAAQ,UAAS;IAC5C,MAAM,CAAU,aAAa,GAClC,6MAA6M,CAAA;IAE/M,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAAmB,EAAE,EAAE;YAC9D,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,QAAQ,EAAE,CAAA;YACjB,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,QAAQ;QACN,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC;YACrB,eAAe,EAAE,IAAI,CAAC,kBAAkB,CAAC,eAAe;YACxD,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;SAC5C,CAAC,CAAA;QACF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;YAC/B,OAAM;QACR,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,oBAAK,CAAC;YACtB,IAAI,EAAE,CAAC,gBAAgB,EAAE,UAA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oBAClC,IAAI,CAAC,IAAI,CACP,GAAG,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAC/C,KAAK,CAAC,QAAQ,CACf,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACjB,CAAA;gBACH,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBAChB,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,IAAA,wBAAc,EAAC,KAAK,CAAC,CAAC,CAAA;YAClC,CAAC,CAAC,CAAA;YACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;YACxD,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAQ,CAAC,CAAA;QACxE,CAAC,CACF,CAAA;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;;AAvEH,iCAwEC","sourcesContent":["import Table from 'cli-table3'\nimport * as messages from '@cucumber/messages'\nimport { doesHaveValue } from '../value_checker'\nimport { formatLocation, getUsage } from './helpers'\nimport Formatter, { IFormatterOptions } from './'\nimport IEnvelope = messages.Envelope\n\nexport default class UsageFormatter extends Formatter {\n public static readonly documentation: string =\n 'Prints where step definitions are used. The slowest step definitions (with duration) are listed first. If --dry-run is used the duration is not shown, and step definitions are sorted by filename instead.'\n\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', (envelope: IEnvelope) => {\n if (doesHaveValue(envelope.testRunFinished)) {\n this.logUsage()\n }\n })\n }\n\n logUsage(): void {\n const usage = getUsage({\n stepDefinitions: this.supportCodeLibrary.stepDefinitions,\n eventDataCollector: this.eventDataCollector,\n })\n if (usage.length === 0) {\n this.log('No step definitions')\n return\n }\n const table = new Table({\n head: ['Pattern / Text', 'Duration', 'Location'],\n style: {\n border: [],\n head: [],\n },\n })\n usage.forEach(\n ({ line, matches, meanDuration, pattern, patternType, uri }) => {\n let formattedPattern = pattern\n if (patternType === 'RegularExpression') {\n formattedPattern = '/' + formattedPattern + '/'\n }\n const col1 = [formattedPattern]\n const col2 = []\n if (matches.length > 0) {\n if (doesHaveValue(meanDuration)) {\n col2.push(\n `${messages.TimeConversion.durationToMilliseconds(\n meanDuration\n ).toFixed(2)}ms`\n )\n } else {\n col2.push('-')\n }\n } else {\n col2.push('UNUSED')\n }\n const col3 = [formatLocation({ line, uri })]\n matches.slice(0, 5).forEach((match) => {\n col1.push(` ${match.text}`)\n if (doesHaveValue(match.duration)) {\n col2.push(\n `${messages.TimeConversion.durationToMilliseconds(\n match.duration\n ).toFixed(2)}ms`\n )\n } else {\n col2.push('-')\n }\n col3.push(formatLocation(match))\n })\n if (matches.length > 5) {\n col1.push(` ${(matches.length - 5).toString()} more`)\n }\n table.push([col1.join('\\n'), col2.join('\\n'), col3.join('\\n')] as any)\n }\n )\n this.log(`${table.toString()}\\n`)\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.d.ts b/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.d.ts new file mode 100644 index 00000000..a77a035f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.d.ts @@ -0,0 +1,7 @@ +import Formatter, { IFormatterOptions } from './'; +export default class UsageJsonFormatter extends Formatter { + static readonly documentation: string; + constructor(options: IFormatterOptions); + logUsage(): void; + replacer(key: string, value: any): any; +} diff --git a/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.js b/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.js new file mode 100644 index 00000000..4b21750d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.js @@ -0,0 +1,34 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const value_checker_1 = require("../value_checker"); +const helpers_1 = require("./helpers"); +const _1 = __importDefault(require("./")); +class UsageJsonFormatter extends _1.default { + static documentation = 'Does what the Usage Formatter does, but outputs JSON, which can be output to a file and then consumed by other tools.'; + constructor(options) { + super(options); + options.eventBroadcaster.on('envelope', (envelope) => { + if ((0, value_checker_1.doesHaveValue)(envelope.testRunFinished)) { + this.logUsage(); + } + }); + } + logUsage() { + const usage = (0, helpers_1.getUsage)({ + stepDefinitions: this.supportCodeLibrary.stepDefinitions, + eventDataCollector: this.eventDataCollector, + }); + this.log(JSON.stringify(usage, this.replacer, 2)); + } + replacer(key, value) { + if (key === 'seconds') { + return parseInt(value); + } + return value; + } +} +exports.default = UsageJsonFormatter; +//# sourceMappingURL=usage_json_formatter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.js.map b/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.js.map new file mode 100644 index 00000000..bd0b723e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/formatter/usage_json_formatter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"usage_json_formatter.js","sourceRoot":"","sources":["../../src/formatter/usage_json_formatter.ts"],"names":[],"mappings":";;;;;AACA,oDAAgD;AAChD,uCAAoC;AACpC,0CAAiD;AAGjD,MAAqB,kBAAmB,SAAQ,UAAS;IAChD,MAAM,CAAU,aAAa,GAClC,uHAAuH,CAAA;IAEzH,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAAmB,EAAE,EAAE;YAC9D,IAAI,IAAA,6BAAa,EAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC5C,IAAI,CAAC,QAAQ,EAAE,CAAA;YACjB,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,QAAQ;QACN,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC;YACrB,eAAe,EAAE,IAAI,CAAC,kBAAkB,CAAC,eAAe;YACxD,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;SAC5C,CAAC,CAAA;QACF,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;IACnD,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAU;QAC9B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAA;QACxB,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;;AA1BH,qCA2BC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { doesHaveValue } from '../value_checker'\nimport { getUsage } from './helpers'\nimport Formatter, { IFormatterOptions } from './'\nimport IEnvelope = messages.Envelope\n\nexport default class UsageJsonFormatter extends Formatter {\n public static readonly documentation: string =\n 'Does what the Usage Formatter does, but outputs JSON, which can be output to a file and then consumed by other tools.'\n\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', (envelope: IEnvelope) => {\n if (doesHaveValue(envelope.testRunFinished)) {\n this.logUsage()\n }\n })\n }\n\n logUsage(): void {\n const usage = getUsage({\n stepDefinitions: this.supportCodeLibrary.stepDefinitions,\n eventDataCollector: this.eventDataCollector,\n })\n this.log(JSON.stringify(usage, this.replacer, 2))\n }\n\n replacer(key: string, value: any): any {\n if (key === 'seconds') {\n return parseInt(value)\n }\n return value\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/index.d.ts b/node_modules/@cucumber/cucumber/lib/index.d.ts new file mode 100644 index 00000000..1ad7aa72 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/index.d.ts @@ -0,0 +1,53 @@ +/** + * User code functions and helpers + * + * @packageDocumentation + * @module (root) + * @remarks + * These docs cover the functions and helpers for user code registration and test setup. The entry point is `@cucumber/cucumber`. + */ +import * as messages from '@cucumber/messages'; +import { default as _Cli } from './cli'; +import * as formatterHelpers from './formatter/helpers'; +import * as parallelCanAssignHelpers from './support_code_library_builder/parallel_can_assign_helpers'; +export declare const version: string; +export { IConfiguration, IProfiles } from './configuration'; +export { default as supportCodeLibraryBuilder } from './support_code_library_builder'; +export { default as DataTable } from './models/data_table'; +export { default as TestCaseHookDefinition } from './models/test_case_hook_definition'; +export { default as Formatter, IFormatterOptions } from './formatter'; +export { default as FormatterBuilder } from './formatter/builder'; +export { default as JsonFormatter } from './formatter/json_formatter'; +export { default as ProgressFormatter } from './formatter/progress_formatter'; +export { default as RerunFormatter } from './formatter/rerun_formatter'; +export { default as SnippetsFormatter } from './formatter/snippets_formatter'; +export { default as SummaryFormatter } from './formatter/summary_formatter'; +export { default as UsageFormatter } from './formatter/usage_formatter'; +export { default as UsageJsonFormatter } from './formatter/usage_json_formatter'; +export { formatterHelpers }; +export declare const After: (>(code: import("./support_code_library_builder/types").TestCaseHookFunction) => void) & (>(tags: string, code: import("./support_code_library_builder/types").TestCaseHookFunction) => void) & (>(options: import("./support_code_library_builder/types").IDefineTestCaseHookOptions, code: import("./support_code_library_builder/types").TestCaseHookFunction) => void); +export declare const AfterAll: ((code: import("./support_code_library_builder/types").TestRunHookFunction) => void) & ((options: import("./support_code_library_builder/types").IDefineTestRunHookOptions, code: import("./support_code_library_builder/types").TestRunHookFunction) => void); +export declare const AfterStep: (>(code: import("./support_code_library_builder/types").TestStepHookFunction) => void) & (>(tags: string, code: import("./support_code_library_builder/types").TestStepHookFunction) => void) & (>(options: import("./support_code_library_builder/types").IDefineTestStepHookOptions, code: import("./support_code_library_builder/types").TestStepHookFunction) => void); +export declare const Before: (>(code: import("./support_code_library_builder/types").TestCaseHookFunction) => void) & (>(tags: string, code: import("./support_code_library_builder/types").TestCaseHookFunction) => void) & (>(options: import("./support_code_library_builder/types").IDefineTestCaseHookOptions, code: import("./support_code_library_builder/types").TestCaseHookFunction) => void); +export declare const BeforeAll: ((code: import("./support_code_library_builder/types").TestRunHookFunction) => void) & ((options: import("./support_code_library_builder/types").IDefineTestRunHookOptions, code: import("./support_code_library_builder/types").TestRunHookFunction) => void); +export declare const BeforeStep: (>(code: import("./support_code_library_builder/types").TestStepHookFunction) => void) & (>(tags: string, code: import("./support_code_library_builder/types").TestStepHookFunction) => void) & (>(options: import("./support_code_library_builder/types").IDefineTestStepHookOptions, code: import("./support_code_library_builder/types").TestStepHookFunction) => void); +export declare const defineStep: import("./support_code_library_builder/types").IDefineStep; +export declare const defineParameterType: (options: import("./support_code_library_builder/types").IParameterTypeDefinition) => void; +export declare const Given: import("./support_code_library_builder/types").IDefineStep; +export declare const setDefaultTimeout: (milliseconds: number) => void; +export declare const setDefinitionFunctionWrapper: (fn: Function) => void; +export declare const setWorldConstructor: (fn: any) => void; +export declare const setParallelCanAssign: (fn: import("./support_code_library_builder/types").ParallelAssignmentValidator) => void; +export declare const Then: import("./support_code_library_builder/types").IDefineStep; +export declare const When: import("./support_code_library_builder/types").IDefineStep; +export { default as World, IWorld, IWorldOptions, } from './support_code_library_builder/world'; +export { IContext } from './support_code_library_builder/context'; +export { worldProxy as world, contextProxy as context } from './runtime/scope'; +export { parallelCanAssignHelpers }; +export { ITestCaseHookParameter, ITestStepHookParameter, } from './support_code_library_builder/types'; +export declare const Status: typeof messages.TestStepResultStatus; +export { wrapPromiseWithTimeout } from './time'; +/** + * @deprecated use `runCucumber` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md + */ +export declare const Cli: typeof _Cli; diff --git a/node_modules/@cucumber/cucumber/lib/index.js b/node_modules/@cucumber/cucumber/lib/index.js new file mode 100644 index 00000000..94e49abe --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/index.js @@ -0,0 +1,116 @@ +"use strict"; +/** + * User code functions and helpers + * + * @packageDocumentation + * @module (root) + * @remarks + * These docs cover the functions and helpers for user code registration and test setup. The entry point is `@cucumber/cucumber`. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Cli = exports.wrapPromiseWithTimeout = exports.Status = exports.parallelCanAssignHelpers = exports.context = exports.world = exports.World = exports.When = exports.Then = exports.setParallelCanAssign = exports.setWorldConstructor = exports.setDefinitionFunctionWrapper = exports.setDefaultTimeout = exports.Given = exports.defineParameterType = exports.defineStep = exports.BeforeStep = exports.BeforeAll = exports.Before = exports.AfterStep = exports.AfterAll = exports.After = exports.formatterHelpers = exports.UsageJsonFormatter = exports.UsageFormatter = exports.SummaryFormatter = exports.SnippetsFormatter = exports.RerunFormatter = exports.ProgressFormatter = exports.JsonFormatter = exports.FormatterBuilder = exports.Formatter = exports.TestCaseHookDefinition = exports.DataTable = exports.supportCodeLibraryBuilder = exports.version = void 0; +const node_util_1 = require("node:util"); +const messages = __importStar(require("@cucumber/messages")); +const cli_1 = __importDefault(require("./cli")); +const formatterHelpers = __importStar(require("./formatter/helpers")); +exports.formatterHelpers = formatterHelpers; +const parallelCanAssignHelpers = __importStar(require("./support_code_library_builder/parallel_can_assign_helpers")); +exports.parallelCanAssignHelpers = parallelCanAssignHelpers; +const support_code_library_builder_1 = __importDefault(require("./support_code_library_builder")); +const version_1 = require("./version"); +// type version as string to avoid tripping api-extractor every release +exports.version = version_1.version; +// Top level +var support_code_library_builder_2 = require("./support_code_library_builder"); +Object.defineProperty(exports, "supportCodeLibraryBuilder", { enumerable: true, get: function () { return __importDefault(support_code_library_builder_2).default; } }); +var data_table_1 = require("./models/data_table"); +Object.defineProperty(exports, "DataTable", { enumerable: true, get: function () { return __importDefault(data_table_1).default; } }); +var test_case_hook_definition_1 = require("./models/test_case_hook_definition"); +Object.defineProperty(exports, "TestCaseHookDefinition", { enumerable: true, get: function () { return __importDefault(test_case_hook_definition_1).default; } }); +// Formatters +var formatter_1 = require("./formatter"); +Object.defineProperty(exports, "Formatter", { enumerable: true, get: function () { return __importDefault(formatter_1).default; } }); +var builder_1 = require("./formatter/builder"); +Object.defineProperty(exports, "FormatterBuilder", { enumerable: true, get: function () { return __importDefault(builder_1).default; } }); +var json_formatter_1 = require("./formatter/json_formatter"); +Object.defineProperty(exports, "JsonFormatter", { enumerable: true, get: function () { return __importDefault(json_formatter_1).default; } }); +var progress_formatter_1 = require("./formatter/progress_formatter"); +Object.defineProperty(exports, "ProgressFormatter", { enumerable: true, get: function () { return __importDefault(progress_formatter_1).default; } }); +var rerun_formatter_1 = require("./formatter/rerun_formatter"); +Object.defineProperty(exports, "RerunFormatter", { enumerable: true, get: function () { return __importDefault(rerun_formatter_1).default; } }); +var snippets_formatter_1 = require("./formatter/snippets_formatter"); +Object.defineProperty(exports, "SnippetsFormatter", { enumerable: true, get: function () { return __importDefault(snippets_formatter_1).default; } }); +var summary_formatter_1 = require("./formatter/summary_formatter"); +Object.defineProperty(exports, "SummaryFormatter", { enumerable: true, get: function () { return __importDefault(summary_formatter_1).default; } }); +var usage_formatter_1 = require("./formatter/usage_formatter"); +Object.defineProperty(exports, "UsageFormatter", { enumerable: true, get: function () { return __importDefault(usage_formatter_1).default; } }); +var usage_json_formatter_1 = require("./formatter/usage_json_formatter"); +Object.defineProperty(exports, "UsageJsonFormatter", { enumerable: true, get: function () { return __importDefault(usage_json_formatter_1).default; } }); +// Support Code Functions +const { methods } = support_code_library_builder_1.default; +exports.After = methods.After; +exports.AfterAll = methods.AfterAll; +exports.AfterStep = methods.AfterStep; +exports.Before = methods.Before; +exports.BeforeAll = methods.BeforeAll; +exports.BeforeStep = methods.BeforeStep; +exports.defineStep = methods.defineStep; +exports.defineParameterType = methods.defineParameterType; +exports.Given = methods.Given; +exports.setDefaultTimeout = methods.setDefaultTimeout; +exports.setDefinitionFunctionWrapper = methods.setDefinitionFunctionWrapper; +exports.setWorldConstructor = methods.setWorldConstructor; +exports.setParallelCanAssign = methods.setParallelCanAssign; +exports.Then = methods.Then; +exports.When = methods.When; +var world_1 = require("./support_code_library_builder/world"); +Object.defineProperty(exports, "World", { enumerable: true, get: function () { return __importDefault(world_1).default; } }); +var scope_1 = require("./runtime/scope"); +Object.defineProperty(exports, "world", { enumerable: true, get: function () { return scope_1.worldProxy; } }); +Object.defineProperty(exports, "context", { enumerable: true, get: function () { return scope_1.contextProxy; } }); +exports.Status = messages.TestStepResultStatus; +// Time helpers +var time_1 = require("./time"); +Object.defineProperty(exports, "wrapPromiseWithTimeout", { enumerable: true, get: function () { return time_1.wrapPromiseWithTimeout; } }); +// Deprecated +/** + * @deprecated use `runCucumber` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md + */ +exports.Cli = (0, node_util_1.deprecate)(cli_1.default, '`Cli` is deprecated, use `runCucumber` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md'); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/index.js.map b/node_modules/@cucumber/cucumber/lib/index.js.map new file mode 100644 index 00000000..bd69f4b1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAqC;AACrC,6DAA8C;AAC9C,gDAAuC;AACvC,sEAAuD;AA0B9C,4CAAgB;AAzBzB,qHAAsG;AAmD7F,4DAAwB;AAlDjC,kGAAsE;AACtE,uCAA+C;AAE/C,uEAAuE;AAC1D,QAAA,OAAO,GAAG,iBAAkB,CAAA;AAKzC,YAAY;AACZ,+EAAqF;AAA5E,0JAAA,OAAO,OAA6B;AAC7C,kDAA0D;AAAjD,wHAAA,OAAO,OAAa;AAC7B,gFAAsF;AAA7E,oJAAA,OAAO,OAA0B;AAE1C,aAAa;AACb,yCAAqE;AAA5D,uHAAA,OAAO,OAAa;AAC7B,+CAAiE;AAAxD,4HAAA,OAAO,OAAoB;AACpC,6DAAqE;AAA5D,gIAAA,OAAO,OAAiB;AACjC,qEAA6E;AAApE,wIAAA,OAAO,OAAqB;AACrC,+DAAuE;AAA9D,kIAAA,OAAO,OAAkB;AAClC,qEAA6E;AAApE,wIAAA,OAAO,OAAqB;AACrC,mEAA2E;AAAlE,sIAAA,OAAO,OAAoB;AACpC,+DAAuE;AAA9D,kIAAA,OAAO,OAAkB;AAClC,yEAAgF;AAAvE,2IAAA,OAAO,OAAsB;AAGtC,yBAAyB;AACzB,MAAM,EAAE,OAAO,EAAE,GAAG,sCAAyB,CAAA;AAChC,QAAA,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;AACrB,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;AAC3B,QAAA,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;AAC7B,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AACvB,QAAA,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;AAC7B,QAAA,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;AAC/B,QAAA,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;AAC/B,QAAA,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAA;AACjD,QAAA,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;AACrB,QAAA,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAA;AAC7C,QAAA,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAA;AACnE,QAAA,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAA;AACjD,QAAA,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAA;AACnD,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACnB,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AAChC,8DAI6C;AAH3C,+GAAA,OAAO,OAAS;AAKlB,yCAA8E;AAArE,8FAAA,UAAU,OAAS;AAAE,gGAAA,YAAY,OAAW;AAOxC,QAAA,MAAM,GAAG,QAAQ,CAAC,oBAAoB,CAAA;AAEnD,eAAe;AACf,+BAA+C;AAAtC,8GAAA,sBAAsB,OAAA;AAE/B,aAAa;AACb;;GAEG;AACU,QAAA,GAAG,GAAG,IAAA,qBAAS,EAC1B,aAAI,EACJ,4HAA4H,CAC7H,CAAA","sourcesContent":["/**\n * User code functions and helpers\n *\n * @packageDocumentation\n * @module (root)\n * @remarks\n * These docs cover the functions and helpers for user code registration and test setup. The entry point is `@cucumber/cucumber`.\n */\n\nimport { deprecate } from 'node:util'\nimport * as messages from '@cucumber/messages'\nimport { default as _Cli } from './cli'\nimport * as formatterHelpers from './formatter/helpers'\nimport * as parallelCanAssignHelpers from './support_code_library_builder/parallel_can_assign_helpers'\nimport supportCodeLibraryBuilder from './support_code_library_builder'\nimport { version as _version } from './version'\n\n// type version as string to avoid tripping api-extractor every release\nexport const version = _version as string\n\n// Configuration\nexport { IConfiguration, IProfiles } from './configuration'\n\n// Top level\nexport { default as supportCodeLibraryBuilder } from './support_code_library_builder'\nexport { default as DataTable } from './models/data_table'\nexport { default as TestCaseHookDefinition } from './models/test_case_hook_definition'\n\n// Formatters\nexport { default as Formatter, IFormatterOptions } from './formatter'\nexport { default as FormatterBuilder } from './formatter/builder'\nexport { default as JsonFormatter } from './formatter/json_formatter'\nexport { default as ProgressFormatter } from './formatter/progress_formatter'\nexport { default as RerunFormatter } from './formatter/rerun_formatter'\nexport { default as SnippetsFormatter } from './formatter/snippets_formatter'\nexport { default as SummaryFormatter } from './formatter/summary_formatter'\nexport { default as UsageFormatter } from './formatter/usage_formatter'\nexport { default as UsageJsonFormatter } from './formatter/usage_json_formatter'\nexport { formatterHelpers }\n\n// Support Code Functions\nconst { methods } = supportCodeLibraryBuilder\nexport const After = methods.After\nexport const AfterAll = methods.AfterAll\nexport const AfterStep = methods.AfterStep\nexport const Before = methods.Before\nexport const BeforeAll = methods.BeforeAll\nexport const BeforeStep = methods.BeforeStep\nexport const defineStep = methods.defineStep\nexport const defineParameterType = methods.defineParameterType\nexport const Given = methods.Given\nexport const setDefaultTimeout = methods.setDefaultTimeout\nexport const setDefinitionFunctionWrapper = methods.setDefinitionFunctionWrapper\nexport const setWorldConstructor = methods.setWorldConstructor\nexport const setParallelCanAssign = methods.setParallelCanAssign\nexport const Then = methods.Then\nexport const When = methods.When\nexport {\n default as World,\n IWorld,\n IWorldOptions,\n} from './support_code_library_builder/world'\nexport { IContext } from './support_code_library_builder/context'\nexport { worldProxy as world, contextProxy as context } from './runtime/scope'\nexport { parallelCanAssignHelpers }\n\nexport {\n ITestCaseHookParameter,\n ITestStepHookParameter,\n} from './support_code_library_builder/types'\nexport const Status = messages.TestStepResultStatus\n\n// Time helpers\nexport { wrapPromiseWithTimeout } from './time'\n\n// Deprecated\n/**\n * @deprecated use `runCucumber` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md\n */\nexport const Cli = deprecate(\n _Cli,\n '`Cli` is deprecated, use `runCucumber` instead; see https://github.com/cucumber/cucumber-js/blob/main/docs/deprecations.md'\n)\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/data_table.d.ts b/node_modules/@cucumber/cucumber/lib/models/data_table.d.ts new file mode 100644 index 00000000..f42a7051 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/data_table.d.ts @@ -0,0 +1,10 @@ +import * as messages from '@cucumber/messages'; +export default class DataTable { + private readonly rawTable; + constructor(sourceTable: messages.PickleTable | string[][]); + hashes(): Record[]; + raw(): string[][]; + rows(): string[][]; + rowsHash(): Record; + transpose(): DataTable; +} diff --git a/node_modules/@cucumber/cucumber/lib/models/data_table.js b/node_modules/@cucumber/cucumber/lib/models/data_table.js new file mode 100644 index 00000000..d9c02cae --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/data_table.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class DataTable { + rawTable; + constructor(sourceTable) { + if (sourceTable instanceof Array) { + this.rawTable = sourceTable; + } + else { + this.rawTable = sourceTable.rows.map((row) => row.cells.map((cell) => cell.value)); + } + } + hashes() { + const copy = this.raw(); + const keys = copy[0]; + const valuesArray = copy.slice(1); + return valuesArray.map((values) => { + const rowObject = {}; + keys.forEach((key, index) => (rowObject[key] = values[index])); + return rowObject; + }); + } + raw() { + return this.rawTable.slice(0); + } + rows() { + const copy = this.raw(); + copy.shift(); + return copy; + } + rowsHash() { + const rows = this.raw(); + const everyRowHasTwoColumns = rows.every((row) => row.length === 2); + if (!everyRowHasTwoColumns) { + throw new Error('rowsHash can only be called on a data table where all rows have exactly two columns'); + } + const result = {}; + rows.forEach((x) => (result[x[0]] = x[1])); + return result; + } + transpose() { + const transposed = this.rawTable[0].map((x, i) => this.rawTable.map((y) => y[i])); + return new DataTable(transposed); + } +} +exports.default = DataTable; +//# sourceMappingURL=data_table.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/data_table.js.map b/node_modules/@cucumber/cucumber/lib/models/data_table.js.map new file mode 100644 index 00000000..24f7e6d5 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/data_table.js.map @@ -0,0 +1 @@ +{"version":3,"file":"data_table.js","sourceRoot":"","sources":["../../src/models/data_table.ts"],"names":[],"mappings":";;AAEA,MAAqB,SAAS;IACX,QAAQ,CAAY;IAErC,YAAY,WAA8C;QACxD,IAAI,WAAW,YAAY,KAAK,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAA;QAC7B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAC3C,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CACpC,CAAA;QACH,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACpB,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACjC,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAChC,MAAM,SAAS,GAA2B,EAAE,CAAA;YAC5C,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAC9D,OAAO,SAAS,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC/B,CAAC;IAED,IAAI;QACF,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACvB,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,OAAO,IAAI,CAAA;IACb,CAAC;IAED,QAAQ;QACN,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACvB,MAAM,qBAAqB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAA;QACnE,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,qFAAqF,CACtF,CAAA;QACH,CAAC;QACD,MAAM,MAAM,GAA2B,EAAE,CAAA;QACzC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1C,OAAO,MAAM,CAAA;IACf,CAAC;IAED,SAAS;QACP,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC/C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC/B,CAAA;QACD,OAAO,IAAI,SAAS,CAAC,UAAU,CAAC,CAAA;IAClC,CAAC;CACF;AArDD,4BAqDC","sourcesContent":["import * as messages from '@cucumber/messages'\n\nexport default class DataTable {\n private readonly rawTable: string[][]\n\n constructor(sourceTable: messages.PickleTable | string[][]) {\n if (sourceTable instanceof Array) {\n this.rawTable = sourceTable\n } else {\n this.rawTable = sourceTable.rows.map((row) =>\n row.cells.map((cell) => cell.value)\n )\n }\n }\n\n hashes(): Record[] {\n const copy = this.raw()\n const keys = copy[0]\n const valuesArray = copy.slice(1)\n return valuesArray.map((values) => {\n const rowObject: Record = {}\n keys.forEach((key, index) => (rowObject[key] = values[index]))\n return rowObject\n })\n }\n\n raw(): string[][] {\n return this.rawTable.slice(0)\n }\n\n rows(): string[][] {\n const copy = this.raw()\n copy.shift()\n return copy\n }\n\n rowsHash(): Record {\n const rows = this.raw()\n const everyRowHasTwoColumns = rows.every((row) => row.length === 2)\n if (!everyRowHasTwoColumns) {\n throw new Error(\n 'rowsHash can only be called on a data table where all rows have exactly two columns'\n )\n }\n const result: Record = {}\n rows.forEach((x) => (result[x[0]] = x[1]))\n return result\n }\n\n transpose(): DataTable {\n const transposed = this.rawTable[0].map((x, i) =>\n this.rawTable.map((y) => y[i])\n )\n return new DataTable(transposed)\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/definition.d.ts b/node_modules/@cucumber/cucumber/lib/models/definition.d.ts new file mode 100644 index 00000000..87d3cebc --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/definition.d.ts @@ -0,0 +1,58 @@ +import * as messages from '@cucumber/messages'; +import { Expression } from '@cucumber/cucumber-expressions'; +import { ITestCaseHookParameter } from '../support_code_library_builder/types'; +import { GherkinStepKeyword } from './gherkin_step_keyword'; +export interface IGetInvocationDataRequest { + hookParameter: ITestCaseHookParameter; + step: messages.PickleStep; + world: any; +} +export interface IGetInvocationDataResponse { + getInvalidCodeLengthMessage: () => string; + parameters: any[]; + validCodeLengths: number[]; +} +export interface IDefinitionOptions { + timeout?: number; + wrapperOptions?: any; +} +export interface IHookDefinitionOptions extends IDefinitionOptions { + name?: string; + tags?: string; +} +export interface IDefinitionParameters { + code: Function; + id: string; + line: number; + options: T; + order: number; + unwrappedCode?: Function; + uri: string; +} +export interface IStepDefinitionParameters extends IDefinitionParameters { + keyword: GherkinStepKeyword; + pattern: string | RegExp; + expression: Expression; +} +export interface IDefinition { + readonly code: Function; + readonly id: string; + readonly line: number; + readonly options: IDefinitionOptions; + readonly order: number; + readonly unwrappedCode: Function; + readonly uri: string; + getInvocationParameters: (options: IGetInvocationDataRequest) => Promise; +} +export default abstract class Definition { + readonly code: Function; + readonly id: string; + readonly line: number; + readonly options: IDefinitionOptions; + readonly order: number; + readonly unwrappedCode: Function; + readonly uri: string; + constructor({ code, id, line, options, order, unwrappedCode, uri, }: IDefinitionParameters); + buildInvalidCodeLengthMessage(syncOrPromiseLength: number | string, callbackLength: number | string): string; + baseGetInvalidCodeLengthMessage(parameters: any[]): string; +} diff --git a/node_modules/@cucumber/cucumber/lib/models/definition.js b/node_modules/@cucumber/cucumber/lib/models/definition.js new file mode 100644 index 00000000..80d28bc1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/definition.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Definition { + code; + id; + line; + options; + order; + unwrappedCode; + uri; + constructor({ code, id, line, options, order, unwrappedCode, uri, }) { + this.code = code; + this.id = id; + this.line = line; + this.options = options; + this.order = order; + this.unwrappedCode = unwrappedCode; + this.uri = uri; + } + buildInvalidCodeLengthMessage(syncOrPromiseLength, callbackLength) { + return (`function has ${this.code.length.toString()} arguments` + + `, should have ${syncOrPromiseLength.toString()} (if synchronous or returning a promise)` + + ` or ${callbackLength.toString()} (if accepting a callback)`); + } + baseGetInvalidCodeLengthMessage(parameters) { + return this.buildInvalidCodeLengthMessage(parameters.length, parameters.length + 1); + } +} +exports.default = Definition; +//# sourceMappingURL=definition.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/definition.js.map b/node_modules/@cucumber/cucumber/lib/models/definition.js.map new file mode 100644 index 00000000..a304aeeb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/definition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/models/definition.ts"],"names":[],"mappings":";;AA0DA,MAA8B,UAAU;IACtB,IAAI,CAAU;IACd,EAAE,CAAQ;IACV,IAAI,CAAQ;IACZ,OAAO,CAAoB;IAC3B,KAAK,CAAQ;IACb,aAAa,CAAU;IACvB,GAAG,CAAQ;IAE3B,YAAY,EACV,IAAI,EACJ,EAAE,EACF,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAa,EACb,GAAG,GACuC;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAED,6BAA6B,CAC3B,mBAAoC,EACpC,cAA+B;QAE/B,OAAO,CACL,gBAAgB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY;YACvD,iBAAiB,mBAAmB,CAAC,QAAQ,EAAE,0CAA0C;YACzF,OAAO,cAAc,CAAC,QAAQ,EAAE,4BAA4B,CAC7D,CAAA;IACH,CAAC;IAED,+BAA+B,CAAC,UAAiB;QAC/C,OAAO,IAAI,CAAC,6BAA6B,CACvC,UAAU,CAAC,MAAM,EACjB,UAAU,CAAC,MAAM,GAAG,CAAC,CACtB,CAAA;IACH,CAAC;CACF;AA5CD,6BA4CC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { Expression } from '@cucumber/cucumber-expressions'\nimport { ITestCaseHookParameter } from '../support_code_library_builder/types'\nimport { GherkinStepKeyword } from './gherkin_step_keyword'\n\nexport interface IGetInvocationDataRequest {\n hookParameter: ITestCaseHookParameter\n step: messages.PickleStep\n world: any\n}\n\nexport interface IGetInvocationDataResponse {\n getInvalidCodeLengthMessage: () => string\n parameters: any[]\n validCodeLengths: number[]\n}\n\nexport interface IDefinitionOptions {\n timeout?: number\n wrapperOptions?: any\n}\n\nexport interface IHookDefinitionOptions extends IDefinitionOptions {\n name?: string\n tags?: string\n}\n\nexport interface IDefinitionParameters {\n code: Function\n id: string\n line: number\n options: T\n order: number\n unwrappedCode?: Function\n uri: string\n}\n\nexport interface IStepDefinitionParameters\n extends IDefinitionParameters {\n keyword: GherkinStepKeyword\n pattern: string | RegExp\n expression: Expression\n}\n\nexport interface IDefinition {\n readonly code: Function\n readonly id: string\n readonly line: number\n readonly options: IDefinitionOptions\n readonly order: number\n readonly unwrappedCode: Function\n readonly uri: string\n\n getInvocationParameters: (\n options: IGetInvocationDataRequest\n ) => Promise\n}\n\nexport default abstract class Definition {\n public readonly code: Function\n public readonly id: string\n public readonly line: number\n public readonly options: IDefinitionOptions\n public readonly order: number\n public readonly unwrappedCode: Function\n public readonly uri: string\n\n constructor({\n code,\n id,\n line,\n options,\n order,\n unwrappedCode,\n uri,\n }: IDefinitionParameters) {\n this.code = code\n this.id = id\n this.line = line\n this.options = options\n this.order = order\n this.unwrappedCode = unwrappedCode\n this.uri = uri\n }\n\n buildInvalidCodeLengthMessage(\n syncOrPromiseLength: number | string,\n callbackLength: number | string\n ): string {\n return (\n `function has ${this.code.length.toString()} arguments` +\n `, should have ${syncOrPromiseLength.toString()} (if synchronous or returning a promise)` +\n ` or ${callbackLength.toString()} (if accepting a callback)`\n )\n }\n\n baseGetInvalidCodeLengthMessage(parameters: any[]): string {\n return this.buildInvalidCodeLengthMessage(\n parameters.length,\n parameters.length + 1\n )\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.d.ts b/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.d.ts new file mode 100644 index 00000000..7cb63d6e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.d.ts @@ -0,0 +1 @@ +export type GherkinStepKeyword = 'Unknown' | 'Given' | 'When' | 'Then'; diff --git a/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.js b/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.js new file mode 100644 index 00000000..3e3d74eb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=gherkin_step_keyword.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.js.map b/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.js.map new file mode 100644 index 00000000..adad1a2e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/gherkin_step_keyword.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gherkin_step_keyword.js","sourceRoot":"","sources":["../../src/models/gherkin_step_keyword.ts"],"names":[],"mappings":"","sourcesContent":["export type GherkinStepKeyword = 'Unknown' | 'Given' | 'When' | 'Then'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/step_definition.d.ts b/node_modules/@cucumber/cucumber/lib/models/step_definition.d.ts new file mode 100644 index 00000000..9c3f2886 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/step_definition.d.ts @@ -0,0 +1,11 @@ +import { Expression } from '@cucumber/cucumber-expressions'; +import Definition, { IDefinition, IGetInvocationDataRequest, IGetInvocationDataResponse, IStepDefinitionParameters } from './definition'; +import { GherkinStepKeyword } from './gherkin_step_keyword'; +export default class StepDefinition extends Definition implements IDefinition { + readonly keyword: GherkinStepKeyword; + readonly pattern: string | RegExp; + readonly expression: Expression; + constructor(data: IStepDefinitionParameters); + getInvocationParameters({ step, world, }: IGetInvocationDataRequest): Promise; + matchesStepName(stepName: string): boolean; +} diff --git a/node_modules/@cucumber/cucumber/lib/models/step_definition.js b/node_modules/@cucumber/cucumber/lib/models/step_definition.js new file mode 100644 index 00000000..051789ae --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/step_definition.js @@ -0,0 +1,40 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const step_arguments_1 = require("../step_arguments"); +const value_checker_1 = require("../value_checker"); +const data_table_1 = __importDefault(require("./data_table")); +const definition_1 = __importDefault(require("./definition")); +class StepDefinition extends definition_1.default { + keyword; + pattern; + expression; + constructor(data) { + super(data); + this.keyword = data.keyword; + this.pattern = data.pattern; + this.expression = data.expression; + } + async getInvocationParameters({ step, world, }) { + const parameters = await Promise.all(this.expression.match(step.text).map((arg) => arg.getValue(world))); + if ((0, value_checker_1.doesHaveValue)(step.argument)) { + const argumentParameter = (0, step_arguments_1.parseStepArgument)(step.argument, { + dataTable: (arg) => new data_table_1.default(arg), + docString: (arg) => arg.content, + }); + parameters.push(argumentParameter); + } + return { + getInvalidCodeLengthMessage: () => this.baseGetInvalidCodeLengthMessage(parameters), + parameters, + validCodeLengths: [parameters.length, parameters.length + 1], + }; + } + matchesStepName(stepName) { + return (0, value_checker_1.doesHaveValue)(this.expression.match(stepName)); + } +} +exports.default = StepDefinition; +//# sourceMappingURL=step_definition.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/step_definition.js.map b/node_modules/@cucumber/cucumber/lib/models/step_definition.js.map new file mode 100644 index 00000000..f760b61c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/step_definition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"step_definition.js","sourceRoot":"","sources":["../../src/models/step_definition.ts"],"names":[],"mappings":";;;;;AACA,sDAAqD;AACrD,oDAAgD;AAChD,8DAAoC;AACpC,8DAKqB;AAGrB,MAAqB,cAAe,SAAQ,oBAAU;IACpC,OAAO,CAAoB;IAC3B,OAAO,CAAiB;IACxB,UAAU,CAAY;IAEtC,YAA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esContent":["import { Expression } from '@cucumber/cucumber-expressions'\nimport { parseStepArgument } from '../step_arguments'\nimport { doesHaveValue } from '../value_checker'\nimport DataTable from './data_table'\nimport Definition, {\n IDefinition,\n IGetInvocationDataRequest,\n IGetInvocationDataResponse,\n IStepDefinitionParameters,\n} from './definition'\nimport { GherkinStepKeyword } from './gherkin_step_keyword'\n\nexport default class StepDefinition extends Definition implements IDefinition {\n public readonly keyword: GherkinStepKeyword\n public readonly pattern: string | RegExp\n public readonly expression: Expression\n\n constructor(data: IStepDefinitionParameters) {\n super(data)\n this.keyword = data.keyword\n this.pattern = data.pattern\n this.expression = data.expression\n }\n\n async getInvocationParameters({\n step,\n world,\n }: IGetInvocationDataRequest): Promise {\n const parameters = await Promise.all(\n this.expression.match(step.text).map((arg) => arg.getValue(world))\n )\n if (doesHaveValue(step.argument)) {\n const argumentParameter = parseStepArgument(step.argument, {\n dataTable: (arg) => new DataTable(arg),\n docString: (arg) => arg.content,\n })\n parameters.push(argumentParameter)\n }\n return {\n getInvalidCodeLengthMessage: () =>\n this.baseGetInvalidCodeLengthMessage(parameters),\n parameters,\n validCodeLengths: [parameters.length, parameters.length + 1],\n }\n }\n\n matchesStepName(stepName: string): boolean {\n return doesHaveValue(this.expression.match(stepName))\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.d.ts b/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.d.ts new file mode 100644 index 00000000..c905a31c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.d.ts @@ -0,0 +1,10 @@ +import * as messages from '@cucumber/messages'; +import Definition, { IDefinition, IDefinitionParameters, IGetInvocationDataRequest, IGetInvocationDataResponse, IHookDefinitionOptions } from './definition'; +export default class TestCaseHookDefinition extends Definition implements IDefinition { + readonly name: string; + readonly tagExpression: string; + private readonly pickleTagFilter; + constructor(data: IDefinitionParameters); + appliesToTestCase(pickle: messages.Pickle): boolean; + getInvocationParameters({ hookParameter, }: IGetInvocationDataRequest): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.js b/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.js new file mode 100644 index 00000000..65162e17 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.js @@ -0,0 +1,30 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const pickle_filter_1 = require("../pickle_filter"); +const definition_1 = __importDefault(require("./definition")); +class TestCaseHookDefinition extends definition_1.default { + name; + tagExpression; + pickleTagFilter; + constructor(data) { + super(data); + this.name = data.options.name; + this.tagExpression = data.options.tags; + this.pickleTagFilter = new pickle_filter_1.PickleTagFilter(data.options.tags); + } + appliesToTestCase(pickle) { + return this.pickleTagFilter.matchesAllTagExpressions(pickle); + } + async getInvocationParameters({ hookParameter, }) { + return { + getInvalidCodeLengthMessage: () => this.buildInvalidCodeLengthMessage('0 or 1', '2'), + parameters: [hookParameter], + validCodeLengths: [0, 1, 2], + }; + } +} +exports.default = TestCaseHookDefinition; +//# sourceMappingURL=test_case_hook_definition.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.js.map b/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.js.map new file mode 100644 index 00000000..35ce4419 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_case_hook_definition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_case_hook_definition.js","sourceRoot":"","sources":["../../src/models/test_case_hook_definition.ts"],"names":[],"mappings":";;;;;AACA,oDAAkD;AAClD,8DAMqB;AAErB,MAAqB,sBACnB,SAAQ,oBAAU;IAGF,IAAI,CAAQ;IACZ,aAAa,CAAQ;IACpB,eAAe,CAAiB;IAEjD,YAAY,IAAmD;QAC7D,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;QACtC,IAAI,CAAC,eAAe,GAAG,IAAI,+BAAe,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/D,CAAC;IAED,iBAAiB,CAAC,MAAuB;QACvC,OAAO,IAAI,CAAC,eAAe,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAA;IAC9D,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,EAC5B,aAAa,GACa;QAC1B,OAAO;YACL,2BAA2B,EAAE,GAAG,EAAE,CAChC,IAAI,CAAC,6BAA6B,CAAC,QAAQ,EAAE,GAAG,CAAC;YACnD,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;SAC5B,CAAA;IACH,CAAC;CACF;AA7BD,yCA6BC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { PickleTagFilter } from '../pickle_filter'\nimport Definition, {\n IDefinition,\n IDefinitionParameters,\n IGetInvocationDataRequest,\n IGetInvocationDataResponse,\n IHookDefinitionOptions,\n} from './definition'\n\nexport default class TestCaseHookDefinition\n extends Definition\n implements IDefinition\n{\n public readonly name: string\n public readonly tagExpression: string\n private readonly pickleTagFilter: PickleTagFilter\n\n constructor(data: IDefinitionParameters) {\n super(data)\n this.name = data.options.name\n this.tagExpression = data.options.tags\n this.pickleTagFilter = new PickleTagFilter(data.options.tags)\n }\n\n appliesToTestCase(pickle: messages.Pickle): boolean {\n return this.pickleTagFilter.matchesAllTagExpressions(pickle)\n }\n\n async getInvocationParameters({\n hookParameter,\n }: IGetInvocationDataRequest): Promise {\n return {\n getInvalidCodeLengthMessage: () =>\n this.buildInvalidCodeLengthMessage('0 or 1', '2'),\n parameters: [hookParameter],\n validCodeLengths: [0, 1, 2],\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.d.ts b/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.d.ts new file mode 100644 index 00000000..5ed30026 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.d.ts @@ -0,0 +1,8 @@ +import Definition, { IDefinitionParameters, IDefinitionOptions } from './definition'; +export interface ITestRunHookDefinitionOptions extends IDefinitionOptions { + name?: string; +} +export default class TestRunHookDefinition extends Definition { + readonly name: string; + constructor(data: IDefinitionParameters); +} diff --git a/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.js b/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.js new file mode 100644 index 00000000..82fc1f27 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const definition_1 = __importDefault(require("./definition")); +class TestRunHookDefinition extends definition_1.default { + name; + constructor(data) { + super(data); + this.name = data.options.name; + } +} +exports.default = TestRunHookDefinition; +//# sourceMappingURL=test_run_hook_definition.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.js.map b/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.js.map new file mode 100644 index 00000000..f907a331 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_run_hook_definition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_run_hook_definition.js","sourceRoot":"","sources":["../../src/models/test_run_hook_definition.ts"],"names":[],"mappings":";;;;;AAAA,8DAGqB;AAMrB,MAAqB,qBAAsB,SAAQ,oBAAU;IAC3C,IAAI,CAAQ;IAE5B,YAAY,IAA0D;QACpE,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;IAC/B,CAAC;CACF;AAPD,wCAOC","sourcesContent":["import Definition, {\n IDefinitionParameters,\n IDefinitionOptions,\n} from './definition'\n\nexport interface ITestRunHookDefinitionOptions extends IDefinitionOptions {\n name?: string\n}\n\nexport default class TestRunHookDefinition extends Definition {\n public readonly name: string\n\n constructor(data: IDefinitionParameters) {\n super(data)\n this.name = data.options.name\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.d.ts b/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.d.ts new file mode 100644 index 00000000..c56ebc40 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.d.ts @@ -0,0 +1,9 @@ +import * as messages from '@cucumber/messages'; +import Definition, { IDefinition, IGetInvocationDataResponse, IGetInvocationDataRequest, IDefinitionParameters, IHookDefinitionOptions } from './definition'; +export default class TestStepHookDefinition extends Definition implements IDefinition { + readonly tagExpression: string; + private readonly pickleTagFilter; + constructor(data: IDefinitionParameters); + appliesToTestCase(pickle: messages.Pickle): boolean; + getInvocationParameters({ hookParameter, }: IGetInvocationDataRequest): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.js b/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.js new file mode 100644 index 00000000..6102ce82 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.js @@ -0,0 +1,28 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const pickle_filter_1 = require("../pickle_filter"); +const definition_1 = __importDefault(require("./definition")); +class TestStepHookDefinition extends definition_1.default { + tagExpression; + pickleTagFilter; + constructor(data) { + super(data); + this.tagExpression = data.options.tags; + this.pickleTagFilter = new pickle_filter_1.PickleTagFilter(data.options.tags); + } + appliesToTestCase(pickle) { + return this.pickleTagFilter.matchesAllTagExpressions(pickle); + } + async getInvocationParameters({ hookParameter, }) { + return { + getInvalidCodeLengthMessage: () => this.buildInvalidCodeLengthMessage('0 or 1', '2'), + parameters: [hookParameter], + validCodeLengths: [0, 1, 2], + }; + } +} +exports.default = TestStepHookDefinition; +//# sourceMappingURL=test_step_hook_definition.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.js.map b/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.js.map new file mode 100644 index 00000000..cf87d659 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/models/test_step_hook_definition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_step_hook_definition.js","sourceRoot":"","sources":["../../src/models/test_step_hook_definition.ts"],"names":[],"mappings":";;;;;AACA,oDAAkD;AAClD,8DAMqB;AAErB,MAAqB,sBACnB,SAAQ,oBAAU;IAGF,aAAa,CAAQ;IACpB,eAAe,CAAiB;IAEjD,YAAY,IAAmD;QAC7D,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;QACtC,IAAI,CAAC,eAAe,GAAG,IAAI,+BAAe,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/D,CAAC;IAED,iBAAiB,CAAC,MAAuB;QACvC,OAAO,IAAI,CAAC,eAAe,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAA;IAC9D,CAAC;IAED,KAAK,CAAC,uBAAuB,CAAC,EAC5B,aAAa,GACa;QAC1B,OAAO;YACL,2BAA2B,EAAE,GAAG,EAAE,CAChC,IAAI,CAAC,6BAA6B,CAAC,QAAQ,EAAE,GAAG,CAAC;YACnD,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;SAC5B,CAAA;IACH,CAAC;CACF;AA3BD,yCA2BC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { PickleTagFilter } from '../pickle_filter'\nimport Definition, {\n IDefinition,\n IGetInvocationDataResponse,\n IGetInvocationDataRequest,\n IDefinitionParameters,\n IHookDefinitionOptions,\n} from './definition'\n\nexport default class TestStepHookDefinition\n extends Definition\n implements IDefinition\n{\n public readonly tagExpression: string\n private readonly pickleTagFilter: PickleTagFilter\n\n constructor(data: IDefinitionParameters) {\n super(data)\n this.tagExpression = data.options.tags\n this.pickleTagFilter = new PickleTagFilter(data.options.tags)\n }\n\n appliesToTestCase(pickle: messages.Pickle): boolean {\n return this.pickleTagFilter.matchesAllTagExpressions(pickle)\n }\n\n async getInvocationParameters({\n hookParameter,\n }: IGetInvocationDataRequest): Promise {\n return {\n getInvalidCodeLengthMessage: () =>\n this.buildInvalidCodeLengthMessage('0 or 1', '2'),\n parameters: [hookParameter],\n validCodeLengths: [0, 1, 2],\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/paths/index.d.ts b/node_modules/@cucumber/cucumber/lib/paths/index.d.ts new file mode 100644 index 00000000..e7a3adde --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/index.d.ts @@ -0,0 +1,2 @@ +export * from './paths'; +export * from './types'; diff --git a/node_modules/@cucumber/cucumber/lib/paths/index.js b/node_modules/@cucumber/cucumber/lib/paths/index.js new file mode 100644 index 00000000..d8078cfe --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./paths"), exports); +__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/paths/index.js.map b/node_modules/@cucumber/cucumber/lib/paths/index.js.map new file mode 100644 index 00000000..6fc0a7d2 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/paths/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,0CAAuB","sourcesContent":["export * from './paths'\nexport * from './types'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/paths/paths.d.ts b/node_modules/@cucumber/cucumber/lib/paths/paths.d.ts new file mode 100644 index 00000000..6b8a9013 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/paths.d.ts @@ -0,0 +1,4 @@ +import { ILogger } from '../environment'; +import { ISourcesCoordinates, ISupportCodeCoordinates } from '../api'; +import { IResolvedPaths } from './types'; +export declare function resolvePaths(logger: ILogger, cwd: string, sources: Pick, support?: ISupportCodeCoordinates): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/paths/paths.js b/node_modules/@cucumber/cucumber/lib/paths/paths.js new file mode 100644 index 00000000..e666b803 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/paths.js @@ -0,0 +1,103 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolvePaths = resolvePaths; +const node_path_1 = __importDefault(require("node:path")); +const glob_1 = require("glob"); +const fs_1 = __importDefault(require("mz/fs")); +async function resolvePaths(logger, cwd, sources, support = { + requireModules: [], + requirePaths: [], + importPaths: [], + loaders: [], +}) { + const unexpandedSourcePaths = await getUnexpandedSourcePaths(cwd, sources.paths); + const sourcePaths = await expandSourcePaths(cwd, unexpandedSourcePaths); + logger.debug('Found source files based on configuration:', sourcePaths); + const { requirePaths, importPaths } = await deriveSupportPaths(cwd, sourcePaths, support.requirePaths, support.importPaths); + logger.debug('Found support files to load via `require` based on configuration:', requirePaths); + logger.debug('Found support files to load via `import` based on configuration:', importPaths); + return { + unexpandedSourcePaths: unexpandedSourcePaths, + sourcePaths: sourcePaths, + requirePaths, + importPaths, + }; +} +async function expandPaths(cwd, unexpandedPaths, defaultExtension) { + const expandedPaths = await Promise.all(unexpandedPaths.map(async (unexpandedPath) => { + const matches = await (0, glob_1.glob)(unexpandedPath, { + absolute: true, + windowsPathsNoEscape: true, + cwd, + }); + const expanded = await Promise.all(matches.map(async (match) => { + if (node_path_1.default.extname(match) === '') { + return (0, glob_1.glob)(`${match}/**/*${defaultExtension}`, { + windowsPathsNoEscape: true, + }); + } + return [match]; + })); + return expanded.flat().sort(); + })); + const normalized = expandedPaths.flat().map((x) => node_path_1.default.normalize(x)); + return [...new Set(normalized)]; +} +async function getUnexpandedSourcePaths(cwd, args) { + if (args.length > 0) { + const nestedFeaturePaths = await Promise.all(args.map(async (arg) => { + const filename = node_path_1.default.basename(arg); + if (filename[0] === '@') { + const filePath = node_path_1.default.join(cwd, arg); + const content = await fs_1.default.readFile(filePath, 'utf8'); + return content.split('\n').map((x) => x.trim()); + } + return [arg]; + })); + const featurePaths = nestedFeaturePaths.flat(); + if (featurePaths.length > 0) { + return featurePaths.filter((x) => x !== ''); + } + } + return ['features/**/*.{feature,feature.md}']; +} +function getFeatureDirectoryPaths(cwd, featurePaths) { + const featureDirs = featurePaths.map((featurePath) => { + let featureDir = node_path_1.default.dirname(featurePath); + let childDir; + let parentDir = featureDir; + while (childDir !== parentDir) { + childDir = parentDir; + parentDir = node_path_1.default.dirname(childDir); + if (node_path_1.default.basename(parentDir) === 'features') { + featureDir = parentDir; + break; + } + } + return node_path_1.default.relative(cwd, featureDir); + }); + return [...new Set(featureDirs)]; +} +async function expandSourcePaths(cwd, featurePaths) { + featurePaths = featurePaths.map((p) => p.replace(/(:\d+)*$/g, '')); // Strip line numbers + return await expandPaths(cwd, featurePaths, '.feature'); +} +async function deriveSupportPaths(cwd, featurePaths, unexpandedRequirePaths, unexpandedImportPaths) { + if (unexpandedRequirePaths.length === 0 && + unexpandedImportPaths.length === 0) { + const defaultPaths = getFeatureDirectoryPaths(cwd, featurePaths); + const importPaths = await expandPaths(cwd, defaultPaths, '.@(js|cjs|mjs)'); + return { requirePaths: [], importPaths }; + } + const requirePaths = unexpandedRequirePaths.length > 0 + ? await expandPaths(cwd, unexpandedRequirePaths, '.js') + : []; + const importPaths = unexpandedImportPaths.length > 0 + ? await expandPaths(cwd, unexpandedImportPaths, '.@(js|cjs|mjs)') + : []; + return { requirePaths, importPaths }; +} +//# sourceMappingURL=paths.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/paths/paths.js.map b/node_modules/@cucumber/cucumber/lib/paths/paths.js.map new file mode 100644 index 00000000..9f65c483 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/paths.js.map @@ -0,0 +1 @@ +{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/paths/paths.ts"],"names":[],"mappings":";;;;;AAOA,oCAwCC;AA/CD,0DAA4B;AAC5B,+BAA2B;AAC3B,+CAAsB;AAKf,KAAK,UAAU,YAAY,CAChC,MAAe,EACf,GAAW,EACX,OAA2C,EAC3C,UAAmC;IACjC,cAAc,EAAE,EAAE;IAClB,YAAY,EAAE,EAAE;IAChB,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,EAAE;CACZ;IAED,MAAM,qBAAqB,GAAG,MAAM,wBAAwB,CAC1D,GAAG,EACH,OAAO,CAAC,KAAK,CACd,CAAA;IACD,MAAM,WAAW,GAAa,MAAM,iBAAiB,CACnD,GAAG,EACH,qBAAqB,CACtB,CAAA;IACD,MAAM,CAAC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,GAAG,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAA;QAC1E,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,WAAW,EAAE,CAAA;IAC1C,CAAC;IACD,MAAM,YAAY,GAChB,sBAAsB,CAAC,MAAM,GAAG,CAAC;QAC/B,CAAC,CAAC,MAAM,WAAW,CAAC,GAAG,EAAE,sBAAsB,EAAE,KAAK,CAAC;QACvD,CAAC,CAAC,EAAE,CAAA;IACR,MAAM,WAAW,GACf,qBAAqB,CAAC,MAAM,GAAG,CAAC;QAC9B,CAAC,CAAC,MAAM,WAAW,CAAC,GAAG,EAAE,qBAAqB,EAAE,gBAAgB,CAAC;QACjE,CAAC,CAAC,EAAE,CAAA;IACR,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAA;AACtC,CAAC","sourcesContent":["import path from 'node:path'\nimport { glob } from 'glob'\nimport fs from 'mz/fs'\nimport { ILogger } from '../environment'\nimport { ISourcesCoordinates, ISupportCodeCoordinates } from '../api'\nimport { IResolvedPaths } from './types'\n\nexport async function resolvePaths(\n logger: ILogger,\n cwd: string,\n sources: Pick,\n support: ISupportCodeCoordinates = {\n requireModules: [],\n requirePaths: [],\n importPaths: [],\n loaders: [],\n }\n): Promise {\n const unexpandedSourcePaths = await getUnexpandedSourcePaths(\n cwd,\n sources.paths\n )\n const sourcePaths: string[] = await expandSourcePaths(\n cwd,\n unexpandedSourcePaths\n )\n logger.debug('Found source files based on configuration:', sourcePaths)\n const { requirePaths, importPaths } = await deriveSupportPaths(\n cwd,\n sourcePaths,\n support.requirePaths,\n support.importPaths\n )\n logger.debug(\n 'Found support files to load via `require` based on configuration:',\n requirePaths\n )\n logger.debug(\n 'Found support files to load via `import` based on configuration:',\n importPaths\n )\n return {\n unexpandedSourcePaths: unexpandedSourcePaths,\n sourcePaths: sourcePaths,\n requirePaths,\n importPaths,\n }\n}\n\nasync function expandPaths(\n cwd: string,\n unexpandedPaths: string[],\n defaultExtension: string\n): Promise {\n const expandedPaths = await Promise.all(\n unexpandedPaths.map(async (unexpandedPath) => {\n const matches = await glob(unexpandedPath, {\n absolute: true,\n windowsPathsNoEscape: true,\n cwd,\n })\n const expanded = await Promise.all(\n matches.map(async (match) => {\n if (path.extname(match) === '') {\n return glob(`${match}/**/*${defaultExtension}`, {\n windowsPathsNoEscape: true,\n })\n }\n return [match]\n })\n )\n return expanded.flat().sort()\n })\n )\n const normalized = expandedPaths.flat().map((x) => path.normalize(x))\n return [...new Set(normalized)]\n}\n\nasync function getUnexpandedSourcePaths(\n cwd: string,\n args: string[]\n): Promise {\n if (args.length > 0) {\n const nestedFeaturePaths = await Promise.all(\n args.map(async (arg) => {\n const filename = path.basename(arg)\n if (filename[0] === '@') {\n const filePath = path.join(cwd, arg)\n const content = await fs.readFile(filePath, 'utf8')\n return content.split('\\n').map((x) => x.trim())\n }\n return [arg]\n })\n )\n const featurePaths = nestedFeaturePaths.flat()\n if (featurePaths.length > 0) {\n return featurePaths.filter((x) => x !== '')\n }\n }\n return ['features/**/*.{feature,feature.md}']\n}\n\nfunction getFeatureDirectoryPaths(\n cwd: string,\n featurePaths: string[]\n): string[] {\n const featureDirs = featurePaths.map((featurePath) => {\n let featureDir = path.dirname(featurePath)\n let childDir: string\n let parentDir = featureDir\n while (childDir !== parentDir) {\n childDir = parentDir\n parentDir = path.dirname(childDir)\n if (path.basename(parentDir) === 'features') {\n featureDir = parentDir\n break\n }\n }\n return path.relative(cwd, featureDir)\n })\n return [...new Set(featureDirs)]\n}\n\nasync function expandSourcePaths(\n cwd: string,\n featurePaths: string[]\n): Promise {\n featurePaths = featurePaths.map((p) => p.replace(/(:\\d+)*$/g, '')) // Strip line numbers\n return await expandPaths(cwd, featurePaths, '.feature')\n}\n\nasync function deriveSupportPaths(\n cwd: string,\n featurePaths: string[],\n unexpandedRequirePaths: string[],\n unexpandedImportPaths: string[]\n): Promise<{\n requirePaths: string[]\n importPaths: string[]\n}> {\n if (\n unexpandedRequirePaths.length === 0 &&\n unexpandedImportPaths.length === 0\n ) {\n const defaultPaths = getFeatureDirectoryPaths(cwd, featurePaths)\n const importPaths = await expandPaths(cwd, defaultPaths, '.@(js|cjs|mjs)')\n return { requirePaths: [], importPaths }\n }\n const requirePaths =\n unexpandedRequirePaths.length > 0\n ? await expandPaths(cwd, unexpandedRequirePaths, '.js')\n : []\n const importPaths =\n unexpandedImportPaths.length > 0\n ? await expandPaths(cwd, unexpandedImportPaths, '.@(js|cjs|mjs)')\n : []\n return { requirePaths, importPaths }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/paths/types.d.ts b/node_modules/@cucumber/cucumber/lib/paths/types.d.ts new file mode 100644 index 00000000..e31b814e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/types.d.ts @@ -0,0 +1,13 @@ +/** + * Paths that woll be used to load feature files and user code + * @public + * @remarks + * These values are the result of pre-processing to expand globs, expand + * directory references, and apply defaults where applicable. + */ +export interface IResolvedPaths { + unexpandedSourcePaths: string[]; + sourcePaths: string[]; + requirePaths: string[]; + importPaths: string[]; +} diff --git a/node_modules/@cucumber/cucumber/lib/paths/types.js b/node_modules/@cucumber/cucumber/lib/paths/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/paths/types.js.map b/node_modules/@cucumber/cucumber/lib/paths/types.js.map new file mode 100644 index 00000000..9c8717e4 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/paths/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/paths/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Paths that woll be used to load feature files and user code\n * @public\n * @remarks\n * These values are the result of pre-processing to expand globs, expand\n * directory references, and apply defaults where applicable.\n */\nexport interface IResolvedPaths {\n unexpandedSourcePaths: string[]\n sourcePaths: string[]\n requirePaths: string[]\n importPaths: string[]\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/pickle_filter.d.ts b/node_modules/@cucumber/cucumber/lib/pickle_filter.d.ts new file mode 100644 index 00000000..635dd794 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/pickle_filter.d.ts @@ -0,0 +1,42 @@ +import * as messages from '@cucumber/messages'; +import IGherkinDocument = messages.GherkinDocument; +import IPickle = messages.Pickle; +export interface IPickleFilterOptions { + cwd: string; + featurePaths?: string[]; + names?: string[]; + tagExpression?: string; +} +export interface IMatchesAnyLineRequest { + gherkinDocument: messages.GherkinDocument; + pickle: messages.Pickle; +} +export default class PickleFilter { + private readonly lineFilter; + private readonly nameFilter; + private readonly tagFilter; + constructor({ cwd, featurePaths, names, tagExpression, }: IPickleFilterOptions); + matches({ gherkinDocument, pickle, }: { + gherkinDocument: IGherkinDocument; + pickle: IPickle; + }): boolean; +} +export declare class PickleLineFilter { + private readonly featureUriToLinesMapping; + constructor(cwd: string, featurePaths?: string[]); + getFeatureUriToLinesMapping({ cwd, featurePaths, }: { + cwd: string; + featurePaths: string[]; + }): Record; + matchesAnyLine({ gherkinDocument, pickle }: IMatchesAnyLineRequest): boolean; +} +export declare class PickleNameFilter { + private readonly names; + constructor(names?: string[]); + matchesAnyName(pickle: messages.Pickle): boolean; +} +export declare class PickleTagFilter { + private readonly tagExpressionNode; + constructor(tagExpression: string); + matchesAllTagExpressions(pickle: messages.Pickle): boolean; +} diff --git a/node_modules/@cucumber/cucumber/lib/pickle_filter.js b/node_modules/@cucumber/cucumber/lib/pickle_filter.js new file mode 100644 index 00000000..438e2c7b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/pickle_filter.js @@ -0,0 +1,105 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PickleTagFilter = exports.PickleNameFilter = exports.PickleLineFilter = void 0; +const node_path_1 = __importDefault(require("node:path")); +const tag_expressions_1 = require("@cucumber/tag-expressions"); +const gherkin_document_parser_1 = require("./formatter/helpers/gherkin_document_parser"); +const value_checker_1 = require("./value_checker"); +const FEATURE_LINENUM_REGEXP = /^(.*?)((?::[\d]+)+)?$/; +class PickleFilter { + lineFilter; + nameFilter; + tagFilter; + constructor({ cwd, featurePaths, names, tagExpression, }) { + this.lineFilter = new PickleLineFilter(cwd, featurePaths); + this.nameFilter = new PickleNameFilter(names); + this.tagFilter = new PickleTagFilter(tagExpression); + } + matches({ gherkinDocument, pickle, }) { + return (this.lineFilter.matchesAnyLine({ gherkinDocument, pickle }) && + this.nameFilter.matchesAnyName(pickle) && + this.tagFilter.matchesAllTagExpressions(pickle)); + } +} +exports.default = PickleFilter; +class PickleLineFilter { + featureUriToLinesMapping; + constructor(cwd, featurePaths = []) { + this.featureUriToLinesMapping = this.getFeatureUriToLinesMapping({ + cwd, + featurePaths, + }); + } + getFeatureUriToLinesMapping({ cwd, featurePaths, }) { + const mapping = {}; + featurePaths.forEach((featurePath) => { + const match = FEATURE_LINENUM_REGEXP.exec(featurePath); + if ((0, value_checker_1.doesHaveValue)(match)) { + let uri = match[1]; + if (node_path_1.default.isAbsolute(uri)) { + uri = node_path_1.default.relative(cwd, uri); + } + else { + uri = node_path_1.default.normalize(uri); + } + const linesExpression = match[2]; + if ((0, value_checker_1.doesHaveValue)(linesExpression)) { + if ((0, value_checker_1.doesNotHaveValue)(mapping[uri])) { + mapping[uri] = []; + } + linesExpression + .slice(1) + .split(':') + .forEach((line) => { + mapping[uri].push(parseInt(line)); + }); + } + } + }); + return mapping; + } + matchesAnyLine({ gherkinDocument, pickle }) { + const uri = node_path_1.default.normalize(pickle.uri); + const linesToMatch = this.featureUriToLinesMapping[uri]; + if ((0, value_checker_1.doesHaveValue)(linesToMatch)) { + const gherkinScenarioLocationMap = (0, gherkin_document_parser_1.getGherkinScenarioLocationMap)(gherkinDocument); + const pickleLines = new Set(pickle.astNodeIds.map((sourceId) => gherkinScenarioLocationMap[sourceId].line)); + const linesIntersection = linesToMatch.filter((x) => pickleLines.has(x)); + return linesIntersection.length > 0; + } + return true; + } +} +exports.PickleLineFilter = PickleLineFilter; +class PickleNameFilter { + names; + constructor(names = []) { + this.names = names; + } + matchesAnyName(pickle) { + if (this.names.length === 0) { + return true; + } + return this.names.some((name) => pickle.name.match(name)); + } +} +exports.PickleNameFilter = PickleNameFilter; +class PickleTagFilter { + tagExpressionNode; + constructor(tagExpression) { + if ((0, value_checker_1.doesHaveValue)(tagExpression) && tagExpression !== '') { + this.tagExpressionNode = (0, tag_expressions_1.parse)(tagExpression); + } + } + matchesAllTagExpressions(pickle) { + if ((0, value_checker_1.doesNotHaveValue)(this.tagExpressionNode)) { + return true; + } + return this.tagExpressionNode.evaluate(pickle.tags.map((x) => x.name)); + } +} +exports.PickleTagFilter = PickleTagFilter; +//# sourceMappingURL=pickle_filter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/pickle_filter.js.map b/node_modules/@cucumber/cucumber/lib/pickle_filter.js.map new file mode 100644 index 00000000..046b1d69 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/pickle_filter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pickle_filter.js","sourceRoot":"","sources":["../src/pickle_filter.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA4B;AAC5B,+DAAuD;AAEvD,yFAA2F;AAC3F,mDAAiE;AAIjE,MAAM,sBAAsB,GAAG,uBAAuB,CAAA;AActD,MAAqB,YAAY;IACd,UAAU,CAAkB;IAC5B,UAAU,CAAkB;IAC5B,SAAS,CAAiB;IAE3C,YAAY,EACV,GAAG,EACH,YAAY,EACZ,KAAK,EACL,aAAa,GACQ;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE,YAAY,CAAC,CAAA;QACzD,IAAI,CAAC,UAAU,GAAG,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V,KAAK,CAAU;IAEhC,YAAY,QAAkB,EAAE;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,cAAc,CAAC,MAAuB;QACpC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3D,CAAC;CACF;AAbD,4CAaC;AAED,MAAa,eAAe;IACT,iBAAiB,CAAM;IAExC,YAAY,aAAqB;QAC/B,IAAI,IAAA,6BAAa,EAAC,aAAa,CAAC,IAAI,aAAa,KAAK,EAAE,EAAE,CAAC;YACzD,IAAI,CAAC,iBAAiB,GAAG,IAAA,uBAAK,EAAC,aAAa,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC;IAED,wBAAwB,CAAC,MAAuB;QAC9C,IAAI,IAAA,gCAAgB,EAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACxE,CAAC;CACF;AAfD,0CAeC","sourcesContent":["import path from 'node:path'\nimport { Node, parse } from '@cucumber/tag-expressions'\nimport * as messages from '@cucumber/messages'\nimport { getGherkinScenarioLocationMap } from './formatter/helpers/gherkin_document_parser'\nimport { doesHaveValue, doesNotHaveValue } from './value_checker'\nimport IGherkinDocument = messages.GherkinDocument\nimport IPickle = messages.Pickle\n\nconst FEATURE_LINENUM_REGEXP = /^(.*?)((?::[\\d]+)+)?$/\n\nexport interface IPickleFilterOptions {\n cwd: string\n featurePaths?: string[]\n names?: string[]\n tagExpression?: string\n}\n\nexport interface IMatchesAnyLineRequest {\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n}\n\nexport default class PickleFilter {\n private readonly lineFilter: PickleLineFilter\n private readonly nameFilter: PickleNameFilter\n private readonly tagFilter: PickleTagFilter\n\n constructor({\n cwd,\n featurePaths,\n names,\n tagExpression,\n }: IPickleFilterOptions) {\n this.lineFilter = new PickleLineFilter(cwd, featurePaths)\n this.nameFilter = new PickleNameFilter(names)\n this.tagFilter = new PickleTagFilter(tagExpression)\n }\n\n matches({\n gherkinDocument,\n pickle,\n }: {\n gherkinDocument: IGherkinDocument\n pickle: IPickle\n }): boolean {\n return (\n this.lineFilter.matchesAnyLine({ gherkinDocument, pickle }) &&\n this.nameFilter.matchesAnyName(pickle) &&\n this.tagFilter.matchesAllTagExpressions(pickle)\n )\n }\n}\n\nexport class PickleLineFilter {\n private readonly featureUriToLinesMapping: Record\n\n constructor(cwd: string, featurePaths: string[] = []) {\n this.featureUriToLinesMapping = this.getFeatureUriToLinesMapping({\n cwd,\n featurePaths,\n })\n }\n\n getFeatureUriToLinesMapping({\n cwd,\n featurePaths,\n }: {\n cwd: string\n featurePaths: string[]\n }): Record {\n const mapping: Record = {}\n featurePaths.forEach((featurePath) => {\n const match = FEATURE_LINENUM_REGEXP.exec(featurePath)\n if (doesHaveValue(match)) {\n let uri = match[1]\n if (path.isAbsolute(uri)) {\n uri = path.relative(cwd, uri)\n } else {\n uri = path.normalize(uri)\n }\n const linesExpression = match[2]\n if (doesHaveValue(linesExpression)) {\n if (doesNotHaveValue(mapping[uri])) {\n mapping[uri] = []\n }\n linesExpression\n .slice(1)\n .split(':')\n .forEach((line) => {\n mapping[uri].push(parseInt(line))\n })\n }\n }\n })\n return mapping\n }\n\n matchesAnyLine({ gherkinDocument, pickle }: IMatchesAnyLineRequest): boolean {\n const uri = path.normalize(pickle.uri)\n const linesToMatch = this.featureUriToLinesMapping[uri]\n if (doesHaveValue(linesToMatch)) {\n const gherkinScenarioLocationMap =\n getGherkinScenarioLocationMap(gherkinDocument)\n const pickleLines = new Set(\n pickle.astNodeIds.map(\n (sourceId) => gherkinScenarioLocationMap[sourceId].line\n )\n )\n const linesIntersection = linesToMatch.filter((x) => pickleLines.has(x))\n return linesIntersection.length > 0\n }\n return true\n }\n}\n\nexport class PickleNameFilter {\n private readonly names: string[]\n\n constructor(names: string[] = []) {\n this.names = names\n }\n\n matchesAnyName(pickle: messages.Pickle): boolean {\n if (this.names.length === 0) {\n return true\n }\n return this.names.some((name) => pickle.name.match(name))\n }\n}\n\nexport class PickleTagFilter {\n private readonly tagExpressionNode: Node\n\n constructor(tagExpression: string) {\n if (doesHaveValue(tagExpression) && tagExpression !== '') {\n this.tagExpressionNode = parse(tagExpression)\n }\n }\n\n matchesAllTagExpressions(pickle: messages.Pickle): boolean {\n if (doesNotHaveValue(this.tagExpressionNode)) {\n return true\n }\n return this.tagExpressionNode.evaluate(pickle.tags.map((x) => x.name))\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/plugin/index.d.ts b/node_modules/@cucumber/cucumber/lib/plugin/index.d.ts new file mode 100644 index 00000000..b92ba5d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/index.d.ts @@ -0,0 +1,2 @@ +export * from './types'; +export * from './plugin_manager'; diff --git a/node_modules/@cucumber/cucumber/lib/plugin/index.js b/node_modules/@cucumber/cucumber/lib/plugin/index.js new file mode 100644 index 00000000..35f0f710 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./types"), exports); +__exportStar(require("./plugin_manager"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/plugin/index.js.map b/node_modules/@cucumber/cucumber/lib/plugin/index.js.map new file mode 100644 index 00000000..4bb79ed3 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,mDAAgC","sourcesContent":["export * from './types'\nexport * from './plugin_manager'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.d.ts b/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.d.ts new file mode 100644 index 00000000..7e26994d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.d.ts @@ -0,0 +1,19 @@ +import { UsableEnvironment } from '../environment'; +import { CoordinatorEventKey, CoordinatorEventValues, CoordinatorTransformKey, CoordinatorTransformValues, FormatterPlugin, Plugin, PluginOperation } from './types'; +export declare class PluginManager { + private readonly environment; + private readonly handlers; + private readonly transformers; + private cleanupFns; + constructor(environment: UsableEnvironment); + private registerHandler; + private registerTransformer; + initFormatter(plugin: FormatterPlugin, options: OptionsType, stream: NodeJS.WritableStream, write: (buffer: string | Uint8Array) => void, directory?: string, specifier?: string): Promise; + initCoordinatorExternal(operation: PluginOperation, plugin: Plugin, options: OptionsType, specifier?: string): Promise; + initCoordinatorInternal(operation: PluginOperation, plugin: Plugin, options: OptionsType): Promise; + private initCoordinator; + private makeCoordinatorContext; + emit(event: K, value: CoordinatorEventValues[K]): void; + transform(event: K, value: CoordinatorTransformValues[K]): Promise; + cleanup(): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.js b/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.js new file mode 100644 index 00000000..4e56a7a0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.js @@ -0,0 +1,132 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PluginManager = void 0; +class PluginManager { + environment; + handlers = { + message: [], + 'paths:resolve': [], + 'publish:url': [], + }; + transformers = { + 'pickles:filter': [], + 'pickles:order': [], + }; + cleanupFns = []; + constructor(environment) { + this.environment = environment; + } + async registerHandler(event, handler, specifier) { + if (!this.handlers[event]) { + throw new Error(`Cannot register handler for unknown event "${event}"`); + } + this.handlers[event].push({ + handler, + specifier, + }); + } + async registerTransformer(event, transformer, specifier) { + if (!this.transformers[event]) { + throw new Error(`Cannot register transformer for unknown event "${event}"`); + } + this.transformers[event].push({ + transformer, + specifier, + }); + } + async initFormatter(plugin, options, stream, write, directory, specifier) { + const cleanupFn = await plugin.formatter({ + on: (key, handler) => this.registerHandler(key, handler, specifier), + options: plugin.optionsKey + ? (options[plugin.optionsKey] ?? {}) + : options, + logger: this.environment.logger, + stream, + write, + directory, + }); + if (typeof cleanupFn === 'function') { + this.cleanupFns.push({ + cleanupFn: cleanupFn, + specifier, + }); + } + } + async initCoordinatorExternal(operation, plugin, options, specifier) { + const context = this.makeCoordinatorContext(operation, plugin, options, specifier); + await this.initCoordinator(plugin, context, specifier); + } + async initCoordinatorInternal(operation, plugin, options) { + const context = { + ...this.makeCoordinatorContext(operation, plugin, options), + emit: this.emit.bind(this), + }; + await this.initCoordinator(plugin, context); + } + async initCoordinator(plugin, context, specifier) { + const cleanupFn = await wrapErrorAsync(async () => await plugin.coordinator(context), `${formatCulprit(specifier)} errored when trying to init`); + if (typeof cleanupFn === 'function') { + this.cleanupFns.push({ + cleanupFn: cleanupFn, + specifier, + }); + } + } + makeCoordinatorContext(operation, plugin, options, specifier) { + return { + operation, + on: (event, handler) => this.registerHandler(event, handler, specifier), + transform: (event, transformer) => this.registerTransformer(event, transformer, specifier), + options: 'optionsKey' in plugin && plugin.optionsKey + ? (options[plugin.optionsKey] ?? {}) + : options, + logger: this.environment.logger, + environment: { + cwd: this.environment.cwd, + stderr: this.environment.stderr, + env: { ...this.environment.env }, + }, + }; + } + emit(event, value) { + this.handlers[event].forEach(({ handler, specifier }) => { + wrapError(() => handler(value), `${formatCulprit(specifier)} errored when trying to handle a "${event}" event`); + }); + } + async transform(event, value) { + let transformed = value; + for (const { transformer, specifier } of this.transformers[event]) { + const returned = await wrapErrorAsync(async () => await transformer(transformed), `${formatCulprit(specifier)} errored when trying to do a "${event}" transform`); + if (typeof returned !== 'undefined') { + transformed = returned; + } + } + return transformed; + } + async cleanup() { + for (const { cleanupFn, specifier } of this.cleanupFns) { + await wrapErrorAsync(async () => await cleanupFn(), `${formatCulprit(specifier)} errored when trying to cleanup`); + } + } +} +exports.PluginManager = PluginManager; +function formatCulprit(specifier) { + return specifier ? `Plugin "${specifier}"` : 'Cucumber'; +} +function wrapError(fn, message) { + try { + return fn(); + } + catch (error) { + throw new Error(message, { cause: error }); + } +} +async function wrapErrorAsync(fn, message) { + try { + return await fn(); + } + catch (error) { + throw new Error(message, { cause: error }); + } +} +//# sourceMappingURL=plugin_manager.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.js.map b/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.js.map new file mode 100644 index 00000000..37363f6d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/plugin_manager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin_manager.js","sourceRoot":"","sources":["../../src/plugin/plugin_manager.ts"],"names":[],"mappings":";;;AAuCA,MAAa,aAAa;IAYK;IAXZ,QAAQ,GAAoB;QAC3C,OAAO,EAAE,EAAE;QACX,eAAe,E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EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC","sourcesContent":["import { UsableEnvironment } from '../environment'\nimport {\n CoordinatorContext,\n CoordinatorEventHandler,\n CoordinatorEventKey,\n CoordinatorEventValues,\n CoordinatorTransformer,\n CoordinatorTransformKey,\n CoordinatorTransformValues,\n FormatterPlugin,\n InternalPlugin,\n Plugin,\n PluginCleanup,\n PluginOperation,\n} from './types'\n\ntype SourcedEventHandler = {\n handler: CoordinatorEventHandler\n specifier?: string\n}\n\ntype SourcedTransformer = {\n transformer: CoordinatorTransformer\n specifier?: string\n}\n\ntype SourcedCleanup = {\n cleanupFn: PluginCleanup\n specifier?: string\n}\n\ntype HandlerRegistry = {\n [K in CoordinatorEventKey]: Array>\n}\n\ntype TransformerRegistry = {\n [K in CoordinatorTransformKey]: Array>\n}\n\nexport class PluginManager {\n private readonly handlers: HandlerRegistry = {\n message: [],\n 'paths:resolve': [],\n 'publish:url': [],\n }\n private readonly transformers: TransformerRegistry = {\n 'pickles:filter': [],\n 'pickles:order': [],\n }\n private cleanupFns: SourcedCleanup[] = []\n\n constructor(private readonly environment: UsableEnvironment) {}\n\n private async registerHandler(\n event: K,\n handler: CoordinatorEventHandler,\n specifier?: string\n ) {\n if (!this.handlers[event]) {\n throw new Error(`Cannot register handler for unknown event \"${event}\"`)\n }\n this.handlers[event].push({\n handler,\n specifier,\n })\n }\n\n private async registerTransformer(\n event: K,\n transformer: CoordinatorTransformer,\n specifier?: string\n ) {\n if (!this.transformers[event]) {\n throw new Error(\n `Cannot register transformer for unknown event \"${event}\"`\n )\n }\n this.transformers[event].push({\n transformer,\n specifier,\n })\n }\n\n async initFormatter(\n plugin: FormatterPlugin,\n options: OptionsType,\n stream: NodeJS.WritableStream,\n write: (buffer: string | Uint8Array) => void,\n directory?: string,\n specifier?: string\n ) {\n const cleanupFn = await plugin.formatter({\n on: (key, handler) => this.registerHandler(key, handler, specifier),\n options: plugin.optionsKey\n ? ((options as any)[plugin.optionsKey] ?? ({} as OptionsType))\n : options,\n logger: this.environment.logger,\n stream,\n write,\n directory,\n })\n if (typeof cleanupFn === 'function') {\n this.cleanupFns.push({\n cleanupFn: cleanupFn,\n specifier,\n })\n }\n }\n\n async initCoordinatorExternal(\n operation: PluginOperation,\n plugin: Plugin,\n options: OptionsType,\n specifier?: string\n ) {\n const context = this.makeCoordinatorContext(\n operation,\n plugin,\n options,\n specifier\n )\n await this.initCoordinator(plugin, context, specifier)\n }\n\n async initCoordinatorInternal(\n operation: PluginOperation,\n plugin: Plugin,\n options: OptionsType\n ) {\n const context = {\n ...this.makeCoordinatorContext(operation, plugin, options),\n emit: this.emit.bind(this),\n }\n await this.initCoordinator(plugin, context)\n }\n\n private async initCoordinator(\n plugin: Plugin,\n context: CoordinatorContext,\n specifier?: string\n ) {\n const cleanupFn = await wrapErrorAsync(\n async () => await plugin.coordinator(context),\n `${formatCulprit(specifier)} errored when trying to init`\n )\n if (typeof cleanupFn === 'function') {\n this.cleanupFns.push({\n cleanupFn: cleanupFn,\n specifier,\n })\n }\n }\n\n private makeCoordinatorContext(\n operation: PluginOperation,\n plugin: Plugin | InternalPlugin,\n options: OptionsType,\n specifier?: string\n ) {\n return {\n operation,\n on: (\n event: K,\n handler: CoordinatorEventHandler\n ) => this.registerHandler(event, handler, specifier),\n transform: (\n event: K,\n transformer: CoordinatorTransformer\n ) => this.registerTransformer(event, transformer, specifier),\n options:\n 'optionsKey' in plugin && plugin.optionsKey\n ? ((options as any)[plugin.optionsKey] ?? ({} as OptionsType))\n : options,\n logger: this.environment.logger,\n environment: {\n cwd: this.environment.cwd,\n stderr: this.environment.stderr,\n env: { ...this.environment.env },\n },\n }\n }\n\n emit(\n event: K,\n value: CoordinatorEventValues[K]\n ): void {\n this.handlers[event].forEach(({ handler, specifier }) => {\n wrapError(\n () => handler(value),\n `${formatCulprit(specifier)} errored when trying to handle a \"${event}\" event`\n )\n })\n }\n\n async transform(\n event: K,\n value: CoordinatorTransformValues[K]\n ): Promise {\n let transformed = value\n for (const { transformer, specifier } of this.transformers[event]) {\n const returned = await wrapErrorAsync(\n async () => await transformer(transformed),\n `${formatCulprit(specifier)} errored when trying to do a \"${event}\" transform`\n )\n if (typeof returned !== 'undefined') {\n transformed = returned\n }\n }\n return transformed\n }\n\n async cleanup(): Promise {\n for (const { cleanupFn, specifier } of this.cleanupFns) {\n await wrapErrorAsync(\n async () => await cleanupFn(),\n `${formatCulprit(specifier)} errored when trying to cleanup`\n )\n }\n }\n}\n\nfunction formatCulprit(specifier?: string) {\n return specifier ? `Plugin \"${specifier}\"` : 'Cucumber'\n}\n\nfunction wrapError(fn: () => T, message: string): T {\n try {\n return fn()\n } catch (error) {\n throw new Error(message, { cause: error })\n }\n}\n\nasync function wrapErrorAsync(\n fn: () => Promise,\n message: string\n): Promise {\n try {\n return await fn()\n } catch (error) {\n throw new Error(message, { cause: error })\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/plugin/types.d.ts b/node_modules/@cucumber/cucumber/lib/plugin/types.d.ts new file mode 100644 index 00000000..0e1246ac --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/types.d.ts @@ -0,0 +1,157 @@ +import { Writable } from 'node:stream'; +import { Envelope } from '@cucumber/messages'; +import { ILogger } from '../environment'; +import { IFilterablePickle } from '../filter'; +import { IResolvedPaths } from '../paths'; +/** + * The operation Cucumber is doing in this process + * @public + * @remarks + * `loadSources` and `loadSupport` are generally used as preflight operations + * for complex use cases. `runCucumber` is the one where tests are actually + * executed. + */ +export type PluginOperation = 'loadSources' | 'loadSupport' | 'runCucumber'; +/** + * Subset of the environment available to plugins + * @public + */ +export type CoordinatorEnvironment = { + /** + * Working directory for the project + */ + cwd: string; + /** + * Writable stream where the test run's warning/error output is written + * and plugins can write to directly if required + */ + stderr: Writable; + /** + * Environment variables + */ + env: Record; +}; +/** + * Keys for event handlers that plugins can register + * @public + */ +export type CoordinatorEventKey = 'message' | 'paths:resolve' | 'publish:url'; +/** + * Keys for transforms that plugins can register + * @public + */ +export type CoordinatorTransformKey = 'pickles:filter' | 'pickles:order'; +/** + * Mapping of event keys to their value types + * @public + */ +export type CoordinatorEventValues = { + message: Readonly; + 'paths:resolve': Readonly; + 'publish:url': string; +}; +/** + * Mapping of transform keys to their value types + * @public + */ +export type CoordinatorTransformValues = { + 'pickles:filter': Readonly>; + 'pickles:order': Readonly>; +}; +/** + * Handler function for a coordinator event + * @public + * @remarks + * You can do async work here, but Cucumber will not await the Promise. + */ +export type CoordinatorEventHandler = (value: CoordinatorEventValues[K]) => void; +/** + * Transformer function for a coordinator transform + * @remarks + * Don't try to modify the original value. Return a transformed value, or + * `undefined` to pass through unchanged. + * @public + */ +export type CoordinatorTransformer = (value: CoordinatorTransformValues[K]) => PromiseLike | CoordinatorTransformValues[K]; +/** + * Context object passed to a plugin's coordinator function + * @public + */ +export type CoordinatorContext = { + /** + * The operation Cucumber is doing in this process + */ + operation: PluginOperation; + /** + * Register an event handler + */ + on: (event: EventKey, handler: CoordinatorEventHandler) => void; + /** + * Register a transformer + */ + transform: (event: EventKey, handler: CoordinatorTransformer) => void; + /** + * Options for the plugin + */ + options: OptionsType; + /** + * Logger for emitting user-facing messages or diagnostics + */ + logger: ILogger; + /** + * Subset of the environment + */ + environment: CoordinatorEnvironment; +}; +/** + * Optional cleanup function returned by a plugin coordinator + * @public + */ +export type PluginCleanup = () => PromiseLike | void; +/** + * A plugin that can subscribe to events and register transforms + * @public + */ +export type Plugin = { + type: 'plugin'; + /** + * Coordinator function called during initialization + * @remarks + * Can do async work, and the Promise will be awaited. Can optionally return + * a cleanup function to be called when Cucumber is about to exit. + */ + coordinator: (context: CoordinatorContext) => PromiseLike | PluginCleanup | void; + /** + * Optional key to extract plugin-specific options from the root options object + */ + optionsKey?: string; +}; +/** + * Context object passed to an internal plugin's coordinator function + * @internal + */ +export type InternalCoordinatorContext = CoordinatorContext & { + emit: (event: EventKey, value: CoordinatorEventValues[EventKey]) => void; +}; +/** + * A built-in plugin with the additional ability to emit events + * @internal + */ +export type InternalPlugin = { + type: 'plugin'; + coordinator: (context: InternalCoordinatorContext) => PromiseLike | PluginCleanup | void; +}; +export type FormatterPluginContext = { + on: (key: 'message', handler: (value: Envelope) => void) => void; + options: OptionsType; + logger: ILogger; + stream: NodeJS.WritableStream; + write: (buffer: string | Uint8Array) => void; + directory?: string; +}; +export type FormatterPluginFunction = (context: FormatterPluginContext) => PromiseLike | PluginCleanup | void; +export type FormatterPlugin = { + type: 'formatter'; + formatter: FormatterPluginFunction; + optionsKey?: string; +}; diff --git a/node_modules/@cucumber/cucumber/lib/plugin/types.js b/node_modules/@cucumber/cucumber/lib/plugin/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/plugin/types.js.map b/node_modules/@cucumber/cucumber/lib/plugin/types.js.map new file mode 100644 index 00000000..63d127af --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/plugin/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Writable } from 'node:stream'\nimport { Envelope } from '@cucumber/messages'\nimport { ILogger } from '../environment'\nimport { IFilterablePickle } from '../filter'\nimport { IResolvedPaths } from '../paths'\n\n/**\n * The operation Cucumber is doing in this process\n * @public\n * @remarks\n * `loadSources` and `loadSupport` are generally used as preflight operations\n * for complex use cases. `runCucumber` is the one where tests are actually\n * executed.\n */\nexport type PluginOperation = 'loadSources' | 'loadSupport' | 'runCucumber'\n\n/**\n * Subset of the environment available to plugins\n * @public\n */\nexport type CoordinatorEnvironment = {\n /**\n * Working directory for the project\n */\n cwd: string\n /**\n * Writable stream where the test run's warning/error output is written\n * and plugins can write to directly if required\n */\n stderr: Writable\n /**\n * Environment variables\n */\n env: Record\n}\n\n/**\n * Keys for event handlers that plugins can register\n * @public\n */\nexport type CoordinatorEventKey = 'message' | 'paths:resolve' | 'publish:url'\n\n/**\n * Keys for transforms that plugins can register\n * @public\n */\nexport type CoordinatorTransformKey = 'pickles:filter' | 'pickles:order'\n\n/**\n * Mapping of event keys to their value types\n * @public\n */\nexport type CoordinatorEventValues = {\n message: Readonly\n 'paths:resolve': Readonly\n 'publish:url': string\n}\n\n/**\n * Mapping of transform keys to their value types\n * @public\n */\nexport type CoordinatorTransformValues = {\n 'pickles:filter': Readonly>\n 'pickles:order': Readonly>\n}\n\n/**\n * Handler function for a coordinator event\n * @public\n * @remarks\n * You can do async work here, but Cucumber will not await the Promise.\n */\nexport type CoordinatorEventHandler = (\n value: CoordinatorEventValues[K]\n) => void\n\n/**\n * Transformer function for a coordinator transform\n * @remarks\n * Don't try to modify the original value. Return a transformed value, or\n * `undefined` to pass through unchanged.\n * @public\n */\nexport type CoordinatorTransformer = (\n value: CoordinatorTransformValues[K]\n) => PromiseLike | CoordinatorTransformValues[K]\n\n/**\n * Context object passed to a plugin's coordinator function\n * @public\n */\nexport type CoordinatorContext = {\n /**\n * The operation Cucumber is doing in this process\n */\n operation: PluginOperation\n /**\n * Register an event handler\n */\n on: (\n event: EventKey,\n handler: CoordinatorEventHandler\n ) => void\n /**\n * Register a transformer\n */\n transform: (\n event: EventKey,\n handler: CoordinatorTransformer\n ) => void\n /**\n * Options for the plugin\n */\n options: OptionsType\n /**\n * Logger for emitting user-facing messages or diagnostics\n */\n logger: ILogger\n /**\n * Subset of the environment\n */\n environment: CoordinatorEnvironment\n}\n\n/**\n * Optional cleanup function returned by a plugin coordinator\n * @public\n */\nexport type PluginCleanup = () => PromiseLike | void\n\n/**\n * A plugin that can subscribe to events and register transforms\n * @public\n */\nexport type Plugin = {\n type: 'plugin'\n /**\n * Coordinator function called during initialization\n * @remarks\n * Can do async work, and the Promise will be awaited. Can optionally return\n * a cleanup function to be called when Cucumber is about to exit.\n */\n coordinator: (\n context: CoordinatorContext\n ) => PromiseLike | PluginCleanup | void\n /**\n * Optional key to extract plugin-specific options from the root options object\n */\n optionsKey?: string\n}\n\n/**\n * Context object passed to an internal plugin's coordinator function\n * @internal\n */\nexport type InternalCoordinatorContext =\n CoordinatorContext & {\n emit: (\n event: EventKey,\n value: CoordinatorEventValues[EventKey]\n ) => void\n }\n\n/**\n * A built-in plugin with the additional ability to emit events\n * @internal\n */\nexport type InternalPlugin = {\n type: 'plugin'\n coordinator: (\n context: InternalCoordinatorContext\n ) => PromiseLike | PluginCleanup | void\n}\n\nexport type FormatterPluginContext = {\n on: (key: 'message', handler: (value: Envelope) => void) => void\n options: OptionsType\n logger: ILogger\n stream: NodeJS.WritableStream\n write: (buffer: string | Uint8Array) => void\n directory?: string\n}\n\nexport type FormatterPluginFunction = (\n context: FormatterPluginContext\n) => PromiseLike | PluginCleanup | void\n\nexport type FormatterPlugin = {\n type: 'formatter'\n formatter: FormatterPluginFunction\n optionsKey?: string\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/publish/index.d.ts b/node_modules/@cucumber/cucumber/lib/publish/index.d.ts new file mode 100644 index 00000000..c7e67b48 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/index.d.ts @@ -0,0 +1,3 @@ +import { publishPlugin } from './publish_plugin'; +export default publishPlugin; +export * from './types'; diff --git a/node_modules/@cucumber/cucumber/lib/publish/index.js b/node_modules/@cucumber/cucumber/lib/publish/index.js new file mode 100644 index 00000000..5074801b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/index.js @@ -0,0 +1,20 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const publish_plugin_1 = require("./publish_plugin"); +exports.default = publish_plugin_1.publishPlugin; +__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/publish/index.js.map b/node_modules/@cucumber/cucumber/lib/publish/index.js.map new file mode 100644 index 00000000..d92fa2ec --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/publish/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAgD;AAEhD,kBAAe,8BAAa,CAAA;AAC5B,0CAAuB","sourcesContent":["import { publishPlugin } from './publish_plugin'\n\nexport default publishPlugin\nexport * from './types'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.d.ts b/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.d.ts new file mode 100644 index 00000000..63320493 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.d.ts @@ -0,0 +1,2 @@ +import { InternalPlugin } from '../plugin'; +export declare const publishPlugin: InternalPlugin; diff --git a/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.js b/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.js new file mode 100644 index 00000000..125782e3 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.js @@ -0,0 +1,95 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.publishPlugin = void 0; +const promises_1 = require("node:stream/promises"); +const node_util_1 = require("node:util"); +const promises_2 = require("node:fs/promises"); +const node_path_1 = __importDefault(require("node:path")); +const node_os_1 = require("node:os"); +const node_fs_1 = require("node:fs"); +const node_zlib_1 = require("node:zlib"); +const supports_color_1 = require("supports-color"); +const has_ansi_1 = __importDefault(require("has-ansi")); +const DEFAULT_CUCUMBER_PUBLISH_URL = 'https://reports.cucumber.io/api/reports'; +exports.publishPlugin = { + type: 'plugin', + coordinator: async ({ on, emit, logger, options, environment }) => { + if (!options) { + return undefined; + } + const { url = DEFAULT_CUCUMBER_PUBLISH_URL, token } = options; + const headers = { + Accept: 'application/json', + }; + if (token !== undefined) { + headers.Authorization = `Bearer ${token}`; + } + const touchResponse = await fetch(url, { headers }); + if (touchResponse.status >= 500) { + return () => { + logger.error(`Failed to publish report to ${new URL(url).origin} with status ${touchResponse.status}`); + logger.debug(touchResponse); + }; + } + const touchResult = (await touchResponse.json()); + if (!touchResponse.ok) { + return () => { + environment.stderr.write(sanitisePublishOutput(touchResult.banner, environment.stderr) + '\n'); + }; + } + if (touchResult.url) { + emit('publish:url', touchResult.url); + } + const uploadUrl = touchResponse.headers.get('Location'); + const tempDir = await (0, promises_2.mkdtemp)(node_path_1.default.join((0, node_os_1.tmpdir)(), `cucumber-js-publish-`)); + const tempFilePath = node_path_1.default.join(tempDir, 'envelopes.jsonl.gz'); + const writeStream = (0, node_zlib_1.createGzip)(); + const finishedWriting = (0, promises_1.pipeline)(writeStream, (0, node_fs_1.createWriteStream)(tempFilePath)); + on('message', (value) => writeStream.write(JSON.stringify(value) + '\n')); + return () => { + return new Promise((resolve) => { + writeStream.end(async () => { + await finishedWriting; + const stats = await (0, promises_2.stat)(tempFilePath); + const contentLength = stats.size.toString(); + logger.debug('Uploading envelopes to Cucumber Reports with content length:', contentLength); + const uploadResponse = await fetch(uploadUrl, { + method: 'PUT', + headers: { + 'Content-Type': 'application/jsonl', + 'Content-Encoding': 'gzip', + 'Content-Length': contentLength, + }, + body: (0, node_fs_1.createReadStream)(tempFilePath), + duplex: 'half', + }); + if (uploadResponse.ok) { + environment.stderr.write(sanitisePublishOutput(touchResult.banner, environment.stderr) + + '\n'); + } + else { + logger.error(`Failed to upload report to ${new URL(uploadUrl).origin} with status ${uploadResponse.status}`); + logger.debug(await uploadResponse.text()); + } + resolve(); + }); + }); + }; + }, +}; +/* +This is because the Cucumber Reports service returns a pre-formatted console message +including ANSI escapes, so if our stderr stream doesn't support those we need to +strip them back out. Ideally we should get structured data from the service and +compose the console message on this end. + */ +function sanitisePublishOutput(raw, stderr) { + if (!(0, supports_color_1.supportsColor)(stderr) && (0, has_ansi_1.default)(raw)) { + return (0, node_util_1.stripVTControlCharacters)(raw); + } + return raw; +} +//# sourceMappingURL=publish_plugin.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.js.map b/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.js.map new file mode 100644 index 00000000..aaa1bf73 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/publish_plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"publish_plugin.js","sourceRoot":"","sources":["../../src/publish/publish_plugin.ts"],"names":[],"mappings":";;;;;;AACA,mDAA+C;AAC/C,yCAAoD;AACpD,+CAAgD;AAChD,0DAA4B;AAC5B,qCAAgC;AAChC,qCAA6D;AAC7D,yCAAsC;AACtC,mDAA8C;AAC9C,wDAA8B;AAQ9B,MAAM,4BAA4B,GAAG,yCAAyC,CAAA;AAEjE,QAAA,aAAa,GAAmB;IAC3C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;QAChE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,MAAM,EAAE,GAAG,GAAG,4BAA4B,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;QAC7D,MAA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,EAAE,CACxC,CAAA;wBACD,MAAM,CAAC,KAAK,CAAC,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,CAAA;oBAC3C,CAAC;oBACD,OAAO,EAAE,CAAA;gBACX,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CACF,CAAA;AAED;;;;;GAKG;AACH,SAAS,qBAAqB,CAAC,GAAW,EAAE,MAAgB;IAC1D,IAAI,CAAC,IAAA,8BAAa,EAAC,MAAM,CAAC,IAAI,IAAA,kBAAO,EAAC,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAA,oCAAwB,EAAC,GAAG,CAAC,CAAA;IACtC,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { Writable } from 'node:stream'\nimport { pipeline } from 'node:stream/promises'\nimport { stripVTControlCharacters } from 'node:util'\nimport { mkdtemp, stat } from 'node:fs/promises'\nimport path from 'node:path'\nimport { tmpdir } from 'node:os'\nimport { createReadStream, createWriteStream } from 'node:fs'\nimport { createGzip } from 'node:zlib'\nimport { supportsColor } from 'supports-color'\nimport hasAnsi from 'has-ansi'\nimport { InternalPlugin } from '../plugin'\n\ntype TouchResult = {\n banner: string\n url?: string\n}\n\nconst DEFAULT_CUCUMBER_PUBLISH_URL = 'https://reports.cucumber.io/api/reports'\n\nexport const publishPlugin: InternalPlugin = {\n type: 'plugin',\n coordinator: async ({ on, emit, logger, options, environment }) => {\n if (!options) {\n return undefined\n }\n const { url = DEFAULT_CUCUMBER_PUBLISH_URL, token } = options\n const headers: { [key: string]: string } = {\n Accept: 'application/json',\n }\n if (token !== undefined) {\n headers.Authorization = `Bearer ${token}`\n }\n const touchResponse = await fetch(url, { headers })\n\n if (touchResponse.status >= 500) {\n return () => {\n logger.error(\n `Failed to publish report to ${new URL(url).origin} with status ${\n touchResponse.status\n }`\n )\n logger.debug(touchResponse)\n }\n }\n\n const touchResult = (await touchResponse.json()) as TouchResult\n\n if (!touchResponse.ok) {\n return () => {\n environment.stderr.write(\n sanitisePublishOutput(touchResult.banner, environment.stderr) + '\\n'\n )\n }\n }\n\n if (touchResult.url) {\n emit('publish:url', touchResult.url)\n }\n\n const uploadUrl = touchResponse.headers.get('Location')\n const tempDir = await mkdtemp(path.join(tmpdir(), `cucumber-js-publish-`))\n const tempFilePath = path.join(tempDir, 'envelopes.jsonl.gz')\n const writeStream = createGzip()\n const finishedWriting = pipeline(\n writeStream,\n createWriteStream(tempFilePath)\n )\n on('message', (value) => writeStream.write(JSON.stringify(value) + '\\n'))\n\n return () => {\n return new Promise((resolve) => {\n writeStream.end(async () => {\n await finishedWriting\n const stats = await stat(tempFilePath)\n const contentLength = stats.size.toString()\n logger.debug(\n 'Uploading envelopes to Cucumber Reports with content length:',\n contentLength\n )\n const uploadResponse = await fetch(uploadUrl, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/jsonl',\n 'Content-Encoding': 'gzip',\n 'Content-Length': contentLength,\n },\n body: createReadStream(tempFilePath),\n duplex: 'half',\n })\n if (uploadResponse.ok) {\n environment.stderr.write(\n sanitisePublishOutput(touchResult.banner, environment.stderr) +\n '\\n'\n )\n } else {\n logger.error(\n `Failed to upload report to ${\n new URL(uploadUrl).origin\n } with status ${uploadResponse.status}`\n )\n logger.debug(await uploadResponse.text())\n }\n resolve()\n })\n })\n }\n },\n}\n\n/*\nThis is because the Cucumber Reports service returns a pre-formatted console message\nincluding ANSI escapes, so if our stderr stream doesn't support those we need to\nstrip them back out. Ideally we should get structured data from the service and\ncompose the console message on this end.\n */\nfunction sanitisePublishOutput(raw: string, stderr: Writable) {\n if (!supportsColor(stderr) && hasAnsi(raw)) {\n return stripVTControlCharacters(raw)\n }\n return raw\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/publish/types.d.ts b/node_modules/@cucumber/cucumber/lib/publish/types.d.ts new file mode 100644 index 00000000..3a7713b4 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/types.d.ts @@ -0,0 +1,14 @@ +/** + * Options relating to publication to https://reports.cucumber.io + * @public + */ +export interface IPublishConfig { + /** + * Base URL for the Cucumber Reports service + */ + url: string; + /** + * Access token for the Cucumber Reports service + */ + token: string; +} diff --git a/node_modules/@cucumber/cucumber/lib/publish/types.js b/node_modules/@cucumber/cucumber/lib/publish/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/publish/types.js.map b/node_modules/@cucumber/cucumber/lib/publish/types.js.map new file mode 100644 index 00000000..625f0040 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/publish/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/publish/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options relating to publication to https://reports.cucumber.io\n * @public\n */\nexport interface IPublishConfig {\n /**\n * Base URL for the Cucumber Reports service\n */\n url: string\n /**\n * Access token for the Cucumber Reports service\n */\n token: string\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.d.ts new file mode 100644 index 00000000..ede67bf3 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.d.ts @@ -0,0 +1,33 @@ +import { Readable } from 'node:stream'; +import * as messages from '@cucumber/messages'; +export interface IAttachmentMedia { + encoding: messages.AttachmentContentEncoding; + contentType: string; +} +export interface IAttachment { + data: string; + media: IAttachmentMedia; + fileName?: string; +} +export type IAttachFunction = (attachment: IAttachment) => void; +export interface ICreateAttachmentOptions { + mediaType: string; + fileName?: string; +} +export type ICreateStringAttachment = (data: string, mediaTypeOrOptions?: string | ICreateAttachmentOptions) => void; +export type ICreateBufferAttachment = (data: Buffer, mediaTypeOrOptions: string | ICreateAttachmentOptions) => void; +export type ICreateStreamAttachment = (data: Readable, mediaTypeOrOptions: string | ICreateAttachmentOptions) => Promise; +export type ICreateStreamAttachmentWithCallback = (data: Readable, mediaTypeOrOptions: string | ICreateAttachmentOptions, callback: () => void) => void; +export type ICreateAttachment = ICreateStringAttachment & ICreateBufferAttachment & ICreateStreamAttachment & ICreateStreamAttachmentWithCallback; +export type ICreateLog = (text: string) => void; +export type ICreateLink = (text: string) => void; +export default class AttachmentManager { + private readonly onAttachment; + constructor(onAttachment: IAttachFunction); + log(text: string): void | Promise; + link(...url: string[]): void | Promise; + create(data: Buffer | Readable | string, mediaTypeOrOptions?: string | ICreateAttachmentOptions, callback?: () => void): void | Promise; + createBufferAttachment(data: Buffer, mediaType: string, fileName?: string): void; + createStreamAttachment(data: Readable, mediaType: string, fileName?: string, callback?: () => void): void | Promise; + createStringAttachment(data: string, media: IAttachmentMedia, fileName?: string): void; +} diff --git a/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.js b/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.js new file mode 100644 index 00000000..3dcfe306 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.js @@ -0,0 +1,133 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const is_stream_1 = __importDefault(require("is-stream")); +const messages = __importStar(require("@cucumber/messages")); +const value_checker_1 = require("../../value_checker"); +class AttachmentManager { + onAttachment; + constructor(onAttachment) { + this.onAttachment = onAttachment; + } + log(text) { + return this.create(text, 'text/x.cucumber.log+plain'); + } + link(...url) { + return this.create(url.join('\n'), 'text/uri-list'); + } + create(data, mediaTypeOrOptions, callback) { + const options = normaliseOptions(mediaTypeOrOptions); + if (Buffer.isBuffer(data)) { + if ((0, value_checker_1.doesNotHaveValue)(options.mediaType)) { + throw Error('Buffer attachments must specify a media type'); + } + this.createBufferAttachment(data, options.mediaType, options.fileName); + } + else if (is_stream_1.default.readable(data)) { + if ((0, value_checker_1.doesNotHaveValue)(options.mediaType)) { + throw Error('Stream attachments must specify a media type'); + } + return this.createStreamAttachment(data, options.mediaType, options.fileName, callback); + } + else if (typeof data === 'string') { + if ((0, value_checker_1.doesNotHaveValue)(options.mediaType)) { + options.mediaType = 'text/plain'; + } + if (options.mediaType.startsWith('base64:')) { + this.createStringAttachment(data, { + encoding: messages.AttachmentContentEncoding.BASE64, + contentType: options.mediaType.replace('base64:', ''), + }, options.fileName); + } + else { + this.createStringAttachment(data, { + encoding: messages.AttachmentContentEncoding.IDENTITY, + contentType: options.mediaType, + }, options.fileName); + } + } + else { + throw Error('Invalid attachment data: must be a buffer, readable stream, or string'); + } + } + createBufferAttachment(data, mediaType, fileName) { + this.createStringAttachment(data.toString('base64'), { + encoding: messages.AttachmentContentEncoding.BASE64, + contentType: mediaType, + }, fileName); + } + createStreamAttachment(data, mediaType, fileName, callback) { + const promise = new Promise((resolve, reject) => { + const buffers = []; + data.on('data', (chunk) => { + buffers.push(chunk); + }); + data.on('end', () => { + this.createBufferAttachment(Buffer.concat(buffers), mediaType, fileName); + resolve(); + }); + data.on('error', reject); + }); + if ((0, value_checker_1.doesHaveValue)(callback)) { + promise.then(callback, callback); + } + else { + return promise; + } + } + createStringAttachment(data, media, fileName) { + this.onAttachment({ + data, + media, + ...(fileName ? { fileName } : {}), + }); + } +} +exports.default = AttachmentManager; +function normaliseOptions(mediaTypeOrOptions) { + if (!mediaTypeOrOptions) { + return {}; + } + if (typeof mediaTypeOrOptions === 'string') { + return { + mediaType: mediaTypeOrOptions, + }; + } + return mediaTypeOrOptions; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.js.map b/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.js.map new file mode 100644 index 00000000..66af556f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/attachment_manager/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/attachment_manager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0DAAgC;AAChC,6DAA8C;AAC9C,uDAAqE;AA2CrE,MAAqB,iBAAiB;IACnB,YAAY,CAAiB;IAE9C,YAAY,YAA6B;QACvC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,2BAA2B,CAAC,CAAA;IACvD,CAAC;IAED,IAAI,CAAC,GAAG,GAAa;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,E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,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;QAClC,CAAC;aAAM,CAAC;YACN,OAAO,OAAO,CAAA;QAChB,CAAC;IACH,CAAC;IAED,sBAAsB,CACpB,IAAY,EACZ,KAAuB,EACvB,QAAiB;QAEjB,IAAI,CAAC,YAAY,CAAC;YAChB,IAAI;YACJ,KAAK;YACL,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClC,CAAC,CAAA;IACJ,CAAC;CACF;AApHD,oCAoHC;AAED,SAAS,gBAAgB,CACvB,kBAAsD;IAEtD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,OAAO,EAAE,CAAA;IACX,CAAC;IACD,IAAI,OAAO,kBAAkB,KAAK,QAAQ,EAAE,CAAC;QAC3C,OAAO;YACL,SAAS,EAAE,kBAAkB;SAC9B,CAAA;IACH,CAAC;IACD,OAAO,kBAAkB,CAAA;AAC3B,CAAC","sourcesContent":["import { Readable } from 'node:stream'\nimport isStream from 'is-stream'\nimport * as messages from '@cucumber/messages'\nimport { doesHaveValue, doesNotHaveValue } from '../../value_checker'\n\nexport interface IAttachmentMedia {\n encoding: messages.AttachmentContentEncoding\n contentType: string\n}\n\nexport interface IAttachment {\n data: string\n media: IAttachmentMedia\n fileName?: string\n}\n\nexport type IAttachFunction = (attachment: IAttachment) => void\n\nexport interface ICreateAttachmentOptions {\n mediaType: string\n fileName?: string\n}\nexport type ICreateStringAttachment = (\n data: string,\n mediaTypeOrOptions?: string | ICreateAttachmentOptions\n) => void\nexport type ICreateBufferAttachment = (\n data: Buffer,\n mediaTypeOrOptions: string | ICreateAttachmentOptions\n) => void\nexport type ICreateStreamAttachment = (\n data: Readable,\n mediaTypeOrOptions: string | ICreateAttachmentOptions\n) => Promise\nexport type ICreateStreamAttachmentWithCallback = (\n data: Readable,\n mediaTypeOrOptions: string | ICreateAttachmentOptions,\n callback: () => void\n) => void\nexport type ICreateAttachment = ICreateStringAttachment &\n ICreateBufferAttachment &\n ICreateStreamAttachment &\n ICreateStreamAttachmentWithCallback\nexport type ICreateLog = (text: string) => void\nexport type ICreateLink = (text: string) => void\n\nexport default class AttachmentManager {\n private readonly onAttachment: IAttachFunction\n\n constructor(onAttachment: IAttachFunction) {\n this.onAttachment = onAttachment\n }\n\n log(text: string): void | Promise {\n return this.create(text, 'text/x.cucumber.log+plain')\n }\n\n link(...url: string[]): void | Promise {\n return this.create(url.join('\\n'), 'text/uri-list')\n }\n\n create(\n data: Buffer | Readable | string,\n mediaTypeOrOptions?: string | ICreateAttachmentOptions,\n callback?: () => void\n ): void | Promise {\n const options = normaliseOptions(mediaTypeOrOptions)\n if (Buffer.isBuffer(data)) {\n if (doesNotHaveValue(options.mediaType)) {\n throw Error('Buffer attachments must specify a media type')\n }\n this.createBufferAttachment(data, options.mediaType, options.fileName)\n } else if (isStream.readable(data)) {\n if (doesNotHaveValue(options.mediaType)) {\n throw Error('Stream attachments must specify a media type')\n }\n return this.createStreamAttachment(\n data,\n options.mediaType,\n options.fileName,\n callback\n )\n } else if (typeof data === 'string') {\n if (doesNotHaveValue(options.mediaType)) {\n options.mediaType = 'text/plain'\n }\n if (options.mediaType.startsWith('base64:')) {\n this.createStringAttachment(\n data,\n {\n encoding: messages.AttachmentContentEncoding.BASE64,\n contentType: options.mediaType.replace('base64:', ''),\n },\n options.fileName\n )\n } else {\n this.createStringAttachment(\n data,\n {\n encoding: messages.AttachmentContentEncoding.IDENTITY,\n contentType: options.mediaType,\n },\n options.fileName\n )\n }\n } else {\n throw Error(\n 'Invalid attachment data: must be a buffer, readable stream, or string'\n )\n }\n }\n\n createBufferAttachment(\n data: Buffer,\n mediaType: string,\n fileName?: string\n ): void {\n this.createStringAttachment(\n data.toString('base64'),\n {\n encoding: messages.AttachmentContentEncoding.BASE64,\n contentType: mediaType,\n },\n fileName\n )\n }\n\n createStreamAttachment(\n data: Readable,\n mediaType: string,\n fileName?: string,\n callback?: () => void\n ): void | Promise {\n const promise = new Promise((resolve, reject) => {\n const buffers: Uint8Array[] = []\n data.on('data', (chunk) => {\n buffers.push(chunk)\n })\n data.on('end', () => {\n this.createBufferAttachment(Buffer.concat(buffers), mediaType, fileName)\n resolve()\n })\n data.on('error', reject)\n })\n if (doesHaveValue(callback)) {\n promise.then(callback, callback)\n } else {\n return promise\n }\n }\n\n createStringAttachment(\n data: string,\n media: IAttachmentMedia,\n fileName?: string\n ): void {\n this.onAttachment({\n data,\n media,\n ...(fileName ? { fileName } : {}),\n })\n }\n}\n\nfunction normaliseOptions(\n mediaTypeOrOptions?: string | ICreateAttachmentOptions\n): Partial {\n if (!mediaTypeOrOptions) {\n return {}\n }\n if (typeof mediaTypeOrOptions === 'string') {\n return {\n mediaType: mediaTypeOrOptions,\n }\n }\n return mediaTypeOrOptions\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/coordinator.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/coordinator.d.ts new file mode 100644 index 00000000..afb18fc6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/coordinator.d.ts @@ -0,0 +1,16 @@ +import { EventEmitter } from 'node:events'; +import { IdGenerator } from '@cucumber/messages'; +import { SourcedPickle } from '../assemble'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +import { RuntimeAdapter } from './types'; +import { Runtime } from './index'; +export declare class Coordinator implements Runtime { + private testRunStartedId; + private eventBroadcaster; + private newId; + private sourcedPickles; + private supportCodeLibrary; + private adapter; + constructor(testRunStartedId: string, eventBroadcaster: EventEmitter, newId: IdGenerator.NewId, sourcedPickles: ReadonlyArray, supportCodeLibrary: SupportCodeLibrary, adapter: RuntimeAdapter); + run(): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/runtime/coordinator.js b/node_modules/@cucumber/cucumber/lib/runtime/coordinator.js new file mode 100644 index 00000000..ad3fb595 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/coordinator.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Coordinator = void 0; +const assemble_1 = require("../assemble"); +const stopwatch_1 = require("./stopwatch"); +class Coordinator { + testRunStartedId; + eventBroadcaster; + newId; + sourcedPickles; + supportCodeLibrary; + adapter; + constructor(testRunStartedId, eventBroadcaster, newId, sourcedPickles, supportCodeLibrary, adapter) { + this.testRunStartedId = testRunStartedId; + this.eventBroadcaster = eventBroadcaster; + this.newId = newId; + this.sourcedPickles = sourcedPickles; + this.supportCodeLibrary = supportCodeLibrary; + this.adapter = adapter; + } + async run() { + this.eventBroadcaster.emit('envelope', { + testRunStarted: { + id: this.testRunStartedId, + timestamp: (0, stopwatch_1.timestamp)(), + }, + }); + const assembledTestCases = await (0, assemble_1.assembleTestCases)(this.testRunStartedId, this.eventBroadcaster, this.newId, this.sourcedPickles, this.supportCodeLibrary); + const success = await this.adapter.run(assembledTestCases); + this.eventBroadcaster.emit('envelope', { + testRunFinished: { + testRunStartedId: this.testRunStartedId, + timestamp: (0, stopwatch_1.timestamp)(), + success, + }, + }); + return success; + } +} +exports.Coordinator = Coordinator; +//# sourceMappingURL=coordinator.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/coordinator.js.map b/node_modules/@cucumber/cucumber/lib/runtime/coordinator.js.map new file mode 100644 index 00000000..e26d6d70 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/coordinator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"coordinator.js","sourceRoot":"","sources":["../../src/runtime/coordinator.ts"],"names":[],"mappings":";;;AAEA,0CAA8D;AAG9D,2CAAuC;AAGvC,MAAa,WAAW;IAEZ;IACA;IACA;IACA;IACA;IACA;IANV,YACU,gBAAwB,EACxB,gBAA8B,EAC9B,KAAwB,EACxB,cAA4C,EAC5C,kBAAsC,EACtC,OAAuB;QALvB,qBAAgB,GAAhB,gBAAgB,CAAQ;QACxB,qBAAgB,GAAhB,gBAAgB,CAAc;QAC9B,UAAK,GAAL,KAAK,CAAmB;QACxB,mBAAc,GAAd,cAAc,CAA8B;QAC5C,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,YAAO,GAAP,OAAO,CAAgB;IAC9B,CAAC;IAEJ,KAAK,CAAC,GAAG;QACP,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE;YACrC,cAAc,EAAE;gBACd,EAAE,EAAE,IAAI,CAAC,gBAAgB;gBACzB,SAAS,EAAE,IAAA,qBAAS,GAAE;aACvB;SACiB,CAAC,CAAA;QAErB,MAAM,kBAAkB,GAAG,MAAM,IAAA,4BAAiB,EAChD,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,kBAAkB,CACxB,CAAA;QAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;QAE1D,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE;YACrC,eAAe,EAAE;gBACf,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,SAAS,EAAE,IAAA,qBAAS,GAAE;gBACtB,OAAO;aACR;SACiB,CAAC,CAAA;QAErB,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAtCD,kCAsCC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { Envelope, IdGenerator } from '@cucumber/messages'\nimport { assembleTestCases, SourcedPickle } from '../assemble'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport { RuntimeAdapter } from './types'\nimport { timestamp } from './stopwatch'\nimport { Runtime } from './index'\n\nexport class Coordinator implements Runtime {\n constructor(\n private testRunStartedId: string,\n private eventBroadcaster: EventEmitter,\n private newId: IdGenerator.NewId,\n private sourcedPickles: ReadonlyArray,\n private supportCodeLibrary: SupportCodeLibrary,\n private adapter: RuntimeAdapter\n ) {}\n\n async run(): Promise {\n this.eventBroadcaster.emit('envelope', {\n testRunStarted: {\n id: this.testRunStartedId,\n timestamp: timestamp(),\n },\n } satisfies Envelope)\n\n const assembledTestCases = await assembleTestCases(\n this.testRunStartedId,\n this.eventBroadcaster,\n this.newId,\n this.sourcedPickles,\n this.supportCodeLibrary\n )\n\n const success = await this.adapter.run(assembledTestCases)\n\n this.eventBroadcaster.emit('envelope', {\n testRunFinished: {\n testRunStartedId: this.testRunStartedId,\n timestamp: timestamp(),\n success,\n },\n } satisfies Envelope)\n\n return success\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/format_error.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/format_error.d.ts new file mode 100644 index 00000000..815c7894 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/format_error.d.ts @@ -0,0 +1,2 @@ +import { TestStepResult } from '@cucumber/messages'; +export declare function formatError(error: Error | string, filterStackTraces: boolean): Pick; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/format_error.js b/node_modules/@cucumber/cucumber/lib/runtime/format_error.js new file mode 100644 index 00000000..b52aa092 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/format_error.js @@ -0,0 +1,51 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatError = formatError; +const assertion_error_formatter_1 = require("assertion-error-formatter"); +const error_stack_parser_1 = __importDefault(require("error-stack-parser")); +const filter_stack_trace_1 = require("../filter_stack_trace"); +function formatError(error, filterStackTraces) { + if (typeof error === 'string') { + const stackTrace = `Error: ${error}`; + return { + message: stackTrace, + exception: { + type: 'Error', + message: error, + stackTrace, + }, + }; + } + let processedStackTrace = error.stack; + try { + const parsedStack = error_stack_parser_1.default.parse(error); + const filteredStack = filterStackTraces + ? (0, filter_stack_trace_1.filterStackTrace)(parsedStack) + : parsedStack; + processedStackTrace = filteredStack.map((f) => f.source).join('\n'); + } + catch { + // if we weren't able to parse and process, we'll settle for the original + } + const stackTrace = (0, assertion_error_formatter_1.format)(error, { + colorFns: { + errorStack: (stack) => { + return processedStackTrace ? `\n${processedStackTrace}` : stack; + }, + }, + }); + const type = error.constructor.name; + const message = typeof error === 'string' ? error : error.message; + return { + message: stackTrace, + exception: { + type, + message, + stackTrace, + }, + }; +} +//# sourceMappingURL=format_error.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/format_error.js.map b/node_modules/@cucumber/cucumber/lib/runtime/format_error.js.map new file mode 100644 index 00000000..40d526e9 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/format_error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"format_error.js","sourceRoot":"","sources":["../../src/runtime/format_error.ts"],"names":[],"mappings":";;;;;AAKA,kCA0CC;AA9CD,yEAAkD;AAClD,4EAAiD;AACjD,8DAAwD;AAExD,SAAgB,WAAW,CACzB,KAAqB,EACrB,iBAA0B;IAE1B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,UAAU,KAAK,EAAE,CAAA;QACpC,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,KAAK;gBACd,UAAU;aACX;SACF,CAAA;IACH,CAAC;IACD,IAAI,mBAAmB,GAAW,KAAK,CAAC,KAAK,CAAA;IAC7C,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,4BAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACjD,MAAM,aAAa,GAAG,iBAAiB;YACrC,CAAC,CAAC,IAAA,qCAAgB,EAAC,WAAW,CAAC;YAC/B,CAAC,CAAC,WAAW,CAAA;QACf,mBAAmB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,yEAAyE;IAC3E,CAAC;IACD,MAAM,UAAU,GAAG,IAAA,kCAAM,EAAC,KAAK,EAAE;QAC/B,QAAQ,EAAE;YACR,UAAU,EAAE,CAAC,KAAa,EAAE,EAAE;gBAC5B,OAAO,mBAAmB,CAAC,CAAC,CAAC,KAAK,mBAAmB,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;YACjE,CAAC;SACF;KACF,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAA;IACnC,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAA;IACjE,OAAO;QACL,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE;YACT,IAAI;YACJ,OAAO;YACP,UAAU;SACX;KACF,CAAA;AACH,CAAC","sourcesContent":["import { TestStepResult } from '@cucumber/messages'\nimport { format } from 'assertion-error-formatter'\nimport errorStackParser from 'error-stack-parser'\nimport { filterStackTrace } from '../filter_stack_trace'\n\nexport function formatError(\n error: Error | string,\n filterStackTraces: boolean\n): Pick {\n if (typeof error === 'string') {\n const stackTrace = `Error: ${error}`\n return {\n message: stackTrace,\n exception: {\n type: 'Error',\n message: error,\n stackTrace,\n },\n }\n }\n let processedStackTrace: string = error.stack\n try {\n const parsedStack = errorStackParser.parse(error)\n const filteredStack = filterStackTraces\n ? filterStackTrace(parsedStack)\n : parsedStack\n processedStackTrace = filteredStack.map((f) => f.source).join('\\n')\n } catch {\n // if we weren't able to parse and process, we'll settle for the original\n }\n const stackTrace = format(error, {\n colorFns: {\n errorStack: (stack: string) => {\n return processedStackTrace ? `\\n${processedStackTrace}` : stack\n },\n },\n })\n const type = error.constructor.name\n const message = typeof error === 'string' ? error : error.message\n return {\n message: stackTrace,\n exception: {\n type,\n message,\n stackTrace,\n },\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/helpers.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/helpers.d.ts new file mode 100644 index 00000000..b24212f1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/helpers.d.ts @@ -0,0 +1,6 @@ +import * as messages from '@cucumber/messages'; +import StepDefinition from '../models/step_definition'; +import { RuntimeOptions } from '.'; +export declare function getAmbiguousStepException(stepDefinitions: StepDefinition[]): string; +export declare function retriesForPickle(pickle: messages.Pickle, options: RuntimeOptions): number; +export declare function shouldCauseFailure(status: messages.TestStepResultStatus, options: RuntimeOptions): boolean; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/helpers.js b/node_modules/@cucumber/cucumber/lib/runtime/helpers.js new file mode 100644 index 00000000..b1e5810e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/helpers.js @@ -0,0 +1,110 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getAmbiguousStepException = getAmbiguousStepException; +exports.retriesForPickle = retriesForPickle; +exports.shouldCauseFailure = shouldCauseFailure; +const cli_table3_1 = __importDefault(require("cli-table3")); +const indent_string_1 = __importDefault(require("indent-string")); +const messages = __importStar(require("@cucumber/messages")); +const location_helpers_1 = require("../formatter/helpers/location_helpers"); +const pickle_filter_1 = require("../pickle_filter"); +function getAmbiguousStepException(stepDefinitions) { + const table = new cli_table3_1.default({ + chars: { + bottom: '', + 'bottom-left': '', + 'bottom-mid': '', + 'bottom-right': '', + left: '', + 'left-mid': '', + mid: '', + 'mid-mid': '', + middle: ' - ', + right: '', + 'right-mid': '', + top: '', + 'top-left': '', + 'top-mid': '', + 'top-right': '', + }, + style: { + border: [], + 'padding-left': 0, + 'padding-right': 0, + }, + }); + table.push(...stepDefinitions.map((stepDefinition) => { + const pattern = stepDefinition.pattern.toString(); + return [pattern, (0, location_helpers_1.formatLocation)(stepDefinition)]; + })); + return `${'Multiple step definitions match:' + '\n'}${(0, indent_string_1.default)(table.toString(), 2)}`; +} +function retriesForPickle(pickle, options) { + if (!options.retry) { + return 0; + } + const retries = options.retry; + if (retries === 0) { + return 0; + } + const retryTagFilter = options.retryTagFilter; + if (!retryTagFilter) { + return retries; + } + const pickleTagFilter = new pickle_filter_1.PickleTagFilter(retryTagFilter); + if (pickleTagFilter.matchesAllTagExpressions(pickle)) { + return retries; + } + return 0; +} +function shouldCauseFailure(status, options) { + if (options.dryRun) { + return false; + } + const failureStatuses = [ + messages.TestStepResultStatus.AMBIGUOUS, + messages.TestStepResultStatus.FAILED, + messages.TestStepResultStatus.UNDEFINED, + ]; + if (options.strict) { + failureStatuses.push(messages.TestStepResultStatus.PENDING); + } + return failureStatuses.includes(status); +} +//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/helpers.js.map b/node_modules/@cucumber/cucumber/lib/runtime/helpers.js.map new file mode 100644 index 00000000..f198afc4 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/runtime/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,8DAqCC;AAED,4CAoBC;AAED,gDAgBC;AArFD,4DAA8B;AAC9B,kEAAwC;AACxC,6DAA8C;AAC9C,4EAAsE;AACtE,oDAAkD;AAIlD,SAAgB,yBAAyB,CACvC,eAAiC;IAEjC,MAAM,KAAK,GAAG,IAAI,oBAAK,CAAC;QACtB,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,aAAa,EAAE,EAAE;YACjB,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,EAAE;YAClB,IAAI,EAAE,EAAE;YACR,UAAU,EAAE,EAAE;YACd,GAAG,EAAE,EAAE;YACP,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,EAAE;YACT,WAAW,EAAE,EAAE;YACf,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,EAAE;YACd,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,EAAE;SAChB;QACD,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,cAAc,EAAE,CAAC;YACjB,eAAe,EAAE,CAAC;SACnB;KACF,CAAC,CAAA;IACF,KAAK,CAAC,IAAI,CACR,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAA;QACjD,OAAO,CAAC,OAAO,EAAE,IAAA,iCAAc,EAAC,cAAc,CAAC,CAAC,CAAA;IAClD,CAAC,CAAC,CACH,CAAA;IACD,OAAO,GAAG,kCAAkC,GAAG,IAAI,GAAG,IAAA,uBAAY,EAChE,KAAK,CAAC,QAAQ,EAAE,EAChB,CAAC,CACF,EAAE,CAAA;AACL,CAAC;AAED,SAAgB,gBAAgB,CAC9B,MAAuB,EACvB,OAAuB;IAEvB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO,CAAC,CAAA;IACV,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAA;IAC7B,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,OAAO,CAAC,CAAA;IACV,CAAC;IACD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAA;IAC7C,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,MAAM,eAAe,GAAG,IAAI,+BAAe,CAAC,cAAc,CAAC,CAAA;IAC3D,IAAI,eAAe,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACrD,OAAO,OAAO,CAAA;IAChB,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC;AAED,SAAgB,kBAAkB,CAChC,MAAqC,EACrC,OAAuB;IAEvB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,eAAe,GAAoC;QACvD,QAAQ,CAAC,oBAAoB,CAAC,SAAS;QACvC,QAAQ,CAAC,oBAAoB,CAAC,MAAM;QACpC,QAAQ,CAAC,oBAAoB,CAAC,SAAS;KACxC,CAAA;IACD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;IAC7D,CAAC;IACD,OAAO,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACzC,CAAC","sourcesContent":["import Table from 'cli-table3'\nimport indentString from 'indent-string'\nimport * as messages from '@cucumber/messages'\nimport { formatLocation } from '../formatter/helpers/location_helpers'\nimport { PickleTagFilter } from '../pickle_filter'\nimport StepDefinition from '../models/step_definition'\nimport { RuntimeOptions } from '.'\n\nexport function getAmbiguousStepException(\n stepDefinitions: StepDefinition[]\n): string {\n const table = new Table({\n chars: {\n bottom: '',\n 'bottom-left': '',\n 'bottom-mid': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n middle: ' - ',\n right: '',\n 'right-mid': '',\n top: '',\n 'top-left': '',\n 'top-mid': '',\n 'top-right': '',\n },\n style: {\n border: [],\n 'padding-left': 0,\n 'padding-right': 0,\n },\n })\n table.push(\n ...stepDefinitions.map((stepDefinition) => {\n const pattern = stepDefinition.pattern.toString()\n return [pattern, formatLocation(stepDefinition)]\n })\n )\n return `${'Multiple step definitions match:' + '\\n'}${indentString(\n table.toString(),\n 2\n )}`\n}\n\nexport function retriesForPickle(\n pickle: messages.Pickle,\n options: RuntimeOptions\n): number {\n if (!options.retry) {\n return 0\n }\n const retries = options.retry\n if (retries === 0) {\n return 0\n }\n const retryTagFilter = options.retryTagFilter\n if (!retryTagFilter) {\n return retries\n }\n const pickleTagFilter = new PickleTagFilter(retryTagFilter)\n if (pickleTagFilter.matchesAllTagExpressions(pickle)) {\n return retries\n }\n return 0\n}\n\nexport function shouldCauseFailure(\n status: messages.TestStepResultStatus,\n options: RuntimeOptions\n): boolean {\n if (options.dryRun) {\n return false\n }\n const failureStatuses: messages.TestStepResultStatus[] = [\n messages.TestStepResultStatus.AMBIGUOUS,\n messages.TestStepResultStatus.FAILED,\n messages.TestStepResultStatus.UNDEFINED,\n ]\n if (options.strict) {\n failureStatuses.push(messages.TestStepResultStatus.PENDING)\n }\n return failureStatuses.includes(status)\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/index.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/index.d.ts new file mode 100644 index 00000000..fd9a4675 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/index.d.ts @@ -0,0 +1,2 @@ +export * from './make_runtime'; +export { Runtime, RuntimeOptions } from './types'; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/index.js b/node_modules/@cucumber/cucumber/lib/runtime/index.js new file mode 100644 index 00000000..97ac4590 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./make_runtime"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/index.js.map b/node_modules/@cucumber/cucumber/lib/runtime/index.js.map new file mode 100644 index 00000000..4a9e5324 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B","sourcesContent":["export * from './make_runtime'\nexport { Runtime, RuntimeOptions } from './types'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.d.ts new file mode 100644 index 00000000..56bf3eb9 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.d.ts @@ -0,0 +1,18 @@ +import { EventEmitter } from 'node:events'; +import { IdGenerator } from '@cucumber/messages'; +import { IRunOptionsRuntime } from '../api'; +import { ILogger, IRunEnvironment } from '../environment'; +import { SourcedPickle } from '../assemble'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +import { FormatOptions } from '../formatter'; +import { Runtime } from './types'; +export declare function makeRuntime({ environment, logger, eventBroadcaster, sourcedPickles, newId, supportCodeLibrary, options, snippetOptions, }: { + environment: IRunEnvironment; + logger: ILogger; + eventBroadcaster: EventEmitter; + newId: IdGenerator.NewId; + sourcedPickles: ReadonlyArray; + supportCodeLibrary: SupportCodeLibrary; + options: IRunOptionsRuntime; + snippetOptions: Pick; +}): Promise; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.js b/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.js new file mode 100644 index 00000000..53bee0fd --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.js @@ -0,0 +1,28 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeRuntime = makeRuntime; +const builder_1 = __importDefault(require("../formatter/builder")); +const adapter_1 = require("./parallel/adapter"); +const adapter_2 = require("./serial/adapter"); +const coordinator_1 = require("./coordinator"); +async function makeRuntime({ environment, logger, eventBroadcaster, sourcedPickles, newId, supportCodeLibrary, options, snippetOptions, }) { + const testRunStartedId = newId(); + const adapter = await makeAdapter(options, snippetOptions, testRunStartedId, environment, logger, eventBroadcaster, supportCodeLibrary, newId); + return new coordinator_1.Coordinator(testRunStartedId, eventBroadcaster, newId, sourcedPickles, supportCodeLibrary, adapter); +} +async function makeAdapter(options, snippetOptions, testRunStartedId, environment, logger, eventBroadcaster, supportCodeLibrary, newId) { + if (options.parallel > 0) { + return new adapter_1.ChildProcessAdapter(testRunStartedId, environment, logger, eventBroadcaster, options, snippetOptions, supportCodeLibrary); + } + const snippetBuilder = await builder_1.default.getStepDefinitionSnippetBuilder({ + cwd: environment.cwd, + snippetInterface: snippetOptions.snippetInterface, + snippetSyntax: snippetOptions.snippetSyntax, + supportCodeLibrary, + }); + return new adapter_2.InProcessAdapter(testRunStartedId, eventBroadcaster, newId, options, supportCodeLibrary, snippetBuilder); +} +//# sourceMappingURL=make_runtime.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.js.map b/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.js.map new file mode 100644 index 00000000..f1144038 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/make_runtime.js.map @@ -0,0 +1 @@ +{"version":3,"file":"make_runtime.js","sourceRoot":"","sources":["../../src/runtime/make_runtime.ts"],"names":[],"mappings":";;;;;AAaA,kCAsCC;AA7CD,mEAAmD;AAGnD,gDAAwD;AACxD,8CAAmD;AACnD,+CAA2C;AAEpC,KAAK,UAAU,WAAW,CAAC,EAChC,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,kBAAkB,EAClB,OAAO,EACP,cAAc,GAUf;IACC,MAAM,gBAAgB,GAAG,KAAK,EAAE,CAAA;IAChC,MAAM,OAAO,GAAG,MAAM,WAAW,CAC/B,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,CACN,CAAA;IACD,OAAO,IAAI,yBAAW,CACpB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,kBAAkB,EAClB,OAAO,CACR,CAAA;AACH,CAAC;AAED,KAAK,UAAU,WAAW,CACxB,OAA2B,EAC3B,cAAyE,EACzE,gBAAwB,EACxB,WAA4B,EAC5B,MAAe,EACf,gBAA8B,EAC9B,kBAAsC,EACtC,KAAmB;IAEnB,IAAI,OAAO,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,6BAAmB,CAC5B,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,kBAAkB,CACnB,CAAA;IACH,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,iBAAgB,CAAC,+BAA+B,CAC3E;QACE,GAAG,EAAE,WAAW,CAAC,GAAG;QACpB,gBAAgB,EAAE,cAAc,CAAC,gBAAgB;QACjD,aAAa,EAAE,cAAc,CAAC,aAAa;QAC3C,kBAAkB;KACnB,CACF,CAAA;IACD,OAAO,IAAI,0BAAgB,CACzB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,OAAO,EACP,kBAAkB,EAClB,cAAc,CACf,CAAA;AACH,CAAC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { IdGenerator } from '@cucumber/messages'\nimport { IRunOptionsRuntime } from '../api'\nimport { ILogger, IRunEnvironment } from '../environment'\nimport { SourcedPickle } from '../assemble'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport FormatterBuilder from '../formatter/builder'\nimport { FormatOptions } from '../formatter'\nimport { Runtime } from './types'\nimport { ChildProcessAdapter } from './parallel/adapter'\nimport { InProcessAdapter } from './serial/adapter'\nimport { Coordinator } from './coordinator'\n\nexport async function makeRuntime({\n environment,\n logger,\n eventBroadcaster,\n sourcedPickles,\n newId,\n supportCodeLibrary,\n options,\n snippetOptions,\n}: {\n environment: IRunEnvironment\n logger: ILogger\n eventBroadcaster: EventEmitter\n newId: IdGenerator.NewId\n sourcedPickles: ReadonlyArray\n supportCodeLibrary: SupportCodeLibrary\n options: IRunOptionsRuntime\n snippetOptions: Pick\n}): Promise {\n const testRunStartedId = newId()\n const adapter = await makeAdapter(\n options,\n snippetOptions,\n testRunStartedId,\n environment,\n logger,\n eventBroadcaster,\n supportCodeLibrary,\n newId\n )\n return new Coordinator(\n testRunStartedId,\n eventBroadcaster,\n newId,\n sourcedPickles,\n supportCodeLibrary,\n adapter\n )\n}\n\nasync function makeAdapter(\n options: IRunOptionsRuntime,\n snippetOptions: Pick,\n testRunStartedId: string,\n environment: IRunEnvironment,\n logger: ILogger,\n eventBroadcaster: EventEmitter,\n supportCodeLibrary: SupportCodeLibrary,\n newId: () => string\n) {\n if (options.parallel > 0) {\n return new ChildProcessAdapter(\n testRunStartedId,\n environment,\n logger,\n eventBroadcaster,\n options,\n snippetOptions,\n supportCodeLibrary\n )\n }\n const snippetBuilder = await FormatterBuilder.getStepDefinitionSnippetBuilder(\n {\n cwd: environment.cwd,\n snippetInterface: snippetOptions.snippetInterface,\n snippetSyntax: snippetOptions.snippetSyntax,\n supportCodeLibrary,\n }\n )\n return new InProcessAdapter(\n testRunStartedId,\n eventBroadcaster,\n newId,\n options,\n supportCodeLibrary,\n snippetBuilder\n )\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.d.ts new file mode 100644 index 00000000..2bae0f2f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.d.ts @@ -0,0 +1,7 @@ +import { IdGenerator, PickleStep, Suggestion } from '@cucumber/messages'; +import StepDefinitionSnippetBuilder from '../formatter/step_definition_snippet_builder'; +export declare function makeSuggestion({ newId, snippetBuilder, pickleStep, }: { + newId: IdGenerator.NewId; + snippetBuilder: StepDefinitionSnippetBuilder; + pickleStep: PickleStep; +}): Suggestion; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.js b/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.js new file mode 100644 index 00000000..0d00fda6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeSuggestion = makeSuggestion; +const messages_1 = require("@cucumber/messages"); +const helpers_1 = require("../formatter/helpers"); +function mapPickleStepTypeToKeywordType(type) { + switch (type) { + case messages_1.PickleStepType.CONTEXT: + return helpers_1.KeywordType.Precondition; + case messages_1.PickleStepType.ACTION: + return helpers_1.KeywordType.Event; + case messages_1.PickleStepType.OUTCOME: + return helpers_1.KeywordType.Outcome; + default: + return helpers_1.KeywordType.Precondition; + } +} +function makeSuggestion({ newId, snippetBuilder, pickleStep, }) { + const keywordType = mapPickleStepTypeToKeywordType(pickleStep.type); + const codes = snippetBuilder.buildMultiple({ keywordType, pickleStep }); + const snippets = codes.map((code) => ({ + code, + language: 'javascript', + })); + return { + id: newId(), + pickleStepId: pickleStep.id, + snippets, + }; +} +//# sourceMappingURL=make_suggestion.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.js.map b/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.js.map new file mode 100644 index 00000000..66f40528 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/make_suggestion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"make_suggestion.js","sourceRoot":"","sources":["../../src/runtime/make_suggestion.ts"],"names":[],"mappings":";;AAsBA,wCAqBC;AA3CD,iDAK2B;AAE3B,kDAAkD;AAElD,SAAS,8BAA8B,CAAC,IAAqB;IAC3D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,yBAAc,CAAC,OAAO;YACzB,OAAO,qBAAW,CAAC,YAAY,CAAA;QACjC,KAAK,yBAAc,CAAC,MAAM;YACxB,OAAO,qBAAW,CAAC,KAAK,CAAA;QAC1B,KAAK,yBAAc,CAAC,OAAO;YACzB,OAAO,qBAAW,CAAC,OAAO,CAAA;QAC5B;YACE,OAAO,qBAAW,CAAC,YAAY,CAAA;IACnC,CAAC;AACH,CAAC;AAED,SAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,cAAc,EACd,UAAU,GAKX;IACC,MAAM,WAAW,GAAG,8BAA8B,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IACnE,MAAM,KAAK,GAAG,cAAc,CAAC,aAAa,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CAAA;IACvE,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACpC,IAAI;QACJ,QAAQ,EAAE,YAAY;KACvB,CAAC,CAAC,CAAA;IAEH,OAAO;QACL,EAAE,EAAE,KAAK,EAAE;QACX,YAAY,EAAE,UAAU,CAAC,EAAE;QAC3B,QAAQ;KACT,CAAA;AACH,CAAC","sourcesContent":["import {\n IdGenerator,\n PickleStep,\n PickleStepType,\n Suggestion,\n} from '@cucumber/messages'\nimport StepDefinitionSnippetBuilder from '../formatter/step_definition_snippet_builder'\nimport { KeywordType } from '../formatter/helpers'\n\nfunction mapPickleStepTypeToKeywordType(type?: PickleStepType): KeywordType {\n switch (type) {\n case PickleStepType.CONTEXT:\n return KeywordType.Precondition\n case PickleStepType.ACTION:\n return KeywordType.Event\n case PickleStepType.OUTCOME:\n return KeywordType.Outcome\n default:\n return KeywordType.Precondition\n }\n}\n\nexport function makeSuggestion({\n newId,\n snippetBuilder,\n pickleStep,\n}: {\n newId: IdGenerator.NewId\n snippetBuilder: StepDefinitionSnippetBuilder\n pickleStep: PickleStep\n}): Suggestion {\n const keywordType = mapPickleStepTypeToKeywordType(pickleStep.type)\n const codes = snippetBuilder.buildMultiple({ keywordType, pickleStep })\n const snippets = codes.map((code) => ({\n code,\n language: 'javascript',\n }))\n\n return {\n id: newId(),\n pickleStepId: pickleStep.id,\n snippets,\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.d.ts new file mode 100644 index 00000000..b25d185d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.d.ts @@ -0,0 +1,49 @@ +import { ChildProcess } from 'node:child_process'; +import { EventEmitter } from 'node:events'; +import { SupportCodeLibrary } from '../../support_code_library_builder/types'; +import { AssembledTestCase } from '../../assemble'; +import { ILogger, IRunEnvironment } from '../../environment'; +import { RuntimeAdapter } from '../types'; +import { IRunOptionsRuntime } from '../../api'; +import { FormatOptions } from '../../formatter'; +import { WorkerToCoordinatorEvent } from './types'; +declare const enum WorkerState { + 'idle' = 0, + 'closed' = 1, + 'running' = 2, + 'new' = 3 +} +interface ManagedWorker { + state: WorkerState; + process: ChildProcess; + id: string; +} +interface WorkPlacement { + index: number; + item: AssembledTestCase; +} +export declare class ChildProcessAdapter implements RuntimeAdapter { + private readonly testRunStartedId; + private readonly environment; + private readonly logger; + private readonly eventBroadcaster; + private readonly options; + private readonly snippetOptions; + private readonly supportCodeLibrary; + private idleInterventions; + private failing; + private onFinish; + private todo; + private readonly inProgress; + private readonly workers; + constructor(testRunStartedId: string, environment: IRunEnvironment, logger: ILogger, eventBroadcaster: EventEmitter, options: IRunOptionsRuntime, snippetOptions: Pick, supportCodeLibrary: SupportCodeLibrary); + parseWorkerMessage(worker: ManagedWorker, message: WorkerToCoordinatorEvent): void; + awakenWorkers(triggeringWorker: ManagedWorker): void; + startWorker(id: string, total: number): void; + onWorkerProcessClose(exitCode: number): void; + run(assembledTestCases: ReadonlyArray): Promise; + nextWorkPlacement(): WorkPlacement; + placementAt(index: number): WorkPlacement; + giveWork(worker: ManagedWorker, force?: boolean): void; +} +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.js b/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.js new file mode 100644 index 00000000..1ba71cce --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.js @@ -0,0 +1,160 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChildProcessAdapter = void 0; +const node_child_process_1 = require("node:child_process"); +const node_path_1 = __importDefault(require("node:path")); +const runWorkerPath = node_path_1.default.resolve(__dirname, 'run_worker.js'); +class ChildProcessAdapter { + testRunStartedId; + environment; + logger; + eventBroadcaster; + options; + snippetOptions; + supportCodeLibrary; + idleInterventions = 0; + failing = false; + onFinish; + todo = []; + inProgress = {}; + workers = {}; + constructor(testRunStartedId, environment, logger, eventBroadcaster, options, snippetOptions, supportCodeLibrary) { + this.testRunStartedId = testRunStartedId; + this.environment = environment; + this.logger = logger; + this.eventBroadcaster = eventBroadcaster; + this.options = options; + this.snippetOptions = snippetOptions; + this.supportCodeLibrary = supportCodeLibrary; + } + parseWorkerMessage(worker, message) { + switch (message.type) { + case 'READY': + worker.state = 0 /* WorkerState.idle */; + this.awakenWorkers(worker); + break; + case 'ENVELOPE': + this.eventBroadcaster.emit('envelope', message.envelope); + break; + case 'FINISHED': + if (!message.success) { + this.failing = true; + } + delete this.inProgress[worker.id]; + worker.state = 0 /* WorkerState.idle */; + this.awakenWorkers(worker); + break; + default: + throw new Error(`Unexpected message from worker: ${JSON.stringify(message)}`); + } + } + awakenWorkers(triggeringWorker) { + Object.values(this.workers).forEach((worker) => { + if (worker.state === 0 /* WorkerState.idle */) { + this.giveWork(worker); + } + return worker.state !== 0 /* WorkerState.idle */; + }); + if (Object.keys(this.inProgress).length == 0 && this.todo.length > 0) { + this.giveWork(triggeringWorker, true); + this.idleInterventions++; + } + } + startWorker(id, total) { + const workerProcess = (0, node_child_process_1.fork)(runWorkerPath, [], { + cwd: this.environment.cwd, + env: { + ...this.environment.env, + CUCUMBER_PARALLEL: 'true', + CUCUMBER_TOTAL_WORKERS: total.toString(), + CUCUMBER_WORKER_ID: id, + }, + stdio: ['inherit', 'inherit', 'inherit', 'ipc'], + }); + const worker = { state: 3 /* WorkerState.new */, process: workerProcess, id }; + this.workers[id] = worker; + worker.process.on('message', (message) => { + this.parseWorkerMessage(worker, message); + }); + worker.process.on('close', (exitCode) => { + worker.state = 1 /* WorkerState.closed */; + this.onWorkerProcessClose(exitCode); + }); + worker.process.send({ + type: 'INITIALIZE', + testRunStartedId: this.testRunStartedId, + supportCodeCoordinates: this.supportCodeLibrary.originalCoordinates, + supportCodeIds: { + stepDefinitionIds: this.supportCodeLibrary.stepDefinitions.map((s) => s.id), + beforeTestCaseHookDefinitionIds: this.supportCodeLibrary.beforeTestCaseHookDefinitions.map((h) => h.id), + afterTestCaseHookDefinitionIds: this.supportCodeLibrary.afterTestCaseHookDefinitions.map((h) => h.id), + beforeTestRunHookDefinitionIds: this.supportCodeLibrary.beforeTestRunHookDefinitions.map((h) => h.id), + afterTestRunHookDefinitionIds: this.supportCodeLibrary.afterTestRunHookDefinitions.map((h) => h.id), + }, + options: this.options, + snippetOptions: this.snippetOptions, + }); + } + onWorkerProcessClose(exitCode) { + if (exitCode !== 0) { + this.failing = true; + } + if (Object.values(this.workers).every((x) => x.state === 1 /* WorkerState.closed */)) { + this.onFinish(!this.failing); + } + } + async run(assembledTestCases) { + this.todo = Array.from(assembledTestCases); + return await new Promise((resolve) => { + for (let i = 0; i < this.options.parallel; i++) { + this.startWorker(i.toString(), this.options.parallel); + } + this.onFinish = (status) => { + if (this.idleInterventions > 0) { + this.logger.warn(`WARNING: All workers went idle ${this.idleInterventions} time(s). Consider revising handler passed to setParallelCanAssign.`); + } + resolve(status); + }; + }); + } + nextWorkPlacement() { + for (let index = 0; index < this.todo.length; index++) { + const placement = this.placementAt(index); + if (this.supportCodeLibrary.parallelCanAssign(placement.item.pickle, Object.values(this.inProgress).map(({ pickle }) => pickle))) { + return placement; + } + } + return null; + } + placementAt(index) { + return { + index, + item: this.todo[index], + }; + } + giveWork(worker, force = false) { + if (this.todo.length < 1) { + worker.state = 2 /* WorkerState.running */; + worker.process.send({ type: 'FINALIZE' }); + return; + } + const workPlacement = force ? this.placementAt(0) : this.nextWorkPlacement(); + if (workPlacement === null) { + return; + } + const { index: nextIndex, item } = workPlacement; + this.todo.splice(nextIndex, 1); + this.inProgress[worker.id] = item; + worker.state = 2 /* WorkerState.running */; + worker.process.send({ + type: 'RUN', + assembledTestCase: item, + failing: this.failing, + }); + } +} +exports.ChildProcessAdapter = ChildProcessAdapter; +//# sourceMappingURL=adapter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.js.map b/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.js.map new file mode 100644 index 00000000..f2868edf --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/adapter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/runtime/parallel/adapter.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAuD;AACvD,0DAA4B;AAe5B,MAAM,aAAa,GAAG,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;AAoB9D,MAAa,mBAAmB;IASX;IACA;IACA;IACA;IACA;IACA;IAIA;IAjBX,iBAAiB,GAAW,CAAC,CAAA;IAC7B,OAAO,GAAY,KAAK,CAAA;IACxB,QAAQ,CAA4B;IACpC,IAAI,GAA6B,EAAE,CAAA;IAC1B,UAAU,GAAsC,EAAE,CAAA;IAClD,OAAO,GAAkC,EAAE,CAAA;IAE5D,YACmB,gBAAwB,EACxB,WAA4B,EAC5B,MAAe,EACf,gBAA8B,EAC9B,OAA2B,EAC3B,cAGhB,EACgB,kBAAsC;QATtC,qBAAgB,GAAhB,gBAAgB,CAAQ;QACxB,gBAAW,GAAX,WAAW,CAAiB;QAC5B,WAAM,GAAN,MAAM,CAAS;QACf,qBAAgB,GAAhB,gBAAgB,CAAc;QAC9B,YAAO,GAAP,OAAO,CAAoB;QAC3B,mBAAc,GAAd,cAAc,CAG9B;QACgB,uBAAkB,GAAlB,kBAAkB,CAAoB;IACtD,CAAC;IAEJ,kBAAkB,CAChB,MAAqB,EACrB,OAAiC;QAEjC,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,OAAO;gBACV,MAAM,CAAC,KAAK,2BAAmB,CAAA;gBAC/B,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;gBAC1B,MAAK;YACP,KAAK,UAAU;gBACb,IAAI,CAAC,gBAA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AAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAE5E,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;YAC3B,OAAM;QACR,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,aAAa,CAAA;QAEhD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;QAC9B,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;QACjC,MAAM,CAAC,KAAK,8BAAsB,CAAA;QAClC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;YAClB,IAAI,EAAE,KAAK;YACX,iBAAiB,EAAE,IAAI;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;SACD,CAAC,CAAA;IACzB,CAAC;CACF;AAzLD,kDAyLC","sourcesContent":["import { ChildProcess, fork } from 'node:child_process'\nimport path from 'node:path'\nimport { EventEmitter } from 'node:events'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport { AssembledTestCase } from '../../assemble'\nimport { ILogger, IRunEnvironment } from '../../environment'\nimport { RuntimeAdapter } from '../types'\nimport { IRunOptionsRuntime } from '../../api'\nimport { FormatOptions } from '../../formatter'\nimport {\n FinalizeCommand,\n InitializeCommand,\n RunCommand,\n WorkerToCoordinatorEvent,\n} from './types'\n\nconst runWorkerPath = path.resolve(__dirname, 'run_worker.js')\n\nconst enum WorkerState {\n 'idle',\n 'closed',\n 'running',\n 'new',\n}\n\ninterface ManagedWorker {\n state: WorkerState\n process: ChildProcess\n id: string\n}\n\ninterface WorkPlacement {\n index: number\n item: AssembledTestCase\n}\n\nexport class ChildProcessAdapter implements RuntimeAdapter {\n private idleInterventions: number = 0\n private failing: boolean = false\n private onFinish: (success: boolean) => void\n private todo: Array = []\n private readonly inProgress: Record = {}\n private readonly workers: Record = {}\n\n constructor(\n private readonly testRunStartedId: string,\n private readonly environment: IRunEnvironment,\n private readonly logger: ILogger,\n private readonly eventBroadcaster: EventEmitter,\n private readonly options: IRunOptionsRuntime,\n private readonly snippetOptions: Pick<\n FormatOptions,\n 'snippetInterface' | 'snippetSyntax'\n >,\n private readonly supportCodeLibrary: SupportCodeLibrary\n ) {}\n\n parseWorkerMessage(\n worker: ManagedWorker,\n message: WorkerToCoordinatorEvent\n ): void {\n switch (message.type) {\n case 'READY':\n worker.state = WorkerState.idle\n this.awakenWorkers(worker)\n break\n case 'ENVELOPE':\n this.eventBroadcaster.emit('envelope', message.envelope)\n break\n case 'FINISHED':\n if (!message.success) {\n this.failing = true\n }\n delete this.inProgress[worker.id]\n worker.state = WorkerState.idle\n this.awakenWorkers(worker)\n break\n default:\n throw new Error(\n `Unexpected message from worker: ${JSON.stringify(message)}`\n )\n }\n }\n\n awakenWorkers(triggeringWorker: ManagedWorker): void {\n Object.values(this.workers).forEach((worker) => {\n if (worker.state === WorkerState.idle) {\n this.giveWork(worker)\n }\n return worker.state !== WorkerState.idle\n })\n\n if (Object.keys(this.inProgress).length == 0 && this.todo.length > 0) {\n this.giveWork(triggeringWorker, true)\n this.idleInterventions++\n }\n }\n\n startWorker(id: string, total: number): void {\n const workerProcess = fork(runWorkerPath, [], {\n cwd: this.environment.cwd,\n env: {\n ...this.environment.env,\n CUCUMBER_PARALLEL: 'true',\n CUCUMBER_TOTAL_WORKERS: total.toString(),\n CUCUMBER_WORKER_ID: id,\n },\n stdio: ['inherit', 'inherit', 'inherit', 'ipc'],\n })\n const worker = { state: WorkerState.new, process: workerProcess, id }\n this.workers[id] = worker\n worker.process.on('message', (message: WorkerToCoordinatorEvent) => {\n this.parseWorkerMessage(worker, message)\n })\n worker.process.on('close', (exitCode) => {\n worker.state = WorkerState.closed\n this.onWorkerProcessClose(exitCode)\n })\n worker.process.send({\n type: 'INITIALIZE',\n testRunStartedId: this.testRunStartedId,\n supportCodeCoordinates: this.supportCodeLibrary.originalCoordinates,\n supportCodeIds: {\n stepDefinitionIds: this.supportCodeLibrary.stepDefinitions.map(\n (s) => s.id\n ),\n beforeTestCaseHookDefinitionIds:\n this.supportCodeLibrary.beforeTestCaseHookDefinitions.map(\n (h) => h.id\n ),\n afterTestCaseHookDefinitionIds:\n this.supportCodeLibrary.afterTestCaseHookDefinitions.map((h) => h.id),\n beforeTestRunHookDefinitionIds:\n this.supportCodeLibrary.beforeTestRunHookDefinitions.map((h) => h.id),\n afterTestRunHookDefinitionIds:\n this.supportCodeLibrary.afterTestRunHookDefinitions.map((h) => h.id),\n },\n options: this.options,\n snippetOptions: this.snippetOptions,\n } satisfies InitializeCommand)\n }\n\n onWorkerProcessClose(exitCode: number): void {\n if (exitCode !== 0) {\n this.failing = true\n }\n\n if (\n Object.values(this.workers).every((x) => x.state === WorkerState.closed)\n ) {\n this.onFinish(!this.failing)\n }\n }\n\n async run(\n assembledTestCases: ReadonlyArray\n ): Promise {\n this.todo = Array.from(assembledTestCases)\n return await new Promise((resolve) => {\n for (let i = 0; i < this.options.parallel; i++) {\n this.startWorker(i.toString(), this.options.parallel)\n }\n this.onFinish = (status) => {\n if (this.idleInterventions > 0) {\n this.logger.warn(\n `WARNING: All workers went idle ${this.idleInterventions} time(s). Consider revising handler passed to setParallelCanAssign.`\n )\n }\n\n resolve(status)\n }\n })\n }\n\n nextWorkPlacement(): WorkPlacement {\n for (let index = 0; index < this.todo.length; index++) {\n const placement = this.placementAt(index)\n if (\n this.supportCodeLibrary.parallelCanAssign(\n placement.item.pickle,\n Object.values(this.inProgress).map(({ pickle }) => pickle)\n )\n ) {\n return placement\n }\n }\n\n return null\n }\n\n placementAt(index: number): WorkPlacement {\n return {\n index,\n item: this.todo[index],\n }\n }\n\n giveWork(worker: ManagedWorker, force: boolean = false): void {\n if (this.todo.length < 1) {\n worker.state = WorkerState.running\n worker.process.send({ type: 'FINALIZE' } satisfies FinalizeCommand)\n return\n }\n\n const workPlacement = force ? this.placementAt(0) : this.nextWorkPlacement()\n\n if (workPlacement === null) {\n return\n }\n\n const { index: nextIndex, item } = workPlacement\n\n this.todo.splice(nextIndex, 1)\n this.inProgress[worker.id] = item\n worker.state = WorkerState.running\n worker.process.send({\n type: 'RUN',\n assembledTestCase: item,\n failing: this.failing,\n } satisfies RunCommand)\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.js b/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.js new file mode 100644 index 00000000..32a93c8a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const value_checker_1 = require("../../value_checker"); +const worker_1 = require("./worker"); +function run() { + const exit = (exitCode, error, message) => { + if ((0, value_checker_1.doesHaveValue)(error)) { + console.error(new Error(message, { cause: error })); // eslint-disable-line no-console + } + process.exit(exitCode); + }; + const worker = new worker_1.ChildProcessWorker({ + id: process.env.CUCUMBER_WORKER_ID, + sendMessage: (message) => process.send(message), + cwd: process.cwd(), + exit, + }); + process.on('message', (m) => { + worker + .receiveMessage(m) + .catch((error) => exit(1, error, 'Unexpected error on worker.receiveMessage')); + }); +} +run(); +//# sourceMappingURL=run_worker.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.js.map b/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.js.map new file mode 100644 index 00000000..b5242b91 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/run_worker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"run_worker.js","sourceRoot":"","sources":["../../../src/runtime/parallel/run_worker.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,qCAA6C;AAE7C,SAAS,GAAG;IACV,MAAM,IAAI,GAAG,CAAC,QAAgB,EAAE,KAAa,EAAE,OAAgB,EAAQ,EAAE;QACvE,IAAI,IAAA,6BAAa,EAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA,CAAC,iCAAiC;QACvF,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACxB,CAAC,CAAA;IACD,MAAM,MAAM,GAAG,IAAI,2BAAkB,CAAC;QACpC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;QAClC,WAAW,EAAE,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;QACpD,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,IAAI;KACL,CAAC,CAAA;IACF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAM,EAAQ,EAAE;QACrC,MAAM;aACH,cAAc,CAAC,CAAC,CAAC;aACjB,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE,CACtB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,2CAA2C,CAAC,CAC5D,CAAA;IACL,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,GAAG,EAAE,CAAA","sourcesContent":["import { doesHaveValue } from '../../value_checker'\nimport { ChildProcessWorker } from './worker'\n\nfunction run(): void {\n const exit = (exitCode: number, error?: Error, message?: string): void => {\n if (doesHaveValue(error)) {\n console.error(new Error(message, { cause: error })) // eslint-disable-line no-console\n }\n process.exit(exitCode)\n }\n const worker = new ChildProcessWorker({\n id: process.env.CUCUMBER_WORKER_ID,\n sendMessage: (message: any) => process.send(message),\n cwd: process.cwd(),\n exit,\n })\n process.on('message', (m: any): void => {\n worker\n .receiveMessage(m)\n .catch((error: Error) =>\n exit(1, error, 'Unexpected error on worker.receiveMessage')\n )\n })\n}\n\nrun()\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.d.ts new file mode 100644 index 00000000..4f77b097 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.d.ts @@ -0,0 +1,35 @@ +import { Envelope } from '@cucumber/messages'; +import { RuntimeOptions } from '../index'; +import { ISupportCodeCoordinates } from '../../api'; +import { AssembledTestCase } from '../../assemble'; +import { CanonicalSupportCodeIds } from '../../support_code_library_builder/types'; +import { FormatOptions } from '../../formatter'; +export type CoordinatorToWorkerCommand = InitializeCommand | RunCommand | FinalizeCommand; +export interface InitializeCommand { + type: 'INITIALIZE'; + testRunStartedId: string; + supportCodeCoordinates: ISupportCodeCoordinates; + supportCodeIds: CanonicalSupportCodeIds; + options: RuntimeOptions; + snippetOptions: Pick; +} +export interface RunCommand { + type: 'RUN'; + assembledTestCase: AssembledTestCase; + failing: boolean; +} +export interface FinalizeCommand { + type: 'FINALIZE'; +} +export type WorkerToCoordinatorEvent = ReadyEvent | EnvelopeEvent | FinishedEvent; +export interface ReadyEvent { + type: 'READY'; +} +export interface EnvelopeEvent { + type: 'ENVELOPE'; + envelope: Envelope; +} +export interface FinishedEvent { + type: 'FINISHED'; + success: boolean; +} diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.js b/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.js.map b/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.js.map new file mode 100644 index 00000000..95add3ab --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/runtime/parallel/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Envelope } from '@cucumber/messages'\nimport { RuntimeOptions } from '../index'\nimport { ISupportCodeCoordinates } from '../../api'\nimport { AssembledTestCase } from '../../assemble'\nimport { CanonicalSupportCodeIds } from '../../support_code_library_builder/types'\nimport { FormatOptions } from '../../formatter'\n\n// Messages from Coordinator to Worker\n\nexport type CoordinatorToWorkerCommand =\n | InitializeCommand\n | RunCommand\n | FinalizeCommand\n\nexport interface InitializeCommand {\n type: 'INITIALIZE'\n testRunStartedId: string\n supportCodeCoordinates: ISupportCodeCoordinates\n supportCodeIds: CanonicalSupportCodeIds\n options: RuntimeOptions\n snippetOptions: Pick\n}\n\nexport interface RunCommand {\n type: 'RUN'\n assembledTestCase: AssembledTestCase\n failing: boolean\n}\n\nexport interface FinalizeCommand {\n type: 'FINALIZE'\n}\n\n// Messages from Worker to Coordinator\n\nexport type WorkerToCoordinatorEvent =\n | ReadyEvent\n | EnvelopeEvent\n | FinishedEvent\n\nexport interface ReadyEvent {\n type: 'READY'\n}\n\nexport interface EnvelopeEvent {\n type: 'ENVELOPE'\n envelope: Envelope\n}\n\nexport interface FinishedEvent {\n type: 'FINISHED'\n success: boolean\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.d.ts new file mode 100644 index 00000000..46399629 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.d.ts @@ -0,0 +1,25 @@ +import { WorkerToCoordinatorEvent, CoordinatorToWorkerCommand, InitializeCommand, RunCommand } from './types'; +type IExitFunction = (exitCode: number, error?: Error, message?: string) => void; +type IMessageSender = (command: WorkerToCoordinatorEvent) => void; +export declare class ChildProcessWorker { + private readonly cwd; + private readonly exit; + private readonly id; + private readonly eventBroadcaster; + private readonly newId; + private readonly sendMessage; + private options; + private supportCodeLibrary; + private worker; + constructor({ cwd, exit, id, sendMessage, }: { + cwd: string; + exit: IExitFunction; + id: string; + sendMessage: IMessageSender; + }); + initialize({ testRunStartedId, supportCodeCoordinates, supportCodeIds, options, snippetOptions, }: InitializeCommand): Promise; + finalize(): Promise; + receiveMessage(command: CoordinatorToWorkerCommand): Promise; + runTestCase(command: RunCommand): Promise; +} +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js b/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js new file mode 100644 index 00000000..da88a874 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js @@ -0,0 +1,83 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChildProcessWorker = void 0; +const node_events_1 = require("node:events"); +const node_url_1 = require("node:url"); +const node_module_1 = require("node:module"); +const messages_1 = require("@cucumber/messages"); +const support_code_library_builder_1 = __importDefault(require("../../support_code_library_builder")); +const try_require_1 = __importDefault(require("../../try_require")); +const worker_1 = require("../worker"); +const builder_1 = __importDefault(require("../../formatter/builder")); +const { uuid } = messages_1.IdGenerator; +class ChildProcessWorker { + cwd; + exit; + id; + eventBroadcaster; + newId; + sendMessage; + options; + supportCodeLibrary; + worker; + constructor({ cwd, exit, id, sendMessage, }) { + this.id = id; + this.newId = uuid(); + this.cwd = cwd; + this.exit = exit; + this.sendMessage = sendMessage; + this.eventBroadcaster = new node_events_1.EventEmitter(); + this.eventBroadcaster.on('envelope', (envelope) => this.sendMessage({ type: 'ENVELOPE', envelope })); + } + async initialize({ testRunStartedId, supportCodeCoordinates, supportCodeIds, options, snippetOptions, }) { + support_code_library_builder_1.default.reset(this.cwd, this.newId, supportCodeCoordinates); + supportCodeCoordinates.requireModules.map((module) => (0, try_require_1.default)(module)); + supportCodeCoordinates.requirePaths.map((module) => (0, try_require_1.default)(module)); + for (const specifier of supportCodeCoordinates.loaders) { + (0, node_module_1.register)(specifier, (0, node_url_1.pathToFileURL)('./')); + } + for (const path of supportCodeCoordinates.importPaths) { + await import((0, node_url_1.pathToFileURL)(path).toString()); + } + this.supportCodeLibrary = support_code_library_builder_1.default.finalize(supportCodeIds); + this.options = options; + const snippetBuilder = await builder_1.default.getStepDefinitionSnippetBuilder({ + cwd: this.cwd, + snippetInterface: snippetOptions.snippetInterface, + snippetSyntax: snippetOptions.snippetSyntax, + supportCodeLibrary: this.supportCodeLibrary, + }); + this.worker = new worker_1.Worker(testRunStartedId, this.id, this.eventBroadcaster, this.newId, this.options, this.supportCodeLibrary, snippetBuilder); + await this.worker.runBeforeAllHooks(); + this.sendMessage({ type: 'READY' }); + } + async finalize() { + await this.worker.runAfterAllHooks(); + this.exit(0); + } + async receiveMessage(command) { + switch (command.type) { + case 'INITIALIZE': + await this.initialize(command); + break; + case 'RUN': + await this.runTestCase(command); + break; + case 'FINALIZE': + await this.finalize(); + break; + } + } + async runTestCase(command) { + const success = await this.worker.runTestCase(command.assembledTestCase, command.failing); + this.sendMessage({ + type: 'FINISHED', + success, + }); + } +} +exports.ChildProcessWorker = ChildProcessWorker; +//# sourceMappingURL=worker.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js.map b/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js.map new file mode 100644 index 00000000..a66e27e3 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/parallel/worker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/runtime/parallel/worker.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA0C;AAC1C,uCAAwC;AACxC,6CAAsC;AACtC,iDAA0D;AAC1D,sGAA0E;AAE1E,oEAA0C;AAC1C,sCAAkC;AAElC,s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ACf,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;gBAC9B,MAAK;YACP,KAAK,KAAK;gBACR,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;gBAC/B,MAAK;YACP,KAAK,UAAU;gBACb,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;gBACrB,MAAK;QACT,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAmB;QACnC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAC3C,OAAO,CAAC,iBAAiB,EACzB,OAAO,CAAC,OAAO,CAChB,CAAA;QACD,IAAI,CAAC,WAAW,CAAC;YACf,IAAI,EAAE,UAAU;YAChB,OAAO;SACR,CAAC,CAAA;IACJ,CAAC;CACF;AA5GD,gDA4GC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { pathToFileURL } from 'node:url'\nimport { register } from 'node:module'\nimport { Envelope, IdGenerator } from '@cucumber/messages'\nimport supportCodeLibraryBuilder from '../../support_code_library_builder'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport tryRequire from '../../try_require'\nimport { Worker } from '../worker'\nimport { RuntimeOptions } from '../index'\nimport FormatterBuilder from '../../formatter/builder'\nimport {\n WorkerToCoordinatorEvent,\n CoordinatorToWorkerCommand,\n InitializeCommand,\n RunCommand,\n} from './types'\n\nconst { uuid } = IdGenerator\n\ntype IExitFunction = (exitCode: number, error?: Error, message?: string) => void\ntype IMessageSender = (command: WorkerToCoordinatorEvent) => void\n\nexport class ChildProcessWorker {\n private readonly cwd: string\n private readonly exit: IExitFunction\n\n private readonly id: string\n private readonly eventBroadcaster: EventEmitter\n private readonly newId: IdGenerator.NewId\n private readonly sendMessage: IMessageSender\n private options: RuntimeOptions\n private supportCodeLibrary: SupportCodeLibrary\n private worker: Worker\n\n constructor({\n cwd,\n exit,\n id,\n sendMessage,\n }: {\n cwd: string\n exit: IExitFunction\n id: string\n sendMessage: IMessageSender\n }) {\n this.id = id\n this.newId = uuid()\n this.cwd = cwd\n this.exit = exit\n this.sendMessage = sendMessage\n this.eventBroadcaster = new EventEmitter()\n this.eventBroadcaster.on('envelope', (envelope: Envelope) =>\n this.sendMessage({ type: 'ENVELOPE', envelope })\n )\n }\n\n async initialize({\n testRunStartedId,\n supportCodeCoordinates,\n supportCodeIds,\n options,\n snippetOptions,\n }: InitializeCommand): Promise {\n supportCodeLibraryBuilder.reset(\n this.cwd,\n this.newId,\n supportCodeCoordinates\n )\n supportCodeCoordinates.requireModules.map((module) => tryRequire(module))\n supportCodeCoordinates.requirePaths.map((module) => tryRequire(module))\n for (const specifier of supportCodeCoordinates.loaders) {\n register(specifier, pathToFileURL('./'))\n }\n for (const path of supportCodeCoordinates.importPaths) {\n await import(pathToFileURL(path).toString())\n }\n this.supportCodeLibrary = supportCodeLibraryBuilder.finalize(supportCodeIds)\n\n this.options = options\n\n const snippetBuilder =\n await FormatterBuilder.getStepDefinitionSnippetBuilder({\n cwd: this.cwd,\n snippetInterface: snippetOptions.snippetInterface,\n snippetSyntax: snippetOptions.snippetSyntax,\n supportCodeLibrary: this.supportCodeLibrary,\n })\n\n this.worker = new Worker(\n testRunStartedId,\n this.id,\n this.eventBroadcaster,\n this.newId,\n this.options,\n this.supportCodeLibrary,\n snippetBuilder\n )\n await this.worker.runBeforeAllHooks()\n this.sendMessage({ type: 'READY' })\n }\n\n async finalize(): Promise {\n await this.worker.runAfterAllHooks()\n this.exit(0)\n }\n\n async receiveMessage(command: CoordinatorToWorkerCommand): Promise {\n switch (command.type) {\n case 'INITIALIZE':\n await this.initialize(command)\n break\n case 'RUN':\n await this.runTestCase(command)\n break\n case 'FINALIZE':\n await this.finalize()\n break\n }\n }\n\n async runTestCase(command: RunCommand): Promise {\n const success = await this.worker.runTestCase(\n command.assembledTestCase,\n command.failing\n )\n this.sendMessage({\n type: 'FINISHED',\n success,\n })\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/index.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/scope/index.d.ts new file mode 100644 index 00000000..03e4b998 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/index.d.ts @@ -0,0 +1,2 @@ +export * from './test_case_scope'; +export * from './test_run_scope'; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/index.js b/node_modules/@cucumber/cucumber/lib/runtime/scope/index.js new file mode 100644 index 00000000..1fdbcf2b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./test_case_scope"), exports); +__exportStar(require("./test_run_scope"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/index.js.map b/node_modules/@cucumber/cucumber/lib/runtime/scope/index.js.map new file mode 100644 index 00000000..7d9adb41 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/scope/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,mDAAgC","sourcesContent":["export * from './test_case_scope'\nexport * from './test_run_scope'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.d.ts new file mode 100644 index 00000000..395a3eec --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.d.ts @@ -0,0 +1 @@ +export declare function makeProxy(getThing: () => any): T; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.js b/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.js new file mode 100644 index 00000000..b5234edb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeProxy = makeProxy; +function makeProxy(getThing) { + return new Proxy({}, { + defineProperty(_, property, attributes) { + return Reflect.defineProperty(getThing(), property, attributes); + }, + deleteProperty(_, property) { + return Reflect.get(getThing(), property); + }, + get(_, property) { + return Reflect.get(getThing(), property, getThing()); + }, + getOwnPropertyDescriptor(_, property) { + return Reflect.getOwnPropertyDescriptor(getThing(), property); + }, + getPrototypeOf(_) { + return Reflect.getPrototypeOf(getThing()); + }, + has(_, key) { + return Reflect.has(getThing(), key); + }, + isExtensible(_) { + return Reflect.isExtensible(getThing()); + }, + ownKeys(_) { + return Reflect.ownKeys(getThing()); + }, + preventExtensions(_) { + return Reflect.preventExtensions(getThing()); + }, + set(_, property, value) { + return Reflect.set(getThing(), property, value, getThing()); + }, + setPrototypeOf(_, proto) { + return Reflect.setPrototypeOf(getThing(), proto); + }, + }); +} +//# sourceMappingURL=make_proxy.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.js.map b/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.js.map new file mode 100644 index 00000000..f542c117 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/make_proxy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"make_proxy.js","sourceRoot":"","sources":["../../../src/runtime/scope/make_proxy.ts"],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AAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC7D,CAAC;QACD,cAAc,CAAC,CAAC,EAAE,KAAK;YACrB,OAAO,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAA;QAClD,CAAC;KACF,CACG,CAAA;AACR,CAAC","sourcesContent":["export function makeProxy(getThing: () => any): T {\n return new Proxy(\n {},\n {\n defineProperty(_, property, attributes) {\n return Reflect.defineProperty(getThing(), property, attributes)\n },\n deleteProperty(_, property) {\n return Reflect.get(getThing(), property)\n },\n get(_, property) {\n return Reflect.get(getThing(), property, getThing())\n },\n getOwnPropertyDescriptor(_, property) {\n return Reflect.getOwnPropertyDescriptor(getThing(), property)\n },\n getPrototypeOf(_) {\n return Reflect.getPrototypeOf(getThing())\n },\n has(_, key) {\n return Reflect.has(getThing(), key)\n },\n isExtensible(_) {\n return Reflect.isExtensible(getThing())\n },\n ownKeys(_) {\n return Reflect.ownKeys(getThing())\n },\n preventExtensions(_) {\n return Reflect.preventExtensions(getThing())\n },\n set(_, property, value) {\n return Reflect.set(getThing(), property, value, getThing())\n },\n setPrototypeOf(_, proto) {\n return Reflect.setPrototypeOf(getThing(), proto)\n },\n }\n ) as T\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.d.ts new file mode 100644 index 00000000..5db08278 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.d.ts @@ -0,0 +1,17 @@ +import { IWorld } from '../../support_code_library_builder/world'; +interface TestCaseScopeStore { + world: IWorld; +} +export declare function runInTestCaseScope(store: TestCaseScopeStore, callback: () => ResponseType): Promise; +/** + * A proxy to the World instance for the currently-executing test case + * + * @beta + * @remarks + * Useful for getting a handle on the World when using arrow functions and thus + * being unable to rely on the value of `this`. Only callable from the body of a + * step or a `Before`, `After`, `BeforeStep` or `AfterStep` hook (will throw + * otherwise). + */ +export declare const worldProxy: IWorld; +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.js b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.js new file mode 100644 index 00000000..78bae391 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.worldProxy = void 0; +exports.runInTestCaseScope = runInTestCaseScope; +const node_async_hooks_1 = require("node:async_hooks"); +const make_proxy_1 = require("./make_proxy"); +const testCaseScope = new node_async_hooks_1.AsyncLocalStorage(); +async function runInTestCaseScope(store, callback) { + return testCaseScope.run(store, callback); +} +function getWorld() { + const store = testCaseScope.getStore(); + if (!store) { + throw new Error('Attempted to access `world` from incorrect scope; only applicable to steps and case-level hooks'); + } + return store.world; +} +/** + * A proxy to the World instance for the currently-executing test case + * + * @beta + * @remarks + * Useful for getting a handle on the World when using arrow functions and thus + * being unable to rely on the value of `this`. Only callable from the body of a + * step or a `Before`, `After`, `BeforeStep` or `AfterStep` hook (will throw + * otherwise). + */ +exports.worldProxy = (0, make_proxy_1.makeProxy)(getWorld); +//# sourceMappingURL=test_case_scope.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.js.map b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.js.map new file mode 100644 index 00000000..499ebc27 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_case_scope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_case_scope.js","sourceRoot":"","sources":["../../../src/runtime/scope/test_case_scope.ts"],"names":[],"mappings":";;;AAUA,gDAKC;AAfD,uDAAoD;AAEpD,6CAAwC;AAMxC,MAAM,aAAa,GAAG,IAAI,oCAAiB,EAAsB,CAAA;AAE1D,KAAK,UAAU,kBAAkB,CACtC,KAAyB,EACzB,QAA4B;IAE5B,OAAO,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC3C,CAAC;AAED,SAAS,QAAQ;IACf,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,EAAE,CAAA;IACtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAC,KAA+B,CAAA;AAC9C,CAAC;AAED;;;;;;;;;GASG;AACU,QAAA,UAAU,GAAG,IAAA,sBAAS,EAAS,QAAQ,CAAC,CAAA","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks'\nimport { IWorld } from '../../support_code_library_builder/world'\nimport { makeProxy } from './make_proxy'\n\ninterface TestCaseScopeStore {\n world: IWorld\n}\n\nconst testCaseScope = new AsyncLocalStorage()\n\nexport async function runInTestCaseScope(\n store: TestCaseScopeStore,\n callback: () => ResponseType\n) {\n return testCaseScope.run(store, callback)\n}\n\nfunction getWorld(): IWorld {\n const store = testCaseScope.getStore()\n if (!store) {\n throw new Error(\n 'Attempted to access `world` from incorrect scope; only applicable to steps and case-level hooks'\n )\n }\n return store.world as IWorld\n}\n\n/**\n * A proxy to the World instance for the currently-executing test case\n *\n * @beta\n * @remarks\n * Useful for getting a handle on the World when using arrow functions and thus\n * being unable to rely on the value of `this`. Only callable from the body of a\n * step or a `Before`, `After`, `BeforeStep` or `AfterStep` hook (will throw\n * otherwise).\n */\nexport const worldProxy = makeProxy(getWorld)\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.d.ts new file mode 100644 index 00000000..8be4a9b6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.d.ts @@ -0,0 +1,16 @@ +import { IContext } from '../../support_code_library_builder/context'; +interface TestRunScopeStore { + context: IContext; +} +export declare function runInTestRunScope(store: TestRunScopeStore, callback: () => ResponseType): Promise; +/** + * A proxy to the context for the currently-executing test run. + * + * @beta + * @remarks + * Useful for getting a handle on the context when using arrow functions and thus + * being unable to rely on the value of `this`. Only callable from the body of a + * `BeforeAll` or `AfterAll` hook (will throw otherwise). + */ +export declare const contextProxy: IContext; +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.js b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.js new file mode 100644 index 00000000..860eb120 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.contextProxy = void 0; +exports.runInTestRunScope = runInTestRunScope; +const node_async_hooks_1 = require("node:async_hooks"); +const make_proxy_1 = require("./make_proxy"); +const testRunScope = new node_async_hooks_1.AsyncLocalStorage(); +async function runInTestRunScope(store, callback) { + return testRunScope.run(store, callback); +} +function getContext() { + const store = testRunScope.getStore(); + if (!store) { + throw new Error('Attempted to access `context` from incorrect scope; only applicable to run-level hooks'); + } + return store.context; +} +/** + * A proxy to the context for the currently-executing test run. + * + * @beta + * @remarks + * Useful for getting a handle on the context when using arrow functions and thus + * being unable to rely on the value of `this`. Only callable from the body of a + * `BeforeAll` or `AfterAll` hook (will throw otherwise). + */ +exports.contextProxy = (0, make_proxy_1.makeProxy)(getContext); +//# sourceMappingURL=test_run_scope.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.js.map b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.js.map new file mode 100644 index 00000000..3b716ed8 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/scope/test_run_scope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_run_scope.js","sourceRoot":"","sources":["../../../src/runtime/scope/test_run_scope.ts"],"names":[],"mappings":";;;AAUA,8CAKC;AAfD,uDAAoD;AAEpD,6CAAwC;AAMxC,MAAM,YAAY,GAAG,IAAI,oCAAiB,EAAqB,CAAA;AAExD,KAAK,UAAU,iBAAiB,CACrC,KAAwB,EACxB,QAA4B;IAE5B,OAAO,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC1C,CAAC;AAED,SAAS,UAAU;IACjB,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAA;IACrC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAA;IACH,CAAC;IACD,OAAO,KAAK,CAAC,OAAmC,CAAA;AAClD,CAAC;AAED;;;;;;;;GAQG;AACU,QAAA,YAAY,GAAG,IAAA,sBAAS,EAAW,UAAU,CAAC,CAAA","sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks'\nimport { IContext } from '../../support_code_library_builder/context'\nimport { makeProxy } from './make_proxy'\n\ninterface TestRunScopeStore {\n context: IContext\n}\n\nconst testRunScope = new AsyncLocalStorage()\n\nexport async function runInTestRunScope(\n store: TestRunScopeStore,\n callback: () => ResponseType\n) {\n return testRunScope.run(store, callback)\n}\n\nfunction getContext(): IContext {\n const store = testRunScope.getStore()\n if (!store) {\n throw new Error(\n 'Attempted to access `context` from incorrect scope; only applicable to run-level hooks'\n )\n }\n return store.context as IContext\n}\n\n/**\n * A proxy to the context for the currently-executing test run.\n *\n * @beta\n * @remarks\n * Useful for getting a handle on the context when using arrow functions and thus\n * being unable to rely on the value of `this`. Only callable from the body of a\n * `BeforeAll` or `AfterAll` hook (will throw otherwise).\n */\nexport const contextProxy = makeProxy(getContext)\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.d.ts new file mode 100644 index 00000000..2f01da37 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.d.ts @@ -0,0 +1,13 @@ +import { EventEmitter } from 'node:events'; +import { IdGenerator } from '@cucumber/messages'; +import { RuntimeAdapter } from '../types'; +import { AssembledTestCase } from '../../assemble'; +import { RuntimeOptions } from '../index'; +import { SupportCodeLibrary } from '../../support_code_library_builder/types'; +import StepDefinitionSnippetBuilder from '../../formatter/step_definition_snippet_builder'; +export declare class InProcessAdapter implements RuntimeAdapter { + private readonly worker; + private failing; + constructor(testRunStartedId: string, eventBroadcaster: EventEmitter, newId: IdGenerator.NewId, options: RuntimeOptions, supportCodeLibrary: SupportCodeLibrary, snippetBuilder: StepDefinitionSnippetBuilder); + run(assembledTestCases: ReadonlyArray): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.js b/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.js new file mode 100644 index 00000000..61a5e800 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InProcessAdapter = void 0; +const worker_1 = require("../worker"); +class InProcessAdapter { + worker; + failing = false; + constructor(testRunStartedId, eventBroadcaster, newId, options, supportCodeLibrary, snippetBuilder) { + this.worker = new worker_1.Worker(testRunStartedId, undefined, eventBroadcaster, newId, options, supportCodeLibrary, snippetBuilder); + } + async run(assembledTestCases) { + await this.worker.runBeforeAllHooks(); + for (const item of assembledTestCases) { + const success = await this.worker.runTestCase(item, this.failing); + if (!success) { + this.failing = true; + } + } + await this.worker.runAfterAllHooks(); + return !this.failing; + } +} +exports.InProcessAdapter = InProcessAdapter; +//# sourceMappingURL=adapter.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.js.map b/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.js.map new file mode 100644 index 00000000..e69cbe8a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/serial/adapter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/runtime/serial/adapter.ts"],"names":[],"mappings":";;;AAIA,sCAAkC;AAKlC,MAAa,gBAAgB;IACV,MAAM,CAAQ;IACvB,OAAO,GAAY,KAAK,CAAA;IAEhC,YACE,gBAAwB,EACxB,gBAA8B,EAC9B,KAAwB,EACxB,OAAuB,EACvB,kBAAsC,EACtC,cAA4C;QAE5C,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CACtB,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,KAAK,EACL,OAAO,EACP,kBAAkB,EAClB,cAAc,CACf,CAAA;IACH,CAAC;IAED,KAAK,CAAC,GAAG,CACP,kBAAoD;QAEpD,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAA;QACrC,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE,CAAC;YACtC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;YACjE,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;YACrB,CAAC;QACH,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAA;QACpC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAA;IACtB,CAAC;CACF;AApCD,4CAoCC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport { IdGenerator } from '@cucumber/messages'\nimport { RuntimeAdapter } from '../types'\nimport { AssembledTestCase } from '../../assemble'\nimport { Worker } from '../worker'\nimport { RuntimeOptions } from '../index'\nimport { SupportCodeLibrary } from '../../support_code_library_builder/types'\nimport StepDefinitionSnippetBuilder from '../../formatter/step_definition_snippet_builder'\n\nexport class InProcessAdapter implements RuntimeAdapter {\n private readonly worker: Worker\n private failing: boolean = false\n\n constructor(\n testRunStartedId: string,\n eventBroadcaster: EventEmitter,\n newId: IdGenerator.NewId,\n options: RuntimeOptions,\n supportCodeLibrary: SupportCodeLibrary,\n snippetBuilder: StepDefinitionSnippetBuilder\n ) {\n this.worker = new Worker(\n testRunStartedId,\n undefined,\n eventBroadcaster,\n newId,\n options,\n supportCodeLibrary,\n snippetBuilder\n )\n }\n\n async run(\n assembledTestCases: ReadonlyArray\n ): Promise {\n await this.worker.runBeforeAllHooks()\n for (const item of assembledTestCases) {\n const success = await this.worker.runTestCase(item, this.failing)\n if (!success) {\n this.failing = true\n }\n }\n await this.worker.runAfterAllHooks()\n return !this.failing\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/step_runner.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/step_runner.d.ts new file mode 100644 index 00000000..fbd1167b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/step_runner.d.ts @@ -0,0 +1,20 @@ +import * as messages from '@cucumber/messages'; +import { ITestCaseHookParameter } from '../support_code_library_builder/types'; +import { IDefinition } from '../models/definition'; +export interface IRunOptions { + defaultTimeout: number; + filterStackTraces: boolean; + hookParameter: ITestCaseHookParameter; + step: messages.PickleStep; + stepDefinition: IDefinition; + world: any; +} +export interface RunStepResult { + result: messages.TestStepResult; + error?: any; +} +export declare function run({ defaultTimeout, filterStackTraces, hookParameter, step, stepDefinition, world, }: IRunOptions): Promise; +declare const _default: { + run: typeof run; +}; +export default _default; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/step_runner.js b/node_modules/@cucumber/cucumber/lib/runtime/step_runner.js new file mode 100644 index 00000000..d810ca82 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/step_runner.js @@ -0,0 +1,105 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.run = run; +const messages = __importStar(require("@cucumber/messages")); +const user_code_runner_1 = __importDefault(require("../user_code_runner")); +const value_checker_1 = require("../value_checker"); +const scope_1 = require("./scope"); +const stopwatch_1 = require("./stopwatch"); +const format_error_1 = require("./format_error"); +async function run({ defaultTimeout, filterStackTraces, hookParameter, step, stepDefinition, world, }) { + const stopwatch = (0, stopwatch_1.create)().start(); + let error, result, invocationData; + try { + await (0, scope_1.runInTestCaseScope)({ world }, async () => { + invocationData = await stepDefinition.getInvocationParameters({ + hookParameter, + step, + world, + }); + }); + } + catch (err) { + error = err; + } + if ((0, value_checker_1.doesNotHaveValue)(error)) { + const timeoutInMilliseconds = (0, value_checker_1.valueOrDefault)(stepDefinition.options.timeout, defaultTimeout); + if (invocationData.validCodeLengths.includes(stepDefinition.code.length)) { + const data = await (0, scope_1.runInTestCaseScope)({ world }, async () => user_code_runner_1.default.run({ + argsArray: invocationData.parameters, + fn: stepDefinition.code, + thisArg: world, + timeoutInMilliseconds, + })); + error = data.error; + result = data.result; + } + else { + error = invocationData.getInvalidCodeLengthMessage(); + } + } + const duration = stopwatch.stop().duration(); + let status; + let details = {}; + if (result === 'skipped') { + status = messages.TestStepResultStatus.SKIPPED; + } + else if (result === 'pending') { + status = messages.TestStepResultStatus.PENDING; + } + else if ((0, value_checker_1.doesHaveValue)(error)) { + status = messages.TestStepResultStatus.FAILED; + } + else { + status = messages.TestStepResultStatus.PASSED; + } + if ((0, value_checker_1.doesHaveValue)(error)) { + details = (0, format_error_1.formatError)(error, filterStackTraces); + } + return { + result: { + duration, + status, + ...details, + }, + error, + }; +} +exports.default = { run }; +//# sourceMappingURL=step_runner.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/step_runner.js.map b/node_modules/@cucumber/cucumber/lib/runtime/step_runner.js.map new file mode 100644 index 00000000..7b4d1907 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/step_runner.js.map @@ -0,0 +1 @@ +{"version":3,"file":"step_runner.js","sourceRoot":"","sources":["../../src/runtime/step_runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,kBAsEC;AAjGD,6DAA8C;AAC9C,2EAAgD;AAGhD,oDAIyB;AACzB,mCAA4C;AAC5C,2CAAoC;AACpC,iDAA4C;AAgBrC,KAAK,UAAU,GAAG,CAAC,EACxB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,IAAI,EACJ,cAAc,EACd,KAAK,GACO;IACZ,MAAM,SAAS,GAAG,IAAA,kBAAM,GAAE,CAAC,KAAK,EAAE,CAAA;IAClC,IAAI,KAAU,EAAE,MAAW,EAAE,cAA0C,CAAA;IAEvE,IAAI,CAAC;QACH,MAAM,IAAA,0BAAkB,EAAC,EAAE,KAAK,EAAE,EAAE,KAAK,IAAI,EAAE;YAC7C,cAAc,GAAG,MAAM,cAAc,CAAC,uBAAuB,CAAC;gBAC5D,aAAa;gBACb,IAAI;gBACJ,KAAK;aACN,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;IAAC,OA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IAC/C,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAA;IAC/C,CAAC;IAED,IAAI,IAAA,6BAAa,EAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,GAAG,IAAA,0BAAW,EAAC,KAAK,EAAE,iBAAiB,CAAC,CAAA;IACjD,CAAC;IAED,OAAO;QACL,MAAM,EAAE;YACN,QAAQ;YACR,MAAM;YACN,GAAG,OAAO;SACX;QACD,KAAK;KACN,CAAA;AACH,CAAC;AAED,kBAAe,EAAE,GAAG,EAAE,CAAA","sourcesContent":["import * as messages from '@cucumber/messages'\nimport UserCodeRunner from '../user_code_runner'\nimport { ITestCaseHookParameter } from '../support_code_library_builder/types'\nimport { IDefinition, IGetInvocationDataResponse } from '../models/definition'\nimport {\n doesHaveValue,\n doesNotHaveValue,\n valueOrDefault,\n} from '../value_checker'\nimport { runInTestCaseScope } from './scope'\nimport { create } from './stopwatch'\nimport { formatError } from './format_error'\n\nexport interface IRunOptions {\n defaultTimeout: number\n filterStackTraces: boolean\n hookParameter: ITestCaseHookParameter\n step: messages.PickleStep\n stepDefinition: IDefinition\n world: any\n}\n\nexport interface RunStepResult {\n result: messages.TestStepResult\n error?: any\n}\n\nexport async function run({\n defaultTimeout,\n filterStackTraces,\n hookParameter,\n step,\n stepDefinition,\n world,\n}: IRunOptions): Promise {\n const stopwatch = create().start()\n let error: any, result: any, invocationData: IGetInvocationDataResponse\n\n try {\n await runInTestCaseScope({ world }, async () => {\n invocationData = await stepDefinition.getInvocationParameters({\n hookParameter,\n step,\n world,\n })\n })\n } catch (err) {\n error = err\n }\n\n if (doesNotHaveValue(error)) {\n const timeoutInMilliseconds = valueOrDefault(\n stepDefinition.options.timeout,\n defaultTimeout\n )\n\n if (invocationData.validCodeLengths.includes(stepDefinition.code.length)) {\n const data = await runInTestCaseScope({ world }, async () =>\n UserCodeRunner.run({\n argsArray: invocationData.parameters,\n fn: stepDefinition.code,\n thisArg: world,\n timeoutInMilliseconds,\n })\n )\n error = data.error\n result = data.result\n } else {\n error = invocationData.getInvalidCodeLengthMessage()\n }\n }\n\n const duration = stopwatch.stop().duration()\n let status: messages.TestStepResultStatus\n let details = {}\n if (result === 'skipped') {\n status = messages.TestStepResultStatus.SKIPPED\n } else if (result === 'pending') {\n status = messages.TestStepResultStatus.PENDING\n } else if (doesHaveValue(error)) {\n status = messages.TestStepResultStatus.FAILED\n } else {\n status = messages.TestStepResultStatus.PASSED\n }\n\n if (doesHaveValue(error)) {\n details = formatError(error, filterStackTraces)\n }\n\n return {\n result: {\n duration,\n status,\n ...details,\n },\n error,\n }\n}\n\nexport default { run }\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.d.ts new file mode 100644 index 00000000..c9606a67 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.d.ts @@ -0,0 +1,12 @@ +import { Duration } from '@cucumber/messages'; +/** + * A utility for timing test run operations and returning duration and + * timestamp objects in messages-compatible formats + */ +export interface IStopwatch { + start: () => IStopwatch; + stop: () => IStopwatch; + duration: () => Duration; +} +export declare const create: (base?: Duration) => IStopwatch; +export declare const timestamp: () => import("@cucumber/messages").Timestamp; diff --git a/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.js b/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.js new file mode 100644 index 00000000..3999b2a2 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.js @@ -0,0 +1,35 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.timestamp = exports.create = void 0; +const messages_1 = require("@cucumber/messages"); +const time_1 = __importDefault(require("../time")); +class StopwatchImpl { + base; + started; + constructor(base = { seconds: 0, nanos: 0 }) { + this.base = base; + } + start() { + this.started = time_1.default.performance.now(); + return this; + } + stop() { + this.base = this.duration(); + this.started = undefined; + return this; + } + duration() { + if (typeof this.started !== 'number') { + return this.base; + } + return messages_1.TimeConversion.addDurations(this.base, messages_1.TimeConversion.millisecondsToDuration(time_1.default.performance.now() - this.started)); + } +} +const create = (base) => new StopwatchImpl(base); +exports.create = create; +const timestamp = () => messages_1.TimeConversion.millisecondsSinceEpochToTimestamp(time_1.default.Date.now()); +exports.timestamp = timestamp; +//# sourceMappingURL=stopwatch.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.js.map b/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.js.map new file mode 100644 index 00000000..489acc51 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/stopwatch.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stopwatch.js","sourceRoot":"","sources":["../../src/runtime/stopwatch.ts"],"names":[],"mappings":";;;;;;AAAA,iDAA6D;AAC7D,mDAA6B;AAY7B,MAAM,aAAa;IAGG;IAFZ,OAAO,CAAQ;IAEvB,YAAoB,OAAiB,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QAAzC,SAAI,GAAJ,IAAI,CAAqC;IAAG,CAAC;IAEjE,KAAK;QACH,IAAI,CAAC,OAAO,GAAG,cAAO,CAAC,WAAW,CAAC,GAAG,EAAE,CAAA;QACxC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAC3B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAA;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,QAAQ;QACN,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC,IAAI,CAAA;QAClB,CAAC;QACD,OAAO,yBAAc,CAAC,YAAY,CAChC,IAAI,CAAC,IAAI,EACT,yBAAc,CAAC,sBAAsB,CACnC,cAAO,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CACzC,CACF,CAAA;IACH,CAAC;CACF;AAEM,MAAM,MAAM,GAAG,CAAC,IAAe,EAAc,EAAE,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAA;AAAjE,QAAA,MAAM,UAA2D;AAEvE,MAAM,SAAS,GAAG,GAAG,EAAE,CAC5B,yBAAc,CAAC,iCAAiC,CAAC,cAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;AADzD,QAAA,SAAS,aACgD","sourcesContent":["import { Duration, TimeConversion } from '@cucumber/messages'\nimport methods from '../time'\n\n/**\n * A utility for timing test run operations and returning duration and\n * timestamp objects in messages-compatible formats\n */\nexport interface IStopwatch {\n start: () => IStopwatch\n stop: () => IStopwatch\n duration: () => Duration\n}\n\nclass StopwatchImpl implements IStopwatch {\n private started: number\n\n constructor(private base: Duration = { seconds: 0, nanos: 0 }) {}\n\n start(): IStopwatch {\n this.started = methods.performance.now()\n return this\n }\n\n stop(): IStopwatch {\n this.base = this.duration()\n this.started = undefined\n return this\n }\n\n duration(): Duration {\n if (typeof this.started !== 'number') {\n return this.base\n }\n return TimeConversion.addDurations(\n this.base,\n TimeConversion.millisecondsToDuration(\n methods.performance.now() - this.started\n )\n )\n }\n}\n\nexport const create = (base?: Duration): IStopwatch => new StopwatchImpl(base)\n\nexport const timestamp = () =>\n TimeConversion.millisecondsSinceEpochToTimestamp(methods.Date.now())\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.d.ts new file mode 100644 index 00000000..992f694d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.d.ts @@ -0,0 +1,57 @@ +import { EventEmitter } from 'node:events'; +import * as messages from '@cucumber/messages'; +import { IdGenerator } from '@cucumber/messages'; +import { JsonObject } from 'type-fest'; +import { ITestCaseHookParameter, SupportCodeLibrary } from '../support_code_library_builder/types'; +import TestCaseHookDefinition from '../models/test_case_hook_definition'; +import TestStepHookDefinition from '../models/test_step_hook_definition'; +import { IDefinition } from '../models/definition'; +import StepDefinitionSnippetBuilder from '../formatter/step_definition_snippet_builder'; +import { RunStepResult } from './step_runner'; +export interface INewTestCaseRunnerOptions { + workerId?: string; + eventBroadcaster: EventEmitter; + gherkinDocument: messages.GherkinDocument; + newId: IdGenerator.NewId; + pickle: messages.Pickle; + testCase: messages.TestCase; + retries: number; + skip: boolean; + filterStackTraces: boolean; + supportCodeLibrary: SupportCodeLibrary; + worldParameters: JsonObject; + snippetBuilder: StepDefinitionSnippetBuilder; +} +export default class TestCaseRunner { + private readonly workerId; + private readonly attachmentManager; + private currentTestCaseStartedId; + private currentTestStepId; + private readonly eventBroadcaster; + private readonly gherkinDocument; + private readonly newId; + private readonly pickle; + private readonly testCase; + private readonly maxAttempts; + private readonly skip; + private readonly filterStackTraces; + private readonly supportCodeLibrary; + private readonly snippetBuilder; + private testStepResults; + private world; + private readonly worldParameters; + constructor({ workerId, eventBroadcaster, gherkinDocument, newId, pickle, testCase, retries, skip, filterStackTraces, supportCodeLibrary, worldParameters, snippetBuilder, }: INewTestCaseRunnerOptions); + resetTestProgressData(): void; + getBeforeStepHookDefinitions(): TestStepHookDefinition[]; + getAfterStepHookDefinitions(): TestStepHookDefinition[]; + getWorstStepResult(): messages.TestStepResult; + invokeStep(step: messages.PickleStep, stepDefinition: IDefinition, hookParameter?: ITestCaseHookParameter): Promise; + isSkippingSteps(): boolean; + shouldSkipHook(isBeforeHook: boolean): boolean; + aroundTestStep(testStepId: string, runStepFn: () => Promise): Promise; + run(): Promise; + runAttempt(attempt: number, moreAttemptsRemaining: boolean): Promise; + runHook(hookDefinition: TestCaseHookDefinition, hookParameter: ITestCaseHookParameter, isBeforeHook: boolean): Promise; + runStepHooks(stepHooks: TestStepHookDefinition[], pickleStep: messages.PickleStep, stepResult?: RunStepResult): Promise; + runStep(pickleStep: messages.PickleStep, testStep: messages.TestStep): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.js b/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.js new file mode 100644 index 00000000..ad9ba4b8 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.js @@ -0,0 +1,327 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const messages = __importStar(require("@cucumber/messages")); +const messages_1 = require("@cucumber/messages"); +const value_checker_1 = require("../value_checker"); +const stopwatch_1 = require("./stopwatch"); +const step_runner_1 = __importDefault(require("./step_runner")); +const attachment_manager_1 = __importDefault(require("./attachment_manager")); +const helpers_1 = require("./helpers"); +const make_suggestion_1 = require("./make_suggestion"); +class TestCaseRunner { + workerId; + attachmentManager; + currentTestCaseStartedId; + currentTestStepId; + eventBroadcaster; + gherkinDocument; + newId; + pickle; + testCase; + maxAttempts; + skip; + filterStackTraces; + supportCodeLibrary; + snippetBuilder; + testStepResults; + world; + worldParameters; + constructor({ workerId, eventBroadcaster, gherkinDocument, newId, pickle, testCase, retries = 0, skip, filterStackTraces, supportCodeLibrary, worldParameters, snippetBuilder, }) { + this.workerId = workerId; + this.attachmentManager = new attachment_manager_1.default(({ data, media, fileName }) => { + if ((0, value_checker_1.doesNotHaveValue)(this.currentTestStepId)) { + throw new Error('Cannot attach when a step/hook is not running. Ensure your step/hook waits for the attach to finish.'); + } + const attachment = { + attachment: { + body: data, + contentEncoding: media.encoding, + mediaType: media.contentType, + fileName, + testCaseStartedId: this.currentTestCaseStartedId, + testStepId: this.currentTestStepId, + timestamp: (0, stopwatch_1.timestamp)(), + }, + }; + this.eventBroadcaster.emit('envelope', attachment); + }); + this.eventBroadcaster = eventBroadcaster; + this.gherkinDocument = gherkinDocument; + this.maxAttempts = 1 + (skip ? 0 : retries); + this.newId = newId; + this.pickle = pickle; + this.testCase = testCase; + this.skip = skip; + this.filterStackTraces = filterStackTraces; + this.supportCodeLibrary = supportCodeLibrary; + this.worldParameters = worldParameters; + this.snippetBuilder = snippetBuilder; + this.resetTestProgressData(); + } + resetTestProgressData() { + this.world = new this.supportCodeLibrary.World({ + attach: this.attachmentManager.create.bind(this.attachmentManager), + log: this.attachmentManager.log.bind(this.attachmentManager), + link: this.attachmentManager.link.bind(this.attachmentManager), + parameters: structuredClone(this.worldParameters), + }); + this.testStepResults = []; + } + getBeforeStepHookDefinitions() { + return this.supportCodeLibrary.beforeTestStepHookDefinitions.filter((hookDefinition) => hookDefinition.appliesToTestCase(this.pickle)); + } + getAfterStepHookDefinitions() { + return this.supportCodeLibrary.afterTestStepHookDefinitions + .slice(0) + .reverse() + .filter((hookDefinition) => hookDefinition.appliesToTestCase(this.pickle)); + } + getWorstStepResult() { + if (this.testStepResults.length === 0) { + return { + status: this.skip + ? messages.TestStepResultStatus.SKIPPED + : messages.TestStepResultStatus.PASSED, + duration: messages.TimeConversion.millisecondsToDuration(0), + }; + } + return (0, messages_1.getWorstTestStepResult)(this.testStepResults); + } + async invokeStep(step, stepDefinition, hookParameter) { + return await step_runner_1.default.run({ + defaultTimeout: this.supportCodeLibrary.defaultTimeout, + filterStackTraces: this.filterStackTraces, + hookParameter, + step, + stepDefinition, + world: this.world, + }); + } + isSkippingSteps() { + return (this.getWorstStepResult().status !== messages.TestStepResultStatus.PASSED); + } + shouldSkipHook(isBeforeHook) { + return this.skip || (this.isSkippingSteps() && isBeforeHook); + } + async aroundTestStep(testStepId, runStepFn) { + const testStepStarted = { + testStepStarted: { + testCaseStartedId: this.currentTestCaseStartedId, + testStepId, + timestamp: (0, stopwatch_1.timestamp)(), + }, + }; + this.eventBroadcaster.emit('envelope', testStepStarted); + this.currentTestStepId = testStepId; + const testStepResult = await runStepFn(); + this.currentTestStepId = null; + this.testStepResults.push(testStepResult); + const testStepFinished = { + testStepFinished: { + testCaseStartedId: this.currentTestCaseStartedId, + testStepId, + testStepResult, + timestamp: (0, stopwatch_1.timestamp)(), + }, + }; + this.eventBroadcaster.emit('envelope', testStepFinished); + } + async run() { + for (let attempt = 0; attempt < this.maxAttempts; attempt++) { + const moreAttemptsRemaining = attempt + 1 < this.maxAttempts; + const willBeRetried = await this.runAttempt(attempt, moreAttemptsRemaining); + if (!willBeRetried) { + break; + } + this.resetTestProgressData(); + } + return this.getWorstStepResult().status; + } + async runAttempt(attempt, moreAttemptsRemaining) { + this.currentTestCaseStartedId = this.newId(); + const testCaseStarted = { + testCaseStarted: { + attempt, + testCaseId: this.testCase.id, + id: this.currentTestCaseStartedId, + timestamp: (0, stopwatch_1.timestamp)(), + }, + }; + if (this.workerId) { + testCaseStarted.testCaseStarted.workerId = this.workerId; + } + this.eventBroadcaster.emit('envelope', testCaseStarted); + // used to determine whether a hook is a Before or After + let didWeRunStepsYet = false; + let error = false; + for (const testStep of this.testCase.testSteps) { + await this.aroundTestStep(testStep.id, async () => { + if ((0, value_checker_1.doesHaveValue)(testStep.hookId)) { + const hookParameter = { + gherkinDocument: this.gherkinDocument, + pickle: this.pickle, + testCaseStartedId: this.currentTestCaseStartedId, + }; + if (didWeRunStepsYet) { + hookParameter.result = this.getWorstStepResult(); + hookParameter.error = error; + hookParameter.willBeRetried = + this.getWorstStepResult().status === + messages.TestStepResultStatus.FAILED && moreAttemptsRemaining; + } + return await this.runHook(findHookDefinition(testStep.hookId, this.supportCodeLibrary), hookParameter, !didWeRunStepsYet); + } + else { + const pickleStep = this.pickle.steps.find((pickleStep) => pickleStep.id === testStep.pickleStepId); + const testStepResult = await this.runStep(pickleStep, testStep); + didWeRunStepsYet = true; + error = testStepResult.error; + return testStepResult.result; + } + }); + } + const willBeRetried = this.getWorstStepResult().status === + messages.TestStepResultStatus.FAILED && moreAttemptsRemaining; + const testCaseFinished = { + testCaseFinished: { + testCaseStartedId: this.currentTestCaseStartedId, + timestamp: (0, stopwatch_1.timestamp)(), + willBeRetried, + }, + }; + this.eventBroadcaster.emit('envelope', testCaseFinished); + return willBeRetried; + } + async runHook(hookDefinition, hookParameter, isBeforeHook) { + if (this.shouldSkipHook(isBeforeHook)) { + return { + status: messages.TestStepResultStatus.SKIPPED, + duration: messages.TimeConversion.millisecondsToDuration(0), + }; + } + const { result } = await this.invokeStep(null, hookDefinition, hookParameter); + return result; + } + async runStepHooks(stepHooks, pickleStep, stepResult) { + const stepHooksResult = []; + const hookParameter = { + gherkinDocument: this.gherkinDocument, + pickle: this.pickle, + pickleStep, + testCaseStartedId: this.currentTestCaseStartedId, + testStepId: this.currentTestStepId, + result: stepResult?.result, + error: stepResult?.error, + }; + for (const stepHookDefinition of stepHooks) { + const { result } = await this.invokeStep(null, stepHookDefinition, hookParameter); + stepHooksResult.push(result); + } + return stepHooksResult; + } + async runStep(pickleStep, testStep) { + const stepDefinitions = testStep.stepDefinitionIds.map((stepDefinitionId) => { + return findStepDefinition(stepDefinitionId, this.supportCodeLibrary); + }); + if (stepDefinitions.length === 0) { + this.eventBroadcaster.emit('envelope', { + suggestion: (0, make_suggestion_1.makeSuggestion)({ + newId: this.newId, + snippetBuilder: this.snippetBuilder, + pickleStep, + }), + }); + return { + result: { + status: messages.TestStepResultStatus.UNDEFINED, + duration: messages.TimeConversion.millisecondsToDuration(0), + }, + }; + } + else if (stepDefinitions.length > 1) { + return { + result: { + message: (0, helpers_1.getAmbiguousStepException)(stepDefinitions), + status: messages.TestStepResultStatus.AMBIGUOUS, + duration: messages.TimeConversion.millisecondsToDuration(0), + }, + }; + } + else if (this.isSkippingSteps()) { + return { + result: { + status: messages.TestStepResultStatus.SKIPPED, + duration: messages.TimeConversion.millisecondsToDuration(0), + }, + }; + } + let stepResult; + let error; + let stepResults = await this.runStepHooks(this.getBeforeStepHookDefinitions(), pickleStep); + if ((0, messages_1.getWorstTestStepResult)(stepResults).status !== + messages.TestStepResultStatus.FAILED) { + stepResult = await this.invokeStep(pickleStep, stepDefinitions[0]); + stepResults.push(stepResult.result); + error = stepResult.error; + } + const afterStepHookResults = await this.runStepHooks(this.getAfterStepHookDefinitions(), pickleStep, stepResult); + stepResults = stepResults.concat(afterStepHookResults); + const finalStepResult = (0, messages_1.getWorstTestStepResult)(stepResults); + let finalDuration = messages.TimeConversion.millisecondsToDuration(0); + for (const result of stepResults) { + finalDuration = messages.TimeConversion.addDurations(finalDuration, result.duration); + } + finalStepResult.duration = finalDuration; + return { + result: finalStepResult, + error, + }; + } +} +exports.default = TestCaseRunner; +function findHookDefinition(id, supportCodeLibrary) { + return [ + ...supportCodeLibrary.beforeTestCaseHookDefinitions, + ...supportCodeLibrary.afterTestCaseHookDefinitions, + ].find((definition) => definition.id === id); +} +function findStepDefinition(id, supportCodeLibrary) { + return supportCodeLibrary.stepDefinitions.find((definition) => definition.id === id); +} +//# sourceMappingURL=test_case_runner.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.js.map b/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.js.map new file mode 100644 index 00000000..6cc4112a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/test_case_runner.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test_case_runner.js","sourceRoot":"","sources":["../../src/runtime/test_case_runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6DAA8C;AAC9C,iDAI2B;AAU3B,oDAAkE;AAIlE,2CAAuC;AACvC,gEAAyD;AACzD,8EAAoD;AACpD,uCAAqD;AACrD,uDAAkD;AAiBlD,MAAqB,cAAc;IAChB,QAAQ,CAAoB;IAC5B,iBAAiB,CAAmB;IAC7C,wBAAwB,CAAQ;IAChC,iBAAiB,CAAQ;IAChB,gBAAgB,CAAc;IAC9B,eAAe,CAA0B;IACzC,KAAK,CAAmB;IACxB,MAAM,CAAiB;IACvB,QAAQ,CAAmB;IAC3B,WAAW,CAAQ;IACnB,IAAI,CAAS;IACb,iBAAiB,CAAS;IAC1B,kBAAkB,CAAoB;IACtC,cAAc,CAA8B;IACrD,eAAe,CAA2B;IAC1C,KAAK,CAAK;IACD,eAAe,CAAY;IAE5C,YAAY,EACV,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,CAAC,EACX,IAAI,EACJ,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,cAAc,GACY;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,iBAAiB,GAAG,IAAI,4BAAiB,CAC5C,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC5B,IAAI,IAAA,gCAAgB,EAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC;gBAC7C,MAAM,IAAI,KAAK,CACb,sGAAsG,CACvG,CAAA;YACH,CAA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AAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAC9C,CAAC;AAED,SAAS,kBAAkB,CACzB,EAAU,EACV,kBAAsC;IAEtC,OAAO,kBAAkB,CAAC,eAAe,CAAC,IAAI,CAC5C,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CACrC,CAAA;AACH,CAAC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport * as messages from '@cucumber/messages'\nimport {\n Envelope,\n getWorstTestStepResult,\n IdGenerator,\n} from '@cucumber/messages'\nimport { JsonObject } from 'type-fest'\nimport {\n ITestCaseHookParameter,\n ITestStepHookParameter,\n SupportCodeLibrary,\n} from '../support_code_library_builder/types'\nimport TestCaseHookDefinition from '../models/test_case_hook_definition'\nimport TestStepHookDefinition from '../models/test_step_hook_definition'\nimport { IDefinition } from '../models/definition'\nimport { doesHaveValue, doesNotHaveValue } from '../value_checker'\nimport StepDefinition from '../models/step_definition'\nimport { IWorldOptions } from '../support_code_library_builder/world'\nimport StepDefinitionSnippetBuilder from '../formatter/step_definition_snippet_builder'\nimport { timestamp } from './stopwatch'\nimport StepRunner, { RunStepResult } from './step_runner'\nimport AttachmentManager from './attachment_manager'\nimport { getAmbiguousStepException } from './helpers'\nimport { makeSuggestion } from './make_suggestion'\n\nexport interface INewTestCaseRunnerOptions {\n workerId?: string\n eventBroadcaster: EventEmitter\n gherkinDocument: messages.GherkinDocument\n newId: IdGenerator.NewId\n pickle: messages.Pickle\n testCase: messages.TestCase\n retries: number\n skip: boolean\n filterStackTraces: boolean\n supportCodeLibrary: SupportCodeLibrary\n worldParameters: JsonObject\n snippetBuilder: StepDefinitionSnippetBuilder\n}\n\nexport default class TestCaseRunner {\n private readonly workerId: string | undefined\n private readonly attachmentManager: AttachmentManager\n private currentTestCaseStartedId: string\n private currentTestStepId: string\n private readonly eventBroadcaster: EventEmitter\n private readonly gherkinDocument: messages.GherkinDocument\n private readonly newId: IdGenerator.NewId\n private readonly pickle: messages.Pickle\n private readonly testCase: messages.TestCase\n private readonly maxAttempts: number\n private readonly skip: boolean\n private readonly filterStackTraces: boolean\n private readonly supportCodeLibrary: SupportCodeLibrary\n private readonly snippetBuilder: StepDefinitionSnippetBuilder\n private testStepResults: messages.TestStepResult[]\n private world: any\n private readonly worldParameters: JsonObject\n\n constructor({\n workerId,\n eventBroadcaster,\n gherkinDocument,\n newId,\n pickle,\n testCase,\n retries = 0,\n skip,\n filterStackTraces,\n supportCodeLibrary,\n worldParameters,\n snippetBuilder,\n }: INewTestCaseRunnerOptions) {\n this.workerId = workerId\n this.attachmentManager = new AttachmentManager(\n ({ data, media, fileName }) => {\n if (doesNotHaveValue(this.currentTestStepId)) {\n throw new Error(\n 'Cannot attach when a step/hook is not running. Ensure your step/hook waits for the attach to finish.'\n )\n }\n const attachment: messages.Envelope = {\n attachment: {\n body: data,\n contentEncoding: media.encoding,\n mediaType: media.contentType,\n fileName,\n testCaseStartedId: this.currentTestCaseStartedId,\n testStepId: this.currentTestStepId,\n timestamp: timestamp(),\n },\n }\n this.eventBroadcaster.emit('envelope', attachment)\n }\n )\n this.eventBroadcaster = eventBroadcaster\n this.gherkinDocument = gherkinDocument\n this.maxAttempts = 1 + (skip ? 0 : retries)\n this.newId = newId\n this.pickle = pickle\n this.testCase = testCase\n this.skip = skip\n this.filterStackTraces = filterStackTraces\n this.supportCodeLibrary = supportCodeLibrary\n this.worldParameters = worldParameters\n this.snippetBuilder = snippetBuilder\n this.resetTestProgressData()\n }\n\n resetTestProgressData(): void {\n this.world = new this.supportCodeLibrary.World({\n attach: this.attachmentManager.create.bind(this.attachmentManager),\n log: this.attachmentManager.log.bind(this.attachmentManager),\n link: this.attachmentManager.link.bind(this.attachmentManager),\n parameters: structuredClone(this.worldParameters),\n } satisfies IWorldOptions)\n this.testStepResults = []\n }\n\n getBeforeStepHookDefinitions(): TestStepHookDefinition[] {\n return this.supportCodeLibrary.beforeTestStepHookDefinitions.filter(\n (hookDefinition) => hookDefinition.appliesToTestCase(this.pickle)\n )\n }\n\n getAfterStepHookDefinitions(): TestStepHookDefinition[] {\n return this.supportCodeLibrary.afterTestStepHookDefinitions\n .slice(0)\n .reverse()\n .filter((hookDefinition) => hookDefinition.appliesToTestCase(this.pickle))\n }\n\n getWorstStepResult(): messages.TestStepResult {\n if (this.testStepResults.length === 0) {\n return {\n status: this.skip\n ? messages.TestStepResultStatus.SKIPPED\n : messages.TestStepResultStatus.PASSED,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n }\n }\n return getWorstTestStepResult(this.testStepResults)\n }\n\n async invokeStep(\n step: messages.PickleStep,\n stepDefinition: IDefinition,\n hookParameter?: ITestCaseHookParameter\n ): Promise {\n return await StepRunner.run({\n defaultTimeout: this.supportCodeLibrary.defaultTimeout,\n filterStackTraces: this.filterStackTraces,\n hookParameter,\n step,\n stepDefinition,\n world: this.world,\n })\n }\n\n isSkippingSteps(): boolean {\n return (\n this.getWorstStepResult().status !== messages.TestStepResultStatus.PASSED\n )\n }\n\n shouldSkipHook(isBeforeHook: boolean): boolean {\n return this.skip || (this.isSkippingSteps() && isBeforeHook)\n }\n\n async aroundTestStep(\n testStepId: string,\n runStepFn: () => Promise\n ): Promise {\n const testStepStarted: messages.Envelope = {\n testStepStarted: {\n testCaseStartedId: this.currentTestCaseStartedId,\n testStepId,\n timestamp: timestamp(),\n },\n }\n this.eventBroadcaster.emit('envelope', testStepStarted)\n this.currentTestStepId = testStepId\n const testStepResult = await runStepFn()\n this.currentTestStepId = null\n this.testStepResults.push(testStepResult)\n const testStepFinished: messages.Envelope = {\n testStepFinished: {\n testCaseStartedId: this.currentTestCaseStartedId,\n testStepId,\n testStepResult,\n timestamp: timestamp(),\n },\n }\n this.eventBroadcaster.emit('envelope', testStepFinished)\n }\n\n async run(): Promise {\n for (let attempt = 0; attempt < this.maxAttempts; attempt++) {\n const moreAttemptsRemaining = attempt + 1 < this.maxAttempts\n\n const willBeRetried = await this.runAttempt(\n attempt,\n moreAttemptsRemaining\n )\n\n if (!willBeRetried) {\n break\n }\n this.resetTestProgressData()\n }\n return this.getWorstStepResult().status\n }\n\n async runAttempt(\n attempt: number,\n moreAttemptsRemaining: boolean\n ): Promise {\n this.currentTestCaseStartedId = this.newId()\n const testCaseStarted: messages.Envelope = {\n testCaseStarted: {\n attempt,\n testCaseId: this.testCase.id,\n id: this.currentTestCaseStartedId,\n timestamp: timestamp(),\n },\n }\n if (this.workerId) {\n testCaseStarted.testCaseStarted.workerId = this.workerId\n }\n this.eventBroadcaster.emit('envelope', testCaseStarted)\n // used to determine whether a hook is a Before or After\n let didWeRunStepsYet = false\n let error = false\n for (const testStep of this.testCase.testSteps) {\n await this.aroundTestStep(testStep.id, async () => {\n if (doesHaveValue(testStep.hookId)) {\n const hookParameter: ITestCaseHookParameter = {\n gherkinDocument: this.gherkinDocument,\n pickle: this.pickle,\n testCaseStartedId: this.currentTestCaseStartedId,\n }\n if (didWeRunStepsYet) {\n hookParameter.result = this.getWorstStepResult()\n hookParameter.error = error\n hookParameter.willBeRetried =\n this.getWorstStepResult().status ===\n messages.TestStepResultStatus.FAILED && moreAttemptsRemaining\n }\n return await this.runHook(\n findHookDefinition(testStep.hookId, this.supportCodeLibrary),\n hookParameter,\n !didWeRunStepsYet\n )\n } else {\n const pickleStep = this.pickle.steps.find(\n (pickleStep) => pickleStep.id === testStep.pickleStepId\n )\n const testStepResult = await this.runStep(pickleStep, testStep)\n didWeRunStepsYet = true\n error = testStepResult.error\n return testStepResult.result\n }\n })\n }\n\n const willBeRetried =\n this.getWorstStepResult().status ===\n messages.TestStepResultStatus.FAILED && moreAttemptsRemaining\n const testCaseFinished: messages.Envelope = {\n testCaseFinished: {\n testCaseStartedId: this.currentTestCaseStartedId,\n timestamp: timestamp(),\n willBeRetried,\n },\n }\n this.eventBroadcaster.emit('envelope', testCaseFinished)\n\n return willBeRetried\n }\n\n async runHook(\n hookDefinition: TestCaseHookDefinition,\n hookParameter: ITestCaseHookParameter,\n isBeforeHook: boolean\n ): Promise {\n if (this.shouldSkipHook(isBeforeHook)) {\n return {\n status: messages.TestStepResultStatus.SKIPPED,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n }\n }\n const { result } = await this.invokeStep(\n null,\n hookDefinition,\n hookParameter\n )\n return result\n }\n\n async runStepHooks(\n stepHooks: TestStepHookDefinition[],\n pickleStep: messages.PickleStep,\n stepResult?: RunStepResult\n ): Promise {\n const stepHooksResult = []\n const hookParameter: ITestStepHookParameter = {\n gherkinDocument: this.gherkinDocument,\n pickle: this.pickle,\n pickleStep,\n testCaseStartedId: this.currentTestCaseStartedId,\n testStepId: this.currentTestStepId,\n result: stepResult?.result,\n error: stepResult?.error,\n }\n for (const stepHookDefinition of stepHooks) {\n const { result } = await this.invokeStep(\n null,\n stepHookDefinition,\n hookParameter\n )\n stepHooksResult.push(result)\n }\n return stepHooksResult\n }\n\n async runStep(\n pickleStep: messages.PickleStep,\n testStep: messages.TestStep\n ): Promise {\n const stepDefinitions = testStep.stepDefinitionIds.map(\n (stepDefinitionId) => {\n return findStepDefinition(stepDefinitionId, this.supportCodeLibrary)\n }\n )\n if (stepDefinitions.length === 0) {\n this.eventBroadcaster.emit('envelope', {\n suggestion: makeSuggestion({\n newId: this.newId,\n snippetBuilder: this.snippetBuilder,\n pickleStep,\n }),\n } satisfies Envelope)\n return {\n result: {\n status: messages.TestStepResultStatus.UNDEFINED,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n },\n }\n } else if (stepDefinitions.length > 1) {\n return {\n result: {\n message: getAmbiguousStepException(stepDefinitions),\n status: messages.TestStepResultStatus.AMBIGUOUS,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n },\n }\n } else if (this.isSkippingSteps()) {\n return {\n result: {\n status: messages.TestStepResultStatus.SKIPPED,\n duration: messages.TimeConversion.millisecondsToDuration(0),\n },\n }\n }\n\n let stepResult\n let error\n let stepResults = await this.runStepHooks(\n this.getBeforeStepHookDefinitions(),\n pickleStep\n )\n if (\n getWorstTestStepResult(stepResults).status !==\n messages.TestStepResultStatus.FAILED\n ) {\n stepResult = await this.invokeStep(pickleStep, stepDefinitions[0])\n stepResults.push(stepResult.result)\n error = stepResult.error\n }\n const afterStepHookResults = await this.runStepHooks(\n this.getAfterStepHookDefinitions(),\n pickleStep,\n stepResult\n )\n stepResults = stepResults.concat(afterStepHookResults)\n\n const finalStepResult = getWorstTestStepResult(stepResults)\n let finalDuration = messages.TimeConversion.millisecondsToDuration(0)\n for (const result of stepResults) {\n finalDuration = messages.TimeConversion.addDurations(\n finalDuration,\n result.duration\n )\n }\n finalStepResult.duration = finalDuration\n return {\n result: finalStepResult,\n error,\n }\n }\n}\n\nfunction findHookDefinition(\n id: string,\n supportCodeLibrary: SupportCodeLibrary\n): TestCaseHookDefinition {\n return [\n ...supportCodeLibrary.beforeTestCaseHookDefinitions,\n ...supportCodeLibrary.afterTestCaseHookDefinitions,\n ].find((definition) => definition.id === id)\n}\n\nfunction findStepDefinition(\n id: string,\n supportCodeLibrary: SupportCodeLibrary\n): StepDefinition {\n return supportCodeLibrary.stepDefinitions.find(\n (definition) => definition.id === id\n )\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/types.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/types.d.ts new file mode 100644 index 00000000..3bb9aaeb --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/types.d.ts @@ -0,0 +1,17 @@ +import { JsonObject } from 'type-fest'; +import { AssembledTestCase } from '../assemble'; +export interface RuntimeOptions { + dryRun: boolean; + failFast: boolean; + filterStacktraces: boolean; + retry: number; + retryTagFilter: string; + strict: boolean; + worldParameters: JsonObject; +} +export interface Runtime { + run: () => Promise; +} +export interface RuntimeAdapter { + run(assembledTestCases: ReadonlyArray): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/runtime/types.js b/node_modules/@cucumber/cucumber/lib/runtime/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/types.js.map b/node_modules/@cucumber/cucumber/lib/runtime/types.js.map new file mode 100644 index 00000000..373de433 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"","sourcesContent":["import { JsonObject } from 'type-fest'\nimport { AssembledTestCase } from '../assemble'\n\nexport interface RuntimeOptions {\n dryRun: boolean\n failFast: boolean\n filterStacktraces: boolean\n retry: number\n retryTagFilter: string\n strict: boolean\n worldParameters: JsonObject\n}\n\nexport interface Runtime {\n run: () => Promise\n}\n\nexport interface RuntimeAdapter {\n run(assembledTestCases: ReadonlyArray): Promise\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/worker.d.ts b/node_modules/@cucumber/cucumber/lib/runtime/worker.d.ts new file mode 100644 index 00000000..61fd8f4a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/worker.d.ts @@ -0,0 +1,25 @@ +import { EventEmitter } from 'node:events'; +import { IdGenerator, TestStepResult } from '@cucumber/messages'; +import { AssembledTestCase } from '../assemble'; +import { SupportCodeLibrary } from '../support_code_library_builder/types'; +import StepDefinitionSnippetBuilder from '../formatter/step_definition_snippet_builder'; +import { RuntimeOptions } from './types'; +export interface RunHookResult { + result: TestStepResult; + error?: any; +} +export declare class Worker { + private readonly testRunStartedId; + private readonly workerId; + private readonly eventBroadcaster; + private readonly newId; + private readonly options; + private readonly supportCodeLibrary; + private readonly snippetBuilder; + constructor(testRunStartedId: string, workerId: string | undefined, eventBroadcaster: EventEmitter, newId: IdGenerator.NewId, options: RuntimeOptions, supportCodeLibrary: SupportCodeLibrary, snippetBuilder: StepDefinitionSnippetBuilder); + private runTestRunHook; + private wrapTestRunHookError; + runBeforeAllHooks(): Promise; + runTestCase({ gherkinDocument, pickle, testCase }: AssembledTestCase, failing: boolean): Promise; + runAfterAllHooks(): Promise; +} diff --git a/node_modules/@cucumber/cucumber/lib/runtime/worker.js b/node_modules/@cucumber/cucumber/lib/runtime/worker.js new file mode 100644 index 00000000..e4f9e336 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/worker.js @@ -0,0 +1,149 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Worker = void 0; +const messages_1 = require("@cucumber/messages"); +const user_code_runner_1 = __importDefault(require("../user_code_runner")); +const value_checker_1 = require("../value_checker"); +const helpers_1 = require("../formatter/helpers"); +const helpers_2 = require("./helpers"); +const test_case_runner_1 = __importDefault(require("./test_case_runner")); +const scope_1 = require("./scope"); +const format_error_1 = require("./format_error"); +const stopwatch_1 = require("./stopwatch"); +class Worker { + testRunStartedId; + workerId; + eventBroadcaster; + newId; + options; + supportCodeLibrary; + snippetBuilder; + constructor(testRunStartedId, workerId, eventBroadcaster, newId, options, supportCodeLibrary, snippetBuilder) { + this.testRunStartedId = testRunStartedId; + this.workerId = workerId; + this.eventBroadcaster = eventBroadcaster; + this.newId = newId; + this.options = options; + this.supportCodeLibrary = supportCodeLibrary; + this.snippetBuilder = snippetBuilder; + } + async runTestRunHook(hookDefinition) { + const testRunHookStartedId = this.newId(); + this.eventBroadcaster.emit('envelope', { + testRunHookStarted: { + testRunStartedId: this.testRunStartedId, + workerId: this.workerId, + id: testRunHookStartedId, + hookId: hookDefinition.id, + timestamp: (0, stopwatch_1.timestamp)(), + }, + }); + let result; + let error; + if (this.options.dryRun) { + result = { + duration: { + seconds: 0, + nanos: 0, + }, + status: messages_1.TestStepResultStatus.SKIPPED, + }; + } + else { + const stopwatch = (0, stopwatch_1.create)().start(); + const context = { parameters: this.options.worldParameters }; + const { error: rawError } = await (0, scope_1.runInTestRunScope)({ context }, () => user_code_runner_1.default.run({ + argsArray: [], + fn: hookDefinition.code, + thisArg: context, + timeoutInMilliseconds: (0, value_checker_1.valueOrDefault)(hookDefinition.options.timeout, this.supportCodeLibrary.defaultTimeout), + })); + const duration = stopwatch.stop().duration(); + if ((0, value_checker_1.doesHaveValue)(rawError)) { + result = { + duration, + status: messages_1.TestStepResultStatus.FAILED, + ...(0, format_error_1.formatError)(rawError, this.options.filterStacktraces), + }; + error = this.wrapTestRunHookError('a BeforeAll', (0, helpers_1.formatLocation)(hookDefinition), rawError); + } + else { + result = { + duration, + status: messages_1.TestStepResultStatus.PASSED, + }; + } + } + this.eventBroadcaster.emit('envelope', { + testRunHookFinished: { + testRunHookStartedId, + result, + timestamp: (0, stopwatch_1.timestamp)(), + }, + }); + return { + result, + error, + }; + } + wrapTestRunHookError(name, location, error) { + if (!(0, value_checker_1.doesHaveValue)(error)) { + return undefined; + } + let message = `${name} hook errored`; + if (this.workerId) { + message += ` on worker ${this.workerId}`; + } + message += `, process exiting: ${location}`; + return new Error(message, { cause: error }); + } + async runBeforeAllHooks() { + const results = []; + for (const hookDefinition of this.supportCodeLibrary + .beforeTestRunHookDefinitions) { + const result = await this.runTestRunHook(hookDefinition); + results.push(result); + if ((0, value_checker_1.doesHaveValue)(result.error)) { + throw result.error; + } + } + return results; + } + async runTestCase({ gherkinDocument, pickle, testCase }, failing) { + const testCaseRunner = new test_case_runner_1.default({ + workerId: this.workerId, + eventBroadcaster: this.eventBroadcaster, + newId: this.newId, + gherkinDocument, + pickle, + testCase, + retries: (0, helpers_2.retriesForPickle)(pickle, this.options), + skip: this.options.dryRun || (this.options.failFast && failing), + filterStackTraces: this.options.filterStacktraces, + supportCodeLibrary: this.supportCodeLibrary, + worldParameters: this.options.worldParameters, + snippetBuilder: this.snippetBuilder, + }); + const status = await testCaseRunner.run(); + return !(0, helpers_2.shouldCauseFailure)(status, this.options); + } + async runAfterAllHooks() { + const results = []; + const reversed = [ + ...this.supportCodeLibrary.afterTestRunHookDefinitions, + ].reverse(); + for (const hookDefinition of reversed) { + const result = await this.runTestRunHook(hookDefinition); + results.push(result); + if ((0, value_checker_1.doesHaveValue)(result.error)) { + throw result.error; + } + } + return results; + } +} +exports.Worker = Worker; +//# sourceMappingURL=worker.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/runtime/worker.js.map b/node_modules/@cucumber/cucumber/lib/runtime/worker.js.map new file mode 100644 index 00000000..a4895d39 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/runtime/worker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/runtime/worker.ts"],"names":[],"mappings":";;;;;;AACA,iDAK2B;AAG3B,2EAAgD;AAChD,oDAAgE;AAEhE,kDAAqD;AAErD,uCAAgE;AAChE,0EAA+C;AAC/C,mCAA2C;AAC3C,iDAA4C;AAC5C,2CAA+C;AAQ/C,MAAa,MAAM;IAEE;IACA;IACA;IACA;IACA;IACA;IACA;IAPnB,YACmB,gBAAwB,EACxB,QAA4B,EAC5B,gBAA8B,EAC9B,KAAwB,EACxB,OAAuB,EACvB,kBAAsC,EACtC,cAA4C;QAN5C,qBAAgB,GAAhB,gBAAgB,CAAQ;QACxB,aAAQ,GAAR,QAAQ,CAAoB;QAC5B,qBAAgB,GAAhB,gBAAgB,CAAc;QAC9B,UAAK,GAAL,KAAK,CAAmB;QACxB,YAAO,GAAP,OAAO,CAAgB;QACvB,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,mBAAc,GAAd,cAAc,CAA8B;IAC5D,CAAC;IAEI,KAAK,CAAC,cAAc,CAC1B,cAAqC;QAErC,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,EAAE,CAAA;QACzC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE;YACrC,kBAAkB,EAAE;gBAClB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ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CAAC,CAAA;YACpB,IAAI,IAAA,6BAAa,EAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAChC,MAAM,MAAM,CAAC,KAAK,CAAA;YACpB,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAvJD,wBAuJC","sourcesContent":["import { EventEmitter } from 'node:events'\nimport {\n Envelope,\n IdGenerator,\n TestStepResult,\n TestStepResultStatus,\n} from '@cucumber/messages'\nimport { AssembledTestCase } from '../assemble'\nimport { SupportCodeLibrary } from '../support_code_library_builder/types'\nimport UserCodeRunner from '../user_code_runner'\nimport { doesHaveValue, valueOrDefault } from '../value_checker'\nimport TestRunHookDefinition from '../models/test_run_hook_definition'\nimport { formatLocation } from '../formatter/helpers'\nimport StepDefinitionSnippetBuilder from '../formatter/step_definition_snippet_builder'\nimport { retriesForPickle, shouldCauseFailure } from './helpers'\nimport TestCaseRunner from './test_case_runner'\nimport { runInTestRunScope } from './scope'\nimport { formatError } from './format_error'\nimport { create, timestamp } from './stopwatch'\nimport { RuntimeOptions } from './types'\n\nexport interface RunHookResult {\n result: TestStepResult\n error?: any\n}\n\nexport class Worker {\n constructor(\n private readonly testRunStartedId: string,\n private readonly workerId: string | undefined,\n private readonly eventBroadcaster: EventEmitter,\n private readonly newId: IdGenerator.NewId,\n private readonly options: RuntimeOptions,\n private readonly supportCodeLibrary: SupportCodeLibrary,\n private readonly snippetBuilder: StepDefinitionSnippetBuilder\n ) {}\n\n private async runTestRunHook(\n hookDefinition: TestRunHookDefinition\n ): Promise {\n const testRunHookStartedId = this.newId()\n this.eventBroadcaster.emit('envelope', {\n testRunHookStarted: {\n testRunStartedId: this.testRunStartedId,\n workerId: this.workerId,\n id: testRunHookStartedId,\n hookId: hookDefinition.id,\n timestamp: timestamp(),\n },\n } satisfies Envelope)\n\n let result: TestStepResult\n let error: any\n if (this.options.dryRun) {\n result = {\n duration: {\n seconds: 0,\n nanos: 0,\n },\n status: TestStepResultStatus.SKIPPED,\n }\n } else {\n const stopwatch = create().start()\n const context = { parameters: this.options.worldParameters }\n const { error: rawError } = await runInTestRunScope({ context }, () =>\n UserCodeRunner.run({\n argsArray: [],\n fn: hookDefinition.code,\n thisArg: context,\n timeoutInMilliseconds: valueOrDefault(\n hookDefinition.options.timeout,\n this.supportCodeLibrary.defaultTimeout\n ),\n })\n )\n const duration = stopwatch.stop().duration()\n\n if (doesHaveValue(rawError)) {\n result = {\n duration,\n status: TestStepResultStatus.FAILED,\n ...formatError(rawError, this.options.filterStacktraces),\n }\n error = this.wrapTestRunHookError(\n 'a BeforeAll',\n formatLocation(hookDefinition),\n rawError\n )\n } else {\n result = {\n duration,\n status: TestStepResultStatus.PASSED,\n }\n }\n }\n\n this.eventBroadcaster.emit('envelope', {\n testRunHookFinished: {\n testRunHookStartedId,\n result,\n timestamp: timestamp(),\n },\n } satisfies Envelope)\n\n return {\n result,\n error,\n }\n }\n\n private wrapTestRunHookError(\n name: string,\n location: string,\n error: any\n ): any | undefined {\n if (!doesHaveValue(error)) {\n return undefined\n }\n let message = `${name} hook errored`\n if (this.workerId) {\n message += ` on worker ${this.workerId}`\n }\n message += `, process exiting: ${location}`\n return new Error(message, { cause: error })\n }\n\n async runBeforeAllHooks(): Promise {\n const results: RunHookResult[] = []\n for (const hookDefinition of this.supportCodeLibrary\n .beforeTestRunHookDefinitions) {\n const result = await this.runTestRunHook(hookDefinition)\n results.push(result)\n if (doesHaveValue(result.error)) {\n throw result.error\n }\n }\n return results\n }\n\n async runTestCase(\n { gherkinDocument, pickle, testCase }: AssembledTestCase,\n failing: boolean\n ): Promise {\n const testCaseRunner = new TestCaseRunner({\n workerId: this.workerId,\n eventBroadcaster: this.eventBroadcaster,\n newId: this.newId,\n gherkinDocument,\n pickle,\n testCase,\n retries: retriesForPickle(pickle, this.options),\n skip: this.options.dryRun || (this.options.failFast && failing),\n filterStackTraces: this.options.filterStacktraces,\n supportCodeLibrary: this.supportCodeLibrary,\n worldParameters: this.options.worldParameters,\n snippetBuilder: this.snippetBuilder,\n })\n\n const status = await testCaseRunner.run()\n\n return !shouldCauseFailure(status, this.options)\n }\n\n async runAfterAllHooks(): Promise {\n const results: RunHookResult[] = []\n const reversed = [\n ...this.supportCodeLibrary.afterTestRunHookDefinitions,\n ].reverse()\n for (const hookDefinition of reversed) {\n const result = await this.runTestRunHook(hookDefinition)\n results.push(result)\n if (doesHaveValue(result.error)) {\n throw result.error\n }\n }\n return results\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/sharding/index.d.ts b/node_modules/@cucumber/cucumber/lib/sharding/index.d.ts new file mode 100644 index 00000000..4ac5bd01 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/sharding/index.d.ts @@ -0,0 +1,2 @@ +import { shardingPlugin } from './sharding_plugin'; +export default shardingPlugin; diff --git a/node_modules/@cucumber/cucumber/lib/sharding/index.js b/node_modules/@cucumber/cucumber/lib/sharding/index.js new file mode 100644 index 00000000..57b06103 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/sharding/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const sharding_plugin_1 = require("./sharding_plugin"); +exports.default = sharding_plugin_1.shardingPlugin; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/sharding/index.js.map b/node_modules/@cucumber/cucumber/lib/sharding/index.js.map new file mode 100644 index 00000000..05b49c0c --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/sharding/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sharding/index.ts"],"names":[],"mappings":";;AAAA,uDAAkD;AAElD,kBAAe,gCAAc,CAAA","sourcesContent":["import { shardingPlugin } from './sharding_plugin'\n\nexport default shardingPlugin\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.d.ts b/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.d.ts new file mode 100644 index 00000000..b7706a95 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.d.ts @@ -0,0 +1,2 @@ +import { InternalPlugin } from '../plugin'; +export declare const shardingPlugin: InternalPlugin; diff --git a/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.js b/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.js new file mode 100644 index 00000000..ac637238 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.shardingPlugin = void 0; +exports.shardingPlugin = { + type: 'plugin', + coordinator: async ({ transform, options }) => { + transform('pickles:filter', async (allPickles) => { + if (!options.shard) { + return allPickles; + } + const [shardIndexStr, shardTotalStr] = options.shard.split('/'); + const shardIndex = parseInt(shardIndexStr, 10) - 1; + const shardTotal = parseInt(shardTotalStr, 10); + return allPickles.filter((_, i) => i % shardTotal === shardIndex); + }); + }, +}; +//# sourceMappingURL=sharding_plugin.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.js.map b/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.js.map new file mode 100644 index 00000000..ec17448e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/sharding/sharding_plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sharding_plugin.js","sourceRoot":"","sources":["../../src/sharding/sharding_plugin.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAmB;IAC5C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5C,SAAS,CAAC,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;YAC/C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBACnB,OAAO,UAAU,CAAA;YACnB,CAAC;YAED,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC/D,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,GAAG,CAAC,CAAA;YAClD,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;YAE9C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,UAAU,KAAK,UAAU,CAAC,CAAA;QACnE,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { InternalPlugin } from '../plugin'\n\nexport const shardingPlugin: InternalPlugin = {\n type: 'plugin',\n coordinator: async ({ transform, options }) => {\n transform('pickles:filter', async (allPickles) => {\n if (!options.shard) {\n return allPickles\n }\n\n const [shardIndexStr, shardTotalStr] = options.shard.split('/')\n const shardIndex = parseInt(shardIndexStr, 10) - 1\n const shardTotal = parseInt(shardTotalStr, 10)\n\n return allPickles.filter((_, i) => i % shardTotal === shardIndex)\n })\n },\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/step_arguments.d.ts b/node_modules/@cucumber/cucumber/lib/step_arguments.d.ts new file mode 100644 index 00000000..522016d6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/step_arguments.d.ts @@ -0,0 +1,6 @@ +import * as messages from '@cucumber/messages'; +export interface IPickleStepArgumentFunctionMap { + dataTable: (arg: messages.PickleTable) => T; + docString: (arg: messages.PickleDocString) => T; +} +export declare function parseStepArgument(arg: messages.PickleStepArgument, mapping: IPickleStepArgumentFunctionMap): T; diff --git a/node_modules/@cucumber/cucumber/lib/step_arguments.js b/node_modules/@cucumber/cucumber/lib/step_arguments.js new file mode 100644 index 00000000..8a81c2a7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/step_arguments.js @@ -0,0 +1,18 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseStepArgument = parseStepArgument; +const node_util_1 = __importDefault(require("node:util")); +const value_checker_1 = require("./value_checker"); +function parseStepArgument(arg, mapping) { + if ((0, value_checker_1.doesHaveValue)(arg.dataTable)) { + return mapping.dataTable(arg.dataTable); + } + else if ((0, value_checker_1.doesHaveValue)(arg.docString)) { + return mapping.docString(arg.docString); + } + throw new Error(`Unknown step argument: ${node_util_1.default.inspect(arg)}`); +} +//# sourceMappingURL=step_arguments.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/step_arguments.js.map b/node_modules/@cucumber/cucumber/lib/step_arguments.js.map new file mode 100644 index 00000000..a01e21b0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/step_arguments.js.map @@ -0,0 +1 @@ +{"version":3,"file":"step_arguments.js","sourceRoot":"","sources":["../src/step_arguments.ts"],"names":[],"mappings":";;;;;AASA,8CAUC;AAnBD,0DAA4B;AAE5B,mDAA+C;AAO/C,SAAgB,iBAAiB,CAC/B,GAAgC,EAChC,OAA0C;IAE1C,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACzC,CAAC;SAAM,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACzC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,0BAA0B,mBAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AAChE,CAAC","sourcesContent":["import util from 'node:util'\nimport * as messages from '@cucumber/messages'\nimport { doesHaveValue } from './value_checker'\n\nexport interface IPickleStepArgumentFunctionMap {\n dataTable: (arg: messages.PickleTable) => T\n docString: (arg: messages.PickleDocString) => T\n}\n\nexport function parseStepArgument(\n arg: messages.PickleStepArgument,\n mapping: IPickleStepArgumentFunctionMap\n): T {\n if (doesHaveValue(arg.dataTable)) {\n return mapping.dataTable(arg.dataTable)\n } else if (doesHaveValue(arg.docString)) {\n return mapping.docString(arg.docString)\n }\n throw new Error(`Unknown step argument: ${util.inspect(arg)}`)\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.d.ts new file mode 100644 index 00000000..2704de0a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.d.ts @@ -0,0 +1,3 @@ +import { ParameterType } from '@cucumber/cucumber-expressions'; +import { IParameterTypeDefinition } from './types'; +export declare function buildParameterType({ name, regexp, transformer, useForSnippets, preferForRegexpMatch, }: IParameterTypeDefinition): ParameterType; diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.js new file mode 100644 index 00000000..1997d3fc --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildParameterType = buildParameterType; +const cucumber_expressions_1 = require("@cucumber/cucumber-expressions"); +function buildParameterType({ name, regexp, transformer, useForSnippets, preferForRegexpMatch, }) { + if (typeof useForSnippets !== 'boolean') + useForSnippets = true; + if (typeof preferForRegexpMatch !== 'boolean') + preferForRegexpMatch = false; + return new cucumber_expressions_1.ParameterType(name, regexp, null, transformer, useForSnippets, preferForRegexpMatch); +} +//# sourceMappingURL=build_parameter_type.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.js.map new file mode 100644 index 00000000..ffbe0409 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/build_parameter_type.js.map @@ -0,0 +1 @@ +{"version":3,"file":"build_parameter_type.js","sourceRoot":"","sources":["../../src/support_code_library_builder/build_parameter_type.ts"],"names":[],"mappings":";;AAGA,gDAiBC;AApBD,yEAA8D;AAG9D,SAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,MAAM,EACN,WAAW,EACX,cAAc,EACd,oBAAoB,GACU;IAC9B,IAAI,OAAO,cAAc,KAAK,SAAS;QAAE,cAAc,GAAG,IAAI,CAAA;IAC9D,IAAI,OAAO,oBAAoB,KAAK,SAAS;QAAE,oBAAoB,GAAG,KAAK,CAAA;IAC3E,OAAO,IAAI,oCAAa,CACtB,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,WAAW,EACX,cAAc,EACd,oBAAoB,CACrB,CAAA;AACH,CAAC","sourcesContent":["import { ParameterType } from '@cucumber/cucumber-expressions'\nimport { IParameterTypeDefinition } from './types'\n\nexport function buildParameterType({\n name,\n regexp,\n transformer,\n useForSnippets,\n preferForRegexpMatch,\n}: IParameterTypeDefinition): ParameterType {\n if (typeof useForSnippets !== 'boolean') useForSnippets = true\n if (typeof preferForRegexpMatch !== 'boolean') preferForRegexpMatch = false\n return new ParameterType(\n name,\n regexp,\n null,\n transformer,\n useForSnippets,\n preferForRegexpMatch\n )\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.d.ts new file mode 100644 index 00000000..5efc5c05 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.d.ts @@ -0,0 +1,3 @@ +export interface IContext { + readonly parameters: ParametersType; +} diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.js new file mode 100644 index 00000000..9de85337 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=context.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.js.map new file mode 100644 index 00000000..2f5c15c6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/context.js.map @@ -0,0 +1 @@ +{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/support_code_library_builder/context.ts"],"names":[],"mappings":"","sourcesContent":["export interface IContext {\n readonly parameters: ParametersType\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.d.ts new file mode 100644 index 00000000..49b8f43b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.d.ts @@ -0,0 +1,3 @@ +import { isFileNameInCucumber } from '../filter_stack_trace'; +import { ILineAndUri } from '../types'; +export declare function getDefinitionLineAndUri(cwd: string, isExcluded?: typeof isFileNameInCucumber): ILineAndUri; diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.js new file mode 100644 index 00000000..941c0bb7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.js @@ -0,0 +1,32 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDefinitionLineAndUri = getDefinitionLineAndUri; +const node_path_1 = __importDefault(require("node:path")); +const node_url_1 = require("node:url"); +const error_stack_parser_1 = __importDefault(require("error-stack-parser")); +const filter_stack_trace_1 = require("../filter_stack_trace"); +const value_checker_1 = require("../value_checker"); +function getDefinitionLineAndUri(cwd, isExcluded = filter_stack_trace_1.isFileNameInCucumber) { + let line; + let uri; + const stackframes = error_stack_parser_1.default.parse(new Error()); + const stackframe = stackframes.find((frame) => frame.fileName !== __filename && !isExcluded(frame.fileName)); + if (stackframe != null) { + line = stackframe.getLineNumber(); + uri = stackframe.getFileName(); + if ((0, value_checker_1.doesHaveValue)(uri)) { + if (uri.startsWith('file://')) { + uri = (0, node_url_1.fileURLToPath)(uri); + } + uri = node_path_1.default.relative(cwd, uri); + } + } + return { + line: (0, value_checker_1.valueOrDefault)(line, 0), + uri: (0, value_checker_1.valueOrDefault)(uri, 'unknown'), + }; +} +//# sourceMappingURL=get_definition_line_and_uri.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.js.map new file mode 100644 index 00000000..db8af056 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/get_definition_line_and_uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"get_definition_line_and_uri.js","sourceRoot":"","sources":["../../src/support_code_library_builder/get_definition_line_and_uri.ts"],"names":[],"mappings":";;;;;AAOA,0DA0BC;AAjCD,0DAA4B;AAC5B,uCAAwC;AACxC,4EAAiE;AACjE,8DAA4D;AAC5D,oDAAgE;AAGhE,SAAgB,uBAAuB,CACrC,GAAW,EACX,UAAU,GAAG,yCAAoB;IAEjC,IAAI,IAAY,CAAA;IAChB,IAAI,GAAW,CAAA;IACf,MAAM,WAAW,GAAiB,4BAAgB,CAAC,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC,CAAA;IACrE,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CACjC,CAAC,KAAiB,EAAE,EAAE,CACpB,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAC/D,CAAA;IACD,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,UAAU,CAAC,aAAa,EAAE,CAAA;QACjC,GAAG,GAAG,UAAU,CAAC,WAAW,EAAE,CAAA;QAC9B,IAAI,IAAA,6BAAa,EAAC,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC9B,GAAG,GAAG,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;YAC1B,CAAC;YACD,GAAG,GAAG,mBAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,IAAA,8BAAc,EAAC,IAAI,EAAE,CAAC,CAAC;QAC7B,GAAG,EAAE,IAAA,8BAAc,EAAC,GAAG,EAAE,SAAS,CAAC;KACpC,CAAA;AACH,CAAC","sourcesContent":["import path from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport errorStackParser, { StackFrame } from 'error-stack-parser'\nimport { isFileNameInCucumber } from '../filter_stack_trace'\nimport { doesHaveValue, valueOrDefault } from '../value_checker'\nimport { ILineAndUri } from '../types'\n\nexport function getDefinitionLineAndUri(\n cwd: string,\n isExcluded = isFileNameInCucumber\n): ILineAndUri {\n let line: number\n let uri: string\n const stackframes: StackFrame[] = errorStackParser.parse(new Error())\n const stackframe = stackframes.find(\n (frame: StackFrame) =>\n frame.fileName !== __filename && !isExcluded(frame.fileName)\n )\n if (stackframe != null) {\n line = stackframe.getLineNumber()\n uri = stackframe.getFileName()\n if (doesHaveValue(uri)) {\n if (uri.startsWith('file://')) {\n uri = fileURLToPath(uri)\n }\n uri = path.relative(cwd, uri)\n }\n }\n\n return {\n line: valueOrDefault(line, 0),\n uri: valueOrDefault(uri, 'unknown'),\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.d.ts new file mode 100644 index 00000000..c59ee931 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.d.ts @@ -0,0 +1,79 @@ +import { IdGenerator } from '@cucumber/messages'; +import * as messages from '@cucumber/messages'; +import TestCaseHookDefinition from '../models/test_case_hook_definition'; +import TestStepHookDefinition from '../models/test_step_hook_definition'; +import TestRunHookDefinition from '../models/test_run_hook_definition'; +import StepDefinition from '../models/step_definition'; +import { GherkinStepKeyword } from '../models/gherkin_step_keyword'; +import { IDefineSupportCodeMethods, IDefineTestCaseHookOptions, IDefineTestStepHookOptions, IDefineTestRunHookOptions, IParameterTypeDefinition, SupportCodeLibrary, TestCaseHookFunction, TestStepHookFunction, ISupportCodeCoordinates, IDefineStep, CanonicalSupportCodeIds } from './types'; +interface IStepDefinitionConfig { + code: Function; + line: number; + options: any; + order: number; + keyword: GherkinStepKeyword; + pattern: string | RegExp; + uri: string; +} +interface ITestCaseHookDefinitionConfig { + code: any; + line: number; + options: any; + order: number; + uri: string; +} +interface ITestStepHookDefinitionConfig { + code: Function; + line: number; + options: any; + order: number; + uri: string; +} +interface ITestRunHookDefinitionConfig { + code: Function; + line: number; + options: any; + order: number; + uri: string; +} +export declare class SupportCodeLibraryBuilder { + readonly methods: IDefineSupportCodeMethods; + private originalCoordinates; + private afterTestCaseHookDefinitionConfigs; + private afterTestRunHookDefinitionConfigs; + private afterTestStepHookDefinitionConfigs; + private beforeTestCaseHookDefinitionConfigs; + private beforeTestRunHookDefinitionConfigs; + private beforeTestStepHookDefinitionConfigs; + private cwd; + private defaultTimeout; + private definitionFunctionWrapper; + private definitionOrder; + private newId; + private parameterTypeRegistry; + private stepDefinitionConfigs; + private World; + private parallelCanAssign; + private status; + constructor(); + defineParameterType(options: IParameterTypeDefinition): void; + defineStep(keyword: GherkinStepKeyword, getCollection: () => IStepDefinitionConfig[]): IDefineStep; + defineTestCaseHook(getCollection: () => ITestCaseHookDefinitionConfig[]): (options: string | IDefineTestCaseHookOptions | TestCaseHookFunction, code?: TestCaseHookFunction) => void; + defineTestStepHook(getCollection: () => ITestStepHookDefinitionConfig[]): (options: string | IDefineTestStepHookOptions | TestStepHookFunction, code?: TestStepHookFunction) => void; + defineTestRunHook(getCollection: () => ITestRunHookDefinitionConfig[]): (options: IDefineTestRunHookOptions | Function, code?: Function) => void; + wrapCode({ code, wrapperOptions, }: { + code: Function; + wrapperOptions: any; + }): Function; + buildTestCaseHookDefinitions(configs: ITestCaseHookDefinitionConfig[], canonicalIds?: string[]): TestCaseHookDefinition[]; + buildTestStepHookDefinitions(configs: ITestStepHookDefinitionConfig[]): TestStepHookDefinition[]; + buildTestRunHookDefinitions(configs: ITestRunHookDefinitionConfig[], canonicalIds?: string[]): TestRunHookDefinition[]; + buildStepDefinitions(canonicalIds?: string[]): { + stepDefinitions: StepDefinition[]; + undefinedParameterTypes: messages.UndefinedParameterType[]; + }; + finalize(canonicalIds?: CanonicalSupportCodeIds): SupportCodeLibrary; + reset(cwd: string, newId: IdGenerator.NewId, originalCoordinates?: ISupportCodeCoordinates): void; +} +declare const _default: SupportCodeLibraryBuilder; +export default _default; diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.js new file mode 100644 index 00000000..7e5ad7ab --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.js @@ -0,0 +1,334 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SupportCodeLibraryBuilder = void 0; +const util_arity_1 = __importDefault(require("util-arity")); +const cucumber_expressions_1 = require("@cucumber/cucumber-expressions"); +const test_case_hook_definition_1 = __importDefault(require("../models/test_case_hook_definition")); +const test_step_hook_definition_1 = __importDefault(require("../models/test_step_hook_definition")); +const test_run_hook_definition_1 = __importDefault(require("../models/test_run_hook_definition")); +const step_definition_1 = __importDefault(require("../models/step_definition")); +const helpers_1 = require("../formatter/helpers"); +const value_checker_1 = require("../value_checker"); +const validate_arguments_1 = __importDefault(require("./validate_arguments")); +const world_1 = __importDefault(require("./world")); +const get_definition_line_and_uri_1 = require("./get_definition_line_and_uri"); +const build_parameter_type_1 = require("./build_parameter_type"); +const sourced_parameter_type_registry_1 = require("./sourced_parameter_type_registry"); +class SupportCodeLibraryBuilder { + methods; + originalCoordinates; + afterTestCaseHookDefinitionConfigs; + afterTestRunHookDefinitionConfigs; + afterTestStepHookDefinitionConfigs; + beforeTestCaseHookDefinitionConfigs; + beforeTestRunHookDefinitionConfigs; + beforeTestStepHookDefinitionConfigs; + cwd; + defaultTimeout; + definitionFunctionWrapper; + definitionOrder; + newId; + parameterTypeRegistry; + stepDefinitionConfigs; + World; + parallelCanAssign; + status = 'PENDING'; + constructor() { + const methods = { + After: this.defineTestCaseHook(() => this.afterTestCaseHookDefinitionConfigs), + AfterAll: this.defineTestRunHook(() => this.afterTestRunHookDefinitionConfigs), + AfterStep: this.defineTestStepHook(() => this.afterTestStepHookDefinitionConfigs), + Before: this.defineTestCaseHook(() => this.beforeTestCaseHookDefinitionConfigs), + BeforeAll: this.defineTestRunHook(() => this.beforeTestRunHookDefinitionConfigs), + BeforeStep: this.defineTestStepHook(() => this.beforeTestStepHookDefinitionConfigs), + defineParameterType: this.defineParameterType.bind(this), + defineStep: this.defineStep('Unknown', () => this.stepDefinitionConfigs), + Given: this.defineStep('Given', () => this.stepDefinitionConfigs), + setDefaultTimeout: (milliseconds) => { + this.defaultTimeout = milliseconds; + }, + setDefinitionFunctionWrapper: (fn) => { + this.definitionFunctionWrapper = fn; + }, + setWorldConstructor: (fn) => { + this.World = fn; + }, + setParallelCanAssign: (fn) => { + this.parallelCanAssign = fn; + }, + Then: this.defineStep('Then', () => this.stepDefinitionConfigs), + When: this.defineStep('When', () => this.stepDefinitionConfigs), + }; + const checkInstall = (method) => { + if (this.status === 'PENDING') { + throw new Error(` + You're calling functions (e.g. "${method}") on an instance of Cucumber that isn't running (status: ${this.status}). + This means you may have an invalid installation, potentially due to: + - Cucumber being installed globally + - A project structure where your support code is depending on a different instance of Cucumber + Either way, you'll need to address this in order for Cucumber to work. + See https://github.com/cucumber/cucumber-js/blob/main/docs/installation.md#invalid-installations + `); + } + }; + this.methods = new Proxy(methods, { + get(target, method) { + return (...args) => { + checkInstall(method); + // @ts-expect-error difficult to type this correctly + return target[method](...args); + }; + }, + }); + } + defineParameterType(options) { + const parameterType = (0, build_parameter_type_1.buildParameterType)(options); + const source = (0, get_definition_line_and_uri_1.getDefinitionLineAndUri)(this.cwd); + this.parameterTypeRegistry.defineSourcedParameterType(parameterType, source, this.definitionOrder++); + } + defineStep(keyword, getCollection) { + return (pattern, options, code) => { + if (typeof options === 'function') { + code = options; + options = {}; + } + const { line, uri } = (0, get_definition_line_and_uri_1.getDefinitionLineAndUri)(this.cwd); + (0, validate_arguments_1.default)({ + args: { code, pattern, options }, + fnName: 'defineStep', + location: (0, helpers_1.formatLocation)({ line, uri }), + }); + getCollection().push({ + code, + line, + options, + order: this.definitionOrder++, + keyword, + pattern, + uri, + }); + }; + } + defineTestCaseHook(getCollection) { + return (options, code) => { + if (typeof options === 'string') { + options = { tags: options }; + } + else if (typeof options === 'function') { + code = options; + options = {}; + } + const { line, uri } = (0, get_definition_line_and_uri_1.getDefinitionLineAndUri)(this.cwd); + (0, validate_arguments_1.default)({ + args: { code, options }, + fnName: 'defineTestCaseHook', + location: (0, helpers_1.formatLocation)({ line, uri }), + }); + getCollection().push({ + code, + line, + options, + order: this.definitionOrder++, + uri, + }); + }; + } + defineTestStepHook(getCollection) { + return (options, code) => { + if (typeof options === 'string') { + options = { tags: options }; + } + else if (typeof options === 'function') { + code = options; + options = {}; + } + const { line, uri } = (0, get_definition_line_and_uri_1.getDefinitionLineAndUri)(this.cwd); + (0, validate_arguments_1.default)({ + args: { code, options }, + fnName: 'defineTestStepHook', + location: (0, helpers_1.formatLocation)({ line, uri }), + }); + getCollection().push({ + code, + line, + options, + order: this.definitionOrder++, + uri, + }); + }; + } + defineTestRunHook(getCollection) { + return (options, code) => { + if (typeof options === 'function') { + code = options; + options = {}; + } + const { line, uri } = (0, get_definition_line_and_uri_1.getDefinitionLineAndUri)(this.cwd); + (0, validate_arguments_1.default)({ + args: { code, options }, + fnName: 'defineTestRunHook', + location: (0, helpers_1.formatLocation)({ line, uri }), + }); + getCollection().push({ + code, + line, + options, + order: this.definitionOrder++, + uri, + }); + }; + } + wrapCode({ code, wrapperOptions, }) { + if ((0, value_checker_1.doesHaveValue)(this.definitionFunctionWrapper)) { + const codeLength = code.length; + const wrappedCode = this.definitionFunctionWrapper(code, wrapperOptions); + if (wrappedCode !== code) { + return (0, util_arity_1.default)(codeLength, wrappedCode); + } + return wrappedCode; + } + return code; + } + buildTestCaseHookDefinitions(configs, canonicalIds) { + return configs.map(({ code, line, options, order, uri }, index) => { + const wrappedCode = this.wrapCode({ + code, + wrapperOptions: options.wrapperOptions, + }); + return new test_case_hook_definition_1.default({ + code: wrappedCode, + id: canonicalIds ? canonicalIds[index] : this.newId(), + line, + options, + order, + unwrappedCode: code, + uri, + }); + }); + } + buildTestStepHookDefinitions(configs) { + return configs.map(({ code, line, options, order, uri }) => { + const wrappedCode = this.wrapCode({ + code, + wrapperOptions: options.wrapperOptions, + }); + return new test_step_hook_definition_1.default({ + code: wrappedCode, + id: this.newId(), + line, + options, + order, + unwrappedCode: code, + uri, + }); + }); + } + buildTestRunHookDefinitions(configs, canonicalIds) { + return configs.map(({ code, line, options, order, uri }, index) => { + const wrappedCode = this.wrapCode({ + code, + wrapperOptions: options.wrapperOptions, + }); + return new test_run_hook_definition_1.default({ + code: wrappedCode, + id: canonicalIds ? canonicalIds[index] : this.newId(), + line, + options: options, + order, + unwrappedCode: code, + uri, + }); + }); + } + buildStepDefinitions(canonicalIds) { + const stepDefinitions = []; + const undefinedParameterTypes = []; + this.stepDefinitionConfigs.forEach(({ code, line, options, order, keyword, pattern, uri }, index) => { + let expression; + if (typeof pattern === 'string') { + try { + expression = new cucumber_expressions_1.CucumberExpression(pattern, this.parameterTypeRegistry); + } + catch (e) { + if ((0, value_checker_1.doesHaveValue)(e.undefinedParameterTypeName)) { + undefinedParameterTypes.push({ + name: e.undefinedParameterTypeName, + expression: pattern, + }); + return; + } + throw e; + } + } + else { + expression = new cucumber_expressions_1.RegularExpression(pattern, this.parameterTypeRegistry); + } + const wrappedCode = this.wrapCode({ + code, + wrapperOptions: options.wrapperOptions, + }); + stepDefinitions.push(new step_definition_1.default({ + code: wrappedCode, + expression, + id: canonicalIds ? canonicalIds[index] : this.newId(), + line, + options, + order, + keyword, + pattern, + unwrappedCode: code, + uri, + })); + }); + return { stepDefinitions, undefinedParameterTypes }; + } + finalize(canonicalIds) { + this.status = 'FINALIZED'; + const stepDefinitionsResult = this.buildStepDefinitions(canonicalIds?.stepDefinitionIds); + return { + originalCoordinates: this.originalCoordinates, + afterTestCaseHookDefinitions: this.buildTestCaseHookDefinitions(this.afterTestCaseHookDefinitionConfigs, canonicalIds?.afterTestCaseHookDefinitionIds), + afterTestRunHookDefinitions: this.buildTestRunHookDefinitions(this.afterTestRunHookDefinitionConfigs, canonicalIds?.afterTestRunHookDefinitionIds), + afterTestStepHookDefinitions: this.buildTestStepHookDefinitions(this.afterTestStepHookDefinitionConfigs), + beforeTestCaseHookDefinitions: this.buildTestCaseHookDefinitions(this.beforeTestCaseHookDefinitionConfigs, canonicalIds?.beforeTestCaseHookDefinitionIds), + beforeTestRunHookDefinitions: this.buildTestRunHookDefinitions(this.beforeTestRunHookDefinitionConfigs, canonicalIds?.beforeTestRunHookDefinitionIds), + beforeTestStepHookDefinitions: this.buildTestStepHookDefinitions(this.beforeTestStepHookDefinitionConfigs), + defaultTimeout: this.defaultTimeout, + parameterTypeRegistry: this.parameterTypeRegistry, + undefinedParameterTypes: stepDefinitionsResult.undefinedParameterTypes, + stepDefinitions: stepDefinitionsResult.stepDefinitions, + World: this.World, + parallelCanAssign: this.parallelCanAssign, + }; + } + reset(cwd, newId, originalCoordinates = { + requireModules: [], + requirePaths: [], + importPaths: [], + loaders: [], + }) { + this.cwd = cwd; + this.newId = newId; + this.originalCoordinates = originalCoordinates; + this.afterTestCaseHookDefinitionConfigs = []; + this.afterTestRunHookDefinitionConfigs = []; + this.afterTestStepHookDefinitionConfigs = []; + this.beforeTestCaseHookDefinitionConfigs = []; + this.beforeTestRunHookDefinitionConfigs = []; + this.beforeTestStepHookDefinitionConfigs = []; + this.definitionFunctionWrapper = null; + this.definitionOrder = 0; + this.defaultTimeout = 5000; + this.parameterTypeRegistry = new sourced_parameter_type_registry_1.SourcedParameterTypeRegistry(); + this.stepDefinitionConfigs = []; + this.parallelCanAssign = () => true; + this.World = world_1.default; + this.status = 'OPEN'; + } +} +exports.SupportCodeLibraryBuilder = SupportCodeLibraryBuilder; +exports.default = new SupportCodeLibraryBuilder(); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.js.map new file mode 100644 index 00000000..a2007fc6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/support_code_library_builder/index.ts"],"names":[],"mappings":";;;;;;AAEA,4DAA8B;AAC9B,yEAGuC;AACvC,oGAAwE;AACxE,oGAAwE;AACxE,kGAE2C;AAC3C,gFAAsD;AACtD,kDAAqD;AACrD,oDAAgD;AAEhD,8EAAoD;AAkBpD,oDAA2B;AAC3B,+EAAuE;AACvE,iEAA2D;AAC3D,uFAAgF;AAsChF,MAAa,yBAAyB;IACpB,OAAO,CAA2B;IAC1C,mBAAmB,CAAyB;IAC5C,kCAAkC,CAAiC;IACnE,iCAAiC,CAAgC;IACjE,kCAAkC,CAAiC;IACnE,mCAAmC,CAAiC;IACpE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util-arity'\nimport {\n CucumberExpression,\n RegularExpression,\n} from '@cucumber/cucumber-expressions'\nimport TestCaseHookDefinition from '../models/test_case_hook_definition'\nimport TestStepHookDefinition from '../models/test_step_hook_definition'\nimport TestRunHookDefinition, {\n ITestRunHookDefinitionOptions,\n} from '../models/test_run_hook_definition'\nimport StepDefinition from '../models/step_definition'\nimport { formatLocation } from '../formatter/helpers'\nimport { doesHaveValue } from '../value_checker'\nimport { GherkinStepKeyword } from '../models/gherkin_step_keyword'\nimport validateArguments from './validate_arguments'\n\nimport {\n DefineStepPattern,\n IDefineStepOptions,\n IDefineSupportCodeMethods,\n IDefineTestCaseHookOptions,\n IDefineTestStepHookOptions,\n IDefineTestRunHookOptions,\n IParameterTypeDefinition,\n SupportCodeLibrary,\n TestCaseHookFunction,\n TestStepHookFunction,\n ParallelAssignmentValidator,\n ISupportCodeCoordinates,\n IDefineStep,\n CanonicalSupportCodeIds,\n} from './types'\nimport World from './world'\nimport { getDefinitionLineAndUri } from './get_definition_line_and_uri'\nimport { buildParameterType } from './build_parameter_type'\nimport { SourcedParameterTypeRegistry } from './sourced_parameter_type_registry'\n\ninterface IStepDefinitionConfig {\n code: Function\n line: number\n options: any\n order: number\n keyword: GherkinStepKeyword\n pattern: string | RegExp\n uri: string\n}\n\ninterface ITestCaseHookDefinitionConfig {\n code: any\n line: number\n options: any\n order: number\n uri: string\n}\n\ninterface ITestStepHookDefinitionConfig {\n code: Function\n line: number\n options: any\n order: number\n uri: string\n}\n\ninterface ITestRunHookDefinitionConfig {\n code: Function\n line: number\n options: any\n order: number\n uri: string\n}\n\ntype LibraryStatus = 'PENDING' | 'OPEN' | 'FINALIZED'\n\nexport class SupportCodeLibraryBuilder {\n public readonly methods: IDefineSupportCodeMethods\n private originalCoordinates: ISupportCodeCoordinates\n private afterTestCaseHookDefinitionConfigs: ITestCaseHookDefinitionConfig[]\n private afterTestRunHookDefinitionConfigs: ITestRunHookDefinitionConfig[]\n private afterTestStepHookDefinitionConfigs: ITestStepHookDefinitionConfig[]\n private beforeTestCaseHookDefinitionConfigs: ITestCaseHookDefinitionConfig[]\n private beforeTestRunHookDefinitionConfigs: ITestRunHookDefinitionConfig[]\n private beforeTestStepHookDefinitionConfigs: ITestStepHookDefinitionConfig[]\n private cwd: string\n private defaultTimeout: number\n private definitionFunctionWrapper: any\n private definitionOrder: number\n private newId: IdGenerator.NewId\n private parameterTypeRegistry: SourcedParameterTypeRegistry\n private stepDefinitionConfigs: IStepDefinitionConfig[]\n private World: any\n private parallelCanAssign: ParallelAssignmentValidator\n private status: LibraryStatus = 'PENDING'\n\n constructor() {\n const methods: IDefineSupportCodeMethods = {\n After: this.defineTestCaseHook(\n () => this.afterTestCaseHookDefinitionConfigs\n ),\n AfterAll: this.defineTestRunHook(\n () => this.afterTestRunHookDefinitionConfigs\n ),\n AfterStep: this.defineTestStepHook(\n () => this.afterTestStepHookDefinitionConfigs\n ),\n Before: this.defineTestCaseHook(\n () => this.beforeTestCaseHookDefinitionConfigs\n ),\n BeforeAll: this.defineTestRunHook(\n () => this.beforeTestRunHookDefinitionConfigs\n ),\n BeforeStep: this.defineTestStepHook(\n () => this.beforeTestStepHookDefinitionConfigs\n ),\n defineParameterType: this.defineParameterType.bind(this),\n defineStep: this.defineStep('Unknown', () => this.stepDefinitionConfigs),\n Given: this.defineStep('Given', () => this.stepDefinitionConfigs),\n setDefaultTimeout: (milliseconds) => {\n this.defaultTimeout = milliseconds\n },\n setDefinitionFunctionWrapper: (fn) => {\n this.definitionFunctionWrapper = fn\n },\n setWorldConstructor: (fn) => {\n this.World = fn\n },\n setParallelCanAssign: (fn: ParallelAssignmentValidator): void => {\n this.parallelCanAssign = fn\n },\n Then: this.defineStep('Then', () => this.stepDefinitionConfigs),\n When: this.defineStep('When', () => this.stepDefinitionConfigs),\n }\n const checkInstall = (method: string) => {\n if (this.status === 'PENDING') {\n throw new Error(\n `\n You're calling functions (e.g. \"${method}\") on an instance of Cucumber that isn't running (status: ${this.status}).\n This means you may have an invalid installation, potentially due to:\n - Cucumber being installed globally\n - A project structure where your support code is depending on a different instance of Cucumber\n Either way, you'll need to address this in order for Cucumber to work.\n See https://github.com/cucumber/cucumber-js/blob/main/docs/installation.md#invalid-installations\n `\n )\n }\n }\n this.methods = new Proxy(methods, {\n get(\n target: IDefineSupportCodeMethods,\n method: keyof IDefineSupportCodeMethods\n ): any {\n return (...args: any[]) => {\n checkInstall(method)\n // @ts-expect-error difficult to type this correctly\n return target[method](...args)\n }\n },\n })\n }\n\n defineParameterType(options: IParameterTypeDefinition): void {\n const parameterType = buildParameterType(options)\n const source = getDefinitionLineAndUri(this.cwd)\n this.parameterTypeRegistry.defineSourcedParameterType(\n parameterType,\n source,\n this.definitionOrder++\n )\n }\n\n defineStep(\n keyword: GherkinStepKeyword,\n getCollection: () => IStepDefinitionConfig[]\n ): IDefineStep {\n return (\n pattern: DefineStepPattern,\n options: IDefineStepOptions | Function,\n code?: Function\n ) => {\n if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, pattern, options },\n fnName: 'defineStep',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n order: this.definitionOrder++,\n keyword,\n pattern,\n uri,\n })\n }\n }\n\n defineTestCaseHook(\n getCollection: () => ITestCaseHookDefinitionConfig[]\n ): (\n options:\n | string\n | IDefineTestCaseHookOptions\n | TestCaseHookFunction,\n code?: TestCaseHookFunction\n ) => void {\n return (\n options:\n | string\n | IDefineTestCaseHookOptions\n | TestCaseHookFunction,\n code?: TestCaseHookFunction\n ) => {\n if (typeof options === 'string') {\n options = { tags: options }\n } else if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestCaseHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n order: this.definitionOrder++,\n uri,\n })\n }\n }\n\n defineTestStepHook(\n getCollection: () => ITestStepHookDefinitionConfig[]\n ): (\n options:\n | string\n | IDefineTestStepHookOptions\n | TestStepHookFunction,\n code?: TestStepHookFunction\n ) => void {\n return (\n options:\n | string\n | IDefineTestStepHookOptions\n | TestStepHookFunction,\n code?: TestStepHookFunction\n ) => {\n if (typeof options === 'string') {\n options = { tags: options }\n } else if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestStepHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n order: this.definitionOrder++,\n uri,\n })\n }\n }\n\n defineTestRunHook(\n getCollection: () => ITestRunHookDefinitionConfig[]\n ): (options: IDefineTestRunHookOptions | Function, code?: Function) => void {\n return (options: IDefineTestRunHookOptions | Function, code?: Function) => {\n if (typeof options === 'function') {\n code = options\n options = {}\n }\n const { line, uri } = getDefinitionLineAndUri(this.cwd)\n validateArguments({\n args: { code, options },\n fnName: 'defineTestRunHook',\n location: formatLocation({ line, uri }),\n })\n getCollection().push({\n code,\n line,\n options,\n order: this.definitionOrder++,\n uri,\n })\n }\n }\n\n wrapCode({\n code,\n wrapperOptions,\n }: {\n code: Function\n wrapperOptions: any\n }): Function {\n if (doesHaveValue(this.definitionFunctionWrapper)) {\n const codeLength = code.length\n const wrappedCode = this.definitionFunctionWrapper(code, wrapperOptions)\n if (wrappedCode !== code) {\n return arity(codeLength, wrappedCode)\n }\n return wrappedCode\n }\n return code\n }\n\n buildTestCaseHookDefinitions(\n configs: ITestCaseHookDefinitionConfig[],\n canonicalIds?: string[]\n ): TestCaseHookDefinition[] {\n return configs.map(({ code, line, options, order, uri }, index) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestCaseHookDefinition({\n code: wrappedCode,\n id: canonicalIds ? canonicalIds[index] : this.newId(),\n line,\n options,\n order,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildTestStepHookDefinitions(\n configs: ITestStepHookDefinitionConfig[]\n ): TestStepHookDefinition[] {\n return configs.map(({ code, line, options, order, uri }) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestStepHookDefinition({\n code: wrappedCode,\n id: this.newId(),\n line,\n options,\n order,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildTestRunHookDefinitions(\n configs: ITestRunHookDefinitionConfig[],\n canonicalIds?: string[]\n ): TestRunHookDefinition[] {\n return configs.map(({ code, line, options, order, uri }, index) => {\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n return new TestRunHookDefinition({\n code: wrappedCode,\n id: canonicalIds ? canonicalIds[index] : this.newId(),\n line,\n options: options as ITestRunHookDefinitionOptions,\n order,\n unwrappedCode: code,\n uri,\n })\n })\n }\n\n buildStepDefinitions(canonicalIds?: string[]): {\n stepDefinitions: StepDefinition[]\n undefinedParameterTypes: messages.UndefinedParameterType[]\n } {\n const stepDefinitions: StepDefinition[] = []\n const undefinedParameterTypes: messages.UndefinedParameterType[] = []\n this.stepDefinitionConfigs.forEach(\n ({ code, line, options, order, keyword, pattern, uri }, index) => {\n let expression\n if (typeof pattern === 'string') {\n try {\n expression = new CucumberExpression(\n pattern,\n this.parameterTypeRegistry\n )\n } catch (e) {\n if (doesHaveValue(e.undefinedParameterTypeName)) {\n undefinedParameterTypes.push({\n name: e.undefinedParameterTypeName,\n expression: pattern,\n })\n return\n }\n throw e\n }\n } else {\n expression = new RegularExpression(\n pattern,\n this.parameterTypeRegistry\n )\n }\n\n const wrappedCode = this.wrapCode({\n code,\n wrapperOptions: options.wrapperOptions,\n })\n stepDefinitions.push(\n new StepDefinition({\n code: wrappedCode,\n expression,\n id: canonicalIds ? canonicalIds[index] : this.newId(),\n line,\n options,\n order,\n keyword,\n pattern,\n unwrappedCode: code,\n uri,\n })\n )\n }\n )\n return { stepDefinitions, undefinedParameterTypes }\n }\n\n finalize(canonicalIds?: CanonicalSupportCodeIds): SupportCodeLibrary {\n this.status = 'FINALIZED'\n const stepDefinitionsResult = this.buildStepDefinitions(\n canonicalIds?.stepDefinitionIds\n )\n return {\n originalCoordinates: this.originalCoordinates,\n afterTestCaseHookDefinitions: this.buildTestCaseHookDefinitions(\n this.afterTestCaseHookDefinitionConfigs,\n canonicalIds?.afterTestCaseHookDefinitionIds\n ),\n afterTestRunHookDefinitions: this.buildTestRunHookDefinitions(\n this.afterTestRunHookDefinitionConfigs,\n canonicalIds?.afterTestRunHookDefinitionIds\n ),\n afterTestStepHookDefinitions: this.buildTestStepHookDefinitions(\n this.afterTestStepHookDefinitionConfigs\n ),\n beforeTestCaseHookDefinitions: this.buildTestCaseHookDefinitions(\n this.beforeTestCaseHookDefinitionConfigs,\n canonicalIds?.beforeTestCaseHookDefinitionIds\n ),\n beforeTestRunHookDefinitions: this.buildTestRunHookDefinitions(\n this.beforeTestRunHookDefinitionConfigs,\n canonicalIds?.beforeTestRunHookDefinitionIds\n ),\n beforeTestStepHookDefinitions: this.buildTestStepHookDefinitions(\n this.beforeTestStepHookDefinitionConfigs\n ),\n defaultTimeout: this.defaultTimeout,\n parameterTypeRegistry: this.parameterTypeRegistry,\n undefinedParameterTypes: stepDefinitionsResult.undefinedParameterTypes,\n stepDefinitions: stepDefinitionsResult.stepDefinitions,\n World: this.World,\n parallelCanAssign: this.parallelCanAssign,\n }\n }\n\n reset(\n cwd: string,\n newId: IdGenerator.NewId,\n originalCoordinates: ISupportCodeCoordinates = {\n requireModules: [],\n requirePaths: [],\n importPaths: [],\n loaders: [],\n }\n ): void {\n this.cwd = cwd\n this.newId = newId\n this.originalCoordinates = originalCoordinates\n this.afterTestCaseHookDefinitionConfigs = []\n this.afterTestRunHookDefinitionConfigs = []\n this.afterTestStepHookDefinitionConfigs = []\n this.beforeTestCaseHookDefinitionConfigs = []\n this.beforeTestRunHookDefinitionConfigs = []\n this.beforeTestStepHookDefinitionConfigs = []\n this.definitionFunctionWrapper = null\n this.definitionOrder = 0\n this.defaultTimeout = 5000\n this.parameterTypeRegistry = new SourcedParameterTypeRegistry()\n this.stepDefinitionConfigs = []\n this.parallelCanAssign = () => true\n this.World = World\n this.status = 'OPEN'\n }\n}\n\nexport default new SupportCodeLibraryBuilder()\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.d.ts new file mode 100644 index 00000000..2d15e252 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.d.ts @@ -0,0 +1,2 @@ +import { ParallelAssignmentValidator } from './types'; +export declare function atMostOnePicklePerTag(tagNames: string[]): ParallelAssignmentValidator; diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.js new file mode 100644 index 00000000..067b9ddd --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.atMostOnePicklePerTag = atMostOnePicklePerTag; +function hasTag(pickle, tagName) { + return pickle.tags.some((t) => t.name == tagName); +} +function atMostOnePicklePerTag(tagNames) { + return (inQuestion, inProgress) => { + return tagNames.every((tagName) => { + return (!hasTag(inQuestion, tagName) || + inProgress.every((p) => !hasTag(p, tagName))); + }); + }; +} +//# sourceMappingURL=parallel_can_assign_helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.js.map new file mode 100644 index 00000000..205b9a9a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/parallel_can_assign_helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parallel_can_assign_helpers.js","sourceRoot":"","sources":["../../src/support_code_library_builder/parallel_can_assign_helpers.ts"],"names":[],"mappings":";;AAOA,sDAWC;AAfD,SAAS,MAAM,CAAC,MAAuB,EAAE,OAAe;IACtD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAA;AACnD,CAAC;AAED,SAAgB,qBAAqB,CACnC,QAAkB;IAElB,OAAO,CAAC,UAA2B,EAAE,UAA6B,EAAE,EAAE;QACpE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE;YAChC,OAAO,CACL,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC;gBAC5B,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAC7C,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { ParallelAssignmentValidator } from './types'\n\nfunction hasTag(pickle: messages.Pickle, tagName: string): boolean {\n return pickle.tags.some((t) => t.name == tagName)\n}\n\nexport function atMostOnePicklePerTag(\n tagNames: string[]\n): ParallelAssignmentValidator {\n return (inQuestion: messages.Pickle, inProgress: messages.Pickle[]) => {\n return tagNames.every((tagName) => {\n return (\n !hasTag(inQuestion, tagName) ||\n inProgress.every((p) => !hasTag(p, tagName))\n )\n })\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.d.ts new file mode 100644 index 00000000..a1961aff --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.d.ts @@ -0,0 +1,9 @@ +import { ParameterType, ParameterTypeRegistry } from '@cucumber/cucumber-expressions'; +import { ILineAndUri } from '../types'; +export declare class SourcedParameterTypeRegistry extends ParameterTypeRegistry { + private parameterTypeToSource; + defineSourcedParameterType(parameterType: ParameterType, source: ILineAndUri, order: number): void; + lookupSource(parameterType: ParameterType): ILineAndUri & { + order: number; + }; +} diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.js new file mode 100644 index 00000000..8792bd08 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SourcedParameterTypeRegistry = void 0; +const cucumber_expressions_1 = require("@cucumber/cucumber-expressions"); +class SourcedParameterTypeRegistry extends cucumber_expressions_1.ParameterTypeRegistry { + parameterTypeToSource = new WeakMap(); + defineSourcedParameterType(parameterType, source, order) { + this.defineParameterType(parameterType); + this.parameterTypeToSource.set(parameterType, { ...source, order }); + } + lookupSource(parameterType) { + return this.parameterTypeToSource.get(parameterType); + } +} +exports.SourcedParameterTypeRegistry = SourcedParameterTypeRegistry; +//# sourceMappingURL=sourced_parameter_type_registry.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.js.map new file mode 100644 index 00000000..346ebd66 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/sourced_parameter_type_registry.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sourced_parameter_type_registry.js","sourceRoot":"","sources":["../../src/support_code_library_builder/sourced_parameter_type_registry.ts"],"names":[],"mappings":";;;AAAA,yEAGuC;AAGvC,MAAa,4BAA6B,SAAQ,4CAAqB;IAC7D,qBAAqB,GAGzB,IAAI,OAAO,EAAE,CAAA;IAEjB,0BAA0B,CACxB,aAAqC,EACrC,MAAmB,EACnB,KAAa;QAEb,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAA;QACvC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;IACrE,CAAC;IAED,YAAY,CAAC,aAAqC;QAChD,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACtD,CAAC;CACF;AAlBD,oEAkBC","sourcesContent":["import {\n ParameterType,\n ParameterTypeRegistry,\n} from '@cucumber/cucumber-expressions'\nimport { ILineAndUri } from '../types'\n\nexport class SourcedParameterTypeRegistry extends ParameterTypeRegistry {\n private parameterTypeToSource: WeakMap<\n ParameterType,\n ILineAndUri & { order: number }\n > = new WeakMap()\n\n defineSourcedParameterType(\n parameterType: ParameterType,\n source: ILineAndUri,\n order: number\n ) {\n this.defineParameterType(parameterType)\n this.parameterTypeToSource.set(parameterType, { ...source, order })\n }\n\n lookupSource(parameterType: ParameterType) {\n return this.parameterTypeToSource.get(parameterType)\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.d.ts new file mode 100644 index 00000000..4b55160f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.d.ts @@ -0,0 +1,103 @@ +import * as messages from '@cucumber/messages'; +import { JsonObject } from 'type-fest'; +import TestCaseHookDefinition from '../models/test_case_hook_definition'; +import TestStepHookDefinition from '../models/test_step_hook_definition'; +import TestRunHookDefinition from '../models/test_run_hook_definition'; +import StepDefinition from '../models/step_definition'; +import { IWorld } from './world'; +import { SourcedParameterTypeRegistry } from './sourced_parameter_type_registry'; +export type DefineStepPattern = string | RegExp; +export type ParallelAssignmentValidator = (pickle: messages.Pickle, runningPickles: messages.Pickle[]) => boolean; +export interface ITestCaseHookParameter { + gherkinDocument: messages.GherkinDocument; + pickle: messages.Pickle; + result?: messages.TestStepResult; + error?: any; + willBeRetried?: boolean; + testCaseStartedId: string; +} +export interface ITestStepHookParameter { + gherkinDocument: messages.GherkinDocument; + pickle: messages.Pickle; + pickleStep: messages.PickleStep; + result: messages.TestStepResult; + error?: any; + testCaseStartedId: string; + testStepId: string; +} +export type TestRunHookFunction = (this: { + parameters: JsonObject; +}) => any | Promise; +export type TestCaseHookFunction = (this: WorldType, arg: ITestCaseHookParameter) => any | Promise; +export type TestStepHookFunction = (this: WorldType, arg: ITestStepHookParameter) => any | Promise; +export type TestStepFunction = (this: WorldType, ...args: any[]) => any | Promise; +export interface IDefineStepOptions { + timeout?: number; + wrapperOptions?: any; +} +export interface IDefineTestCaseHookOptions { + name?: string; + tags?: string; + timeout?: number; +} +export interface IDefineTestStepHookOptions { + tags?: string; + timeout?: number; +} +export interface IDefineTestRunHookOptions { + name?: string; + timeout?: number; +} +export interface IParameterTypeDefinition { + name: string; + regexp: readonly RegExp[] | readonly string[] | RegExp | string; + transformer?: (...match: string[]) => T; + useForSnippets?: boolean; + preferForRegexpMatch?: boolean; +} +export type IDefineStep = ((pattern: DefineStepPattern, code: TestStepFunction) => void) & ((pattern: DefineStepPattern, options: IDefineStepOptions, code: TestStepFunction) => void); +export interface IDefineSupportCodeMethods { + defineParameterType: (options: IParameterTypeDefinition) => void; + defineStep: IDefineStep; + setDefaultTimeout: (milliseconds: number) => void; + setDefinitionFunctionWrapper: (fn: Function) => void; + setParallelCanAssign: (fn: ParallelAssignmentValidator) => void; + setWorldConstructor: (fn: any) => void; + After: ((code: TestCaseHookFunction) => void) & ((tags: string, code: TestCaseHookFunction) => void) & ((options: IDefineTestCaseHookOptions, code: TestCaseHookFunction) => void); + AfterStep: ((code: TestStepHookFunction) => void) & ((tags: string, code: TestStepHookFunction) => void) & ((options: IDefineTestStepHookOptions, code: TestStepHookFunction) => void); + AfterAll: ((code: TestRunHookFunction) => void) & ((options: IDefineTestRunHookOptions, code: TestRunHookFunction) => void); + Before: ((code: TestCaseHookFunction) => void) & ((tags: string, code: TestCaseHookFunction) => void) & ((options: IDefineTestCaseHookOptions, code: TestCaseHookFunction) => void); + BeforeStep: ((code: TestStepHookFunction) => void) & ((tags: string, code: TestStepHookFunction) => void) & ((options: IDefineTestStepHookOptions, code: TestStepHookFunction) => void); + BeforeAll: ((code: TestRunHookFunction) => void) & ((options: IDefineTestRunHookOptions, code: TestRunHookFunction) => void); + Given: IDefineStep; + Then: IDefineStep; + When: IDefineStep; +} +export interface ISupportCodeCoordinates { + requireModules: string[]; + requirePaths: string[]; + importPaths: string[]; + loaders: string[]; +} +export interface CanonicalSupportCodeIds { + stepDefinitionIds: string[]; + beforeTestCaseHookDefinitionIds: string[]; + afterTestCaseHookDefinitionIds: string[]; + beforeTestRunHookDefinitionIds: string[]; + afterTestRunHookDefinitionIds: string[]; +} +export interface SupportCodeLibrary { + readonly originalCoordinates: ISupportCodeCoordinates; + readonly afterTestCaseHookDefinitions: TestCaseHookDefinition[]; + readonly afterTestStepHookDefinitions: TestStepHookDefinition[]; + readonly afterTestRunHookDefinitions: TestRunHookDefinition[]; + readonly beforeTestCaseHookDefinitions: TestCaseHookDefinition[]; + readonly beforeTestStepHookDefinitions: TestStepHookDefinition[]; + readonly beforeTestRunHookDefinitions: TestRunHookDefinition[]; + readonly defaultTimeout: number; + readonly stepDefinitions: StepDefinition[]; + readonly undefinedParameterTypes: messages.UndefinedParameterType[]; + readonly parameterTypeRegistry: SourcedParameterTypeRegistry; + readonly World: any; + readonly parallelCanAssign: ParallelAssignmentValidator; +} diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.js new file mode 100644 index 00000000..11e638d1 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.js.map new file mode 100644 index 00000000..c95da1f9 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/support_code_library_builder/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as messages from '@cucumber/messages'\nimport { JsonObject } from 'type-fest'\nimport TestCaseHookDefinition from '../models/test_case_hook_definition'\nimport TestStepHookDefinition from '../models/test_step_hook_definition'\nimport TestRunHookDefinition from '../models/test_run_hook_definition'\nimport StepDefinition from '../models/step_definition'\nimport { IWorld } from './world'\nimport { SourcedParameterTypeRegistry } from './sourced_parameter_type_registry'\n\nexport type DefineStepPattern = string | RegExp\nexport type ParallelAssignmentValidator = (\n pickle: messages.Pickle,\n runningPickles: messages.Pickle[]\n) => boolean\nexport interface ITestCaseHookParameter {\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n result?: messages.TestStepResult\n error?: any\n willBeRetried?: boolean\n testCaseStartedId: string\n}\n\nexport interface ITestStepHookParameter {\n gherkinDocument: messages.GherkinDocument\n pickle: messages.Pickle\n pickleStep: messages.PickleStep\n result: messages.TestStepResult\n error?: any\n testCaseStartedId: string\n testStepId: string\n}\n\nexport type TestRunHookFunction = (this: {\n parameters: JsonObject\n}) => any | Promise\n\nexport type TestCaseHookFunction = (\n this: WorldType,\n arg: ITestCaseHookParameter\n) => any | Promise\n\nexport type TestStepHookFunction = (\n this: WorldType,\n arg: ITestStepHookParameter\n) => any | Promise\n\nexport type TestStepFunction = (\n this: WorldType,\n ...args: any[]\n) => any | Promise\n\nexport interface IDefineStepOptions {\n timeout?: number\n wrapperOptions?: any\n}\n\nexport interface IDefineTestCaseHookOptions {\n name?: string\n tags?: string\n timeout?: number\n}\n\nexport interface IDefineTestStepHookOptions {\n tags?: string\n timeout?: number\n}\n\nexport interface IDefineTestRunHookOptions {\n name?: string\n timeout?: number\n}\n\nexport interface IParameterTypeDefinition {\n name: string\n regexp: readonly RegExp[] | readonly string[] | RegExp | string\n transformer?: (...match: string[]) => T\n useForSnippets?: boolean\n preferForRegexpMatch?: boolean\n}\n\nexport type IDefineStep = ((\n pattern: DefineStepPattern,\n code: TestStepFunction\n) => void) &\n ((\n pattern: DefineStepPattern,\n options: IDefineStepOptions,\n code: TestStepFunction\n ) => void)\n\nexport interface IDefineSupportCodeMethods {\n defineParameterType: (options: IParameterTypeDefinition) => void\n defineStep: IDefineStep\n setDefaultTimeout: (milliseconds: number) => void\n setDefinitionFunctionWrapper: (fn: Function) => void\n setParallelCanAssign: (fn: ParallelAssignmentValidator) => void\n setWorldConstructor: (fn: any) => void\n After: ((code: TestCaseHookFunction) => void) &\n ((\n tags: string,\n code: TestCaseHookFunction\n ) => void) &\n ((\n options: IDefineTestCaseHookOptions,\n code: TestCaseHookFunction\n ) => void)\n AfterStep: ((\n code: TestStepHookFunction\n ) => void) &\n ((\n tags: string,\n code: TestStepHookFunction\n ) => void) &\n ((\n options: IDefineTestStepHookOptions,\n code: TestStepHookFunction\n ) => void)\n AfterAll: ((code: TestRunHookFunction) => void) &\n ((options: IDefineTestRunHookOptions, code: TestRunHookFunction) => void)\n Before: ((\n code: TestCaseHookFunction\n ) => void) &\n ((\n tags: string,\n code: TestCaseHookFunction\n ) => void) &\n ((\n options: IDefineTestCaseHookOptions,\n code: TestCaseHookFunction\n ) => void)\n BeforeStep: ((\n code: TestStepHookFunction\n ) => void) &\n ((\n tags: string,\n code: TestStepHookFunction\n ) => void) &\n ((\n options: IDefineTestStepHookOptions,\n code: TestStepHookFunction\n ) => void)\n BeforeAll: ((code: TestRunHookFunction) => void) &\n ((options: IDefineTestRunHookOptions, code: TestRunHookFunction) => void)\n Given: IDefineStep\n Then: IDefineStep\n When: IDefineStep\n}\n\nexport interface ISupportCodeCoordinates {\n requireModules: string[]\n requirePaths: string[]\n importPaths: string[]\n loaders: string[]\n}\n\nexport interface CanonicalSupportCodeIds {\n stepDefinitionIds: string[]\n beforeTestCaseHookDefinitionIds: string[]\n afterTestCaseHookDefinitionIds: string[]\n beforeTestRunHookDefinitionIds: string[]\n afterTestRunHookDefinitionIds: string[]\n}\n\nexport interface SupportCodeLibrary {\n readonly originalCoordinates: ISupportCodeCoordinates\n readonly afterTestCaseHookDefinitions: TestCaseHookDefinition[]\n readonly afterTestStepHookDefinitions: TestStepHookDefinition[]\n readonly afterTestRunHookDefinitions: TestRunHookDefinition[]\n readonly beforeTestCaseHookDefinitions: TestCaseHookDefinition[]\n readonly beforeTestStepHookDefinitions: TestStepHookDefinition[]\n readonly beforeTestRunHookDefinitions: TestRunHookDefinition[]\n readonly defaultTimeout: number\n readonly stepDefinitions: StepDefinition[]\n readonly undefinedParameterTypes: messages.UndefinedParameterType[]\n readonly parameterTypeRegistry: SourcedParameterTypeRegistry\n readonly World: any\n readonly parallelCanAssign: ParallelAssignmentValidator\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.d.ts new file mode 100644 index 00000000..740a472e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.d.ts @@ -0,0 +1,12 @@ +import { DefineStepPattern, IDefineStepOptions } from './types'; +interface IDefineStepArguments { + pattern?: DefineStepPattern; + options?: IDefineStepOptions; + code?: Function; +} +export default function validateArguments({ args, fnName, location, }: { + args?: IDefineStepArguments; + fnName: string; + location: string; +}): void; +export {}; diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.js new file mode 100644 index 00000000..4e3f3cfd --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = validateArguments; +const optionsValidation = { + expectedType: 'object or function', + predicate({ options }) { + return typeof options === 'object'; + }, +}; +const optionsTimeoutValidation = { + identifier: '"options.timeout"', + expectedType: 'integer', + predicate({ options }) { + return options.timeout == null || typeof options.timeout === 'number'; + }, +}; +const fnValidation = { + expectedType: 'function', + predicate({ code }) { + return typeof code === 'function'; + }, +}; +const validations = { + defineTestRunHook: [ + { identifier: 'first argument', ...optionsValidation }, + optionsTimeoutValidation, + { identifier: 'second argument', ...fnValidation }, + ], + defineTestCaseHook: [ + { identifier: 'first argument', ...optionsValidation }, + { + identifier: '"options.tags"', + expectedType: 'string', + predicate({ options }) { + return options.tags == null || typeof options.tags === 'string'; + }, + }, + optionsTimeoutValidation, + { identifier: 'second argument', ...fnValidation }, + ], + defineTestStepHook: [ + { identifier: 'first argument', ...optionsValidation }, + { + identifier: '"options.tags"', + expectedType: 'string', + predicate({ options }) { + return options.tags == null || typeof options.tags === 'string'; + }, + }, + optionsTimeoutValidation, + { identifier: 'second argument', ...fnValidation }, + ], + defineStep: [ + { + identifier: 'first argument', + expectedType: 'string or regular expression', + predicate({ pattern }) { + return pattern instanceof RegExp || typeof pattern === 'string'; + }, + }, + { identifier: 'second argument', ...optionsValidation }, + optionsTimeoutValidation, + { identifier: 'third argument', ...fnValidation }, + ], +}; +function validateArguments({ args, fnName, location, }) { + validations[fnName].forEach(({ identifier, expectedType, predicate }) => { + if (!predicate(args)) { + throw new Error(`${location}: Invalid ${identifier}: should be a ${expectedType}`); + } + }); +} +//# sourceMappingURL=validate_arguments.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.js.map new file mode 100644 index 00000000..292dd254 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/validate_arguments.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate_arguments.js","s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YACE,UAAU,EAAE,gBAAgB;YAC5B,YAAY,EAAE,QAAQ;YACtB,SAAS,CAAC,EAAE,OAAO,EAAE;gBACnB,OAAO,OAAO,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CAAA;YACjE,CAAC;SACF;QACD,wBAAwB;QACxB,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE;KACnD;IACD,UAAU,EAAE;QACV;YACE,UAAU,EAAE,gBAAgB;YAC5B,YAAY,EAAE,8BAA8B;YAC5C,SAAS,CAAC,EAAE,OAAO,EAAE;gBACnB,OAAO,OAAO,YAAY,MAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAA;YACjE,CAAC;SACF;QACD,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,EAAE;QACvD,wBAAwB;QACxB,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,YAAY,EAAE;KAClD;CACF,CAAA;AAED,SAAwB,iBAAiB,CAAC,EACxC,IAAI,EACJ,MAAM,EACN,QAAQ,GAKT;IACC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE;QACtE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CACb,GAAG,QAAQ,aAAa,UAAU,iBAAiB,YAAY,EAAE,CAClE,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { DefineStepPattern, IDefineStepOptions } from './types'\n\ninterface IValidation {\n identifier: string\n expectedType: string\n predicate: (args: any) => boolean\n}\n\ninterface IDefineStepArguments {\n pattern?: DefineStepPattern\n options?: IDefineStepOptions\n code?: Function\n}\n\nconst optionsValidation = {\n expectedType: 'object or function',\n predicate({ options }: IDefineStepArguments) {\n return typeof options === 'object'\n },\n}\n\nconst optionsTimeoutValidation = {\n identifier: '\"options.timeout\"',\n expectedType: 'integer',\n predicate({ options }: IDefineStepArguments) {\n return options.timeout == null || typeof options.timeout === 'number'\n },\n}\n\nconst fnValidation = {\n expectedType: 'function',\n predicate({ code }: IDefineStepArguments) {\n return typeof code === 'function'\n },\n}\n\nconst validations: Record = {\n defineTestRunHook: [\n { identifier: 'first argument', ...optionsValidation },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineTestCaseHook: [\n { identifier: 'first argument', ...optionsValidation },\n {\n identifier: '\"options.tags\"',\n expectedType: 'string',\n predicate({ options }) {\n return options.tags == null || typeof options.tags === 'string'\n },\n },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineTestStepHook: [\n { identifier: 'first argument', ...optionsValidation },\n {\n identifier: '\"options.tags\"',\n expectedType: 'string',\n predicate({ options }) {\n return options.tags == null || typeof options.tags === 'string'\n },\n },\n optionsTimeoutValidation,\n { identifier: 'second argument', ...fnValidation },\n ],\n defineStep: [\n {\n identifier: 'first argument',\n expectedType: 'string or regular expression',\n predicate({ pattern }) {\n return pattern instanceof RegExp || typeof pattern === 'string'\n },\n },\n { identifier: 'second argument', ...optionsValidation },\n optionsTimeoutValidation,\n { identifier: 'third argument', ...fnValidation },\n ],\n}\n\nexport default function validateArguments({\n args,\n fnName,\n location,\n}: {\n args?: IDefineStepArguments\n fnName: string\n location: string\n}): void {\n validations[fnName].forEach(({ identifier, expectedType, predicate }) => {\n if (!predicate(args)) {\n throw new Error(\n `${location}: Invalid ${identifier}: should be a ${expectedType}`\n )\n }\n })\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.d.ts b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.d.ts new file mode 100644 index 00000000..432ffd6d --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.d.ts @@ -0,0 +1,21 @@ +import { ICreateAttachment, ICreateLink, ICreateLog } from '../runtime/attachment_manager'; +export interface IWorldOptions { + attach: ICreateAttachment; + log: ICreateLog; + link: ICreateLink; + parameters: ParametersType; +} +export interface IWorld { + readonly attach: ICreateAttachment; + readonly log: ICreateLog; + readonly link: ICreateLink; + readonly parameters: ParametersType; + [key: string]: any; +} +export default class World implements IWorld { + readonly attach: ICreateAttachment; + readonly log: ICreateLog; + readonly link: ICreateLink; + readonly parameters: ParametersType; + constructor({ attach, log, link, parameters, }: IWorldOptions); +} diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.js b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.js new file mode 100644 index 00000000..7de9c403 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class World { + attach; + log; + link; + parameters; + constructor({ attach, log, link, parameters, }) { + this.attach = attach; + this.log = log; + this.link = link; + this.parameters = parameters; + } +} +exports.default = World; +//# sourceMappingURL=world.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.js.map b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.js.map new file mode 100644 index 00000000..f350b54e --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/support_code_library_builder/world.js.map @@ -0,0 +1 @@ +{"version":3,"file":"world.js","sourceRoot":"","sources":["../../src/support_code_library_builder/world.ts"],"names":[],"mappings":";;AAsBA,MAAqB,KAAK;IAGR,MAAM,CAAmB;IACzB,GAAG,CAAY;IACf,IAAI,CAAa;IACjB,UAAU,CAAgB;IAE1C,YAAY,EACV,MAAM,EACN,GAAG,EACH,IAAI,EACJ,UAAU,GACoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAnBD,wBAmBC","sourcesContent":["import {\n ICreateAttachment,\n ICreateLink,\n ICreateLog,\n} from '../runtime/attachment_manager'\n\nexport interface IWorldOptions {\n attach: ICreateAttachment\n log: ICreateLog\n link: ICreateLink\n parameters: ParametersType\n}\n\nexport interface IWorld {\n readonly attach: ICreateAttachment\n readonly log: ICreateLog\n readonly link: ICreateLink\n readonly parameters: ParametersType\n\n [key: string]: any\n}\n\nexport default class World\n implements IWorld\n{\n public readonly attach: ICreateAttachment\n public readonly log: ICreateLog\n public readonly link: ICreateLink\n public readonly parameters: ParametersType\n\n constructor({\n attach,\n log,\n link,\n parameters,\n }: IWorldOptions) {\n this.attach = attach\n this.log = log\n this.link = link\n this.parameters = parameters\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/time.d.ts b/node_modules/@cucumber/cucumber/lib/time.d.ts new file mode 100644 index 00000000..779ef85a --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/time.d.ts @@ -0,0 +1,16 @@ +import { performance } from 'node:perf_hooks'; +import * as messages from '@cucumber/messages'; +interface ProtectedTimingBuiltins { + clearImmediate: typeof clearImmediate; + clearInterval: typeof clearInterval; + clearTimeout: typeof clearTimeout; + Date: typeof Date; + setImmediate: typeof setImmediate; + setInterval: typeof setInterval; + setTimeout: typeof setTimeout; + performance: typeof performance; +} +declare const methods: Partial; +export declare function durationBetweenTimestamps(startedTimestamp: messages.Timestamp, finishedTimestamp: messages.Timestamp): messages.Duration; +export declare function wrapPromiseWithTimeout(promise: Promise, timeoutInMilliseconds: number, timeoutMessage?: string): Promise; +export default methods; diff --git a/node_modules/@cucumber/cucumber/lib/time.js b/node_modules/@cucumber/cucumber/lib/time.js new file mode 100644 index 00000000..b5d72d12 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/time.js @@ -0,0 +1,70 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.durationBetweenTimestamps = durationBetweenTimestamps; +exports.wrapPromiseWithTimeout = wrapPromiseWithTimeout; +const node_perf_hooks_1 = require("node:perf_hooks"); +const messages = __importStar(require("@cucumber/messages")); +const methods = { + clearInterval: clearInterval.bind(global), + clearTimeout: clearTimeout.bind(global), + Date, + setInterval: setInterval.bind(global), + setTimeout: setTimeout.bind(global), + performance: node_perf_hooks_1.performance, +}; +if (typeof setImmediate !== 'undefined') { + methods.setImmediate = setImmediate.bind(global); + methods.clearImmediate = clearImmediate.bind(global); +} +function durationBetweenTimestamps(startedTimestamp, finishedTimestamp) { + const durationMillis = messages.TimeConversion.timestampToMillisecondsSinceEpoch(finishedTimestamp) - + messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp); + return messages.TimeConversion.millisecondsToDuration(durationMillis); +} +async function wrapPromiseWithTimeout(promise, timeoutInMilliseconds, timeoutMessage = '') { + let timeoutId; + if (timeoutMessage === '') { + timeoutMessage = `Action did not complete within ${timeoutInMilliseconds} milliseconds`; + } + const timeoutPromise = new Promise((resolve, reject) => { + timeoutId = methods.setTimeout(() => { + reject(new Error(timeoutMessage)); + }, timeoutInMilliseconds); + }); + return await Promise.race([promise, timeoutPromise]).finally(() => methods.clearTimeout(timeoutId)); +} +exports.default = methods; +//# sourceMappingURL=time.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/time.js.map b/node_modules/@cucumber/cucumber/lib/time.js.map new file mode 100644 index 00000000..4aa6cc98 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/time.js.map @@ -0,0 +1 @@ +{"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,8DAUC;AAED,wDAiBC;AAzDD,qDAA6C;AAC7C,6DAA8C;AAa9C,MAAM,OAAO,GAAqC;IAChD,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;IACzC,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IACvC,IAAI;IACJ,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;IACrC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;IACnC,WAAW,EAAX,6BAAW;CACZ,CAAA;AAED,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE,CAAC;IACxC,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAChD,OAAO,CAAC,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AACtD,CAAC;AAED,SAAgB,yBAAyB,CACvC,gBAAoC,EACpC,iBAAqC;IAErC,MAAM,cAAc,GAClB,QAAQ,CAAC,cAAc,CAAC,iCAAiC,CACvD,iBAAiB,CAClB;QACD,QAAQ,CAAC,cAAc,CAAC,iCAAiC,CAAC,gBAAgB,CAAC,CAAA;IAC7E,OAAO,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAA;AACvE,CAAC;AAEM,KAAK,UAAU,sBAAsB,CAC1C,OAAmB,EACnB,qBAA6B,EAC7B,iBAAyB,EAAE;IAE3B,IAAI,SAAwC,CAAA;IAC5C,IAAI,cAAc,KAAK,EAAE,EAAE,CAAC;QAC1B,cAAc,GAAG,kCAAkC,qBAAqB,eAAe,CAAA;IACzF,CAAC;IACD,MAAM,cAAc,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxD,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE;YAClC,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;QACnC,CAAC,EAAE,qBAAqB,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAChE,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAChC,CAAA;AACH,CAAC;AAED,kBAAe,OAAO,CAAA","sourcesContent":["import { performance } from 'node:perf_hooks'\nimport * as messages from '@cucumber/messages'\n\ninterface ProtectedTimingBuiltins {\n clearImmediate: typeof clearImmediate\n clearInterval: typeof clearInterval\n clearTimeout: typeof clearTimeout\n Date: typeof Date\n setImmediate: typeof setImmediate\n setInterval: typeof setInterval\n setTimeout: typeof setTimeout\n performance: typeof performance\n}\n\nconst methods: Partial = {\n clearInterval: clearInterval.bind(global),\n clearTimeout: clearTimeout.bind(global),\n Date,\n setInterval: setInterval.bind(global),\n setTimeout: setTimeout.bind(global),\n performance,\n}\n\nif (typeof setImmediate !== 'undefined') {\n methods.setImmediate = setImmediate.bind(global)\n methods.clearImmediate = clearImmediate.bind(global)\n}\n\nexport function durationBetweenTimestamps(\n startedTimestamp: messages.Timestamp,\n finishedTimestamp: messages.Timestamp\n): messages.Duration {\n const durationMillis =\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(\n finishedTimestamp\n ) -\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp)\n return messages.TimeConversion.millisecondsToDuration(durationMillis)\n}\n\nexport async function wrapPromiseWithTimeout(\n promise: Promise,\n timeoutInMilliseconds: number,\n timeoutMessage: string = ''\n): Promise {\n let timeoutId: ReturnType\n if (timeoutMessage === '') {\n timeoutMessage = `Action did not complete within ${timeoutInMilliseconds} milliseconds`\n }\n const timeoutPromise = new Promise((resolve, reject) => {\n timeoutId = methods.setTimeout(() => {\n reject(new Error(timeoutMessage))\n }, timeoutInMilliseconds)\n })\n return await Promise.race([promise, timeoutPromise]).finally(() =>\n methods.clearTimeout(timeoutId)\n )\n}\n\nexport default methods\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/try_require.d.ts b/node_modules/@cucumber/cucumber/lib/try_require.d.ts new file mode 100644 index 00000000..6bc320ec --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/try_require.d.ts @@ -0,0 +1,7 @@ +/** + * Provides a try guarded require call that will throw a more detailed error when + * the ERR_REQUIRE_ESM error code is encountered. + * + * @param {string} path File path to require from. + */ +export default function tryRequire(path: string): any; diff --git a/node_modules/@cucumber/cucumber/lib/try_require.js b/node_modules/@cucumber/cucumber/lib/try_require.js new file mode 100644 index 00000000..213afec6 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/try_require.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = tryRequire; +/** + * Provides a try guarded require call that will throw a more detailed error when + * the ERR_REQUIRE_ESM error code is encountered. + * + * @param {string} path File path to require from. + */ +function tryRequire(path) { + try { + return require(path); // eslint-disable-line @typescript-eslint/no-require-imports + } + catch (error) { + if (error.code === 'ERR_REQUIRE_ESM') { + throw Error(`Cucumber expected a CommonJS module at '${path}' but found an ES module. + Either change the file to CommonJS syntax or use the --import directive instead of --require.`, { cause: error }); + } + else if (error.code === 'ERR_REQUIRE_ASYNC_MODULE') { + throw Error(`Cucumber expected a CommonJS module or simple ES module at '${path}' but found an async ES module. + Either change the file so it can be required or use the --import directive instead of --require.`, { cause: error }); + } + else { + throw error; + } + } +} +//# sourceMappingURL=try_require.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/try_require.js.map b/node_modules/@cucumber/cucumber/lib/try_require.js.map new file mode 100644 index 00000000..f37cf670 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/try_require.js.map @@ -0,0 +1 @@ +{"version":3,"file":"try_require.js","sourceRoot":"","sources":["../src/try_require.ts"],"names":[],"mappings":";;AAMA,6BAoBC;AA1BD;;;;;GAKG;AACH,SAAwB,UAAU,CAAC,IAAY;IAC7C,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA,CAAC,4DAA4D;IACnF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;YACrC,MAAM,KAAK,CACT,2CAA2C,IAAI;oGAC6C,EAC5F,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,0BAA0B,EAAE,CAAC;YACrD,MAAM,KAAK,CACT,+DAA+D,IAAI;uGAC4B,EAC/F,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAA;QACH,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["/**\n * Provides a try guarded require call that will throw a more detailed error when\n * the ERR_REQUIRE_ESM error code is encountered.\n *\n * @param {string} path File path to require from.\n */\nexport default function tryRequire(path: string) {\n try {\n return require(path) // eslint-disable-line @typescript-eslint/no-require-imports\n } catch (error) {\n if (error.code === 'ERR_REQUIRE_ESM') {\n throw Error(\n `Cucumber expected a CommonJS module at '${path}' but found an ES module.\n Either change the file to CommonJS syntax or use the --import directive instead of --require.`,\n { cause: error }\n )\n } else if (error.code === 'ERR_REQUIRE_ASYNC_MODULE') {\n throw Error(\n `Cucumber expected a CommonJS module or simple ES module at '${path}' but found an async ES module.\n Either change the file so it can be required or use the --import directive instead of --require.`,\n { cause: error }\n )\n } else {\n throw error\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/tsconfig.node.tsbuildinfo b/node_modules/@cucumber/cucumber/lib/tsconfig.node.tsbuildinfo new file mode 100644 index 00000000..d1c1b27b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/tsconfig.node.tsbuildinfo @@ -0,0 +1 @@ +{"root":["../src/filter_stack_trace.ts","../src/index.ts","../src/pickle_filter.ts","../src/step_arguments.ts","../src/time.ts","../src/try_require.ts","../src/uncaught_exception_manager.ts","../src/user_code_runner.ts","../src/value_checker.ts","../src/version.ts","../src/api/convert_configuration.ts","../src/api/emit_support_code_messages.ts","../src/api/formatters.ts","../src/api/gherkin.ts","../src/api/index.ts","../src/api/load_configuration.ts","../src/api/load_sources.ts","../src/api/load_support.ts","../src/api/plugins.ts","../src/api/run_cucumber.ts","../src/api/support.ts","../src/api/test_helpers.ts","../src/api/types.ts","../src/assemble/assemble_test_cases.ts","../src/assemble/index.ts","../src/assemble/types.ts","../src/cli/i18n.ts","../src/cli/index.ts","../src/cli/install_validator.ts","../src/cli/run.ts","../src/cli/validate_node_engine_version.ts","../src/configuration/argv_parser.ts","../src/configuration/check_schema.ts","../src/configuration/default_configuration.ts","../src/configuration/from_file.ts","../src/configuration/helpers.ts","../src/configuration/index.ts","../src/configuration/locate_file.ts","../src/configuration/merge_configurations.ts","../src/configuration/parse_configuration.ts","../src/configuration/split_format_descriptor.ts","../src/configuration/types.ts","../src/configuration/validate_configuration.ts","../src/environment/console_logger.ts","../src/environment/index.ts","../src/environment/make_environment.ts","../src/environment/types.ts","../src/filter/filter_plugin.ts","../src/filter/index.ts","../src/filter/order_pickles.ts","../src/filter/types.ts","../src/formatter/builder.ts","../src/formatter/create_stream.ts","../src/formatter/find_class_or_plugin.ts","../src/formatter/get_color_fns.ts","../src/formatter/import_code.ts","../src/formatter/index.ts","../src/formatter/json_formatter.ts","../src/formatter/progress_bar_formatter.ts","../src/formatter/progress_formatter.ts","../src/formatter/rerun_formatter.ts","../src/formatter/resolve_implementation.ts","../src/formatter/snippets_formatter.ts","../src/formatter/summary_formatter.ts","../src/formatter/usage_formatter.ts","../src/formatter/usage_json_formatter.ts","../src/formatter/builtin/html.ts","../src/formatter/builtin/index.ts","../src/formatter/builtin/message.ts","../src/formatter/helpers/duration_helpers.ts","../src/formatter/helpers/event_data_collector.ts","../src/formatter/helpers/formatters.ts","../src/formatter/helpers/gherkin_document_parser.ts","../src/formatter/helpers/index.ts","../src/formatter/helpers/issue_helpers.ts","../src/formatter/helpers/keyword_type.ts","../src/formatter/helpers/location_helpers.ts","../src/formatter/helpers/pickle_parser.ts","../src/formatter/helpers/step_argument_formatter.ts","../src/formatter/helpers/summary_helpers.ts","../src/formatter/helpers/test_case_attempt_formatter.ts","../src/formatter/helpers/test_case_attempt_parser.ts","../src/formatter/helpers/usage_helpers/index.ts","../src/formatter/step_definition_snippet_builder/index.ts","../src/formatter/step_definition_snippet_builder/javascript_snippet_syntax.ts","../src/formatter/step_definition_snippet_builder/snippet_syntax.ts","../src/models/data_table.ts","../src/models/definition.ts","../src/models/gherkin_step_keyword.ts","../src/models/step_definition.ts","../src/models/test_case_hook_definition.ts","../src/models/test_run_hook_definition.ts","../src/models/test_step_hook_definition.ts","../src/paths/index.ts","../src/paths/paths.ts","../src/paths/types.ts","../src/plugin/index.ts","../src/plugin/plugin_manager.ts","../src/plugin/types.ts","../src/publish/index.ts","../src/publish/publish_plugin.ts","../src/publish/types.ts","../src/runtime/coordinator.ts","../src/runtime/format_error.ts","../src/runtime/helpers.ts","../src/runtime/index.ts","../src/runtime/make_runtime.ts","../src/runtime/make_suggestion.ts","../src/runtime/step_runner.ts","../src/runtime/stopwatch.ts","../src/runtime/test_case_runner.ts","../src/runtime/types.ts","../src/runtime/worker.ts","../src/runtime/attachment_manager/index.ts","../src/runtime/parallel/adapter.ts","../src/runtime/parallel/run_worker.ts","../src/runtime/parallel/types.ts","../src/runtime/parallel/worker.ts","../src/runtime/scope/index.ts","../src/runtime/scope/make_proxy.ts","../src/runtime/scope/test_case_scope.ts","../src/runtime/scope/test_run_scope.ts","../src/runtime/serial/adapter.ts","../src/sharding/index.ts","../src/sharding/sharding_plugin.ts","../src/support_code_library_builder/build_parameter_type.ts","../src/support_code_library_builder/context.ts","../src/support_code_library_builder/get_definition_line_and_uri.ts","../src/support_code_library_builder/index.ts","../src/support_code_library_builder/parallel_can_assign_helpers.ts","../src/support_code_library_builder/sourced_parameter_type_registry.ts","../src/support_code_library_builder/types.ts","../src/support_code_library_builder/validate_arguments.ts","../src/support_code_library_builder/world.ts","../src/types/index.ts","../src/types/assertion-error-formatter/index.d.ts","../src/types/is-generator/index.d.ts","../src/types/knuth-shuffle-seeded/index.d.ts","../src/types/stack-chain/index.d.ts","../src/types/supports-color/index.d.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/types/index.d.ts b/node_modules/@cucumber/cucumber/lib/types/index.d.ts new file mode 100644 index 00000000..6385fb70 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/types/index.d.ts @@ -0,0 +1,4 @@ +export interface ILineAndUri { + line: number; + uri: string; +} diff --git a/node_modules/@cucumber/cucumber/lib/types/index.js b/node_modules/@cucumber/cucumber/lib/types/index.js new file mode 100644 index 00000000..aa219d8f --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/types/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/types/index.js.map b/node_modules/@cucumber/cucumber/lib/types/index.js.map new file mode 100644 index 00000000..f3470a85 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"","sourcesContent":["export interface ILineAndUri {\n line: number\n uri: string\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.d.ts b/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.d.ts new file mode 100644 index 00000000..6a7dbb8b --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.d.ts @@ -0,0 +1,6 @@ +import UncaughtExceptionListener = NodeJS.UncaughtExceptionListener; +declare const UncaughtExceptionManager: { + registerHandler(handler: UncaughtExceptionListener): void; + unregisterHandler(handler: UncaughtExceptionListener): void; +}; +export default UncaughtExceptionManager; diff --git a/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.js b/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.js new file mode 100644 index 00000000..cbc8db08 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const UncaughtExceptionManager = { + registerHandler(handler) { + process.addListener('uncaughtException', handler); + }, + unregisterHandler(handler) { + process.removeListener('uncaughtException', handler); + }, +}; +exports.default = UncaughtExceptionManager; +//# sourceMappingURL=uncaught_exception_manager.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.js.map b/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.js.map new file mode 100644 index 00000000..bee08805 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/uncaught_exception_manager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uncaught_exception_manager.js","sourceRoot":"","sources":["../src/uncaught_exception_manager.ts"],"names":[],"mappings":";;AAEA,MAAM,wBAAwB,GAAG;IAC/B,eAAe,CAAC,OAAkC;QAChD,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAED,iBAAiB,CAAC,OAAkC;QAClD,OAAO,CAAC,cAAc,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,wBAAwB,CAAA","sourcesContent":["import UncaughtExceptionListener = NodeJS.UncaughtExceptionListener\n\nconst UncaughtExceptionManager = {\n registerHandler(handler: UncaughtExceptionListener): void {\n process.addListener('uncaughtException', handler)\n },\n\n unregisterHandler(handler: UncaughtExceptionListener): void {\n process.removeListener('uncaughtException', handler)\n },\n}\n\nexport default UncaughtExceptionManager\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/user_code_runner.d.ts b/node_modules/@cucumber/cucumber/lib/user_code_runner.d.ts new file mode 100644 index 00000000..0edb3f31 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/user_code_runner.d.ts @@ -0,0 +1,14 @@ +export interface IRunRequest { + argsArray: any[]; + thisArg: any; + fn: Function; + timeoutInMilliseconds: number; +} +export interface IRunResponse { + error?: any; + result?: any; +} +declare const UserCodeRunner: { + run({ argsArray, thisArg, fn, timeoutInMilliseconds, }: IRunRequest): Promise; +}; +export default UserCodeRunner; diff --git a/node_modules/@cucumber/cucumber/lib/user_code_runner.js b/node_modules/@cucumber/cucumber/lib/user_code_runner.js new file mode 100644 index 00000000..51039456 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/user_code_runner.js @@ -0,0 +1,82 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_util_1 = __importDefault(require("node:util")); +const time_1 = require("./time"); +const uncaught_exception_manager_1 = __importDefault(require("./uncaught_exception_manager")); +const value_checker_1 = require("./value_checker"); +const UserCodeRunner = { + async run({ argsArray, thisArg, fn, timeoutInMilliseconds, }) { + const callbackPromise = new Promise((resolve, reject) => { + argsArray.push((error, result) => { + if ((0, value_checker_1.doesHaveValue)(error)) { + reject(error); + } + else { + resolve(result); + } + }); + }); + let fnReturn; + try { + fnReturn = fn.apply(thisArg, argsArray); + } + catch (e) { + const error = e instanceof Error ? e : node_util_1.default.format(e); + return { error }; + } + const racingPromises = []; + const callbackInterface = fn.length === argsArray.length; + const promiseInterface = (0, value_checker_1.doesHaveValue)(fnReturn) && typeof fnReturn.then === 'function'; + if (callbackInterface && promiseInterface) { + return { + error: new Error('function uses multiple asynchronous interfaces: callback and promise\n' + + 'to use the callback interface: do not return a promise\n' + + 'to use the promise interface: remove the last argument to the function'), + }; + } + else if (callbackInterface) { + racingPromises.push(callbackPromise); + } + else if (promiseInterface) { + racingPromises.push(fnReturn); + } + else { + return { result: fnReturn }; + } + let exceptionHandler; + const uncaughtExceptionPromise = new Promise((resolve, reject) => { + exceptionHandler = reject; + uncaught_exception_manager_1.default.registerHandler(exceptionHandler); + }); + racingPromises.push(uncaughtExceptionPromise); + let finalPromise = Promise.race(racingPromises); + if (timeoutInMilliseconds >= 0) { + const timeoutMessage = 'function timed out, ensure the ' + + (callbackInterface ? 'callback is executed' : 'promise resolves') + + ` within ${timeoutInMilliseconds.toString()} milliseconds`; + finalPromise = (0, time_1.wrapPromiseWithTimeout)(finalPromise, timeoutInMilliseconds, timeoutMessage); + } + let error, result; + try { + result = await finalPromise; + } + catch (e) { + if (e instanceof Error) { + error = e; + } + else if ((0, value_checker_1.doesHaveValue)(e)) { + error = node_util_1.default.format(e); + } + else { + error = new Error('Promise rejected without a reason'); + } + } + uncaught_exception_manager_1.default.unregisterHandler(exceptionHandler); + return { error, result }; + }, +}; +exports.default = UserCodeRunner; +//# sourceMappingURL=user_code_runner.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/user_code_runner.js.map b/node_modules/@cucumber/cucumber/lib/user_code_runner.js.map new file mode 100644 index 00000000..9b25ac52 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/user_code_runner.js.map @@ -0,0 +1 @@ +{"version":3,"file":"user_code_runner.js","sourceRoot":"","sources":["../src/user_code_runner.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAC5B,iCAA+C;AAC/C,8FAAmE;AACnE,mDAA+C;AAc/C,MAAM,cAAc,GAAG;IACrB,KAAK,CAAC,GAAG,CAAC,EACR,SAAS,EACT,OAAO,EACP,EAAE,EACF,qBAAqB,GACT;QACZ,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtD,SAAS,CAAC,IAAI,CAAC,CAAC,KAAY,EAAE,MAAoB,EAAE,EAAE;gBACpD,IAAI,IAAA,6BAAa,EAAC,KAAK,CAAC,EAAE,CAAC;oBACzB,MAAM,CAAC,KAAK,CAAC,CAAA;gBACf,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,CAAA;gBACjB,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAA;QACZ,IAAI,CAAC;YACH,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;QACzC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACrD,OAAO,EAAE,KAAK,EAAE,CAAA;QAClB,CAAC;QAED,MAAM,cAAc,GAAG,EAAE,CAAA;QACzB,MAAM,iBAAiB,GAAG,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,CAAA;QACxD,MAAM,gBAAgB,GACpB,IAAA,6BAAa,EAAC,QAAQ,CAAC,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,UAAU,CAAA;QAEhE,IAAI,iBAAiB,IAAI,gBAAgB,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CAAA;YACX,CAAC;iBAAM,IAAI,IAAA,6BAAa,EAAC,CAAC,CAAC,EAAE,CAAC;gBAC5B,KAAK,GAAG,mBAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACxB,CAAC;iBAAM,CAAC;gBACN,KAAK,GAAG,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;YACxD,CAAC;QACH,CAAC;QAED,oCAAwB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAA;QAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AAED,kBAAe,cAAc,CAAA","sourcesContent":["import util from 'node:util'\nimport { wrapPromiseWithTimeout } from './time'\nimport UncaughtExceptionManager from './uncaught_exception_manager'\nimport { doesHaveValue } from './value_checker'\n\nexport interface IRunRequest {\n argsArray: any[]\n thisArg: any\n fn: Function\n timeoutInMilliseconds: number\n}\n\nexport interface IRunResponse {\n error?: any\n result?: any\n}\n\nconst UserCodeRunner = {\n async run({\n argsArray,\n thisArg,\n fn,\n timeoutInMilliseconds,\n }: IRunRequest): Promise {\n const callbackPromise = new Promise((resolve, reject) => {\n argsArray.push((error: Error, result: IRunResponse) => {\n if (doesHaveValue(error)) {\n reject(error)\n } else {\n resolve(result)\n }\n })\n })\n\n let fnReturn\n try {\n fnReturn = fn.apply(thisArg, argsArray)\n } catch (e) {\n const error = e instanceof Error ? e : util.format(e)\n return { error }\n }\n\n const racingPromises = []\n const callbackInterface = fn.length === argsArray.length\n const promiseInterface =\n doesHaveValue(fnReturn) && typeof fnReturn.then === 'function'\n\n if (callbackInterface && promiseInterface) {\n return {\n error: new Error(\n 'function uses multiple asynchronous interfaces: callback and promise\\n' +\n 'to use the callback interface: do not return a promise\\n' +\n 'to use the promise interface: remove the last argument to the function'\n ),\n }\n } else if (callbackInterface) {\n racingPromises.push(callbackPromise)\n } else if (promiseInterface) {\n racingPromises.push(fnReturn)\n } else {\n return { result: fnReturn }\n }\n\n let exceptionHandler\n const uncaughtExceptionPromise = new Promise((resolve, reject) => {\n exceptionHandler = reject\n UncaughtExceptionManager.registerHandler(exceptionHandler)\n })\n racingPromises.push(uncaughtExceptionPromise)\n\n let finalPromise = Promise.race(racingPromises)\n if (timeoutInMilliseconds >= 0) {\n const timeoutMessage =\n 'function timed out, ensure the ' +\n (callbackInterface ? 'callback is executed' : 'promise resolves') +\n ` within ${timeoutInMilliseconds.toString()} milliseconds`\n finalPromise = wrapPromiseWithTimeout(\n finalPromise,\n timeoutInMilliseconds,\n timeoutMessage\n )\n }\n\n let error, result\n try {\n result = await finalPromise\n } catch (e) {\n if (e instanceof Error) {\n error = e\n } else if (doesHaveValue(e)) {\n error = util.format(e)\n } else {\n error = new Error('Promise rejected without a reason')\n }\n }\n\n UncaughtExceptionManager.unregisterHandler(exceptionHandler)\n\n return { error, result }\n },\n}\n\nexport default UserCodeRunner\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/value_checker.d.ts b/node_modules/@cucumber/cucumber/lib/value_checker.d.ts new file mode 100644 index 00000000..0d6f6f41 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/value_checker.d.ts @@ -0,0 +1,3 @@ +export declare function doesHaveValue(value: T): boolean; +export declare function doesNotHaveValue(value: T): boolean; +export declare function valueOrDefault(value: T, defaultValue: T): T; diff --git a/node_modules/@cucumber/cucumber/lib/value_checker.js b/node_modules/@cucumber/cucumber/lib/value_checker.js new file mode 100644 index 00000000..9eb9e954 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/value_checker.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.doesHaveValue = doesHaveValue; +exports.doesNotHaveValue = doesNotHaveValue; +exports.valueOrDefault = valueOrDefault; +function doesHaveValue(value) { + return !doesNotHaveValue(value); +} +function doesNotHaveValue(value) { + return value === null || value === undefined; +} +function valueOrDefault(value, defaultValue) { + if (doesHaveValue(value)) { + return value; + } + return defaultValue; +} +//# sourceMappingURL=value_checker.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/value_checker.js.map b/node_modules/@cucumber/cucumber/lib/value_checker.js.map new file mode 100644 index 00000000..9a246809 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/value_checker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"value_checker.js","sourceRoot":"","sources":["../src/value_checker.ts"],"names":[],"mappings":";;AAAA,sCAEC;AAED,4CAEC;AAED,wCAKC;AAbD,SAAgB,aAAa,CAAI,KAAQ;IACvC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAED,SAAgB,gBAAgB,CAAI,KAAQ;IAC1C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC;AAED,SAAgB,cAAc,CAAI,KAAQ,EAAE,YAAe;IACzD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC","sourcesContent":["export function doesHaveValue(value: T): boolean {\n return !doesNotHaveValue(value)\n}\n\nexport function doesNotHaveValue(value: T): boolean {\n return value === null || value === undefined\n}\n\nexport function valueOrDefault(value: T, defaultValue: T): T {\n if (doesHaveValue(value)) {\n return value\n }\n return defaultValue\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/version.d.ts b/node_modules/@cucumber/cucumber/lib/version.d.ts new file mode 100644 index 00000000..4de75ede --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/version.d.ts @@ -0,0 +1 @@ +export declare const version = "12.9.0"; diff --git a/node_modules/@cucumber/cucumber/lib/version.js b/node_modules/@cucumber/cucumber/lib/version.js new file mode 100644 index 00000000..dbb1c559 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/version.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = void 0; +// Generated by genversion. +exports.version = '12.9.0'; +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/version.js.map b/node_modules/@cucumber/cucumber/lib/version.js.map new file mode 100644 index 00000000..d92e23e7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,QAAQ,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '12.9.0'\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/cucumber/lib/wrapper.mjs b/node_modules/@cucumber/cucumber/lib/wrapper.mjs new file mode 100644 index 00000000..b9a72cf7 --- /dev/null +++ b/node_modules/@cucumber/cucumber/lib/wrapper.mjs @@ -0,0 +1,45 @@ +import cucumber from './index.js' + +export const version = cucumber.version + +export const supportCodeLibraryBuilder = cucumber.supportCodeLibraryBuilder +export const Status = cucumber.Status +export const DataTable = cucumber.DataTable +export const TestCaseHookDefinition = cucumber.TestCaseHookDefinition + +export const Formatter = cucumber.Formatter +export const FormatterBuilder = cucumber.FormatterBuilder +export const JsonFormatter = cucumber.JsonFormatter +export const ProgressFormatter = cucumber.ProgressFormatter +export const RerunFormatter = cucumber.RerunFormatter +export const SnippetsFormatter = cucumber.SnippetsFormatter +export const SummaryFormatter = cucumber.SummaryFormatter +export const UsageFormatter = cucumber.UsageFormatter +export const UsageJsonFormatter = cucumber.UsageJsonFormatter +export const formatterHelpers = cucumber.formatterHelpers + +export const After = cucumber.After +export const AfterAll = cucumber.AfterAll +export const AfterStep = cucumber.AfterStep +export const Before = cucumber.Before +export const BeforeAll = cucumber.BeforeAll +export const BeforeStep = cucumber.BeforeStep +export const defineStep = cucumber.defineStep +export const defineParameterType = cucumber.defineParameterType +export const Given = cucumber.Given +export const setDefaultTimeout = cucumber.setDefaultTimeout +export const setDefinitionFunctionWrapper = + cucumber.setDefinitionFunctionWrapper +export const setWorldConstructor = cucumber.setWorldConstructor +export const setParallelCanAssign = cucumber.setParallelCanAssign +export const Then = cucumber.Then +export const When = cucumber.When +export const World = cucumber.World +export const world = cucumber.world +export const context = cucumber.context +export const parallelCanAssignHelpers = cucumber.parallelCanAssignHelpers + +export const wrapPromiseWithTimeout = cucumber.wrapPromiseWithTimeout + +// Deprecated +export const Cli = cucumber.Cli diff --git a/node_modules/@cucumber/cucumber/package.json b/node_modules/@cucumber/cucumber/package.json new file mode 100644 index 00000000..121b8cd0 --- /dev/null +++ b/node_modules/@cucumber/cucumber/package.json @@ -0,0 +1,358 @@ +{ + "name": "@cucumber/cucumber", + "description": "The official JavaScript implementation of Cucumber.", + "keywords": [ + "testing", + "bdd", + "cucumber", + "gherkin", + "tests" + ], + "version": "12.9.0", + "funding": "https://opencollective.com/cucumber", + "homepage": "https://github.com/cucumber/cucumber-js", + "author": "Julien Biezemans ", + "contributors": [ + "Aaron Garvey", + "abelalmeida ", + "Adam Ark ", + "Ádám Gólya ", + "Ahmed Ashour (https://github.com/asashour)", + "ahulab ", + "Alexandru Gologan (https://github.com/agologan)", + "Artem Bronitsky ", + "Artem Repko ", + "Artur Kania ", + "Artur Neumann ", + "Artur Pomadowski ", + "Aslak Hellesøy ", + "Auke van Leeuwen (https://github.com/aukevanleeuwen)", + "Aurélien Reeves ", + "basemmerink ", + "Ben Van Treese ", + "Benjamín Eidelman ", + "Brian Clozel ", + "Bruce Lindsay ", + "Charles Rudolph ", + "Chris Young ", + "chrismilleruk ", + "Cody Ray Hoeft ", + "Craig Morris ", + "Dale Gardner ", + "Darrin Holst ", + "David Godfrey ", + "David Goss ", + "David H. Gutteridge ", + "Dawn Minion <35529725+dawn-minion@users.noreply.github.com>", + "dbillingham ", + "DevSide ", + "Diego Di Mauro ", + "Dmitry Shirokov ", + "Dmytro Shpakovskyi ", + "Douglas Eggleton (https://github.com/douglaseggleton)", + "Eddie Loeffen ", + "efokschaner ", + "Elwyn ", + "Fedotov Daniil ", + "Fernando Acorreia ", + "Florian Ribon ", + "Gabe Hayes ", + "Gary Taylor ", + "gforceg ", + "Giuseppe DiBella ", + "Greg Knaddison ", + "Honza Javorek ", + "Hugues Malphettes ", + "Ilya Kozhevnikov ", + "Israel Halle ", + "Izhaki ", + "Jan Molak ", + "Jan-Eric Duden ", + "Jaryk (https://github.com/Ugzuzg)", + "Jayson Smith ", + "Jeff Tian (https://github.com/Jeff-Tian)", + "Jesse Harlin ", + "João Guilherme Farias Duda ", + "Joaquín Sorianello ", + "Joey Jan ", + "John Krull ", + "John McLaughlin ", + "John Wright ", + "Johny Jose ", + "Jonathan Gomez ", + "Jonathan Kim ", + "Josh Chisholm ", + "Josh Goldberg ", + "Josua Schmid ", + "jshifflet ", + "Julian ", + "Julian ", + "Julien Biezemans ", + "Julien Gonzalez (https://github.com/customcommander)", + "Karine Pires ", + "Kārlis Amoliņš ", + "Karthik Viswanath ", + "Kevin Goslar ", + "Kevin Kirsche ", + "Kim, Jang-hwan ", + "Konstantin Epishev ", + "kostya.misura ", + "Krispin Schulz ", + "Kushal Pisavadia", + "Kyle Moore ", + "lackita (https://github.com/lackita)", + "Leonardo ", + "Long Nguyen (https://github.com/zcmgyu)", + "lopesc ", + "Lucas Cimon ", + "Ludek", + "Lukas Degener ", + "Łukasz Gandecki ", + "M.P. Korstanje ", + "mannyluvstacos ", + "Manny Pamintuan ", + "Marat Dyatko ", + "Marc Burton ", + "Marcel Hoyer ", + "Marco Muller ", + "Mark Amery ", + "Mark Stein (https://github.com/markstein)", + "Martin Delille ", + "Máté Karácsony ", + "Mateusz Derks ", + "Matt Travi (https://github.com/travi)", + "Matteo Collina ", + "Maxim Koretskiy ", + "mgonnet ", + "Michael Lloyd Morris (https://github.com/michael-lloyd-morris)", + "Michael Mathews (https://github.com/micmath)", + "Michael Zedeler ", + "Miika Hänninen ", + "Mona Ghassemi (https://github.com/BlueMona)", + "Namchee (https://github.com/Namchee)", + "nebehr ", + "Nico Jansen ", + "Niklas Närhinen ", + "Niyaz Akhmetov ", + "Noah Davis ", + "notaphplover (https://github.com/notaphplover)", + "Oliver Odo (https://github.com/olivierodo)", + "Oliver Rogers ", + "Olivier Melcher ", + "Olle Jonsson ", + "Omar Gonzalez ", + "Paul Jensen ", + "Paul Shannon (https://devpaul.com)", + "please-rewrite ", + "plocket ", + "Raphael Gaschignard (https://github.com/rtpg)", + "Renier Morales ", + "Ricardo Albuquerque (https://github.com/ricalbuquerque)", + "Rick Lee-Morlang ", + "RolandArgos ", + "Ronald Chen (https://github.com/Pyrolistical)", + "Sam Saccone ", + "Scott Deakin (https://github.com/GeekyDeaks)", + "seantdg ", + "Seb Rose ", + "Sérgio Junior ", + "Simon Dean ", + "Simon Lampen ", + "Sonny Piers ", + "Stanley Shyiko ", + "Steve Hynding (https://github.com/hynding)", + "Steve Tooke ", + "szymonprz ", + "Ted de Koning", + "temyers ", + "Tim Perry ", + "Toluwap (https://github.com/harcop)", + "Tom V ", + "Tomer Ben-Rachel ", + "Tristan Dunn ", + "Tristan Zander ", + "unknown ", + "Valerio Innocenti Sedili ", + "Vasily Shelkov ", + "vincent.capicotto ", + "vincent-psarga ", + "Warren ", + "Will Farrell ", + "yaronassa ", + "Yohan Siguret ", + "Zearin ", + "zs-zs " + ], + "repository": { + "type": "git", + "url": "git://github.com/cucumber/cucumber-js.git" + }, + "bugs": { + "email": "cukes@googlegroups.com", + "url": "https://github.com/cucumber/cucumber-js/issues" + }, + "directories": { + "lib": "./lib" + }, + "main": "./lib/index.js", + "exports": { + ".": { + "import": "./lib/wrapper.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./api": { + "import": "./lib/api/wrapper.mjs", + "require": "./lib/api/index.js", + "types": "./lib/api/index.d.ts" + }, + "./lib/*": { + "require": "./lib/*.js" + }, + "./package.json": "./package.json" + }, + "types": "./lib/index.d.ts", + "engines": { + "node": "20 || 22 || >=24" + }, + "enginesTested": { + "node": "20 || 22 || 24 || 25" + }, + "dependencies": { + "@cucumber/ci-environment": "13.0.0", + "@cucumber/cucumber-expressions": "19.0.0", + "@cucumber/gherkin": "38.0.0", + "@cucumber/gherkin-streams": "6.0.0", + "@cucumber/gherkin-utils": "11.0.0", + "@cucumber/html-formatter": "23.1.0", + "@cucumber/junit-xml-formatter": "0.13.3", + "@cucumber/message-streams": "4.1.1", + "@cucumber/messages": "32.3.1", + "@cucumber/pretty-formatter": "1.0.1", + "@cucumber/tag-expressions": "9.1.0", + "assertion-error-formatter": "^3.0.0", + "capital-case": "^1.0.4", + "chalk": "^4.1.2", + "cli-table3": "0.6.5", + "commander": "^14.0.0", + "debug": "^4.3.4", + "error-stack-parser": "^2.1.4", + "figures": "^3.2.0", + "glob": "^13.0.0", + "has-ansi": "^4.0.1", + "indent-string": "^4.0.0", + "is-installed-globally": "^0.4.0", + "is-stream": "^2.0.0", + "knuth-shuffle-seeded": "^1.0.6", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "luxon": "3.7.2", + "mkdirp": "^3.0.0", + "mz": "^2.7.0", + "progress": "^2.0.3", + "read-package-up": "^12.0.0", + "semver": "7.7.4", + "string-argv": "0.3.1", + "supports-color": "^8.1.1", + "type-fest": "^4.41.0", + "util-arity": "^1.1.0", + "yaml": "^2.2.2", + "yup": "1.7.1" + }, + "devDependencies": { + "@cucumber/compatibility-kit": "^28.0.0", + "@cucumber/query": "^15.0.1", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "^9.29.0", + "@microsoft/api-extractor": "7.58.5", + "@sinonjs/fake-timers": "15.3.2", + "@types/chai": "4.3.20", + "@types/debug": "4.1.13", + "@types/dirty-chai": "2.0.5", + "@types/express": "5.0.6", + "@types/fs-extra": "11.0.4", + "@types/has-ansi": "5.0.2", + "@types/lodash.merge": "4.6.9", + "@types/lodash.mergewith": "4.6.9", + "@types/luxon": "3.7.1", + "@types/mocha": "10.0.10", + "@types/mustache": "4.2.6", + "@types/mz": "2.7.9", + "@types/node": "^20.11.25", + "@types/progress": "2.0.7", + "@types/semver": "7.7.1", + "@types/sinon-chai": "3.2.12", + "@types/sinonjs__fake-timers": "15.0.1", + "@types/stream-buffers": "3.0.8", + "@types/tmp": "0.2.6", + "@typescript-eslint/eslint-plugin": "^8.34.0", + "@typescript-eslint/parser": "^8.34.0", + "chai": "4.5.0", + "chai-exclude": "2.1.1", + "coffeescript": "2.7.0", + "dependency-lint": "7.1.0", + "dirty-chai": "2.0.1", + "eslint": "^9.29.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^17.20.0", + "eslint-plugin-unicorn": "^63.0.0", + "express": "^5.0.0", + "fs-extra": "11.3.4", + "genversion": "3.2.0", + "mocha": "^11.0.1", + "mustache": "4.2.0", + "nyc": "18.0.0", + "prettier": "^3.5.3", + "reindent-template-literals": "1.1.0", + "shx": "0.4.0", + "sinon": "21.1.2", + "sinon-chai": "3.7.0", + "stream-to-string": "1.2.1", + "tmp": "0.2.5", + "ts-node": "10.9.2", + "tsd": "0.33.0", + "typedoc": "^0.28.0", + "typescript": "^5.8.3" + }, + "overrides": { + "ansi-regex": "^5.0.1" + }, + "scripts": { + "build-local": "genversion --es6 src/version.ts && tsc --build tsconfig.node.json && shx cp src/wrapper.mjs lib/ && shx cp src/api/wrapper.mjs lib/api/", + "cck-test": "mocha \"compatibility/**/*_spec.ts\"", + "exports-generate-docs": "typedoc", + "exports-test": "api-extractor run --config exports/api/api-extractor.json --verbose && api-extractor run --config exports/root/api-extractor.json --verbose", + "exports-update": "api-extractor run --config exports/api/api-extractor.json --verbose --local && api-extractor run --config exports/root/api-extractor.json --verbose --local", + "feature-test": "node bin/cucumber.js", + "lint-code-autofix": "eslint --fix \"{compatibility,example,features,scripts,src,test}/**/*.ts\"", + "lint-code": "eslint \"{compatibility,example,features,scripts,src,test}/**/*.ts\"", + "lint-dependencies": "dependency-lint", + "lint-format-autofix": "prettier --write .", + "lint-format": "prettier --check .", + "lint": "npm run lint-code && npm run lint-format && npm run lint-dependencies", + "preexports-generate-docs": "npm run build-local", + "preexports-test": "npm run build-local", + "preexports-update": "npm run build-local", + "prelint-autofix": "npm run build-local", + "prelint-code": "npm run build-local", + "precck-test": "npm run build-local", + "prefeature-test": "npm run build-local", + "prepublishOnly": "rm -rf lib && npm run build-local", + "pretest-coverage": "npm run build-local", + "pretypes-test": "npm run build-local", + "test-coverage": "nyc --silent mocha \"src/**/*_spec.ts\" \"compatibility/**/*_spec.ts\" && nyc --silent --no-clean node bin/cucumber.js --tags \"not @source-mapping\" && nyc report --reporter=lcov", + "test": "npm run lint && npm run exports-test && npm run types-test && npm run unit-test && npm run cck-test && npm run feature-test", + "types-test": "tsd", + "unit-test": "mocha \"src/**/*_spec.ts\"" + }, + "bin": { + "cucumber-js": "bin/cucumber.js" + }, + "license": "MIT", + "files": [ + "api/", + "bin/", + "lib/" + ] +} diff --git a/node_modules/@cucumber/gherkin-streams/.github/renovate.json b/node_modules/@cucumber/gherkin-streams/.github/renovate.json new file mode 100644 index 00000000..1975114f --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/.github/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>cucumber/renovate-config" + ] +} diff --git a/node_modules/@cucumber/gherkin-streams/.github/settings.yml b/node_modules/@cucumber/gherkin-streams/.github/settings.yml new file mode 100644 index 00000000..87a02423 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/.github/settings.yml @@ -0,0 +1,5 @@ +_extends: .github + +repository: + name: gherkin-streams + description: Stream utilities to read Gherkin parser output. diff --git a/node_modules/@cucumber/gherkin-streams/.github/workflows/release-github.yml b/node_modules/@cucumber/gherkin-streams/.github/workflows/release-github.yml new file mode 100644 index 00000000..fc8f2d0d --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/.github/workflows/release-github.yml @@ -0,0 +1,28 @@ +name: Release on github + +on: + push: + branches: + - release/* + +jobs: + + pre-release-check: + uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main + + test-javascript: + uses: ./.github/workflows/test.yml + + create-github-release: + name: Create GitHub Release and Git tag + needs: [pre-release-check, test-javascript] + runs-on: ubuntu-latest + environment: Release + permissions: + contents: write + + steps: + - uses: actions/checkout@v5 + - uses: cucumber/action-create-github-release@v1.1.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/node_modules/@cucumber/gherkin-streams/.github/workflows/release.yml b/node_modules/@cucumber/gherkin-streams/.github/workflows/release.yml new file mode 100644 index 00000000..b019bf70 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release npm module + +on: + push: + branches: + - release/* + +jobs: + pre-release-check: + uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main + + test-javascript: + uses: ./.github/workflows/test.yml + + publish-npm: + name: Publish NPM module + needs: [pre-release-check, test-javascript] + runs-on: ubuntu-latest + environment: Release + + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-node@v5 + with: + node-version: 22.x + cache: "npm" + cache-dependency-path: package-lock.json + + - run: npm install-ci-test + + - uses: cucumber/action-publish-npm@v1.1.1 + with: + npm-token: ${{ secrets.NPM_TOKEN }} diff --git a/node_modules/@cucumber/gherkin-streams/.github/workflows/test.yml b/node_modules/@cucumber/gherkin-streams/.github/workflows/test.yml new file mode 100644 index 00000000..af6a10c6 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: test-javascript + +on: + push: + branches: + - main + - renovate/** + pull_request: + branches: + - main + workflow_call: + +jobs: + test-javascript: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + node-version: ["20.x", "22.x", "24.x"] + include: + - os: windows-latest + node-version: "22.x" + - os: macos-latest + node-version: "22.x" + + steps: + - name: set git core.autocrlf to 'input' + run: git config --global core.autocrlf input + + - uses: actions/checkout@v5 + + - name: with Node.js ${{ matrix.node-version }} on ${{ matrix.os }} + uses: actions/setup-node@v5 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + cache-dependency-path: package-lock.json + + - run: npm --version + + - run: npm install-ci-test + + - run: npm run build + + - run: npm run lint diff --git a/node_modules/@cucumber/gherkin-streams/.mocharc.json b/node_modules/@cucumber/gherkin-streams/.mocharc.json new file mode 100644 index 00000000..b0833b9c --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/.mocharc.json @@ -0,0 +1,6 @@ +{ + "require": ["ts-node/register", "source-map-support/register"], + "extension": ["ts", "tsx"], + "recursive": true, + "timeout": 10000 +} diff --git a/node_modules/@cucumber/gherkin-streams/.prettierrc.json b/node_modules/@cucumber/gherkin-streams/.prettierrc.json new file mode 100644 index 00000000..b4dbbdc1 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/.prettierrc.json @@ -0,0 +1,5 @@ +{ + "trailingComma": "es5", + "singleQuote": true, + "semi": false +} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/CHANGELOG.md b/node_modules/@cucumber/gherkin-streams/CHANGELOG.md new file mode 100644 index 00000000..aa9426d9 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/CHANGELOG.md @@ -0,0 +1,74 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased] + +## [6.0.0] - 2025-09-12 +### Added +- Add support for Node.js 24.x ([#111](https://github.com/cucumber/gherkin-streams/pull/111)) + +### Removed +- Drop support for Node.js 18.x, 22.x ([#111](https://github.com/cucumber/gherkin-streams/pull/111)) + +## [5.0.1] - 2022-03-31 +### Changed +- Peer dependencies are now more permissive and simply request any version greater than: + - @cucumber/gherkin: >=22.0.0 + - @cucumber/messages: >=17.1.1 + - @cucumber/message-streams: >=4.0.0 + +## [5.0.0] - 2022-03-07 +### Changed +- `@cucumber/gherkin`, `@cucumber/messages` and `@cucumber/message-streams` are now +peer dependencies. You now have to add `@cucumber/gherkin` in your dependencies: +```diff +{ +"dependencies": { + - "@cucumber/gherkin": "22.0.0", +"@cucumber/gherkin-streams": "5.0.0", +} +} +``` +([PR#5](https://github.com/cucumber/gherkin-streams/pull/5)) + +## [4.0.0] - 2021-09-01 +### Changed +- Upgrade to `@cucumber/messages` `17.1.0` +- Upgrade to `@cucumber/gherkin` `21.0.0` + +## [3.0.0] - 2021-07-08 +### Changed +- Upgrade to `@cucumber/messages` `17.0.0` +- Upgrade to `@cucumber/gherkin` `20.0.0` + +## [2.0.2] - 2021-05-17 +### Changed +- Upgrade to `@cucumber/message-streams` `2.0.0` + +## [2.0.1] - 2021-05-17 +### Fixed +- Use `^x.y.z` version for `@cucumber/*` dependencies, allowing minor and patch releases to be picked up. + +## [2.0.0] - 2021-05-15 +### Added +- Add ability to specify a `relativeTo` path for cleaner emitted `uri`s [#1510](https://github.com/cucumber/cucumber/pull/1510) + +### Changed +- Upgrade to gherkin 19.0.0 + +## [1.0.0] - 2021-03-24 + +[Unreleased]: https://github.com/cucumber/gherkin-streams/compare/v6.0.0...HEAD +[6.0.0]: https://github.com/cucumber/gherkin-streams/compare/v5.0.1...v6.0.0 +[5.0.1]: https://github.com/cucumber/gherkin-streams/compare/v5.0.0...v5.0.1 +[5.0.0]: https://github.com/cucumber/gherkin-streams/compare/v4.0.0...v5.0.0 +[4.0.0]: https://github.com/cucumber/gherkin-streams/releases/tag/v3.0.0 +[3.0.0]: https://github.com/cucumber/gherkin-streams/releases/tag/v2.0.2 +[2.0.2]: https://github.com/cucumber/gherkin-streams/releases/tag/v2.0.1 +[2.0.1]: https://github.com/cucumber/gherkin-streams/releases/tag/v2.0.0 +[2.0.0]: https://github.com/cucumber/gherkin-streams/releases/tag/v1.0.0 +[1.0.0]: https://github.com/cucumber/gherkin-streams/releases/tag/v1.0.0 diff --git a/node_modules/@cucumber/gherkin-streams/README.md b/node_modules/@cucumber/gherkin-streams/README.md new file mode 100644 index 00000000..4b9c0c85 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/README.md @@ -0,0 +1,50 @@ +# Gherkin Streams + +This module contains utilities to use the Gherkin library with streams. + +## Installation + +`gherkin-streams` has 3 peer dependencies: `@cucumber/gherkin`, `@cucumber/messages` +and `@cucumber/message-streams`. + +You need to have `@cucumber/gherkin` and`@cucumber/message-streams` in your dependencies, +`@cucumber/messages` is actually installed automatically with `@cucumber/gherkin`. + + npm install @cucumber/gherkin-streams @cucumber/gherkin @cucumber/message-streams + +## Usage + +```javascript +const { GherkinStreams } = require('@cucumber/gherkin-streams') + +const options = { + includeSource: true, + includeGherkinDocument: true, + includePickles: true, +} +const stream = GherkinStreams.fromPaths(['features/hello.feature']) + +// Pipe the stream to another stream that can read messages. +stream.pipe(...) +``` + +### Shortening URIs with `relativeTo` + +You can include `relativeTo` option to avoid emitting longer or absolute URIs, instead making them only relative to the current working directory (or whatever makes sense for your use case): + +```javascript +const { GherkinStreams } = require('@cucumber/gherkin-streams') + +// imagine `discoverPaths()` is a function that returns absolute paths +const paths = discoverPaths(); +const options = { + includeSource: true, + includeGherkinDocument: true, + includePickles: true, + relativeTo: process.cwd() +} +const stream = GherkinStreams.fromPaths(paths) + +// Pipe the stream to another stream that can read messages. +stream.pipe(...) +``` diff --git a/node_modules/@cucumber/gherkin-streams/RELEASIN.md b/node_modules/@cucumber/gherkin-streams/RELEASIN.md new file mode 100644 index 00000000..71e0bb87 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/RELEASIN.md @@ -0,0 +1 @@ +See [.github/RELEASING](https://github.com/cucumber/.github/blob/main/RELEASING.md). diff --git a/node_modules/@cucumber/gherkin-streams/bin/gherkin b/node_modules/@cucumber/gherkin-streams/bin/gherkin new file mode 100644 index 00000000..f03cb990 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/bin/gherkin @@ -0,0 +1,4 @@ +#!/usr/bin/env node +'use strict' +require('source-map-support').install() +require('../dist/src/cli/main') diff --git a/node_modules/@cucumber/gherkin-streams/dist/package.json b/node_modules/@cucumber/gherkin-streams/dist/package.json new file mode 100644 index 00000000..51ff0737 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/package.json @@ -0,0 +1,62 @@ +{ + "name": "@cucumber/gherkin-streams", + "version": "6.0.0", + "description": "Streams for reading Gherkin parser output", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "bin": { + "gherkin-javascript": "bin/gherkin" + }, + "repository": { + "type": "git", + "url": "git://github.com/cucumber/gherkin-streams.git" + }, + "author": "Cucumber Limited ", + "license": "MIT", + "scripts": { + "test": "mocha", + "build": "tsc --build tsconfig.build.json", + "prepublishOnly": "npm run build", + "fix": "eslint --max-warnings 0 --fix src test && prettier --write src test", + "lint": "eslint --max-warnings 0 src test && prettier --check src test" + }, + "dependencies": { + "commander": "14.0.0", + "source-map-support": "0.5.21" + }, + "devDependencies": { + "@cucumber/gherkin": "^34.0.0", + "@cucumber/message-streams": "^4.0.1", + "@cucumber/messages": "^29.0.0", + "@eslint/compat": "^1.2.7", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "^9.21.0", + "@types/mocha": "10.0.10", + "@types/node": "22.18.1", + "@typescript-eslint/eslint-plugin": "^8.43.0", + "@typescript-eslint/parser": "^8.43.0", + "eslint": "^9.21.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-simple-import-sort": "^12.1.1", + "globals": "^16.0.0", + "mocha": "11.7.2", + "nyc": "17.1.0", + "prettier": "^3.5.2", + "ts-node": "^10.7.0", + "typescript": "5.9.2" + }, + "peerDependencies": { + "@cucumber/gherkin": ">=22.0.0", + "@cucumber/message-streams": ">=4.0.0", + "@cucumber/messages": ">=17.1.1" + }, + "bugs": { + "url": "https://github.com/cucumber/gherkin-streams/issues" + }, + "homepage": "https://github.com/cucumber/gherkin-streams#readme", + "directories": { + "test": "test" + }, + "keywords": [] +} diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.d.ts b/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.d.ts new file mode 100644 index 00000000..7d0bd36c --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.d.ts @@ -0,0 +1,14 @@ +import { IGherkinOptions } from '@cucumber/gherkin'; +import * as messages from '@cucumber/messages'; +import { Readable } from 'stream'; +export interface IGherkinStreamOptions extends IGherkinOptions { + relativeTo?: string; +} +declare function fromPaths(paths: readonly string[], options: IGherkinStreamOptions): Readable; +declare function fromSources(envelopes: readonly messages.Envelope[], options: IGherkinOptions): Readable; +declare const _default: { + fromPaths: typeof fromPaths; + fromSources: typeof fromSources; +}; +export default _default; +//# sourceMappingURL=GherkinStreams.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.d.ts.map b/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.d.ts.map new file mode 100644 index 00000000..8aa770aa --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GherkinStreams.d.ts","sourceRoot":"","sources":["../../src/GherkinStreams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAe,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAM9C,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,iBAAS,SAAS,CAChB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,EAAE,qBAAqB,GAC7B,QAAQ,CA8BV;AAED,iBAAS,WAAW,CAClB,SAAS,EAAE,SAAS,QAAQ,CAAC,QAAQ,EAAE,EACvC,OAAO,EAAE,eAAe,GACvB,QAAQ,CAsBV;;;;;AAED,wBAGC"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.js b/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.js new file mode 100644 index 00000000..99040def --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.js @@ -0,0 +1,65 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs_1 = __importDefault(require("fs")); +const stream_1 = require("stream"); +const makeGherkinOptions_1 = __importDefault(require("./makeGherkinOptions")); +const ParserMessageStream_1 = __importDefault(require("./ParserMessageStream")); +const SourceMessageStream_1 = __importDefault(require("./SourceMessageStream")); +function fromPaths(paths, options) { + const pathsCopy = paths.slice(); + options = (0, makeGherkinOptions_1.default)(options); + const combinedMessageStream = new stream_1.PassThrough({ + writableObjectMode: true, + readableObjectMode: true, + }); + function pipeSequentially() { + const path = pathsCopy.shift(); + if (path !== undefined) { + const parserMessageStream = new ParserMessageStream_1.default(options); + parserMessageStream.on('end', () => { + pipeSequentially(); + }); + const end = pathsCopy.length === 0; + // Can't use pipeline here because of the { end } argument, + // so we have to manually propagate errors. + fs_1.default.createReadStream(path, { encoding: 'utf-8' }) + .on('error', (err) => combinedMessageStream.emit('error', err)) + .pipe(new SourceMessageStream_1.default(path, options.relativeTo)) + .on('error', (err) => combinedMessageStream.emit('error', err)) + .pipe(parserMessageStream) + .on('error', (err) => combinedMessageStream.emit('error', err)) + .pipe(combinedMessageStream, { end }); + } + } + pipeSequentially(); + return combinedMessageStream; +} +function fromSources(envelopes, options) { + const envelopesCopy = envelopes.slice(); + options = (0, makeGherkinOptions_1.default)(options); + const combinedMessageStream = new stream_1.PassThrough({ + writableObjectMode: true, + readableObjectMode: true, + }); + function pipeSequentially() { + const envelope = envelopesCopy.shift(); + if (envelope !== undefined && envelope.source) { + const parserMessageStream = new ParserMessageStream_1.default(options); + parserMessageStream.pipe(combinedMessageStream, { + end: envelopesCopy.length === 0, + }); + parserMessageStream.on('end', pipeSequentially); + parserMessageStream.end(envelope); + } + } + pipeSequentially(); + return combinedMessageStream; +} +exports.default = { + fromPaths, + fromSources, +}; +//# sourceMappingURL=GherkinStreams.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.js.map b/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.js.map new file mode 100644 index 00000000..9e36dc16 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/GherkinStreams.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GherkinStreams.js","sourceRoot":"","sources":["../../src/GherkinStreams.ts"],"names":[],"mappings":";;;;;AAEA,4CAAmB;AACnB,mCAA8C;AAE9C,8EAAqD;AACrD,gFAAuD;AACvD,gFAAuD;AAMvD,SAAS,SAAS,CAChB,KAAwB,EACxB,OAA8B;IAE9B,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;IAC/B,OAAO,GAAG,IAAA,4BAAkB,EAAC,OAAO,CAAC,CAAA;IACrC,MAAM,qBAAqB,GAAG,IAAI,oBAAW,CAAC;QAC5C,kBAAkB,EAAE,IAAI;QACxB,kBAAkB,EAAE,IAAI;KACzB,CAAC,CAAA;IAEF,SAAS,gBAAgB;QACvB,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAE,CAAA;QAC9B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,mBAAmB,GAAG,IAAI,6BAAmB,CAAC,OAAO,CAAC,CAAA;YAC5D,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjC,gBAAgB,EAAE,CAAA;YACpB,CAAC,CAAC,CAAA;YAEF,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,KAAK,CAAC,CAAA;YAClC,2DAA2D;YAC3D,2CAA2C;YAC3C,YAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;iBAC7C,EAAE,CAAC,OAA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KAAK,EAAE,gBAAgB,CAAC,CAAA;YAC/C,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACnC,CAAC;IACH,CAAC;IACD,gBAAgB,EAAE,CAAA;IAElB,OAAO,qBAAqB,CAAA;AAC9B,CAAC;AAED,kBAAe;IACb,SAAS;IACT,WAAW;CACZ,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.d.ts b/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.d.ts new file mode 100644 index 00000000..4bbfddc4 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.d.ts @@ -0,0 +1,12 @@ +import { IGherkinOptions } from '@cucumber/gherkin'; +import * as messages from '@cucumber/messages'; +import { Transform, TransformCallback } from 'stream'; +/** + * Stream that reads Source messages and writes GherkinDocument and Pickle messages. + */ +export default class ParserMessageStream extends Transform { + private readonly options; + constructor(options: IGherkinOptions); + _transform(envelope: messages.Envelope, encoding: string, callback: TransformCallback): void; +} +//# sourceMappingURL=ParserMessageStream.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.d.ts.map b/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.d.ts.map new file mode 100644 index 00000000..12528253 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ParserMessageStream.d.ts","sourceRoot":"","sources":["../../src/ParserMessageStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAErD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,SAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,eAAe;IAI9C,UAAU,CACf,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,iBAAiB;CAe9B"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.js b/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.js new file mode 100644 index 00000000..75dbc874 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const gherkin_1 = require("@cucumber/gherkin"); +const stream_1 = require("stream"); +/** + * Stream that reads Source messages and writes GherkinDocument and Pickle messages. + */ +class ParserMessageStream extends stream_1.Transform { + constructor(options) { + super({ writableObjectMode: true, readableObjectMode: true }); + this.options = options; + } + _transform(envelope, encoding, callback) { + if (envelope.source) { + const messageList = (0, gherkin_1.generateMessages)(envelope.source.data, envelope.source.uri, envelope.source.mediaType, this.options); + for (const message of messageList) { + this.push(message); + } + } + callback(); + } +} +exports.default = ParserMessageStream; +//# sourceMappingURL=ParserMessageStream.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.js.map b/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.js.map new file mode 100644 index 00000000..c7719a34 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/ParserMessageStream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ParserMessageStream.js","sourceRoot":"","sources":["../../src/ParserMessageStream.ts"],"names":[],"mappings":";;AAAA,+CAAqE;AAErE,mCAAqD;AAErD;;GAEG;AACH,MAAqB,mBAAoB,SAAQ,kBAAS;IACxD,YAA6B,OAAwB;QACnD,KAAK,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAA;QADlC,YAAO,GAAP,OAAO,CAAiB;IAErD,CAAC;IAEM,UAAU,CACf,QAA2B,EAC3B,QAAgB,EAChB,QAA2B;QAE3B,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM,WAAW,GAAG,IAAA,0BAAgB,EAClC,QAAQ,CAAC,MAAM,CAAC,IAAI,EACpB,QAAQ,CAAC,MAAM,CAAC,GAAG,EACnB,QAAQ,CAAC,MAAM,CAAC,SAAS,EACzB,IAAI,CAAC,OAAO,CACb,CAAA;YACD,KAAK,MAAM,OAAO,IAAI,WAAW,EAAE,CAAC;gBAClC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACpB,CAAC;QACH,CAAC;QACD,QAAQ,EAAE,CAAA;IACZ,CAAC;CACF;AAvBD,sCAuBC"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.d.ts b/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.d.ts new file mode 100644 index 00000000..d83ebaaa --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.d.ts @@ -0,0 +1,13 @@ +import { Transform, TransformCallback } from 'stream'; +/** + * Stream that reads a string and writes a single Source message. + */ +export default class SourceMessageStream extends Transform { + private readonly uri; + private readonly relativeTo?; + private buffer; + constructor(uri: string, relativeTo?: string); + _transform(chunk: Buffer, encoding: string, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; +} +//# sourceMappingURL=SourceMessageStream.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.d.ts.map b/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.d.ts.map new file mode 100644 index 00000000..7918c0f3 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SourceMessageStream.d.ts","sourceRoot":"","sources":["../../src/SourceMessageStream.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAErD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,SAAS;IAItD,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAJ9B,OAAO,CAAC,MAAM,CAAkB;gBAGb,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM;IAK/B,UAAU,CACf,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,iBAAiB;IAMtB,MAAM,CAAC,QAAQ,EAAE,iBAAiB;CAS1C"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.js b/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.js new file mode 100644 index 00000000..332bcae9 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const gherkin_1 = require("@cucumber/gherkin"); +const path_1 = require("path"); +const stream_1 = require("stream"); +/** + * Stream that reads a string and writes a single Source message. + */ +class SourceMessageStream extends stream_1.Transform { + constructor(uri, relativeTo) { + super({ readableObjectMode: true, writableObjectMode: false }); + this.uri = uri; + this.relativeTo = relativeTo; + this.buffer = Buffer.alloc(0); + } + _transform(chunk, encoding, callback) { + this.buffer = Buffer.concat([this.buffer, chunk]); + callback(); + } + _flush(callback) { + const data = this.buffer.toString('utf-8'); + const chunk = (0, gherkin_1.makeSourceEnvelope)(data, this.relativeTo ? (0, path_1.relative)(this.relativeTo, this.uri) : this.uri); + this.push(chunk); + callback(); + } +} +exports.default = SourceMessageStream; +//# sourceMappingURL=SourceMessageStream.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.js.map b/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.js.map new file mode 100644 index 00000000..84fe13e1 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/SourceMessageStream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SourceMessageStream.js","sourceRoot":"","sources":["../../src/SourceMessageStream.ts"],"names":[],"mappings":";;AAAA,+CAAsD;AACtD,+BAA+B;AAC/B,mCAAqD;AAErD;;GAEG;AACH,MAAqB,mBAAoB,SAAQ,kBAAS;IAGxD,YACmB,GAAW,EACX,UAAmB;QAEpC,KAAK,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAA;QAH7C,QAAG,GAAH,GAAG,CAAQ;QACX,eAAU,GAAV,UAAU,CAAS;QAJ9B,WAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAOhC,CAAC;IAEM,UAAU,CACf,KAAa,EACb,QAAgB,EAChB,QAA2B;QAE3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;QACjD,QAAQ,EAAE,CAAA;IACZ,CAAC;IAEM,MAAM,CAAC,QAA2B;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC1C,MAAM,KAAK,GAAG,IAAA,4BAAkB,EAC9B,IAAI,EACJ,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CACjE,CAAA;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAChB,QAAQ,EAAE,CAAA;IACZ,CAAC;CACF;AA5BD,sCA4BC"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.d.ts b/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.d.ts new file mode 100644 index 00000000..371115b3 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=main.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.d.ts.map b/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.d.ts.map new file mode 100644 index 00000000..f39e3296 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/cli/main.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.js b/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.js new file mode 100644 index 00000000..c8db8a3e --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.js @@ -0,0 +1,31 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const message_streams_1 = require("@cucumber/message-streams"); +const messages_1 = require("@cucumber/messages"); +const commander_1 = require("commander"); +const package_json_1 = __importDefault(require("../../package.json")); +const GherkinStreams_1 = __importDefault(require("../GherkinStreams")); +const program = new commander_1.Command(); +program.version(package_json_1.default.version); +program.option('--no-source', 'Do not output Source messages'); +program.option('--no-ast', 'Do not output GherkinDocument messages'); +program.option('--no-pickles', 'Do not output Pickle messages'); +program.option('--predictable-ids', 'Use predictable ids', false); +program.parse(process.argv); +const paths = program.args; +const options = { + defaultDialect: 'en', + includeSource: program.opts().source, + includeGherkinDocument: program.opts().ast, + includePickles: program.opts().pickles, + newId: program.opts().predictableIds + ? messages_1.IdGenerator.incrementing() + : messages_1.IdGenerator.uuid(), +}; +GherkinStreams_1.default.fromPaths(paths, options) + .pipe(new message_streams_1.MessageToNdjsonStream()) + .pipe(process.stdout); +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.js.map b/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.js.map new file mode 100644 index 00000000..12c4ffd5 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/cli/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/cli/main.ts"],"names":[],"mappings":";;;;;AACA,+DAAiE;AACjE,iDAAgD;AAChD,yCAAmC;AAEnC,sEAA4C;AAC5C,uEAA8C;AAE9C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAA;AAC7B,OAAO,CAAC,OAAO,CAAC,sBAAW,CAAC,OAAO,CAAC,CAAA;AACpC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,+BAA+B,CAAC,CAAA;AAC9D,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,wCAAwC,CAAC,CAAA;AACpE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,+BAA+B,CAAC,CAAA;AAC/D,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAA;AACjE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAA;AAE1B,MAAM,OAAO,GAAoB;IAC/B,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM;IACpC,sBAAsB,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG;IAC1C,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO;IACtC,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,cAAc;QAClC,CAAC,CAAC,sBAAW,CAAC,YAAY,EAAE;QAC5B,CAAC,CAAC,sBAAW,CAAC,IAAI,EAAE;CACvB,CAAA;AAED,wBAAc,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;KACrC,IAAI,CAAC,IAAI,uCAAqB,EAAE,CAAC;KACjC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/index.d.ts b/node_modules/@cucumber/gherkin-streams/dist/src/index.d.ts new file mode 100644 index 00000000..bee0c0c4 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/index.d.ts @@ -0,0 +1,3 @@ +import GherkinStreams, { IGherkinStreamOptions } from './GherkinStreams'; +export { GherkinStreams, IGherkinStreamOptions }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/index.d.ts.map b/node_modules/@cucumber/gherkin-streams/dist/src/index.d.ts.map new file mode 100644 index 00000000..d3151268 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,EAAE,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAExE,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/index.js b/node_modules/@cucumber/gherkin-streams/dist/src/index.js new file mode 100644 index 00000000..39256a3c --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/index.js @@ -0,0 +1,9 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GherkinStreams = void 0; +const GherkinStreams_1 = __importDefault(require("./GherkinStreams")); +exports.GherkinStreams = GherkinStreams_1.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/index.js.map b/node_modules/@cucumber/gherkin-streams/dist/src/index.js.map new file mode 100644 index 00000000..a75b4f2d --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAwE;AAE/D,yBAFF,wBAAc,CAEE"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.d.ts b/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.d.ts new file mode 100644 index 00000000..d8c4795a --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.d.ts @@ -0,0 +1,3 @@ +import { IGherkinOptions } from '@cucumber/gherkin'; +export default function gherkinOptions(options: IGherkinOptions): IGherkinOptions; +//# sourceMappingURL=makeGherkinOptions.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.d.ts.map b/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.d.ts.map new file mode 100644 index 00000000..adff1f88 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"makeGherkinOptions.d.ts","sourceRoot":"","sources":["../../src/makeGherkinOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAWnD,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,eAAe,GACvB,eAAe,CAEjB"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.js b/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.js new file mode 100644 index 00000000..cd0e3ecb --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = gherkinOptions; +const messages_1 = require("@cucumber/messages"); +const defaultOptions = { + defaultDialect: 'en', + includeSource: true, + includeGherkinDocument: true, + includePickles: true, + newId: messages_1.IdGenerator.uuid(), +}; +function gherkinOptions(options) { + return Object.assign(Object.assign({}, defaultOptions), options); +} +//# sourceMappingURL=makeGherkinOptions.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.js.map b/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.js.map new file mode 100644 index 00000000..2768edb7 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/src/makeGherkinOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"makeGherkinOptions.js","sourceRoot":"","sources":["../../src/makeGherkinOptions.ts"],"names":[],"mappings":";;AAWA,iCAIC;AAdD,iDAAgD;AAEhD,MAAM,cAAc,GAAoB;IACtC,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;IACnB,sBAAsB,EAAE,IAAI;IAC5B,cAAc,EAAE,IAAI;IACpB,KAAK,EAAE,sBAAW,CAAC,IAAI,EAAE;CAC1B,CAAA;AAED,SAAwB,cAAc,CACpC,OAAwB;IAExB,uCAAY,cAAc,GAAK,OAAO,EAAE;AAC1C,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.d.ts b/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.d.ts new file mode 100644 index 00000000..9434fdb6 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=StreamTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.d.ts.map b/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.d.ts.map new file mode 100644 index 00000000..155e0247 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StreamTest.d.ts","sourceRoot":"","sources":["../../test/StreamTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.js b/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.js new file mode 100644 index 00000000..49d72137 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.js @@ -0,0 +1,68 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const gherkin_1 = require("@cucumber/gherkin"); +const assert_1 = __importDefault(require("assert")); +const src_1 = require("../src"); +const defaultOptions = {}; +describe('gherkin', () => { + it('parses gherkin from the file system', () => __awaiter(void 0, void 0, void 0, function* () { + const envelopes = yield streamToArray(src_1.GherkinStreams.fromPaths(['testdata/good/minimal.feature'], defaultOptions)); + assert_1.default.strictEqual(envelopes.length, 3); + assert_1.default.strictEqual(envelopes[0].source.uri, 'testdata/good/minimal.feature'); + assert_1.default.strictEqual(envelopes[1].gherkinDocument.uri, 'testdata/good/minimal.feature'); + assert_1.default.strictEqual(envelopes[2].pickle.uri, 'testdata/good/minimal.feature'); + })); + it('throws an error when the path is a directory', () => __awaiter(void 0, void 0, void 0, function* () { + assert_1.default.rejects(() => __awaiter(void 0, void 0, void 0, function* () { return streamToArray(src_1.GherkinStreams.fromPaths(['testdata/good'], defaultOptions)); })); + })); + it('emits uris relative to a given path', () => __awaiter(void 0, void 0, void 0, function* () { + const envelopes = yield streamToArray(src_1.GherkinStreams.fromPaths(['testdata/good/minimal.feature'], Object.assign(Object.assign({}, defaultOptions), { relativeTo: 'testdata/good' }))); + assert_1.default.strictEqual(envelopes.length, 3); + assert_1.default.strictEqual(envelopes[0].source.uri, 'minimal.feature'); + assert_1.default.strictEqual(envelopes[1].gherkinDocument.uri, 'minimal.feature'); + assert_1.default.strictEqual(envelopes[2].pickle.uri, 'minimal.feature'); + })); + it('parses gherkin from STDIN', () => __awaiter(void 0, void 0, void 0, function* () { + const source = (0, gherkin_1.makeSourceEnvelope)(`Feature: Minimal + + Scenario: minimalistic + Given the minimalism +`, 'test.feature'); + const envelopes = yield streamToArray(src_1.GherkinStreams.fromSources([source], defaultOptions)); + assert_1.default.strictEqual(envelopes.length, 3); + })); + it('parses gherkin using the provided default language', () => __awaiter(void 0, void 0, void 0, function* () { + const source = (0, gherkin_1.makeSourceEnvelope)(`Fonctionnalité: i18n support + Scénario: Support des caractères spéciaux + Soit un exemple de scénario en français +`, 'test.feature'); + const envelopes = yield streamToArray(src_1.GherkinStreams.fromSources([source], { defaultDialect: 'fr' })); + assert_1.default.strictEqual(envelopes.length, 3); + })); + it('outputs dialects', () => __awaiter(void 0, void 0, void 0, function* () { + assert_1.default.strictEqual(gherkin_1.dialects.en.name, 'English'); + })); +}); +function streamToArray(readableStream) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + const items = []; + readableStream.on('data', items.push.bind(items)); + readableStream.on('error', (err) => reject(err)); + readableStream.on('end', () => resolve(items)); + }); + }); +} +//# sourceMappingURL=StreamTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.js.map b/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.js.map new file mode 100644 index 00000000..dce5d412 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/test/StreamTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StreamTest.js","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A,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,SAAe,aAAa,CAC1B,cAAwB;;QAExB,OAAO,IAAI,OAAO,CAChB,CACE,OAAgD,EAChD,MAA4B,EAC5B,EAAE;YACF,MAAM,KAAK,GAAwB,EAAE,CAAA;YACrC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;YACjD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAU,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;YACvD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;QAChD,CAAC,CACF,CAAA;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/dist/tsconfig.build.tsbuildinfo b/node_modules/@cucumber/gherkin-streams/dist/tsconfig.build.tsbuildinfo new file mode 100644 index 00000000..e1635798 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/dist/tsconfig.build.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/reflect-metadata/index.d.ts","../node_modules/@cucumber/gherkin/node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts","../node_modules/@cucumber/gherkin/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts","../node_modules/@cucumber/gherkin/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts","../node_modules/@cucumber/gherkin/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts","../node_modules/@cucumber/gherkin/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts","../node_modules/@cucumber/gherkin/node_modules/@cucumber/messages/dist/cjs/src/version.d.ts","../node_modules/@cucumber/gherkin/node_modules/@cucumber/messages/dist/cjs/src/index.d.ts","../node_modules/@cucumber/gherkin/dist/src/IGherkinOptions.d.ts","../node_modules/@cucumber/gherkin/dist/src/generateMessages.d.ts","../node_modules/@cucumber/gherkin/dist/src/makeSourceEnvelope.d.ts","../node_modules/@cucumber/gherkin/dist/src/Dialect.d.ts","../node_modules/@cucumber/gherkin/dist/src/IToken.d.ts","../node_modules/@cucumber/gherkin/dist/src/ITokenMatcher.d.ts","../node_modules/@cucumber/gherkin/dist/src/GherkinLine.d.ts","../node_modules/@cucumber/gherkin/dist/src/IAstBuilder.d.ts","../node_modules/@cucumber/gherkin/dist/src/Parser.d.ts","../node_modules/@cucumber/gherkin/dist/src/AstNode.d.ts","../node_modules/@cucumber/gherkin/dist/src/AstBuilder.d.ts","../node_modules/@cucumber/gherkin/dist/src/TokenScanner.d.ts","../node_modules/@cucumber/gherkin/dist/src/Errors.d.ts","../node_modules/@cucumber/gherkin/dist/src/pickles/compile.d.ts","../node_modules/@cucumber/gherkin/dist/src/GherkinClassicTokenMatcher.d.ts","../node_modules/@cucumber/gherkin/dist/src/GherkinInMarkdownTokenMatcher.d.ts","../node_modules/@cucumber/gherkin/dist/src/index.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/version.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/index.d.ts","../src/makeGherkinOptions.ts","../src/ParserMessageStream.ts","../src/SourceMessageStream.ts","../src/GherkinStreams.ts","../src/index.ts","../node_modules/@types/node/compatibility/disposable.d.ts","../node_modules/@types/node/compatibility/indexable.d.ts","../node_modules/@types/node/compatibility/iterators.d.ts","../node_modules/@types/node/compatibility/index.d.ts","../node_modules/@types/node/globals.typedarray.d.ts","../node_modules/@types/node/buffer.buffer.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/web-globals/abortcontroller.d.ts","../node_modules/@types/node/web-globals/domexception.d.ts","../node_modules/@types/node/web-globals/events.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/env-http-proxy-agent.d.ts","../node_modules/undici-types/retry-handler.d.ts","../node_modules/undici-types/retry-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/util.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/eventsource.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/web-globals/fetch.d.ts","../node_modules/@types/node/web-globals/navigator.d.ts","../node_modules/@types/node/web-globals/storage.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/sea.d.ts","../node_modules/@types/node/sqlite.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@cucumber/message-streams/dist/cjs/src/MessageToNdjsonStream.d.ts","../node_modules/@cucumber/message-streams/dist/cjs/src/NdjsonToMessageStream.d.ts","../node_modules/@cucumber/message-streams/dist/cjs/src/index.d.ts","../node_modules/commander/typings/index.d.ts","../package.json","../src/cli/main.ts","../test/StreamTest.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/uuid/index.d.ts"],"fileIdsList":[[54,59,62,63,64,89,137],[59,63,89,137],[89,137],[54,89,137],[54,59,60,63,89,137],[54,60,63,89,137],[59,89,137],[54,59,89,137],[54,59,60,61,62,89,137],[54,55,89,137],[55,56,57,58,63,65,66,67,68,69,70,89,137],[48,89,137],[48,49,50,51,52,53,89,137],[47,89,137],[78,89,137,168,186],[89,137,187,188],[72,89,137],[72,73,74,75,76,77,89,137],[89,134,137],[89,136,137],[137],[89,137,142,171],[89,137,138,143,148,156,168,179],[89,137,138,139,148,156],[84,85,86,89,137],[89,137,140,180],[89,137,141,142,149,157],[89,137,142,168,176],[89,137,143,145,148,156],[89,136,137,144],[89,137,145,146],[89,137,147,148],[89,136,137,148],[89,137,148,149,150,168,179],[89,137,148,149,150,163,168,171],[89,130,137,145,148,151,156,168,179],[89,137,148,149,151,152,156,168,176,179],[89,137,151,153,168,176,179],[87,88,89,90,91,92,93,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185],[89,137,148,154],[89,137,155,179],[89,137,145,148,156,168],[89,137,157],[89,137,158],[89,136,137,159],[89,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185],[89,137,161],[89,137,162],[89,137,148,163,164],[89,137,163,165,180,182],[89,137,148,168,169,171],[89,137,170,171],[89,137,168,169],[89,137,171],[89,137,172],[89,134,137,168,173],[89,137,148,174,175],[89,137,174,175],[89,137,142,156,168,176],[89,137,177],[89,137,156,178],[89,137,151,162,179],[89,137,142,180],[89,137,168,181],[89,137,155,182],[89,137,183],[89,130,137],[89,137,148,150,159,168,171,179,181,182,184],[89,137,168,185],[89,102,106,137,179],[89,102,137,168,179],[89,97,137],[89,99,102,137,176,179],[89,137,156,176],[89,137,186],[89,97,137,186],[89,99,102,137,156,179],[89,94,95,98,101,137,148,168,179],[89,102,109,137],[89,94,100,137],[89,102,123,124,137],[89,98,102,137,171,179,186],[89,123,137,186],[89,96,97,137,186],[89,102,137],[89,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,124,125,126,127,128,129,137],[89,102,117,137],[89,102,109,110,137],[89,100,102,110,111,137],[89,101,137],[89,94,97,102,137],[89,102,106,110,111,137],[89,106,137],[89,100,102,105,137,179],[89,94,99,102,109,137],[89,137,168],[89,97,102,123,137,184,186],[71,78,79,80,81,89,137,149,168],[71,78,89,137,168],[71,89,137,158,168],[71,78,82,89,137,189,190,191],[82,89,137],[71,78,89,137],[71,78,83,89,134,137,168]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true,"impliedFormat":1},{"version":"935811369c7018772fd8ab4f904b0f07d22920a5cb74c254b03f3cdb6968dd75","impliedFormat":1},{"version":"d9f4ec5156491a24eee340452d7e87e432512d5ebde23fe18c2ceb5a31c1720b","impliedFormat":1},{"version":"44716259b743dacde932f7f1922ac85f533af74e3ed82a078ba505414f6f6b53","impliedFormat":1},{"version":"653dc417862cf079d590653212a8d48ace7c89ff7b73c239791099afc25dca96","impliedFormat":1},{"version":"497efde09001124a1bfab8ea16409b6908fe8a49ae8d5d69082910838150fbfd","impliedFormat":1},{"version":"9d7424de16fc06f2c76b4aa27394d5f7f80a7933122120c3c5b115baf18fd9b4","impliedFormat":1},{"version":"5ed925f9d0dfcb0fde32518c7ae42f88461fd8eabb015a35183fac5ce95bbc6c","impliedFormat":1},{"version":"c889230d56462fe05b70ab6fd53acdef388c4ccc473cf90f4cb32ecd2b962b4d","impliedFormat":1},{"version":"28993cc461214aae66c110c1cf28fc8077fe8f05057049337ac72f5a7c98fca5","impliedFormat":1},{"version":"506bb887b7df4ffad6f6fa63d24411619e0a03b7665683ec3d3a4973063886e6","impliedFormat":1},{"version":"afbea638922aaca9d9cc8b65a02a520c7454229903871fbb04e2a348bf836828","impliedFormat":1},{"version":"b7f1672ce9af85034cdb8c5b04dcedd6c0452c96eba0571c096298aaeedfdff5","impliedFormat":1},{"version":"d2f5dc88e221ccdfe47023e718cb4ceaffd20feb86fb9e13b05820e2b0f85c56","impliedFormat":1},{"version":"cd2a5f46beacf5c57cef4fe0da2d794187be79bf748e94c641b190d69cebe132","impliedFormat":1},{"version":"18719ba62b0021a65fe4b5cd42e158faa6b41c0da08adb3325c9d9a18f35bab7","impliedFormat":1},{"version":"1683703acf57f406b362f5bb60a3478b38270966d045c1f9ded2748e5a4d574a","impliedFormat":1},{"version":"489b692d9023b2e840ce27625d3f20d60bd170db210fb0b82d8e297b85d43819","impliedFormat":1},{"version":"17af13f4f5416e01af722b89816c7a44a1e5b1c4c05decabc498c382b9ef5e03","impliedFormat":1},{"version":"2ec2927513bae24e1cde365bac84039ed143c4459431d626515ffef83417f1e4","impliedFormat":1},{"version":"8219ac333bd9febd8967d0a4c7e4913dc22761f5adbb154b1a9cc56356d2ac49","impliedFormat":1},{"version":"bbf12932d8dd583fe79ef95796e43e9d4fb12e34c5e4e40b698adb635a7ea6cc","impliedFormat":1},{"version":"5e76dd5c9f1030abb47b45638f31b795b4ec415eaadfbee6e83677e538814ac9","impliedFormat":1},{"version":"06a17bb1e15c642821467026b33933540ccba1250c42941ee96017e700de4663","impliedFormat":1},{"version":"0dc7806e087842cd9634419c63fa8f31c08a2bcdb47f7a06ed303ada9c7d685e","impliedFormat":1},{"version":"79a2c87885335374cb777e1f91677d0825d16afe4fda35b4df5ea99560929676","impliedFormat":1},{"version":"d9f4ec5156491a24eee340452d7e87e432512d5ebde23fe18c2ceb5a31c1720b","impliedFormat":1},{"version":"44716259b743dacde932f7f1922ac85f533af74e3ed82a078ba505414f6f6b53","impliedFormat":1},{"version":"653dc417862cf079d590653212a8d48ace7c89ff7b73c239791099afc25dca96","impliedFormat":1},{"version":"497efde09001124a1bfab8ea16409b6908fe8a49ae8d5d69082910838150fbfd","impliedFormat":1},{"version":"d428ae549f714c7e4ad9a3c2b4929d6e6f96176d11d6535c614d4a9927612d28","impliedFormat":1},{"version":"5ed925f9d0dfcb0fde32518c7ae42f88461fd8eabb015a35183fac5ce95bbc6c","impliedFormat":1},{"version":"7db9c81c16018e103ef20023e5f369f861f74a83fdbe17feefb23a0a9ae5439c","signature":"b7858b9fded3b1f7f706f48f3f0db792ee9c477b86926163bb5be9a683030426"},{"version":"9685a11d8f38478f85c899f5d27bc26f9f36336b8ae3b938a64fe39a26a6b2b5","signature":"5723558c796773cf44f1c65f3abf64d6aede7462ac5b2dc8b12a579e3163cdf6"},{"version":"614c2c87ded5814a4202a1d66ac9e25014da483e77d1199ae7fdd479b3b9408b","signature":"c859174831bac13c0e7e1c36039110728dfafccd6a275af194ff9132967e9ec8"},{"version":"05d6a5c1fc6bfb5f55b95cb15338bd412d5729286b5c9f3489027daea543349d","signature":"4ce1c827b3ee552d549c8ed1507a60a3d3c1cd2aaba114e8a335f034484e7dc9"},{"version":"99adb65fb1c5a83d3935a92dec1edc150de1ec617618aea823c29ed22f5d4382","signature":"6b58a277793c4ad8547cd9716e41fd0030f7a302e250fc8d2a1fba2b5e0bc2ae"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"d802f0e6b5188646d307f070d83512e8eb94651858de8a82d1e47f60fb6da4e2","affectsGlobalScope":true,"impliedFormat":1},{"version":"17bb4105d0ea2ab2bfcb4f77ff8585691d5569c90ae15f4fa8d5ff9fb42b910b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"456fa0c0ab68731564917642b977c71c3b7682240685b118652fb9253c9a6429","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"a38efe83ff77c34e0f418a806a01ca3910c02ee7d64212a59d59bca6c2c38fa1","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"7b988bc259155186e6b09dd8b32856d9e45c8d261e63c19abaf590bb6550f922","affectsGlobalScope":true,"impliedFormat":1},{"version":"fe7b52f993f9336b595190f3c1fcc259bb2cf6dcb4ac8fdb1e0454cc5df7301e","impliedFormat":1},{"version":"e9b97d69510658d2f4199b7d384326b7c4053b9e6645f5c19e1c2a54ede427fc","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"81711af669f63d43ccb4c08e15beda796656dd46673d0def001c7055db53852d","affectsGlobalScope":true,"impliedFormat":1},{"version":"19d5f8d3930e9f99aa2c36258bf95abbe5adf7e889e6181872d1cdba7c9a7dd5","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"bdba81959361810be44bcfdd283f4d601e406ab5ad1d2bdff0ed480cf983c9d7","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"b326f4813b90d230ec3950f66bd5b5ce3971aac5fac67cfafc54aa07b39fd07f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c8420c7c2b778b334587a4c0311833b5212ff2f684ea37b2f0e2b117f1d7210d","impliedFormat":1},{"version":"b6b08215821c9833b0e8e30ea1ed178009f2f3ff5d7fae3865ee42f97cc87784","impliedFormat":1},{"version":"b795c3e47a26be91ac33d8115acdc37bfa41ecc701fb237c64a23da4d2b7e1d8","impliedFormat":1},{"version":"73cf6cc19f16c0191e4e9d497ab0c11c7b38f1ca3f01ad0f09a3a5a971aac4b8","impliedFormat":1},{"version":"528b62e4272e3ddfb50e8eed9e359dedea0a4d171c3eb8f337f4892aac37b24b","impliedFormat":1},{"version":"ed58b9974bb3114f39806c9c2c6258c4ffa6a255921976a7c53dfa94bf178f42","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"f72bc8fe16da67e4e3268599295797b202b95e54bd215a03f97e925dd1502a36","impliedFormat":1},{"version":"b1b6ee0d012aeebe11d776a155d8979730440082797695fc8e2a5c326285678f","impliedFormat":1},{"version":"45875bcae57270aeb3ebc73a5e3fb4c7b9d91d6b045f107c1d8513c28ece71c0","impliedFormat":1},{"version":"915e18c559321c0afaa8d34674d3eb77e1ded12c3e85bf2a9891ec48b07a1ca5","affectsGlobalScope":true,"impliedFormat":1},{"version":"e9727a118ce60808e62457c89762fe5a4e2be8e9fd0112d12432d1bafdba942f","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"70b57b5529051497e9f6482b76d91c0dcbb103d9ead8a0549f5bab8f65e5d031","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"3a90b9beac4c2bfdf6517faae0940a042b81652badf747df0a7c7593456f6ebe","impliedFormat":1},{"version":"8302157cd431b3943eed09ad439b4441826c673d9f870dcb0e1f48e891a4211e","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"125d792ec6c0c0f657d758055c494301cc5fdb327d9d9d5960b3f129aff76093","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"2754d8221d77c7b382096651925eb476f1066b3348da4b73fe71ced7801edada","impliedFormat":1},{"version":"a5890565ed564c7b29eb1b1038d4e10c03a3f5231b0a8d48fea4b41ab19f4f46","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"98ffdf93dfdd206516971d28e3e473f417a5cfd41172e46b4ce45008f640588e","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"cee74f5970ffc01041e5bffc3f324c20450534af4054d2c043cb49dbbd4ec8f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"1a654e0d950353614ba4637a8de4f9d367903a0692b748e11fccf8c880c99735","affectsGlobalScope":true,"impliedFormat":1},{"version":"42da246c46ca3fd421b6fd88bb4466cda7137cf33e87ba5ceeded30219c428bd","impliedFormat":1},{"version":"3a051941721a7f905544732b0eb819c8d88333a96576b13af08b82c4f17581e4","impliedFormat":1},{"version":"ac5ed35e649cdd8143131964336ab9076937fa91802ec760b3ea63b59175c10a","impliedFormat":1},{"version":"f2feb9696208311cdcf1936df2b7cbec96a3f0ab9d403952bf170546d4253a90","affectsGlobalScope":true,"impliedFormat":1},{"version":"db3d77167a7da6c5ba0c51c5b654820e3464093f21724ccd774c0b9bc3f81bc0","impliedFormat":1},{"version":"d9b6fd8640f6ad3f13ce9ce47d91061a698cf7763fed7f668e4f89709989aae5","impliedFormat":1},{"version":"429520b04f37103b6679c58549cec683402da8c18fbc0e3963d8a55e43138350","impliedFormat":1},{"version":"72810281e445fc86709330305b0d66a6a82d992d062c75d839a01a98888390a6","impliedFormat":1},{"version":"8a2fe38797fbf3eb75d872133872ec9a3c09bda7a3f3a5b7084d77899411b11c","impliedFormat":1},{"version":"1a2ae3df505891912038749a39e434643cf1f91a578475ae049f36e35c870c58","impliedFormat":1},"eddcfc9bcd244626e7f87e7717c844deb3e040c88ce19ccd10debfc8cc280142",{"version":"49bf8a1e108ccdc5166207e6711c06c13b8bdb51d0a649f22b90d4eb09b1ece7","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"67dd9582c2aa54891d78df04ca4dbbc40b1223631329ac978b5eb378eb9bb940","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1},{"version":"f874ea4d0091b0a44362a5f74d26caab2e66dec306c2bf7e8965f5106e784c3b","impliedFormat":1}],"root":[[79,83],[191,193]],"options":{"allowJs":false,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitAny":true,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":false,"target":2},"referencedMap":[[65,1],[64,2],[58,3],[67,4],[69,5],[70,6],[61,7],[62,8],[55,4],[59,4],[60,8],[63,9],[66,8],[56,10],[71,11],[57,4],[68,4],[50,3],[49,12],[52,12],[54,13],[48,14],[51,12],[53,3],[187,15],[188,15],[189,16],[74,3],[73,17],[76,17],[78,18],[72,14],[75,17],[77,3],[194,3],[195,3],[196,3],[197,3],[134,19],[135,19],[136,20],[89,21],[137,22],[138,23],[139,24],[84,3],[87,25],[85,3],[86,3],[140,26],[141,27],[142,28],[143,29],[144,30],[145,31],[146,31],[147,32],[148,33],[149,34],[150,35],[90,3],[88,3],[151,36],[152,37],[153,38],[186,39],[154,40],[155,41],[156,42],[157,43],[158,44],[159,45],[160,46],[161,47],[162,48],[163,49],[164,49],[165,50],[166,3],[167,3],[168,51],[170,52],[169,53],[171,54],[172,55],[173,56],[174,57],[175,58],[176,59],[177,60],[178,61],[179,62],[180,63],[181,64],[182,65],[183,66],[91,3],[92,3],[93,3],[131,67],[132,3],[133,3],[184,68],[185,69],[198,3],[190,3],[47,3],[45,3],[46,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[19,3],[20,3],[4,3],[21,3],[25,3],[22,3],[23,3],[24,3],[26,3],[27,3],[28,3],[5,3],[29,3],[30,3],[31,3],[32,3],[6,3],[36,3],[33,3],[34,3],[35,3],[37,3],[7,3],[38,3],[43,3],[44,3],[39,3],[40,3],[41,3],[42,3],[1,3],[109,70],[119,71],[108,70],[129,72],[100,73],[99,74],[128,75],[122,76],[127,77],[102,78],[116,79],[101,80],[125,81],[97,82],[96,75],[126,83],[98,84],[103,85],[104,3],[107,85],[94,3],[130,86],[120,87],[111,88],[112,89],[114,90],[110,91],[113,92],[123,75],[105,93],[106,94],[115,95],[95,96],[118,87],[117,85],[121,3],[124,97],[191,3],[82,98],[80,99],[81,100],[192,101],[83,102],[79,103],[193,104]],"latestChangedDtsFile":"./test/StreamTest.d.ts","version":"5.9.2"} \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/eslint.config.mjs b/node_modules/@cucumber/gherkin-streams/eslint.config.mjs new file mode 100644 index 00000000..249bbd32 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/eslint.config.mjs @@ -0,0 +1,66 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +import { fixupConfigRules, fixupPluginRules } from "@eslint/compat"; +import { FlatCompat } from "@eslint/eslintrc"; +import js from "@eslint/js"; +import typescriptEslint from "@typescript-eslint/eslint-plugin"; +import tsParser from "@typescript-eslint/parser"; +import _import from "eslint-plugin-import"; +import n from "eslint-plugin-n"; +import simpleImportSort from "eslint-plugin-simple-import-sort"; +import globals from "globals"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...fixupConfigRules(compat.extends( + "eslint:recommended", + "plugin:import/typescript", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", +)), { + plugins: { + import: fixupPluginRules(_import), + "simple-import-sort": simpleImportSort, + n, + "@typescript-eslint": fixupPluginRules(typescriptEslint), + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: tsParser, + ecmaVersion: 5, + sourceType: "module", + }, + + rules: { + "import/no-cycle": "error", + "n/no-extraneous-import": "error", + "@typescript-eslint/ban-ts-ignore": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/interface-name-prefix": "off", + "@typescript-eslint/member-delimiter-style": "off", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-non-null-assertion": "error", + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error", + }, +}, { + files: ["test/**"], + + rules: { + "@typescript-eslint/no-non-null-assertion": "off", + }, +}]; \ No newline at end of file diff --git a/node_modules/@cucumber/gherkin-streams/node_modules/commander/LICENSE b/node_modules/@cucumber/gherkin-streams/node_modules/commander/LICENSE new file mode 100644 index 00000000..10f997ab --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/node_modules/commander/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2011 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@cucumber/gherkin-streams/node_modules/commander/Readme.md b/node_modules/@cucumber/gherkin-streams/node_modules/commander/Readme.md new file mode 100644 index 00000000..b4f81f16 --- /dev/null +++ b/node_modules/@cucumber/gherkin-streams/node_modules/commander/Readme.md @@ -0,0 +1,1159 @@ +# Commander.js + +[![Build Status](https://github.com/tj/commander.js/workflows/build/badge.svg)](https://github.com/tj/commander.js/actions?query=workflow%3A%22build%22) +[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander) +[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true) +[![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander) + +The complete solution for [node.js](http://nodejs.org) command-line interfaces. + +Read this in other languages: English | [简体中文](./Readme_zh-CN.md) + +- [Commander.js](#commanderjs) + - [Installation](#installation) + - [Quick Start](#quick-start) + - [Declaring _program_ variable](#declaring-program-variable) + - [Options](#options) + - [Common option types, boolean and value](#common-option-types-boolean-and-value) + - [Default option value](#default-option-value) + - [Other option types, negatable boolean and boolean|value](#other-option-types-negatable-boolean-and-booleanvalue) + - [Required option](#required-option) + - [Variadic option](#variadic-option) + - [Version option](#version-option) + - [More configuration](#more-configuration) + - [Custom option processing](#custom-option-processing) + - [Commands](#commands) + - [Command-arguments](#command-arguments) + - [More configuration](#more-configuration-1) + - [Custom argument processing](#custom-argument-processing) + - [Action handler](#action-handler) + - [Stand-alone executable (sub)commands](#stand-alone-executable-subcommands) + - [Life cycle hooks](#life-cycle-hooks) + - [Automated help](#automated-help) + - [Custom help](#custom-help) + - [Display help after errors](#display-help-after-errors) + - [Display help from code](#display-help-from-code) + - [.name](#name) + - [.usage](#usage) + - [.description and .summary](#description-and-summary) + - [.helpOption(flags, description)](#helpoptionflags-description) + - [.helpCommand()](#helpcommand) + - [Help Groups](#help-groups) + - [More configuration](#more-configuration-2) + - [Custom event listeners](#custom-event-listeners) + - [Bits and pieces](#bits-and-pieces) + - [.parse() and .parseAsync()](#parse-and-parseasync) + - [Parsing Configuration](#parsing-configuration) + - [Legacy options as properties](#legacy-options-as-properties) + - [TypeScript](#typescript) + - [createCommand()](#createcommand) + - [Node options such as `--harmony`](#node-options-such-as---harmony) + - [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands) + - [npm run-script](#npm-run-script) + - [Display error](#display-error) + - [Override exit and output handling](#override-exit-and-output-handling) + - [Additional documentation](#additional-documentation) + - [Support](#support) + - [Commander for enterprise](#commander-for-enterprise) + +For information about terms used in this document see: [terminology](./docs/terminology.md) + +## Installation + +```sh +npm install commander +``` + +## Quick Start + +You write code to describe your command line interface. +Commander looks after parsing the arguments into options and command-arguments, +displays usage errors for problems, and implements a help system. + +Commander is strict and displays an error for unrecognised options. +The two most used option types are a boolean option, and an option which takes its value from the following argument. + +Example file: [split.js](./examples/split.js) + +```js +const { program } = require('commander'); + +program + .option('--first') + .option('-s, --separator ') + .argument(''); + +program.parse(); + +const options = program.opts(); +const limit = options.first ? 1 : undefined; +console.log(program.args[0].split(options.separator, limit)); +``` + +```console +$ node split.js -s / --fits a/b/c +error: unknown option '--fits' +(Did you mean --first?) +$ node split.js -s / --first a/b/c +[ 'a' ] +``` + +Here is a more complete program using a subcommand and with descriptions for the help. In a multi-command program, you have an action handler for each command (or stand-alone executables for the commands). + +Example file: [string-util.js](./examples/string-util.js) + +```js +const { Command } = require('commander'); +const program = new Command(); + +program + .name('string-util') + .description('CLI to some JavaScript string utilities') + .version('0.8.0'); + +program.command('split') + .description('Split a string into substrings and display as an array') + .argument('', 'string to split') + .option('--first', 'display just the first substring') + .option('-s, --separator ', 'separator character', ',') + .action((str, options) => { + const limit = options.first ? 1 : undefined; + console.log(str.split(options.separator, limit)); + }); + +program.parse(); +``` + +```console +$ node string-util.js help split +Usage: string-util split [options] + +Split a string into substrings and display as an array. + +Arguments: + string string to split + +Options: + --first display just the first substring + -s, --separator separator character (default: ",") + -h, --help display help for command + +$ node string-util.js split --separator=/ a/b/c +[ 'a', 'b', 'c' ] +``` + +More samples can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. + +## Declaring _program_ variable + +Commander exports a global object which is convenient for quick programs. +This is used in the examples in this README for brevity. + +```js +// CommonJS (.cjs) +const { program } = require('commander'); +``` + +For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use. + +```js +// CommonJS (.cjs) +const { Command } = require('commander'); +const program = new Command(); +``` + +```js +// ECMAScript (.mjs) +import { Command } from 'commander'; +const program = new Command(); +``` + +```ts +// TypeScript (.ts) +import { Command } from 'commander'; +const program = new Command(); +``` + +## Options + +Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space or vertical bar ('|'). To allow a wider range of short-ish flags than just +single characters, you may also have two long options. Examples: + +```js +program + .option('-p, --port ', 'server port number') + .option('--trace', 'add extra debugging output') + .option('--ws, --workspace ', 'use a custom workspace') +``` + +The parsed options can be accessed by calling `.opts()` on a `Command` object, and are passed to the action handler. + +Multi-word options such as "--template-engine" are camel-cased, becoming `program.opts().templateEngine` etc. + +An option and its option-argument can be separated by a space, or combined into the same argument. The option-argument can follow the short option directly or follow an `=` for a long option. + +```sh +serve -p 80 +serve -p80 +serve --port 80 +serve --port=80 +``` + +You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted. + +By default, options on the command line are not positional, and can be specified before or after other arguments. + +There are additional related routines for when `.opts()` is not enough: + +- `.optsWithGlobals()` returns merged local and global option values +- `.getOptionValue()` and `.setOptionValue()` work with a single option value +- `.getOptionValueSource()` and `.setOptionValueWithSource()` include where the option value came from + +### Common option types, boolean and value + +The two most used option types are a boolean option, and an option which takes its value +from the following argument (declared with angle brackets like `--expect `). Both are `undefined` unless specified on command line. + +Example file: [options-common.js](./examples/options-common.js) + +```js +program + .option('-d, --debug', 'output extra debugging') + .option('-s, --small', 'small pizza size') + .option('-p, --pizza-type ', 'flavour of pizza'); + +program.parse(process.argv); + +const options = program.opts(); +if (options.debug) console.log(options); +console.log('pizza details:'); +if (options.small) console.log('- small pizza size'); +if (options.pizzaType) console.log(`- ${options.pizzaType}`); +``` + +```console +$ pizza-options -p +error: option '-p, --pizza-type ' argument missing +$ pizza-options -d -s -p vegetarian +{ debug: true, small: true, pizzaType: 'vegetarian' } +pizza details: +- small pizza size +- vegetarian +$ pizza-options --pizza-type=cheese +pizza details: +- cheese +``` + +Multiple boolean short options may be combined following the dash, and may be followed by a single short option taking a value. +For example `-d -s -p cheese` may be written as `-ds -p cheese` or even `-dsp cheese`. + +Options with an expected option-argument are greedy and will consume the following argument whatever the value. +So `--id -xyz` reads `-xyz` as the option-argument. + +`program.parse(arguments)` processes the arguments, leaving any args not consumed by the program options in the `program.args` array. The parameter is optional and defaults to `process.argv`. + +### Default option value + +You can specify a default value for an option. + +Example file: [options-defaults.js](./examples/options-defaults.js) + +```js +program + .option('-c, --cheese ', 'add the specified type of cheese', 'blue'); + +program.parse(); + +console.log(`cheese: ${program.opts().cheese}`); +``` + +```console +$ pizza-options +cheese: blue +$ pizza-options --cheese stilton +cheese: stilton +``` + +### Other option types, negatable boolean and boolean|value + +You can define a boolean option long name with a leading `no-` to set the option value to false when used. +Defined alone this also makes the option true by default. + +If you define `--foo` first, adding `--no-foo` does not change the default value from what it would +otherwise be. + +Example file: [options-negatable.js](./examples/options-negatable.js) + +```js +program + .option('--no-sauce', 'Remove sauce') + .option('--cheese ', 'cheese flavour', 'mozzarella') + .option('--no-cheese', 'plain with no cheese') + .parse(); + +const options = program.opts(); +const sauceStr = options.sauce ? 'sauce' : 'no sauce'; +const cheeseStr = (options.cheese === false) ? 'no cheese' : `${options.cheese} cheese`; +console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`); +``` + +```console +$ pizza-options +You ordered a pizza with sauce and mozzarella cheese +$ pizza-options --sauce +error: unknown option '--sauce' +$ pizza-options --cheese=blue +You ordered a pizza with sauce and blue cheese +$ pizza-options --no-sauce --no-cheese +You ordered a pizza with no sauce and no cheese +``` + +You can specify an option which may be used as a boolean option but may optionally take an option-argument +(declared with square brackets like `--optional [value]`). + +Example file: [options-boolean-or-value.js](./examples/options-boolean-or-value.js) + +```js +program + .option('-c, --cheese [type]', 'Add cheese with optional type'); + +program.parse(process.argv); + +const options = program.opts(); +if (options.cheese === undefined) console.log('no cheese'); +else if (options.cheese === true) console.log('add cheese'); +else console.log(`add cheese type ${options.cheese}`); +``` + +```console +$ pizza-options +no cheese +$ pizza-options --cheese +add cheese +$ pizza-options --cheese mozzarella +add cheese type mozzarella +``` + +Options with an optional option-argument are not greedy and will ignore arguments starting with a dash. +So `id` behaves as a boolean option for `--id -ABCD`, but you can use a combined form if needed like `--id=-ABCD`. +Negative numbers are special and are accepted as an option-argument. + +For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-in-depth.md). + +### Required option + +You may specify a required (mandatory) option using `.requiredOption()`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option()` in format, taking flags and description, and optional default value or custom processing. + +Example file: [options-required.js](./examples/options-required.js) + +```js +program + .requiredOption('-c, --cheese ', 'pizza must have cheese'); + +program.parse(); +``` + +```console +$ pizza +error: required option '-c, --cheese ' not specified +``` + +### Variadic option + +You may make an option variadic by appending `...` to the value placeholder when declaring the option. On the command line you +can then specify multiple option-arguments, and the parsed option value will be an array. The extra arguments +are read until the first argument starting with a dash. The special argument `--` stops option processing entirely. If a value +is specified in the same argument as the option then no further values are read. + +Example file: [options-variadic.js](./examples/options-variadic.js) + +```js +program + .option('-n, --number ', 'specify numbers') + .option('-l, --letter [letters...]', 'specify letters'); + +program.parse(); + +console.log('Options: ', program.opts()); +console.log('Remaining arguments: ', program.args); +``` + +```console +$ collect -n 1 2 3 --letter a b c +Options: { number: [ '1', '2', '3' ], letter: [ 'a', 'b', 'c' ] } +Remaining arguments: [] +$ collect --letter=A -n80 operand +Options: { number: [ '80' ], letter: [ 'A' ] } +Remaining arguments: [ 'operand' ] +$ collect --letter -n 1 -n 2 3 -- operand +Options: { number: [ '1', '2', '3' ], letter: true } +Remaining arguments: [ 'operand' ] +``` + +For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-in-depth.md). + +### Version option + +The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits. + +```js +program.version('0.0.1'); +``` + +```console +$ ./examples/pizza -V +0.0.1 +``` + +You may change the flags and description by passing additional parameters to the `version` method, using +the same syntax for flags as the `option` method. + +```js +program.version('0.0.1', '-v, --vers', 'output the current version'); +``` + +### More configuration + +You can add most options using the `.option()` method, but there are some additional features available +by constructing an `Option` explicitly for less common cases. + +Example files: [options-extra.js](./examples/options-extra.js), [options-env.js](./examples/options-env.js), [options-conflicts.js](./examples/options-conflicts.js), [options-implies.js](./examples/options-implies.js) + +```js +program + .addOption(new Option('-s, --secret').hideHelp()) + .addOption(new Option('-t, --timeout ', 'timeout in seconds').default(60, 'one minute')) + .addOption(new Option('-d, --drink ', 'drink size').choices(['small', 'medium', 'large'])) + .addOption(new Option('-p, --port ', 'port number').env('PORT')) + .addOption(new Option('--donate [amount]', 'optional donation in dollars').preset('20').argParser(parseFloat)) + .addOption(new Option('--disable-server', 'disables the server').conflicts('port')) + .addOption(new Option('--free-drink', 'small drink included free ').implies({ drink: 'small' })); +``` + +```console +$ extra --help +Usage: help [options] + +Options: + -t, --timeout timeout in seconds (default: one minute) + -d, --drink drink cup size (choices: "small", "medium", "large") + -p, --port port number (env: PORT) + --donate [amount] optional donation in dollars (preset: "20") + --disable-server disables the server + --free-drink small drink included free + -h, --help display help for command + +$ extra --drink huge +error: option '-d, --drink ' argument 'huge' is invalid. Allowed choices are small, medium, large. + +$ PORT=80 extra --donate --free-drink +Options: { timeout: 60, donate: 20, port: '80', freeDrink: true, drink: 'small' } + +$ extra --disable-server --port 8000 +error: option '--disable-server' cannot be used with option '-p, --port ' +``` + +Specify a required (mandatory) option using the `Option` method `.makeOptionMandatory()`. This matches the `Command` method [.requiredOption()](#required-option). + +### Custom option processing + +You may specify a function to do custom processing of option-arguments. The callback function receives two parameters, +the user specified option-argument and the previous value for the option. It returns the new value for the option. + +This allows you to coerce the option-argument to the desired type, or accumulate values, or do entirely custom processing. + +You can optionally specify the default/starting value for the option after the function parameter. + +Example file: [options-custom-processing.js](./examples/options-custom-processing.js) + +```js +function myParseInt(value, dummyPrevious) { + // parseInt takes a string and a radix + const parsedValue = parseInt(value, 10); + if (isNaN(parsedValue)) { + throw new commander.InvalidArgumentError('Not a number.'); + } + return parsedValue; +} + +function increaseVerbosity(dummyValue, previous) { + return previous + 1; +} + +function collect(value, previous) { + return previous.concat([value]); +} + +function commaSeparatedList(value, dummyPrevious) { + return value.split(','); +} + +program + .option('-f, --float ', 'float argument', parseFloat) + .option('-i, --integer ', 'integer argument', myParseInt) + .option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0) + .option('-c, --collect ', 'repeatable value', collect, []) + .option('-l, --list ', 'comma separated list', commaSeparatedList) +; + +program.parse(); + +const options = program.opts(); +if (options.float !== undefined) console.log(`float: ${options.float}`); +if (options.integer !== undefined) console.log(`integer: ${options.integer}`); +if (options.verbose > 0) console.log(`verbosity: ${options.verbose}`); +if (options.collect.length > 0) console.log(options.collect); +if (options.list !== undefined) console.log(options.list); +``` + +```console +$ custom -f 1e2 +float: 100 +$ custom --integer 2 +integer: 2 +$ custom -v -v -v +verbose: 3 +$ custom -c a -c b -c c +[ 'a', 'b', 'c' ] +$ custom --list x,y,z +[ 'x', 'y', 'z' ] +``` + +## Commands + +You can specify (sub)commands using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)). + +In the first parameter to `.command()` you specify the command name. You may append the command-arguments after the command name, or specify them separately using `.argument()`. The arguments may be `` or `[optional]`, and the last argument may also be `variadic...`. + +You can use `.addCommand()` to add an already configured subcommand to the program. + +For example: + +```js +// Command implemented using action handler (description is supplied separately to `.command`) +// Returns new command for configuring. +program + .command('clone [destination]') + .description('clone a repository into a newly created directory') + .action((source, destination) => { + console.log('clone command called'); + }); + +// Command implemented using stand-alone executable file, indicated by adding description as second parameter to `.command`. +// Returns `this` for adding more commands. +program + .command('start ', 'start named service') + .command('stop [service]', 'stop named service, or all if no name supplied'); + +// Command prepared separately. +// Returns `this` for adding more commands. +program + .addCommand(build.makeBuildCommand()); +``` + +Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `hidden: true` will +remove the command from the generated help output. Specifying `isDefault: true` will run the subcommand if no other +subcommand is specified ([example](./examples/defaultCommand.js)). + +You can add alternative names for a command with `.alias()`. ([example](./examples/alias.js)) + +`.command()` automatically copies the inherited settings from the parent command to the newly created subcommand. This is only done during creation, any later setting changes to the parent are not inherited. + +For safety, `.addCommand()` does not automatically copy the inherited settings from the parent command. There is a helper routine `.copyInheritedSettings()` for copying the settings when they are wanted. + +### Command-arguments + +For subcommands, you can specify the argument syntax in the call to `.command()` (as shown above). This +is the only method usable for subcommands implemented using a stand-alone executable, but for other subcommands +you can instead use the following method. + +To configure a command, you can use `.argument()` to specify each expected command-argument. +You supply the argument name and an optional description. The argument may be `` or `[optional]`. +You can specify a default value for an optional command-argument. + +Example file: [argument.js](./examples/argument.js) + +```js +program + .version('0.1.0') + .argument('', 'user to login') + .argument('[password]', 'password for user, if required', 'no password given') + .action((username, password) => { + console.log('username:', username); + console.log('password:', password); + }); +``` + + The last argument of a command can be variadic, and only the last argument. To make an argument variadic you + append `...` to the argument name. A variadic argument is passed to the action handler as an array. For example: + +```js +program + .version('0.1.0') + .command('rmdir') + .argument('') + .action(function (dirs) { + dirs.forEach((dir) => { + console.log('rmdir %s', dir); + }); + }); +``` + +There is a convenience method to add multiple arguments at once, but without descriptions: + +```js +program + .arguments(' '); +``` + +#### More configuration + +There are some additional features available by constructing an `Argument` explicitly for less common cases. + +Example file: [arguments-extra.js](./examples/arguments-extra.js) + +```js +program + .addArgument(new commander.Argument('', 'drink cup size').choices(['small', 'medium', 'large'])) + .addArgument(new commander.Argument('[timeout]', 'timeout in seconds').default(60, 'one minute')) +``` + +#### Custom argument processing + +You may specify a function to do custom processing of command-arguments (like for option-arguments). +The callback function receives two parameters, the user specified command-argument and the previous value for the argument. +It returns the new value for the argument. + +The processed argument values are passed to the action handler, and saved as `.processedArgs`. + +You can optionally specify the default/starting value for the argument after the function parameter. + +Example file: [arguments-custom-processing.js](./examples/arguments-custom-processing.js) + +```js +program + .command('add') + .argument('', 'integer argument', myParseInt) + .argument('[second]', 'integer argument', myParseInt, 1000) + .action((first, second) => { + console.log(`${first} + ${second} = ${first + second}`); + }) +; +``` + +### Action handler + +The action handler gets passed a parameter for each command-argument you declared, and two additional parameters +which are the parsed options and the command object itself. + +Example file: [thank.js](./examples/thank.js) + +```js +program + .argument('') + .option('-t, --title ', 'title to use before name') + .option('-d, --debug', 'display some debugging') + .action((name, options, command) => { + if (options.debug) { + console.error('Called %s with options %o', command.name(), options); + } + const title = options.title ? `${options.title} ` : ''; + console.log(`Thank-you ${title}${name}`); + }); +``` + +If you prefer, you can work with the command directly and skip declaring the parameters for the action handler. The `this` keyword is set to the running command and can be used from a function expression (but not from an arrow function). + +Example file: [action-this.js](./examples/action-this.js) + +```js +program + .command('serve') + .argument('`, + }, + ], + }, + }; + const html = yield renderAsHtml(e1); + (0, node_assert_1.default)(html.indexOf(`window.CUCUMBER_MESSAGES = [{"gherkinDocument":{"comments":[{"location":{"line":0,"column":0},"text":"\\x3C/script>\\x3Cscript>alert('Hello')\\x3C/script>"}]}}];`) >= 0); + })); +}); +//# sourceMappingURL=CucumberHtmlStream.spec.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/CucumberHtmlStream.spec.js.map b/node_modules/@cucumber/html-formatter/dist/src/CucumberHtmlStream.spec.js.map new file mode 100644 index 00000000..c5718465 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/CucumberHtmlStream.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CucumberHtmlStream.spec.js","sourceRoot":"","sources":["../../src/CucumberHtmlStream.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8DAAgC;AAChC,6CAAsC;AAGtC,6DAAyD;AAEzD,SAAe,YAAY,CAAC,GAAG,SAAqB;;QAClD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,IAAI,GAAG,EAAE,CAAA;YACb,MAAM,IAAI,GAAa,IAA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AC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACjF,CAAC,CAAA,CAAC,CAAA;IAEF,EAAE,CAAC,6BAA6B,EAAE,GAAS,EAAE;QAC3C,MAAM,EAAE,GAAa;YACnB,cAAc,EAAE;gBACd,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;aACpC;SACF,CAAA;QACD,MAAM,EAAE,GAAa;YACnB,eAAe,EAAE;gBACf,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;gBACnC,OAAO,EAAE,IAAI;aACd;SACF,CAAA;QACD,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACvC,IAAA,qBAAM,EACJ,IAAI,CAAC,OAAO,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAC9F,CAAA;IACH,CAAC,CAAA,CAAC,CAAA;IAEF,EAAE,CAAC,yBAAyB,EAAE,GAAS,EAAE;QACvC,MAAM,EAAE,GAAa;YACnB,eAAe,EAAE;gBACf,QAAQ,EAAE;oBACR;wBACE,QAAQ,EAAE;4BACR,IAAI,EAAE,CAAC;4BACP,MAAM,EAAE,CAAC;yBACV;wBACD,IAAI,EAAE,0CAA0C;qBACjD;iBACF;aACF;SACF,CAAA;QACD,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,EAAE,CAAC,CAAA;QACnC,IAAA,qBAAM,EACJ,IAAI,CAAC,OAAO,CACV,mKAAmK,CACpK,IAAI,CAAC,CACP,CAAA;IACH,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/icon.url b/node_modules/@cucumber/html-formatter/dist/src/icon.url new file mode 100644 index 00000000..9d5009c8 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/icon.url @@ -0,0 +1 @@ +data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAuMDYgMC41NiAzMi41IDM3LjEzIj4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPHBhdGggZD0iTS00LTFoNDB2NDBILTR6Ii8+CiAgICAgICAgPHBhdGggZmlsbD0iIzAwYTgxOCIKICAgICAgICAgICAgICBkPSJNMTYuNDM4LjU2M0M3LjM4Ni41NjMuMDYzIDcuODg2LjA2MyAxNi45MzhjMCA3Ljk2OCA1LjcxMiAxNC41ODkgMTMuMjUgMTYuMDYydjQuNjg4YzkuOC0xLjQ3OCAxOC40NzctOS4yNTcgMTkuMTI0LTE5LjQ3LjM5LTYuMTQ2LTIuNjc0LTEyLjQyMS03Ljg0My0xNS40NjhhMTMuNjIgMTMuNjIgMCAwIDAtMS44NzUtLjkzOGwtLjMxMy0uMTI1Yy0uMjg3LS4xMDYtLjU3Ny0uMjI1LS44NzUtLjMxMmExNi4yNDYgMTYuMjQ2IDAgMCAwLTUuMDkzLS44MTN2LjAwMXoiLz4KICAgICAgICA8cGF0aCBmaWxsPSIjZmZmIgogICAgICAgICAgICAgIGQ9Ik0xOS44MTMgNi42MjVhMS43ODcgMS43ODcgMCAwIDAtMS41NjMuNjI1Yy0uMy40LS40ODguNzg3LS42ODggMS4xODgtLjYgMS40LS40IDIuOS41IDQgMS40LS4zIDIuNTg4LTEuMTk0IDMuMTg4LTIuNTk0LjItLjQuMzEzLS45MTMuMzEzLTEuMzEzLjA2Mi0xLjA2Mi0uODE3LTEuODEtMS43NS0xLjkwNnptLTcuMjgyLjA5NGMtLjkxMy4wODctMS43ODEuODEyLTEuNzgxIDEuODEyIDAgLjQuMTEzLjkxMy4zMTMgMS4zMTMuNiAxLjQgMS44OCAyLjI5MyA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EuMS0xLjAwNiAyLjYtLjQwNiA0IC4yLjQuMzg3Ljc5My42ODggMS4wOTMgMS4xIDEuMiAzLjQxMi4zMTMgMy4zMTItMS4xODcgMC0uNC0uMTEzLS45MTMtLjMxMy0xLjMxMy0uNi0xLjQtMS44OC0yLjI5My0zLjI4LTIuNTkzaC0uMDAxeiIvPgogICAgPC9nPgo8L3N2Zz4K \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/index.d.ts b/node_modules/@cucumber/html-formatter/dist/src/index.d.ts new file mode 100644 index 00000000..b68d58d5 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/index.d.ts @@ -0,0 +1,7 @@ +import { CucumberHtmlStream } from './CucumberHtmlStream'; +export * from './CucumberHtmlStream'; +/** + * @deprecated use the named export `CucumberHtmlStream` instead + */ +export default CucumberHtmlStream; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/index.d.ts.map b/node_modules/@cucumber/html-formatter/dist/src/index.d.ts.map new file mode 100644 index 00000000..7b60f9cb --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,cAAc,sBAAsB,CAAA;AAEpC;;GAEG;AACH,eAAe,kBAAkB,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/index.js b/node_modules/@cucumber/html-formatter/dist/src/index.js new file mode 100644 index 00000000..eccef2c3 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/index.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const CucumberHtmlStream_1 = require("./CucumberHtmlStream"); +__exportStar(require("./CucumberHtmlStream"), exports); +/** + * @deprecated use the named export `CucumberHtmlStream` instead + */ +exports.default = CucumberHtmlStream_1.CucumberHtmlStream; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/index.js.map b/node_modules/@cucumber/html-formatter/dist/src/index.js.map new file mode 100644 index 00000000..abf50279 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAAyD;AAEzD,uDAAoC;AAEpC;;GAEG;AACH,kBAAe,uCAAkB,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/index.mustache b/node_modules/@cucumber/html-formatter/dist/src/index.mustache new file mode 100644 index 00000000..80572ab6 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/index.mustache @@ -0,0 +1,28 @@ + + + + {{title}} + + + + + + + +
+
+ + + + + diff --git a/node_modules/@cucumber/html-formatter/dist/src/main.d.ts b/node_modules/@cucumber/html-formatter/dist/src/main.d.ts new file mode 100644 index 00000000..ad504b3b --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/main.d.ts @@ -0,0 +1,8 @@ +import './styles.scss'; +import type { Envelope } from '@cucumber/messages'; +declare global { + interface Window { + CUCUMBER_MESSAGES: Envelope[]; + } +} +//# sourceMappingURL=main.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/main.d.ts.map b/node_modules/@cucumber/html-formatter/dist/src/main.d.ts.map new file mode 100644 index 00000000..56c53391 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/main.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAIlD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,EAAE,QAAQ,EAAE,CAAA;KAC9B;CACF"} \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/main.js b/node_modules/@cucumber/html-formatter/dist/src/main.js new file mode 100644 index 00000000..59d357ed --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/main.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const jsx_runtime_1 = require("react/jsx-runtime"); +require("./styles.scss"); +const react_components_1 = require("@cucumber/react-components"); +const client_1 = require("react-dom/client"); +const root = (0, client_1.createRoot)(document.getElementById('content')); +root.render((0, jsx_runtime_1.jsx)(react_components_1.EnvelopesProvider, { envelopes: window.CUCUMBER_MESSAGES, children: (0, jsx_runtime_1.jsx)(react_components_1.UrlSearchProvider, { children: (0, jsx_runtime_1.jsx)("div", { id: "report", className: "html-formatter", children: (0, jsx_runtime_1.jsx)(react_components_1.Report, {}) }) }) })); +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/main.js.map b/node_modules/@cucumber/html-formatter/dist/src/main.js.map new file mode 100644 index 00000000..4ff01a52 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.tsx"],"names":[],"mappings":";;;AAAA,yBAAsB;AAGtB,iEAAyF;AACzF,6CAA6C;AAQ7C,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAgB,CAAC,CAAA;AAE1E,IAAI,CAAC,MAAM,CACT,uBAAC,oCAAiB,IAAC,SAAS,EAAE,MAAM,CAAC,iBAAiB,YACpD,uBAAC,oCAAiB,cAChB,gCAAK,EAAE,EAAC,QAAQ,EAAC,SAAS,EAAC,gBAAgB,YACzC,uBAAC,yBAAM,KAAG,GACN,GACY,GACF,CACrB,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/src/styles.scss b/node_modules/@cucumber/html-formatter/dist/src/styles.scss new file mode 100644 index 00000000..79544ea1 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/src/styles.scss @@ -0,0 +1,60 @@ +$sansFamily: + 'Inter var', + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + 'Helvetica Neue', + Arial, + 'Noto Sans', + sans-serif, + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Segoe UI Symbol', + 'Noto Color Emoji'; +$monoFamily: + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', + 'Courier New', monospace; + +:root { + background-color: white; + color: #222; +} + +body { + font-family: $sansFamily; + padding: 0; + margin: 0; +} + +pre, +code { + font-family: $monoFamily; +} + +.html-formatter { + max-width: 1600px; + min-height: 100vh; + margin: 0 auto; +} + +@media all and (prefers-color-scheme: dark) { + :root { + background-color: #1d1d26; + color: #c9c9d1; + --cucumber-anchor-color: #4caaee; + --cucumber-keyword-color: #d89077; + --cucumber-parameter-color: #4caaee; + --cucumber-tag-color: #85a658; + --cucumber-docstring-color: #66a565; + --cucumber-error-background-color: #cf6679; + --cucumber-error-text-color: #222; + --cucumber-code-background-color: #282a36; + --cucumber-code-text-color: #f8f8f2; + --cucumber-panel-background-color: #282a36; + --cucumber-panel-accent-color: #313442; + --cucumber-panel-text-color: #f8f8f2; + } +} diff --git a/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.d.ts b/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.d.ts new file mode 100644 index 00000000..98456317 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=acceptance.spec.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.d.ts.map b/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.d.ts.map new file mode 100644 index 00000000..0a05fc77 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"acceptance.spec.d.ts","sourceRoot":"","sources":["../../test/acceptance.spec.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.js b/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.js new file mode 100644 index 00000000..eba5ffad --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.js @@ -0,0 +1,39 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_fs_1 = __importDefault(require("node:fs")); +const node_path_1 = __importDefault(require("node:path")); +const promises_1 = require("node:stream/promises"); +const message_streams_1 = require("@cucumber/message-streams"); +const test_1 = require("@playwright/test"); +const glob_1 = require("glob"); +const src_1 = require("../src"); +const fixtures = (0, glob_1.sync)(`./node_modules/@cucumber/compatibility-kit/features/**/*.ndjson`); +test_1.test.beforeAll(() => __awaiter(void 0, void 0, void 0, function* () { + const outputDir = node_path_1.default.join(__dirname, './__output__'); + for (const fixture of fixtures) { + const name = node_path_1.default.basename(fixture, '.ndjson'); + const outputFile = node_path_1.default.join(outputDir, `${name}.html`); + yield (0, promises_1.pipeline)(node_fs_1.default.createReadStream(fixture, { encoding: 'utf-8' }), new message_streams_1.NdjsonToMessageStream(), new src_1.CucumberHtmlStream(node_path_1.default.join(__dirname, '../dist/main.css'), node_path_1.default.join(__dirname, '../dist/main.js'), node_path_1.default.join(__dirname, '../dist/src/icon.url')), node_fs_1.default.createWriteStream(outputFile)); + } +})); +for (const fixture of fixtures) { + const name = node_path_1.default.basename(fixture, '.ndjson'); + (0, test_1.test)(`can render ${name}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ page }) { + yield page.goto(`/${name}.html`); + yield page.waitForSelector('#report', { timeout: 3000 }); + yield (0, test_1.expect)(page).toHaveScreenshot(`${name}.png`, { fullPage: true }); + })); +} +//# sourceMappingURL=acceptance.spec.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.js.map b/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.js.map new file mode 100644 index 00000000..1b78145c --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/test/acceptance.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"acceptance.spec.js","sourceRoot":"","sources":["../../test/acceptance.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sDAAwB;AACxB,0DAA4B;AAC5B,mDAA+C;AAE/C,+DAAiE;AACjE,2CAA+C;AAC/C,+BAA2B;AAE3B,gCAA2C;AAE3C,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,iEAAiE,CAAC,CAAA;AAExF,WAAI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E,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACxE,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/dist/tsconfig.build.tsbuildinfo b/node_modules/@cucumber/html-formatter/dist/tsconfig.build.tsbuildinfo new file mode 100644 index 00000000..c3661650 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/dist/tsconfig.build.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/@types/react/global.d.ts","../node_modules/csstype/index.d.ts","../node_modules/@types/react/index.d.ts","../node_modules/@types/react/jsx-runtime.d.ts","../node_modules/reflect-metadata/index.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/version.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/index.d.ts","../src/CucumberHtmlStream.ts","../src/CucumberHtmlStream.spec.ts","../src/index.ts","../node_modules/@cucumber/react-components/node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts","../node_modules/@cucumber/react-components/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts","../node_modules/@cucumber/react-components/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts","../node_modules/@cucumber/react-components/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts","../node_modules/@cucumber/react-components/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts","../node_modules/@cucumber/react-components/node_modules/@cucumber/messages/dist/cjs/src/version.d.ts","../node_modules/@cucumber/react-components/node_modules/@cucumber/messages/dist/cjs/src/index.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/CICommitLink.d.ts","../node_modules/@cucumber/tag-expressions/dist/cjs/src/index.d.ts","../node_modules/@cucumber/react-components/dist/src/SearchContext.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/ControlledSearchProvider.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/EnvelopesProvider.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/ExecutionSummary.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/FilteredDocuments.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/GherkinDocumentList.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/HighLight.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/InMemorySearchProvider.d.ts","../node_modules/@cucumber/gherkin-utils/dist/src/GherkinDocumentHandlers.d.ts","../node_modules/@cucumber/gherkin-utils/dist/src/walkGherkinDocument.d.ts","../node_modules/@cucumber/gherkin-utils/dist/src/GherkinDocumentWalker.d.ts","../node_modules/@cucumber/gherkin-utils/dist/src/pretty.d.ts","../node_modules/@cucumber/gherkin-utils/dist/src/Query.d.ts","../node_modules/@cucumber/gherkin-utils/dist/src/index.d.ts","../node_modules/@cucumber/query/dist/src/Lineage.d.ts","../node_modules/@cucumber/query/dist/src/Query.d.ts","../node_modules/@cucumber/query/dist/src/index.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/QueriesProvider.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/Report.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/SearchBar.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/StatusesSummary.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/TestRunHooks.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/UrlSearchProvider.d.ts","../node_modules/@cucumber/react-components/dist/src/components/app/index.d.ts","../node_modules/@cucumber/react-components/dist/src/components/customise/CustomRendering.d.ts","../node_modules/@cucumber/react-components/dist/src/components/customise/theming.d.ts","../node_modules/@cucumber/react-components/dist/src/components/customise/index.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Anchor.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/attachment/Attachment.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Background.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Children.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/DataTable.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Description.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/DocString.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/ErrorMessage.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Examples.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Feature.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/GherkinDocument.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Keyword.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Parameter.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Rule.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Scenario.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/StatusIcon.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Tags.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/Title.d.ts","../node_modules/@cucumber/react-components/dist/src/components/gherkin/index.d.ts","../node_modules/@cucumber/react-components/dist/src/components/index.d.ts","../node_modules/@cucumber/react-components/dist/src/hooks/useQueries.d.ts","../node_modules/@cucumber/react-components/dist/src/hooks/useSearch.d.ts","../node_modules/@cucumber/react-components/dist/src/hooks/index.d.ts","../node_modules/@cucumber/react-components/dist/src/index.d.ts","../node_modules/@types/react-dom/client.d.ts","../src/main.tsx","../node_modules/@cucumber/message-streams/dist/src/MessageToNdjsonStream.d.ts","../node_modules/@cucumber/message-streams/dist/src/NdjsonToMessageStream.d.ts","../node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.d.ts","../node_modules/@cucumber/message-streams/dist/src/index.d.ts","../node_modules/playwright-core/types/protocol.d.ts","../node_modules/playwright-core/types/structs.d.ts","../node_modules/playwright-core/types/types.d.ts","../node_modules/playwright/types/test.d.ts","../node_modules/playwright/test.d.ts","../node_modules/@playwright/test/index.d.ts","../node_modules/minipass/dist/commonjs/index.d.ts","../node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.d.ts","../node_modules/path-scurry/dist/commonjs/index.d.ts","../node_modules/glob/node_modules/minimatch/dist/commonjs/ast.d.ts","../node_modules/glob/node_modules/minimatch/dist/commonjs/escape.d.ts","../node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.d.ts","../node_modules/glob/node_modules/minimatch/dist/commonjs/index.d.ts","../node_modules/glob/dist/commonjs/pattern.d.ts","../node_modules/glob/dist/commonjs/processor.d.ts","../node_modules/glob/dist/commonjs/walker.d.ts","../node_modules/glob/dist/commonjs/ignore.d.ts","../node_modules/glob/dist/commonjs/glob.d.ts","../node_modules/glob/dist/commonjs/has-magic.d.ts","../node_modules/glob/dist/commonjs/index.d.ts","../test/acceptance.spec.ts","../package.json","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/@types/eslint/helpers.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/eslint/index.d.ts","../node_modules/@types/eslint-scope/index.d.ts","../node_modules/@types/estree-jsx/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/hast/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/node/compatibility/disposable.d.ts","../node_modules/@types/node/compatibility/indexable.d.ts","../node_modules/@types/node/compatibility/iterators.d.ts","../node_modules/@types/node/compatibility/index.d.ts","../node_modules/@types/node/globals.typedarray.d.ts","../node_modules/@types/node/buffer.buffer.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/web-globals/abortcontroller.d.ts","../node_modules/@types/node/web-globals/domexception.d.ts","../node_modules/@types/node/web-globals/events.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/env-http-proxy-agent.d.ts","../node_modules/undici-types/retry-handler.d.ts","../node_modules/undici-types/retry-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/util.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/eventsource.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/web-globals/fetch.d.ts","../node_modules/@types/node/web-globals/navigator.d.ts","../node_modules/@types/node/web-globals/storage.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/inspector.generated.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/sea.d.ts","../node_modules/@types/node/sqlite.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/react-dom/index.d.ts"],"fileIdsList":[[58,167,215,232,233],[79,80,81,82,83,167,215,232,233],[58,79,167,215,232,233],[58,167,215,232,233,247],[124,125,126,167,215,232,233],[167,215,232,233],[52,167,215,232,233],[52,53,54,55,56,57,167,215,232,233],[51,167,215,232,233],[58,85,167,215,232,233],[85,86,167,215,232,233],[49,68,70,167,215,232,233],[49,68,167,215,232,233],[49,71,167,215,232,233],[49,167,215,232,233],[49,84,87,167,215,232,233],[69,72,73,74,75,76,77,78,88,89,90,91,92,93,167,215,232,233],[95,96,167,215,232,233],[49,97,167,215,232,233],[98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,167,215,232,233],[94,97,116,167,215,232,233],[118,119,167,215,232,233],[84,87,167,215,232,233],[71,167,215,232,233],[117,120,167,215,232,233],[62,167,215,232,233],[62,63,64,65,66,67,167,215,232,233],[132,167,215,232,233],[150,167,215,232,233],[154,155,157,167,215,232,233],[152,153,154,157,167,215,232,233],[154,157,167,215,232,233],[158,167,215,232,233],[167,212,213,215,232,233],[167,214,215,232,233],[215,232,233],[167,215,220,232,233,250],[167,215,216,221,226,232,233,235,247,258],[167,215,216,217,226,232,233,235],[162,163,164,167,215,232,233],[167,215,218,232,233,259],[167,215,219,220,227,232,233,236],[167,215,220,232,233,247,255],[167,215,221,223,226,232,233,235],[167,214,215,222,232,233],[167,215,223,224,232,233],[167,215,225,226,232,233],[167,214,215,226,232,233],[167,215,226,227,228,232,233,247,258],[167,215,226,227,228,232,233,242,247,250],[167,208,215,223,226,229,232,233,235,247,258],[167,215,226,227,229,230,232,233,235,247,255,258],[167,215,229,231,232,233,247,255,258],[165,166,167,168,169,170,171,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264],[167,215,226,232,233],[167,215,232,233,234,258],[167,215,223,226,232,233,235,247],[167,215,232,233,236],[167,215,232,233,237],[167,214,215,232,233,238],[167,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264],[167,215,232,233,240],[167,215,232,233,241],[167,215,226,232,233,242,243],[167,215,232,233,242,244,259,261],[167,215,227,232,233],[167,215,226,232,233,247,248,250],[167,215,232,233,249,250],[167,215,232,233,247,248],[167,215,232,233,250],[167,215,232,233,251],[167,212,215,232,233,247,252,258],[167,215,226,232,233,253,254],[167,215,232,233,253,254],[167,215,220,232,233,235,247,255],[167,215,232,233,256],[167,215,232,233,235,257],[167,215,229,232,233,241,258],[167,215,220,232,233,259],[167,215,232,233,247,260],[167,215,232,233,234,261],[167,215,232,233,262],[167,208,215,232,233],[167,208,215,226,228,232,233,238,247,250,258,260,261,263],[167,215,232,233,247,264],[47,48,167,215,232,233],[134,136,140,141,144,167,215,232,233],[145,167,215,232,233],[136,140,143,167,215,232,233],[134,136,140,143,144,145,146,167,215,232,233],[140,167,215,232,233],[136,140,141,143,167,215,232,233],[134,136,141,142,144,167,215,232,233],[137,138,139,167,215,232,233],[167,215,226,232,233,251],[134,135,167,215,227,232,233,237],[130,167,215,232,233],[128,129,167,215,216,227,232,233,247],[131,167,215,232,233],[167,180,184,215,232,233,258],[167,180,215,232,233,247,258],[167,175,215,232,233],[167,177,180,215,232,233,255,258],[167,215,232,233,235,255],[167,215,232,233,265],[167,175,215,232,233,265],[167,177,180,215,232,233,235,258],[167,172,173,176,179,215,226,232,233,247,258],[167,180,187,215,232,233],[167,172,178,215,232,233],[167,180,201,202,215,232,233],[167,176,180,215,232,233,250,258,265],[167,201,215,232,233,265],[167,174,175,215,232,233,265],[167,180,215,232,233],[167,174,175,176,177,178,179,180,181,182,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,202,203,204,205,206,207,215,232,233],[167,180,195,215,232,233],[167,180,187,188,215,232,233],[167,178,180,188,189,215,232,233],[167,179,215,232,233],[167,172,175,180,215,232,233],[167,180,184,188,189,215,232,233],[167,184,215,232,233],[167,178,180,183,215,232,233,258],[167,172,177,180,187,215,232,233],[167,215,232,233,247],[167,175,180,201,215,232,233,263,265],[50,167,215,232,233],[50,58,59,167,212,215,232,233,247],[50,58,167,215,227,232,233,237,247],[50,59,167,215,232,233],[50,58,121,122,167,215,232,233],[50,61,127,133,147,167,215,227,232,233,237,248]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"7e29f41b158de217f94cb9676bf9cbd0cd9b5a46e1985141ed36e075c52bf6ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"dc0a7f107690ee5cd8afc8dbf05c4df78085471ce16bdd9881642ec738bc81fe","impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true,"impliedFormat":1},{"version":"a1387533f292cc1377923ba182557241ca949a2ca8495866dec169038c9e45a2","impliedFormat":1},{"version":"d9f4ec5156491a24eee340452d7e87e432512d5ebde23fe18c2ceb5a31c1720b","impliedFormat":1},{"version":"44716259b743dacde932f7f1922ac85f533af74e3ed82a078ba505414f6f6b53","impliedFormat":1},{"version":"653dc417862cf079d590653212a8d48ace7c89ff7b73c239791099afc25dca96","impliedFormat":1},{"version":"497efde09001124a1bfab8ea16409b6908fe8a49ae8d5d69082910838150fbfd","impliedFormat":1},{"version":"881d8c5d323b9a03009e467e1fb7bc2a32da16a567ca29c9d484518cb02ce3f7","impliedFormat":1},{"version":"5ed925f9d0dfcb0fde32518c7ae42f88461fd8eabb015a35183fac5ce95bbc6c","impliedFormat":1},{"version":"6ec2b44c0ec47a902ff373791d06826440a745d0eb7b284f504b1c4767493193","signature":"f7bdc9cea3eda01c487b962cca7cc15b811ae58fb8fa73fafc04a14ef07f0fa9"},{"version":"925197d3e9c833dc838b15e92bc18256dfc78e76849dea6238ef48ad0250c7c9","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"82008c79e53bddd417f96a32a0be7fa625e5a4fd4a650e0dd56ac83d44671981","signature":"c818fe5b5454b9fd01d04a3dc5df6c49f15444c82051693a41b9f8e69bb29fc0"},{"version":"a1387533f292cc1377923ba182557241ca949a2ca8495866dec169038c9e45a2","impliedFormat":1},{"version":"d9f4ec5156491a24eee340452d7e87e432512d5ebde23fe18c2ceb5a31c1720b","impliedFormat":1},{"version":"44716259b743dacde932f7f1922ac85f533af74e3ed82a078ba505414f6f6b53","impliedFormat":1},{"version":"653dc417862cf079d590653212a8d48ace7c89ff7b73c239791099afc25dca96","impliedFormat":1},{"version":"497efde09001124a1bfab8ea16409b6908fe8a49ae8d5d69082910838150fbfd","impliedFormat":1},{"version":"881d8c5d323b9a03009e467e1fb7bc2a32da16a567ca29c9d484518cb02ce3f7","impliedFormat":1},{"version":"5ed925f9d0dfcb0fde32518c7ae42f88461fd8eabb015a35183fac5ce95bbc6c","impliedFormat":1},{"version":"edb57b27d48489baf5a87ce96836f1528a321ba457f041d2ac0547695e7b834d","impliedFormat":99},{"version":"ff7ffac8d9efc0c3c21083324e96d40aae6debeff7599af97ea19510391236bc","impliedFormat":1},{"version":"528478c48719597726719b0c02c9933bf30c4d08240379df2737b0855acf3a90","impliedFormat":99},{"version":"1c818600f03ad929f377da68467907829a798274bb0b39de15eacdb1241003b6","impliedFormat":99},{"version":"15e2142e16301eca8fb366111117768b44154c8128a61496a8b0af17008239e8","impliedFormat":99},{"version":"0d37c43ae51d1b13017bf50618a62552e882ae1a9c0d4425e86a034e3781c509","impliedFormat":99},{"version":"e3f13b824c948792bb46b2859d7c5eb30efd0d50d9af7e83764b227f845050da","impliedFormat":99},{"version":"f2ed3f8d9c948390ed90b0d7127fda3c0ce07b18d21e48168dd5fd73670e988f","impliedFormat":99},{"version":"14b7f2e37bf42ab1f0b45d01443710c31b0f9cbba6f725cd1aa496859c765db0","impliedFormat":99},{"version":"1306c87ada55f6d882bd105e63a35fd500963af597985455255f915a3181673b","impliedFormat":99},{"version":"2e1188831736864fbd665075a904657abb32d408d0f5ff8a602b199629da318c","impliedFormat":1},{"version":"5ae76ad70cfa4018ee68c99dc54f5e61e6121e21e6225e0743df0abb92c95405","impliedFormat":1},{"version":"12898267ff8712ba92472197c6c3564bc6df883b07d38abe40051354b58fee43","impliedFormat":1},{"version":"5bb7aa46ccff237fa042d687bdea3772e5d3306dab25867d8810a8b14996e295","impliedFormat":1},{"version":"738d4339dab94f3d956302ebe262550cc55ae1e2325aa3c07f67cfd2dfd4f2f7","impliedFormat":1},{"version":"18483e142d029a403d4af3017f0b42047cf523f5644993bf06e3c7168d30efec","impliedFormat":1},{"version":"f91fa6b7d7b917cb13abba172f09cb9322c4d4c6d3235c57fbd54a2db497efa0","impliedFormat":1},{"version":"0b17ba1214d60974a7f28729da417368ba63d6ffd622b6d2935005e4ced5da68","impliedFormat":1},{"version":"7ea405f18742e9ca5cdea12c391b58a16a5f12e2a8faf29f1af8da53b49d5adc","impliedFormat":1},{"version":"f0009b468a30c32db6ef3b58aea8293a5dcbf7be105e38c4599438fc76b38394","impliedFormat":99},{"version":"06a06b5047ff381fe6f45076532f73b9a5b3c9f453a7ac7e401781bd95672c32","impliedFormat":99},{"version":"6ccbcfbcab033b9b7ab70739bfeb95e7472ddfcb94b0729d2cdc1021e20f9399","impliedFormat":99},{"version":"d85fc88fe1ff8eca1ea1b58f75730b0ff27b8000529ab8c57ebe409e32e593ca","impliedFormat":99},{"version":"73216471057e2581feec6d718232836d6998a793dd8d5d0b88b8b2a80bf344be","impliedFormat":99},{"version":"4e9062342cc5aed8828fc8ee0e04a0ba42cc52a390ac3f899d987eabd245697b","impliedFormat":99},{"version":"6c06d626cdb0dfa2ff6228dc0294fe65950c6c414fb961bc0c97f224a2a88715","impliedFormat":99},{"version":"2d6c84e69145203d346795140f66485924307231ec8bf2efbd2a5442f1893d40","impliedFormat":99},{"version":"ddd2e107ff7cec410fff277194e8a820b5ec4fc43b2b1164a5d9848e3b224615","impliedFormat":99},{"version":"35b7993c1896a9f91426d8602e06800acac6c41653e7aad211a38351f2f1137e","impliedFormat":99},{"version":"7f48ac6b67c38d784c4461536d5786b287bc887a40d336696df9ffda552c3026","impliedFormat":99},{"version":"8603ad107b941d1b11634e11bf1f30f1a63209a157a49c6806a9346d4014b229","impliedFormat":99},{"version":"966b1aaed0c756acd90bf0be7247e58f070dc870ec04709a626982c056bfcdc8","impliedFormat":99},{"version":"b2a2ecda21956cb0e9f1711f2b88363bdfe34b66df51fff3093476dcd8b08c40","impliedFormat":99},{"version":"8886569e698727ba5aeb3df443e4e7a7224bf7cfc9dc88ec90f6561dc95b8975","impliedFormat":99},{"version":"e1f1fea201441745b6df7a711ddc65cf556655a447af6499995fdf061d7a25ce","impliedFormat":99},{"version":"cd12a32f577a139273fabf45ffe2f0d1b7e03b4829cff822c4e41adec447ccff","impliedFormat":99},{"version":"0e18f3b56866a19d4aba40d3a0bef9164055d9e704f06fa78c4658395fa1d8cd","impliedFormat":99},{"version":"4de49db63cc9706eaf23a7ae923ef6e20a996c7b6b0714f66805486fc3eef0e0","impliedFormat":99},{"version":"744b83cd662146e0edca6559a7777344eac401c80b4b64c9a747260140b32c6f","impliedFormat":99},{"version":"d0f4653d210a5cecf89ce7b57658d8bc20a8a70a567e6b29f72b6eaf0f4b8a11","impliedFormat":99},{"version":"653e1162c47368daf00009f3e44ef9b99d61d285e4fc373de5ae7786c4801a82","impliedFormat":99},{"version":"3d7540c3b55994757e63f6b806971007a6114e4a10d1a8dc913fd1ee2b565fc7","impliedFormat":99},{"version":"47b12cd359444e90e09d30326497cd98abaacc7fdb1731417001d47d97d6d20f","impliedFormat":99},{"version":"e5aab10ac642bce4e682752ecf7d9be01a5aef352470221293e0c8a761bc531c","impliedFormat":99},{"version":"505084107f9a5cae5b0eebd74afb8b9b367704de06d0d22984bbed4a24c01c84","impliedFormat":99},{"version":"6bc7b70645783405c67547714959bc86221290e86dbdf96a1d3105cbaf748d5a","impliedFormat":99},{"version":"ae2032c46dbfefa06fcb221321e79af9018d493421e4ba0e367bae368a809df1","impliedFormat":99},{"version":"c8504ddc0e62963dbf1be49a581e39201405f2f6769e9e4aabbf5ce36579fcfe","impliedFormat":99},{"version":"5fcbc73afb531a51dea9307366dd3bfe9f8a4c8e6aa81a656d91a91a8d4d7758","impliedFormat":99},{"version":"033baf9bd75627c25ea2bd0da9f3721b82b157ed05f80ef9621ffd039c9c36a9","impliedFormat":99},{"version":"8fdd1687d63d53d8f9485052b846ac09c876a85b2f5fab8a89caf34c79c1c5ff","impliedFormat":99},{"version":"d070c2ac67c342b91cacd7e6ea5ed1f3bc0fd05ca7cce760810768e2916032be","impliedFormat":99},{"version":"2bfc14f3606b9a78af2aa9555406c3281b8e4b7c6f25b828c110370648fb3e4f","impliedFormat":99},{"version":"bc03c3c352f689e38c0ddd50c39b1e65d59273991bfc8858a9e3c0ebb79c023b","impliedFormat":1},{"version":"ef40dadc9172dc6e5f0732f257734681637feab7afb399c111f38acbd7fa43ae","signature":"0b53f2acc15b98cc6bdd228b5ffe6c3fed0b9b947eaf10e1cd20823f90f7ce9a","affectsGlobalScope":true},{"version":"c5918c2ae02d88b93e93e60d87b550890fa613c29583ed64ef092a973504086c","impliedFormat":1},{"version":"eea15ca51e6dc8262c7e9bf7ce60ee64cb3a1c79077afc81d38216eb9f179cba","impliedFormat":1},{"version":"9777dfc22bb5be17ba22af5a785c9fb0f6d505144ae71630ce7addf258bcab0c","impliedFormat":1},{"version":"f34455f488adf70936ebfb7bac6e1dde0fdd41cfcab2ec565a18a761e1995716","impliedFormat":1},{"version":"e08660f21d0e8b367414e78706ae69a19b078fb67b0fe8c818ccaeeeedc00272","impliedFormat":1},{"version":"32727845ab5bd8a9ef3e4844c567c09f6d418fcf0f90d381c00652a6f23e7f6e","impliedFormat":1},{"version":"8324f3861a7a8db0f9d294f6a189182b2d231840cebb7f3ea5f4635773cdaf41","impliedFormat":1},{"version":"be57def447f85b42c8f509a8ce4125c1af5f26597c4a93ef617aae5e0b81fa02","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f00324f263189b385c3a9383b1f4dae6237697bcf0801f96aa35c340512d79c","impliedFormat":1},{"version":"ec8997c2e5cea26befc76e7bf990750e96babb16977673a9ff3b5c0575d01e48","impliedFormat":1},{"version":"894bd2a64bfce5b28d1f4b6760f2eb75f07ce64dd1c272bbf7ceb6fec3f27912","impliedFormat":1},{"version":"0838507efff4f479c6f603ec812810ddfe14ab32abf8f4a8def140be970fe439","impliedFormat":1},{"version":"072f583571d6e3d30cd9760ee3485d29484fb7b54ba772ac135c747a380096a1","impliedFormat":1},{"version":"31eca2d6be5e38d8b2f76c917424e01cc47b0b99a5b9aa07059ff91408abe555","impliedFormat":1},{"version":"6d398ebb9de7ff3ce18bed9dc64dc7d8e8a3ff2fd099f3d98626a1be47d967a3","impliedFormat":1},{"version":"b21469f3144ac62cba082602b8495482633443bf8afcd65caf794025532662a5","impliedFormat":1},{"version":"53d6831f9f6b4dbf422c99c0dc2d879a7aaeb51b42a43911e899258527ba4983","impliedFormat":1},{"version":"a0846c150c0960c2a1ab7582d9b4c351afa4923e0f767d4ef7d8c26ed893f685","impliedFormat":1},{"version":"6ff702721d87c0ba8e7f8950e7b0a3b009dfd912fab3997e0b63fab8d83919c3","impliedFormat":1},{"version":"9dce9fc12e9a79d1135699d525aa6b44b71a45e32e3fa0cf331060b980b16317","impliedFormat":1},{"version":"586b2fd8a7d582329658aaceec22f8a5399e05013deb49bcfde28f95f093c8ee","impliedFormat":1},{"version":"add2e396a8d10be760e447464be5861e12ecc215489f87910afeaa26a6a54c88","impliedFormat":1},{"version":"ef1f3eadd7bed282de45bafd7c2c00105cf1db93e22f6cd763bec8a9c2cf6df1","impliedFormat":1},{"version":"2b90463c902dbe4f5bbb9eae084c05de37477c17a5de1e342eb7cbc9410dc6a1","impliedFormat":1},{"version":"804b4a23ae83d4d1a21d1ec7b797940293cbc00154e777b8d1e3e427271d568c","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"7720d729ef5218ad6e987b13e1c46f4c4d0a70d1b85efa5a4083d0c08354f7d1",{"version":"fb893a0dfc3c9fb0f9ca93d0648694dd95f33cbad2c0f2c629f842981dfd4e2e","impliedFormat":1},{"version":"89e326922cadcc2331d7e851011cf9f0456a681aaf3c95b48b81f8d80e8cdfba","impliedFormat":1},{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1},{"version":"8566fa84085caa46340393b1704ecd368491918fb45bd688d6e89736aec73a2f","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1},{"version":"5d08a179b846f5ee674624b349ebebe2121c455e3a265dc93da4e8d9e89722b4","impliedFormat":1},{"version":"89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","impliedFormat":1},{"version":"79b4369233a12c6fa4a07301ecb7085802c98f3a77cf9ab97eee27e1656f82e6","impliedFormat":1},{"version":"d4a22007b481fe2a2e6bfd3a42c00cd62d41edb36d30fc4697df2692e9891fc8","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"58647d85d0f722a1ce9de50955df60a7489f0593bf1a7015521efe901c06d770","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6f137d651076822d4fe884287e68fd61785a0d3d1fdb250a5059b691fa897db","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"bceb58df66ab8fb00170df20cd813978c5ab84be1d285710c4eb005d8e9d8efb","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"80523c00b8544a2000ae0143e4a90a00b47f99823eb7926c1e03c494216fc363","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"746911b62b329587939560deb5c036aca48aece03147b021fa680223255d5183","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c8d3e5a18ba35629954e48c4cc8f11dc88224650067a172685c736b27a34a4dc","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"2b55d426ff2b9087485e52ac4bc7cfafe1dc420fc76dad926cd46526567c501a","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"358765d5ea8afd285d4fd1532e78b88273f18cb3f87403a9b16fef61ac9fdcfe","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1},{"version":"be1cc4d94ea60cbe567bc29ed479d42587bf1e6cba490f123d329976b0fe4ee5","impliedFormat":1}],"root":[[59,61],123,148,149],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":1,"noImplicitAny":true,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":2},"referencedMap":[[79,1],[81,1],[83,1],[84,2],[82,1],[80,3],[126,4],[124,4],[125,4],[127,5],[54,6],[53,7],[56,7],[58,8],[52,9],[55,7],[57,6],[85,1],[86,10],[87,11],[71,12],[69,13],[72,14],[73,13],[74,15],[75,15],[76,13],[77,15],[78,13],[88,16],[89,15],[90,15],[91,15],[92,15],[93,15],[94,17],[95,13],[97,18],[96,6],[98,19],[100,19],[101,19],[102,19],[103,19],[104,19],[105,19],[106,19],[107,19],[108,19],[109,19],[110,19],[111,19],[112,19],[113,19],[114,19],[115,19],[99,19],[116,20],[117,21],[120,22],[118,23],[119,24],[121,25],[64,6],[63,26],[66,26],[68,27],[62,9],[65,26],[67,6],[70,6],[133,28],[151,29],[156,30],[152,6],[155,31],[157,32],[154,6],[159,33],[153,6],[160,33],[161,6],[150,6],[212,34],[213,34],[214,35],[167,36],[215,37],[216,38],[217,39],[162,6],[165,40],[163,6],[164,6],[218,41],[219,42],[220,43],[221,44],[222,45],[223,46],[224,46],[225,47],[226,48],[227,49],[228,50],[168,6],[166,6],[229,51],[230,52],[231,53],[265,54],[232,55],[233,6],[234,56],[235,57],[236,58],[237,59],[238,60],[239,61],[240,62],[241,63],[242,64],[243,64],[244,65],[245,6],[246,66],[247,67],[249,68],[248,69],[250,70],[251,71],[252,72],[253,73],[254,74],[255,75],[256,76],[257,77],[258,78],[259,79],[260,80],[261,81],[262,82],[169,6],[170,6],[171,6],[209,83],[210,6],[211,6],[263,84],[264,85],[122,15],[266,15],[47,6],[49,86],[50,15],[158,6],[48,6],[145,87],[146,88],[144,89],[147,90],[141,91],[142,92],[143,93],[137,91],[138,91],[140,94],[139,91],[134,95],[136,96],[135,6],[128,6],[129,97],[130,98],[132,99],[131,97],[51,6],[45,6],[46,6],[8,6],[10,6],[9,6],[2,6],[11,6],[12,6],[13,6],[14,6],[15,6],[16,6],[17,6],[18,6],[3,6],[19,6],[20,6],[4,6],[21,6],[25,6],[22,6],[23,6],[24,6],[26,6],[27,6],[28,6],[5,6],[29,6],[30,6],[31,6],[32,6],[6,6],[36,6],[33,6],[34,6],[35,6],[37,6],[7,6],[38,6],[43,6],[44,6],[39,6],[40,6],[41,6],[42,6],[1,6],[187,100],[197,101],[186,100],[207,102],[178,103],[177,104],[206,105],[200,106],[205,107],[180,108],[194,109],[179,110],[203,111],[175,112],[174,105],[204,113],[176,114],[181,115],[182,6],[185,115],[172,6],[208,116],[198,117],[189,118],[190,119],[192,120],[188,121],[191,122],[201,105],[183,123],[184,124],[193,125],[173,126],[196,117],[195,115],[199,6],[202,127],[149,128],[60,129],[59,130],[61,131],[123,132],[148,133]],"latestChangedDtsFile":"./test/acceptance.spec.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/html-formatter/docker-compose.yml b/node_modules/@cucumber/html-formatter/docker-compose.yml new file mode 100644 index 00000000..102837ff --- /dev/null +++ b/node_modules/@cucumber/html-formatter/docker-compose.yml @@ -0,0 +1,9 @@ +services: + playwright: + image: mcr.microsoft.com/playwright:v1.59.1-jammy + working_dir: /work + volumes: + - .:/work + environment: + - CI=true + command: sh -c "npm ci && npm run build && npx playwright test" diff --git a/node_modules/@cucumber/html-formatter/package.json b/node_modules/@cucumber/html-formatter/package.json new file mode 100644 index 00000000..61245ee1 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/package.json @@ -0,0 +1,73 @@ +{ + "name": "@cucumber/html-formatter", + "version": "23.1.0", + "description": "HTML formatter for Cucumber", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "repository": { + "type": "git", + "url": "git+https://github.com/cucumber/html-formatter.git" + }, + "author": "Aslak Hellesøy", + "license": "MIT", + "scripts": { + "clean": "shx rm -rf dist", + "build:tsc": "tsc --build tsconfig.build.json", + "build:webpack": "webpack", + "build": "npm run clean && npm run build:tsc && npm run prepare && npm run build:webpack", + "prepare": "shx mkdir -p dist/src && shx cp src/*.scss dist/src && shx cp src/index.mustache dist/src && shx cp src/icon.url dist/src", + "test": "mocha", + "prepublishOnly": "npm run build", + "fix": "biome check --fix --error-on-warnings", + "lint": "biome check --error-on-warnings", + "acceptance:local": "docker compose run --rm playwright", + "acceptance:update": "docker compose run --rm playwright npx playwright test --update-snapshots" + }, + "peerDependencies": { + "@cucumber/messages": ">=18" + }, + "devDependencies": { + "@babel/core": "7.29.0", + "@biomejs/biome": "^2.4.11", + "@cucumber/biome-config": "github:cucumber/biome-config#v0.1.0", + "@cucumber/compatibility-kit": "^29.1.4", + "@cucumber/gherkin": "39.0.0", + "@cucumber/gherkin-streams": "^6.0.0", + "@cucumber/gherkin-utils": "^11.0.0", + "@cucumber/message-streams": "4.1.1", + "@cucumber/messages": "32.3.0", + "@cucumber/query": "15.0.1", + "@cucumber/react-components": "24.3.0", + "@playwright/test": "1.59.1", + "@types/glob": "^9.0.0", + "@types/mocha": "10.0.10", + "@types/node": "22.19.17", + "@types/react": "19.2.14", + "@types/react-dom": "19.2.3", + "babel-loader": "10.1.1", + "css-loader": "7.1.4", + "glob": "^13.0.0", + "mini-css-extract-plugin": "2.10.2", + "mocha": "11.7.5", + "react": "19.2.5", + "react-dom": "19.2.5", + "sass": "1.99.0", + "sass-loader": "16.0.7", + "serve": "^14.2.4", + "shx": "^0.4.0", + "source-map-support": "0.5.21", + "ts-loader": "9.5.7", + "ts-node": "10.9.2", + "typescript": "5.9.3", + "webpack": "5.106.1", + "webpack-cli": "7.0.2" + }, + "bugs": { + "url": "https://github.com/cucumber/html-formatter/issues" + }, + "homepage": "https://github.com/cucumber/html-formatter#readme", + "directories": { + "test": "test" + }, + "keywords": [] +} diff --git a/node_modules/@cucumber/html-formatter/playwright.config.ts b/node_modules/@cucumber/html-formatter/playwright.config.ts new file mode 100644 index 00000000..f86785a7 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/playwright.config.ts @@ -0,0 +1,32 @@ +import { defineConfig, devices } from '@playwright/test' + +export default defineConfig({ + testDir: './test', + fullyParallel: true, + webServer: { + command: 'npx serve ./test/__output__', + url: 'http://localhost:3000', + reuseExistingServer: !process.env.CI, + stdout: 'ignore', + stderr: 'pipe', + }, + use: { + headless: true, + baseURL: 'http://localhost:3000', + colorScheme: 'light', + }, + projects: [ + { + name: 'chromium', + use: { + ...devices['Desktop Chrome'], + }, + }, + ], + snapshotPathTemplate: '{testDir}/__screenshots__/{arg}{ext}', + expect: { + toHaveScreenshot: { + stylePath: './test/screenshot.css', + }, + }, +}) diff --git a/node_modules/@cucumber/html-formatter/src/CucumberHtmlStream.spec.ts b/node_modules/@cucumber/html-formatter/src/CucumberHtmlStream.spec.ts new file mode 100644 index 00000000..21bee1d5 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/src/CucumberHtmlStream.spec.ts @@ -0,0 +1,86 @@ +import assert from 'node:assert' +import { Writable } from 'node:stream' +import type { Envelope } from '@cucumber/messages' + +import { CucumberHtmlStream } from './CucumberHtmlStream' + +async function renderAsHtml(...envelopes: Envelope[]): Promise { + return new Promise((resolve, reject) => { + let html = '' + const sink: Writable = new Writable({ + write(chunk: string, _: string, callback: (error?: Error | null) => void): void { + html += chunk + callback() + }, + }) + sink.on('finish', () => resolve(html)) + const cucumberHtmlStream = new CucumberHtmlStream( + `${__dirname}/dummy.css`, + `${__dirname}/dummy.js` + ) + cucumberHtmlStream.on('error', reject) + cucumberHtmlStream.pipe(sink) + + for (const envelope of envelopes) { + cucumberHtmlStream.write(envelope) + } + cucumberHtmlStream.end() + }) +} + +describe('CucumberHtmlStream', () => { + it('writes zero messages to html', async () => { + const html = await renderAsHtml() + assert(html.indexOf('window.CUCUMBER_MESSAGES = []') >= 0) + }) + + it('writes one message to html', async () => { + const e1: Envelope = { + testRunStarted: { + timestamp: { seconds: 0, nanos: 0 }, + }, + } + const html = await renderAsHtml(e1) + assert(html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)}]`) >= 0) + }) + + it('writes two messages to html', async () => { + const e1: Envelope = { + testRunStarted: { + timestamp: { seconds: 0, nanos: 0 }, + }, + } + const e2: Envelope = { + testRunFinished: { + timestamp: { seconds: 0, nanos: 0 }, + success: true, + }, + } + const html = await renderAsHtml(e1, e2) + assert( + html.indexOf(`window.CUCUMBER_MESSAGES = [${JSON.stringify(e1)},${JSON.stringify(e2)}]`) >= 0 + ) + }) + + it('escapes forward slashes', async () => { + const e1: Envelope = { + gherkinDocument: { + comments: [ + { + location: { + line: 0, + column: 0, + }, + text: ``, + }, + ], + }, + } + const html = await renderAsHtml(e1) + assert( + html.indexOf( + `window.CUCUMBER_MESSAGES = [{"gherkinDocument":{"comments":[{"location":{"line":0,"column":0},"text":"\\x3C/script>\\x3Cscript>alert('Hello')\\x3C/script>"}]}}];` + ) >= 0 + ) + }) +}) diff --git a/node_modules/@cucumber/html-formatter/src/CucumberHtmlStream.ts b/node_modules/@cucumber/html-formatter/src/CucumberHtmlStream.ts new file mode 100644 index 00000000..717f468a --- /dev/null +++ b/node_modules/@cucumber/html-formatter/src/CucumberHtmlStream.ts @@ -0,0 +1,134 @@ +import fs from 'node:fs' +import path from 'node:path' +import { type Readable, Transform, type TransformCallback } from 'node:stream' +import type { Envelope } from '@cucumber/messages' + +export class CucumberHtmlStream extends Transform { + private template: string | null = null + private preMessageWritten = false + private postMessageWritten = false + private firstMessageWritten = false + + /** + * @param cssPath + * @param jsPath + * @param iconPath + */ + constructor( + private readonly cssPath: string = path.join(__dirname, '..', 'main.css'), + private readonly jsPath: string = path.join(__dirname, '..', 'main.js'), + private readonly iconPath: string = path.join(__dirname, 'icon.url') + ) { + super({ objectMode: true }) + } + + public _transform(envelope: Envelope, _encoding: string, callback: TransformCallback): void { + if (this.postMessageWritten) { + callback(new Error('Stream closed')) + return + } + + this.writePreMessageUnlessAlreadyWritten((err) => { + if (err) { + callback(err) + return + } + this.writeMessage(envelope) + callback() + }) + } + + public _flush(callback: TransformCallback): void { + this.writePostMessage(callback) + } + + private writePreMessageUnlessAlreadyWritten(callback: TransformCallback) { + if (this.preMessageWritten) { + return callback() + } + this.preMessageWritten = true + this.writeTemplateBetween(null, '{{title}}', (err) => { + if (err) return callback(err) + this.push('Cucumber') + this.writeTemplateBetween('{{title}}', '{{icon}}', (err) => { + if (err) return callback(err) + this.writeFile(this.iconPath, (err) => { + if (err) return callback(err) + this.writeTemplateBetween('{{icon}}', '{{css}}', (err) => { + if (err) return callback(err) + this.writeFile(this.cssPath, (err) => { + if (err) return callback(err) + this.writeTemplateBetween('{{css}}', '{{custom_css}}', (err) => { + if (err) return callback(err) + this.writeTemplateBetween('{{custom_css}}', '{{messages}}', (err) => { + if (err) return callback(err) + callback() + }) + }) + }) + }) + }) + }) + }) + } + + private writePostMessage(callback: TransformCallback) { + this.writePreMessageUnlessAlreadyWritten((err) => { + if (err) return callback(err) + this.writeTemplateBetween('{{messages}}', '{{script}}', (err) => { + if (err) return callback(err) + this.writeFile(this.jsPath, (err) => { + if (err) return callback(err) + this.writeTemplateBetween('{{script}}', '{{custom_script}}', (err) => { + if (err) return callback(err) + this.writeTemplateBetween('{{custom_script}}', null, callback) + }) + }) + }) + }) + } + + private writeFile(path: string, callback: (error?: Error | null) => void) { + const cssStream: Readable = fs.createReadStream(path, { encoding: 'utf-8' }) + cssStream.on('data', (chunk) => this.push(chunk)) + cssStream.on('error', (err) => callback(err)) + cssStream.on('end', callback) + } + + private writeTemplateBetween( + begin: string | null, + end: string | null, + callback: (err?: Error | null) => void + ) { + this.readTemplate((err, template) => { + if (err) return callback(err) + if (!template) return callback(new Error('template is required if error is missing')) + const beginIndex = begin == null ? 0 : template.indexOf(begin) + begin.length + const endIndex = end == null ? template.length : template.indexOf(end) + this.push(template.substring(beginIndex, endIndex)) + callback() + }) + } + + private readTemplate(callback: (error?: Error | null, data?: string) => void) { + if (this.template !== null) { + return callback(null, this.template) + } + fs.readFile(`${__dirname}/index.mustache`, { encoding: 'utf-8' }, (err, template) => { + if (err) return callback(err) + this.template = template + return callback(null, template) + }) + } + + private writeMessage(envelope: Envelope) { + if (!this.firstMessageWritten) { + this.firstMessageWritten = true + } else { + this.push(',') + } + // Replace < with \x3C + // https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements + this.push(JSON.stringify(envelope).replace(/ + + + {{title}} + + + + + + + +
+
+ + + + + diff --git a/node_modules/@cucumber/html-formatter/src/index.ts b/node_modules/@cucumber/html-formatter/src/index.ts new file mode 100644 index 00000000..fd3544f6 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/src/index.ts @@ -0,0 +1,8 @@ +import { CucumberHtmlStream } from './CucumberHtmlStream' + +export * from './CucumberHtmlStream' + +/** + * @deprecated use the named export `CucumberHtmlStream` instead + */ +export default CucumberHtmlStream diff --git a/node_modules/@cucumber/html-formatter/src/main.tsx b/node_modules/@cucumber/html-formatter/src/main.tsx new file mode 100644 index 00000000..e24b94d1 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/src/main.tsx @@ -0,0 +1,23 @@ +import './styles.scss' + +import type { Envelope } from '@cucumber/messages' +import { EnvelopesProvider, Report, UrlSearchProvider } from '@cucumber/react-components' +import { createRoot } from 'react-dom/client' + +declare global { + interface Window { + CUCUMBER_MESSAGES: Envelope[] + } +} + +const root = createRoot(document.getElementById('content') as HTMLElement) + +root.render( + + +
+ +
+
+
+) diff --git a/node_modules/@cucumber/html-formatter/src/styles.scss b/node_modules/@cucumber/html-formatter/src/styles.scss new file mode 100644 index 00000000..79544ea1 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/src/styles.scss @@ -0,0 +1,60 @@ +$sansFamily: + 'Inter var', + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + 'Helvetica Neue', + Arial, + 'Noto Sans', + sans-serif, + 'Apple Color Emoji', + 'Segoe UI Emoji', + 'Segoe UI Symbol', + 'Noto Color Emoji'; +$monoFamily: + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', + 'Courier New', monospace; + +:root { + background-color: white; + color: #222; +} + +body { + font-family: $sansFamily; + padding: 0; + margin: 0; +} + +pre, +code { + font-family: $monoFamily; +} + +.html-formatter { + max-width: 1600px; + min-height: 100vh; + margin: 0 auto; +} + +@media all and (prefers-color-scheme: dark) { + :root { + background-color: #1d1d26; + color: #c9c9d1; + --cucumber-anchor-color: #4caaee; + --cucumber-keyword-color: #d89077; + --cucumber-parameter-color: #4caaee; + --cucumber-tag-color: #85a658; + --cucumber-docstring-color: #66a565; + --cucumber-error-background-color: #cf6679; + --cucumber-error-text-color: #222; + --cucumber-code-background-color: #282a36; + --cucumber-code-text-color: #f8f8f2; + --cucumber-panel-background-color: #282a36; + --cucumber-panel-accent-color: #313442; + --cucumber-panel-text-color: #f8f8f2; + } +} diff --git a/node_modules/@cucumber/html-formatter/test/__output__/.gitkeep b/node_modules/@cucumber/html-formatter/test/__output__/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/all-statuses.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/all-statuses.png new file mode 100644 index 00000000..9979bd12 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/all-statuses.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/ambiguous.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/ambiguous.png new file mode 100644 index 00000000..cfc7d235 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/ambiguous.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/attachments.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/attachments.png new file mode 100644 index 00000000..faffc115 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/attachments.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/backgrounds.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/backgrounds.png new file mode 100644 index 00000000..c534aea7 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/backgrounds.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/cdata.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/cdata.png new file mode 100644 index 00000000..159ae040 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/cdata.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/data-tables.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/data-tables.png new file mode 100644 index 00000000..8232070a Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/data-tables.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/doc-strings.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/doc-strings.png new file mode 100644 index 00000000..aa5b768c Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/doc-strings.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/empty.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/empty.png new file mode 100644 index 00000000..4331262d Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/empty.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables-attachment.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables-attachment.png new file mode 100644 index 00000000..ae5323f7 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables-attachment.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables-undefined.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables-undefined.png new file mode 100644 index 00000000..4b15b199 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables-undefined.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables.png new file mode 100644 index 00000000..fd45438e Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/examples-tables.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/failedish-combinations.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/failedish-combinations.png new file mode 100644 index 00000000..9ec6b413 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/failedish-combinations.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-afterall-error.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-afterall-error.png new file mode 100644 index 00000000..69989e6b Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-afterall-error.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-attachments.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-attachments.png new file mode 100644 index 00000000..4f26eb76 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-attachments.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-beforeall-error.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-beforeall-error.png new file mode 100644 index 00000000..124c0507 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks-beforeall-error.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks.png new file mode 100644 index 00000000..fe87a955 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/global-hooks.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-attachment.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-attachment.png new file mode 100644 index 00000000..97825e87 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-attachment.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-conditional.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-conditional.png new file mode 100644 index 00000000..88da3193 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-conditional.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-named.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-named.png new file mode 100644 index 00000000..03b09129 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-named.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-skipped.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-skipped.png new file mode 100644 index 00000000..c04402a6 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-skipped.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-undefined.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-undefined.png new file mode 100644 index 00000000..ddbda9e4 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks-undefined.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks.png new file mode 100644 index 00000000..c8eba2ea Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/hooks.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/markdown.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/markdown.png new file mode 100644 index 00000000..0cdb31c1 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/markdown.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/minimal.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/minimal.png new file mode 100644 index 00000000..dc7217f4 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/minimal.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/multiple-features-reversed.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/multiple-features-reversed.png new file mode 100644 index 00000000..2b0b7309 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/multiple-features-reversed.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/multiple-features.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/multiple-features.png new file mode 100644 index 00000000..67d0ab29 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/multiple-features.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/parameter-types.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/parameter-types.png new file mode 100644 index 00000000..afab163d Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/parameter-types.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/pending-exception.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/pending-exception.png new file mode 100644 index 00000000..2960c4df Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/pending-exception.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/pending.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/pending.png new file mode 100644 index 00000000..6dd43412 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/pending.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/regular-expression.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/regular-expression.png new file mode 100644 index 00000000..347198b7 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/regular-expression.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-ambiguous.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-ambiguous.png new file mode 100644 index 00000000..0091a297 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-ambiguous.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-pending.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-pending.png new file mode 100644 index 00000000..74c5d578 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-pending.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-undefined.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-undefined.png new file mode 100644 index 00000000..1f21b1f2 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/retry-undefined.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/retry.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/retry.png new file mode 100644 index 00000000..4b3cfcca Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/retry.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/rules-backgrounds.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/rules-backgrounds.png new file mode 100644 index 00000000..d3567494 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/rules-backgrounds.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/rules.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/rules.png new file mode 100644 index 00000000..eb5248ab Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/rules.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped-exception.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped-exception.png new file mode 100644 index 00000000..e59b0733 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped-exception.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped-failing-hook.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped-failing-hook.png new file mode 100644 index 00000000..3309d1ac Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped-failing-hook.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped.png new file mode 100644 index 00000000..06114b69 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/skipped.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/stack-traces.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/stack-traces.png new file mode 100644 index 00000000..6e848d80 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/stack-traces.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/test-run-exception.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/test-run-exception.png new file mode 100644 index 00000000..763f27b0 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/test-run-exception.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/undefined.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/undefined.png new file mode 100644 index 00000000..0c063ba6 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/undefined.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/unknown-parameter-type.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/unknown-parameter-type.png new file mode 100644 index 00000000..3ae9477f Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/unknown-parameter-type.png differ diff --git a/node_modules/@cucumber/html-formatter/test/__screenshots__/unused-steps.png b/node_modules/@cucumber/html-formatter/test/__screenshots__/unused-steps.png new file mode 100644 index 00000000..09a204c6 Binary files /dev/null and b/node_modules/@cucumber/html-formatter/test/__screenshots__/unused-steps.png differ diff --git a/node_modules/@cucumber/html-formatter/test/acceptance.spec.ts b/node_modules/@cucumber/html-formatter/test/acceptance.spec.ts new file mode 100644 index 00000000..972fb284 --- /dev/null +++ b/node_modules/@cucumber/html-formatter/test/acceptance.spec.ts @@ -0,0 +1,41 @@ +import fs from 'node:fs' +import path from 'node:path' +import { pipeline } from 'node:stream/promises' + +import { NdjsonToMessageStream } from '@cucumber/message-streams' +import { expect, test } from '@playwright/test' +import { sync } from 'glob' + +import { CucumberHtmlStream } from '../src' + +const fixtures = sync(`./node_modules/@cucumber/compatibility-kit/features/**/*.ndjson`) + +test.beforeAll(async () => { + const outputDir = path.join(__dirname, './__output__') + + for (const fixture of fixtures) { + const name = path.basename(fixture, '.ndjson') + const outputFile = path.join(outputDir, `${name}.html`) + + await pipeline( + fs.createReadStream(fixture, { encoding: 'utf-8' }), + new NdjsonToMessageStream(), + new CucumberHtmlStream( + path.join(__dirname, '../dist/main.css'), + path.join(__dirname, '../dist/main.js'), + path.join(__dirname, '../dist/src/icon.url') + ), + fs.createWriteStream(outputFile) + ) + } +}) + +for (const fixture of fixtures) { + const name = path.basename(fixture, '.ndjson') + + test(`can render ${name}`, async ({ page }) => { + await page.goto(`/${name}.html`) + await page.waitForSelector('#report', { timeout: 3000 }) + await expect(page).toHaveScreenshot(`${name}.png`, { fullPage: true }) + }) +} diff --git a/node_modules/@cucumber/html-formatter/test/screenshot.css b/node_modules/@cucumber/html-formatter/test/screenshot.css new file mode 100644 index 00000000..2c4ce08a --- /dev/null +++ b/node_modules/@cucumber/html-formatter/test/screenshot.css @@ -0,0 +1,4 @@ +time, +[data-testid="cucumber.summary.setup"] { + visibility: hidden; +} diff --git a/node_modules/@cucumber/html-formatter/tsconfig.build.json b/node_modules/@cucumber/html-formatter/tsconfig.build.json new file mode 100644 index 00000000..8a11a99f --- /dev/null +++ b/node_modules/@cucumber/html-formatter/tsconfig.build.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "dist", + "composite": true, + "declarationMap": true, + "noEmit": false + }, + "include": ["src", "test", "package.json"] +} diff --git a/node_modules/@cucumber/html-formatter/tsconfig.json b/node_modules/@cucumber/html-formatter/tsconfig.json new file mode 100644 index 00000000..fd35d08d --- /dev/null +++ b/node_modules/@cucumber/html-formatter/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "sourceMap": true, + "allowJs": false, + "resolveJsonModule": true, + "esModuleInterop": true, + "noImplicitAny": true, + "downlevelIteration": true, + "skipLibCheck": true, + "strictNullChecks": true, + "experimentalDecorators": true, + "module": "CommonJS", + "lib": ["ES6", "dom"], + "target": "ES6", + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "noEmit": true, + "jsx": "react-jsx" + } +} diff --git a/node_modules/@cucumber/html-formatter/webpack.config.js b/node_modules/@cucumber/html-formatter/webpack.config.js new file mode 100644 index 00000000..5082a3eb --- /dev/null +++ b/node_modules/@cucumber/html-formatter/webpack.config.js @@ -0,0 +1,30 @@ +const MiniCssExtractPlugin = require('mini-css-extract-plugin') + +module.exports = { + entry: './dist/src/main.js', + module: { + rules: [ + { + test: /\.scss$/, + use: [ + MiniCssExtractPlugin.loader, + { + loader: 'css-loader', + options: { + modules: { + auto: true, + namedExport: false, + }, + }, + }, + 'sass-loader', + ], + }, + ], + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: 'main.css', + }), + ], +} diff --git a/node_modules/@cucumber/junit-xml-formatter/LICENSE b/node_modules/@cucumber/junit-xml-formatter/LICENSE new file mode 100644 index 00000000..a31fbfff --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Cucumber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/junit-xml-formatter/README.md b/node_modules/@cucumber/junit-xml-formatter/README.md new file mode 100644 index 00000000..d5e1ccda --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/README.md @@ -0,0 +1,5 @@ +⚠️ This is an internal package; you don't need to install it in order to use the junit formatter in `@cucumber/cucumber` as it's built in there. + +# junit-xml-formatter + +> Takes a stream of Cucumber messages and outputs a JUnit XML report \ No newline at end of file diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/JUnitXmlPrinter.d.ts b/node_modules/@cucumber/junit-xml-formatter/dist/JUnitXmlPrinter.d.ts new file mode 100644 index 00000000..52e22ce5 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/JUnitXmlPrinter.d.ts @@ -0,0 +1,15 @@ +import { Envelope } from '@cucumber/messages'; +import { Options } from './types'; +export declare class JUnitXmlPrinter { + private readonly write; + private readonly query; + private readonly builder; + private readonly testClassName?; + private readonly namingStrategy; + constructor(options: Options, write: (content: string) => void); + update(envelope: Envelope): void; + private makeReport; + private makeTestCases; + private pickleComparator; + private makeFailure; +} diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/JUnitXmlPrinter.js b/node_modules/@cucumber/junit-xml-formatter/dist/JUnitXmlPrinter.js new file mode 100644 index 00000000..038d5fa0 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/JUnitXmlPrinter.js @@ -0,0 +1,124 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JUnitXmlPrinter = void 0; +const messages_1 = require("@cucumber/messages"); +const query_1 = require("@cucumber/query"); +const xmlbuilder_1 = __importDefault(require("xmlbuilder")); +const helpers_1 = require("./helpers"); +const DEFAULT_NAMING_STRATEGY = (0, query_1.namingStrategy)(query_1.NamingStrategyLength.LONG, query_1.NamingStrategyFeatureName.EXCLUDE, query_1.NamingStrategyExampleName.NUMBER_AND_PICKLE_IF_PARAMETERIZED); +class JUnitXmlPrinter { + write; + query = new query_1.Query(); + builder; + testClassName; + namingStrategy; + constructor(options, write) { + this.write = write; + this.testClassName = options.testClassName; + this.namingStrategy = options.testNamingStrategy ?? DEFAULT_NAMING_STRATEGY; + this.builder = xmlbuilder_1.default + .create('testsuite', { invalidCharReplacement: '' }) + .att('name', options.suiteName || 'Cucumber'); + } + update(envelope) { + this.query.update(envelope); + if (envelope.testRunFinished) { + const testSuite = this.makeReport(); + this.builder.att('time', testSuite.time); + this.builder.att('tests', testSuite.tests); + this.builder.att('skipped', testSuite.skipped); + this.builder.att('failures', testSuite.failures); + this.builder.att('errors', testSuite.errors); + if (testSuite.timestamp) { + this.builder.att('timestamp', testSuite.timestamp); + } + for (const testCase of testSuite.testCases) { + const testcaseElement = this.builder.ele('testcase', { + classname: testCase.classname, + name: testCase.name, + time: testCase.time, + }); + if (testCase.failure) { + const failureElement = testcaseElement.ele(testCase.failure.kind); + if (testCase.failure.kind === 'failure' && testCase.failure.type) { + failureElement.att('type', testCase.failure.type); + } + if (testCase.failure.kind === 'failure' && testCase.failure.message) { + failureElement.att('message', testCase.failure.message); + } + if (testCase.failure.stack) { + failureElement.cdata(testCase.failure.stack); + } + } + if (testCase.output) { + testcaseElement.ele('system-out').cdata(testCase.output); + } + } + this.write(this.builder.end({ pretty: true })); + } + } + makeReport() { + const statuses = this.query.countMostSevereTestStepResultStatus(); + return { + time: (0, helpers_1.durationToSeconds)(this.query.findTestRunDuration()), + tests: this.query.countTestCasesStarted(), + skipped: (0, helpers_1.countStatuses)(statuses, (status) => status === messages_1.TestStepResultStatus.SKIPPED), + failures: (0, helpers_1.countStatuses)(statuses, (status) => status !== messages_1.TestStepResultStatus.PASSED && status !== messages_1.TestStepResultStatus.SKIPPED), + errors: 0, + testCases: this.makeTestCases(), + timestamp: (0, helpers_1.formatTimestamp)(this.query.findTestRunStarted()), + }; + } + makeTestCases() { + return this.query + .findAllTestCaseStartedOrderBy((q, testCaseStarted) => q.findPickleBy(testCaseStarted), this.pickleComparator) + .map((testCaseStarted) => { + const pickle = (0, helpers_1.ensure)(this.query.findPickleBy(testCaseStarted), 'Expected to find Pickle by TestCaseStarted'); + const lineage = (0, helpers_1.ensure)(this.query.findLineageBy(pickle), 'Expected to find Lineage by Pickle'); + return { + classname: this.testClassName ?? lineage.feature?.name ?? pickle.uri, + name: this.namingStrategy.reduce(lineage, pickle), + time: (0, helpers_1.durationToSeconds)(this.query.findTestCaseDurationBy(testCaseStarted)), + failure: this.makeFailure(testCaseStarted), + output: this.query + .findTestStepFinishedAndTestStepBy(testCaseStarted) + .filter(([, testStep]) => !!testStep.pickleStepId) + .map(([testStepFinished, testStep]) => { + const pickleStep = (0, helpers_1.ensure)(this.query.findPickleStepBy(testStep), 'Expected to find PickleStep by TestStep'); + const gherkinStep = (0, helpers_1.ensure)(this.query.findStepBy(pickleStep), 'Expected to find Step by PickleStep'); + return (0, helpers_1.formatStep)(gherkinStep, pickleStep, testStepFinished.testStepResult.status); + }) + .join('\n'), + }; + }); + } + pickleComparator(a, b) { + if (a.uri !== b.uri) { + return a.uri.localeCompare(b.uri); + } + if (!a.location) { + return !b.location ? 0 : -1; + } + else if (!b.location) { + return 1; + } + return a.location.line - b.location.line; + } + makeFailure(testCaseStarted) { + const result = this.query.findMostSevereTestStepResultBy(testCaseStarted); + if (!result || result.status === messages_1.TestStepResultStatus.PASSED) { + return undefined; + } + return { + kind: result.status === messages_1.TestStepResultStatus.SKIPPED ? 'skipped' : 'failure', + type: result.exception?.type, + message: result.exception?.message, + stack: result.exception?.stackTrace ?? result.message, + }; + } +} +exports.JUnitXmlPrinter = JUnitXmlPrinter; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSlVuaXRYbWxQcmludGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0pVbml0WG1sUHJpbnRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxpREFBNEY7QUFDNUYsMkNBT3dCO0FBQ3hCLDREQUFtQztBQUVuQyx1Q0FBaUc7QUFHakcsTUFBTSx1QkFBdUIsR0FBRyxJQUFBLHNCQUFjLEVBQzVDLDRCQUFvQixDQUFDLElBQUksRUFDekIsaUNBQXlCLENBQUMsT0FBTyxFQUNqQyxpQ0FBeUIsQ0FBQyxrQ0FBa0MsQ0FDN0QsQ0FBQTtBQTJCRCxNQUFhLGVBQWU7SUFRUDtJQVBGLEtBQUssR0FBRyxJQUFJLGFBQUssRUFBRSxDQUFBO0lBQ25CLE9BQU8sQ0FBdUI7SUFDOUIsYUFBYSxDQUFTO0lBQ3RCLGNBQWMsQ0FBZ0I7SUFFL0MsWUFDRSxPQUFnQixFQUNDLEtBQWdDO1FBQWhDLFVBQUssR0FBTCxLQUFLLENBQTJCO1FBRWpELElBQUksQ0FBQyxhQUFhLEdBQUcsT0FBTyxDQUFDLGFBQWEsQ0FBQTtRQUMxQyxJQUFJLENBQUMsY0FBYyxHQUFHLE9BQU8sQ0FBQyxrQkFBa0IsSUFBSSx1QkFBdUIsQ0FBQTtRQUMzRSxJQUFJLENBQUMsT0FBTyxHQUFHLG9CQUFVO2FBQ3RCLE1BQU0sQ0FBQyxXQUFXLEVBQUUsRUFBRSxzQkFBc0IsRUFBRSxFQUFFLEVBQUUsQ0FBQzthQUNuRCxHQUFHLENBQUMsTUFB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QVEsRUFBRSxDQUFDO1lBQ3ZCLE9BQU8sQ0FBQyxDQUFBO1FBQ1YsQ0FBQztRQUNELE9BQU8sQ0FBQyxDQUFDLFFBQVEsQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUE7SUFDMUMsQ0FBQztJQUVPLFdBQVcsQ0FBQyxlQUFnQztRQUNsRCxNQUFNLE1BQU0sR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLDhCQUE4QixDQUFDLGVBQWUsQ0FBQyxDQUFBO1FBQ3pFLElBQUksQ0FBQyxNQUFNLElBQUksTUFBTSxDQUFDLE1BQU0sS0FBSywrQkFBb0IsQ0FBQyxNQUFNLEVBQUUsQ0FBQztZQUM3RCxPQUFPLFNBQVMsQ0FBQTtRQUNsQixDQUFDO1FBQ0QsT0FBTztZQUNMLElBQUksRUFBRSxNQUFNLENBQUMsTUFBTSxLQUFLLCtCQUFvQixDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQyxTQUFTO1lBQzVFLElBQUksRUFBRSxNQUFNLENBQUMsU0FBUyxFQUFFLElBQUk7WUFDNUIsT0FBTyxFQUFFLE1BQU0sQ0FBQyxTQUFTLEVBQUUsT0FBTztZQUNsQyxLQUFLLEVBQUUsTUFBTSxDQUFDLFNBQVMsRUFBRSxVQUFVLElBQUksTUFBTSxDQUFDLE9BQU87U0FDdEQsQ0FBQTtJQUNILENBQUM7Q0FDRjtBQTVJRCwwQ0E0SUMifQ== \ No newline at end of file diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/helpers.d.ts b/node_modules/@cucumber/junit-xml-formatter/dist/helpers.d.ts new file mode 100644 index 00000000..c4b00083 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/helpers.d.ts @@ -0,0 +1,6 @@ +import { Duration, PickleStep, Step, TestRunStarted, TestStepResultStatus } from '@cucumber/messages'; +export declare function ensure(value: T | undefined, message: string): T; +export declare function durationToSeconds(duration?: Duration): number; +export declare function countStatuses(statuses: Record, predicate?: (status: TestStepResultStatus) => boolean): number; +export declare function formatStep(step: Step, pickleStep: PickleStep, status: TestStepResultStatus): string; +export declare function formatTimestamp(testRunStarted: TestRunStarted | undefined): string | undefined; diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/helpers.js b/node_modules/@cucumber/junit-xml-formatter/dist/helpers.js new file mode 100644 index 00000000..84c7ee8c --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/helpers.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ensure = ensure; +exports.durationToSeconds = durationToSeconds; +exports.countStatuses = countStatuses; +exports.formatStep = formatStep; +exports.formatTimestamp = formatTimestamp; +const messages_1 = require("@cucumber/messages"); +const luxon_1 = require("luxon"); +function ensure(value, message) { + if (!value) { + throw new Error(message); + } + return value; +} +function durationToSeconds(duration) { + if (!duration) { + return 0; + } + return messages_1.TimeConversion.durationToMilliseconds(duration) / 1000; +} +function countStatuses(statuses, predicate = () => true) { + return Object.entries(statuses) + .filter(([status]) => predicate(status)) + .reduce((prev, [, curr]) => prev + curr, 0); +} +function formatStep(step, pickleStep, status) { + let text = `${step.keyword.trim()} ${pickleStep.text.trim()}.`; + do { + text += '.'; + } while (text.length < 76); + return text + status.toLowerCase(); +} +function formatTimestamp(testRunStarted) { + if (!testRunStarted) { + return undefined; + } + const millis = messages_1.TimeConversion.timestampToMillisecondsSinceEpoch(testRunStarted.timestamp); + return luxon_1.DateTime.fromMillis(millis, { zone: 'UTC' }).toISO({ + suppressMilliseconds: true, + }); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGVscGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9oZWxwZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBVUEsd0JBS0M7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FVBQVUsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLEdBQUcsQ0FBQTtJQUM5RCxHQUFHLENBQUM7UUFDRixJQUFJLElBQUksR0FBRyxDQUFBO0lBQ2IsQ0FBQyxRQUFRLElBQUksQ0FBQyxNQUFNLEdBQUcsRUFBRSxFQUFDO0lBQzFCLE9BQU8sSUFBSSxHQUFHLE1BQU0sQ0FBQyxXQUFXLEVBQUUsQ0FBQTtBQUNwQyxDQUFDO0FBRUQsU0FBZ0IsZUFBZSxDQUFDLGNBQTBDO0lBQ3hFLElBQUksQ0FBQyxjQUFjLEVBQUUsQ0FBQztRQUNwQixPQUFPLFNBQVMsQ0FBQTtJQUNsQixDQUFDO0lBQ0QsTUFBTSxNQUFNLEdBQUcseUJBQWMsQ0FBQyxpQ0FBaUMsQ0FBQyxjQUFjLENBQUMsU0FBUyxDQUFDLENBQUE7SUFDekYsT0FBTyxnQkFBUSxDQUFDLFVBQVUsQ0FBQyxNQUFNLEVBQUUsRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQyxLQUFLLENBQUM7UUFDeEQsb0JBQW9CLEVBQUUsSUFBSTtLQUMzQixDQUFXLENBQUE7QUFDZCxDQUFDIn0= \ No newline at end of file diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/index.d.ts b/node_modules/@cucumber/junit-xml-formatter/dist/index.d.ts new file mode 100644 index 00000000..f2b671e9 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/index.d.ts @@ -0,0 +1,4 @@ +import { plugin } from './plugin'; +export * from './JUnitXmlPrinter'; +export * from './types'; +export default plugin; diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/index.js b/node_modules/@cucumber/junit-xml-formatter/dist/index.js new file mode 100644 index 00000000..0c29d454 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/index.js @@ -0,0 +1,21 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const plugin_1 = require("./plugin"); +__exportStar(require("./JUnitXmlPrinter"), exports); +__exportStar(require("./types"), exports); +exports.default = plugin_1.plugin; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHFDQUFpQztBQUVqQyxvREFBaUM7QUFDakMsMENBQXVCO0FBRXZCLGtCQUFlLGVBQU0sQ0FBQSJ9 \ No newline at end of file diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/plugin.d.ts b/node_modules/@cucumber/junit-xml-formatter/dist/plugin.d.ts new file mode 100644 index 00000000..59a96c19 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/plugin.d.ts @@ -0,0 +1,11 @@ +import { Envelope } from '@cucumber/messages'; +import { Options } from './types'; +export declare const plugin: { + type: string; + formatter({ options, on, write, }: { + options: Options; + on: (type: "message", handler: (message: Envelope) => void) => void; + write: (content: string) => void; + }): void; + optionsKey: string; +}; diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/plugin.js b/node_modules/@cucumber/junit-xml-formatter/dist/plugin.js new file mode 100644 index 00000000..e86b21ad --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/plugin.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.plugin = void 0; +const JUnitXmlPrinter_1 = require("./JUnitXmlPrinter"); +exports.plugin = { + type: 'formatter', + formatter({ options, on, write, }) { + const printer = new JUnitXmlPrinter_1.JUnitXmlPrinter(options, write); + on('message', (message) => printer.update(message)); + }, + optionsKey: 'junit', +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2luLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3BsdWdpbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSx1REFBbUQ7QUFHdEMsUUFBQSxNQUFNLEdBQUc7SUFDcEIsSUFBSSxFQUFFLFdBQVc7SUFDakIsU0FBUyxDQUFDLEVBQ1IsT0FBTyxFQUNQLEVBQUUsRUFDRixLQUFLLEdBS047UUFDQyxNQUFNLE9BQU8sR0FBRyxJQUFJLGlDQUFlLENBQUMsT0FBTyxFQUFFLEtBQUssQ0FBQyxDQUFBO1FBQ25ELEVBQUUsQ0FBQyxTQUFTLEVBQUUsQ0FBQyxPQUFPLEVBQUUsRUFBRSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQTtJQUNyRCxDQUFDO0lBQ0QsVUFBVSxFQUFFLE9BQU87Q0FDcEIsQ0FBQSJ9 \ No newline at end of file diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/tsconfig.build.tsbuildinfo b/node_modules/@cucumber/junit-xml-formatter/dist/tsconfig.build.tsbuildinfo new file mode 100644 index 00000000..bc3bc418 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/tsconfig.build.tsbuildinfo @@ -0,0 +1 @@ +{"root":["../src/JUnitXmlPrinter.ts","../src/helpers.ts","../src/index.ts","../src/plugin.ts","../src/types.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/types.d.ts b/node_modules/@cucumber/junit-xml-formatter/dist/types.d.ts new file mode 100644 index 00000000..16e7029f --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/types.d.ts @@ -0,0 +1,6 @@ +import { NamingStrategy } from '@cucumber/query'; +export interface Options { + suiteName?: string; + testClassName?: string; + testNamingStrategy?: NamingStrategy; +} diff --git a/node_modules/@cucumber/junit-xml-formatter/dist/types.js b/node_modules/@cucumber/junit-xml-formatter/dist/types.js new file mode 100644 index 00000000..c9544d52 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/dist/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9 \ No newline at end of file diff --git a/node_modules/@cucumber/junit-xml-formatter/package.json b/node_modules/@cucumber/junit-xml-formatter/package.json new file mode 100644 index 00000000..9243e131 --- /dev/null +++ b/node_modules/@cucumber/junit-xml-formatter/package.json @@ -0,0 +1,61 @@ +{ + "name": "@cucumber/junit-xml-formatter", + "version": "0.13.3", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/cucumber/junit-xml-formatter.git" + }, + "author": "David Goss", + "license": "MIT", + "scripts": { + "build": "tsc --build tsconfig.build.json", + "clean": "rm -rf dist", + "fix": "eslint --ext ts --max-warnings 0 src --fix src && prettier --write src", + "lint": "eslint --ext ts --max-warnings 0 src && prettier --check src", + "test": "mocha 'src/**/*.spec.*'", + "prepublishOnly": "tsc --build tsconfig.build.json" + }, + "dependencies": { + "@cucumber/query": "^15.0.1", + "@teppeis/multimaps": "^3.0.0", + "luxon": "^3.5.0", + "xmlbuilder": "^15.1.1" + }, + "peerDependencies": { + "@cucumber/messages": "*" + }, + "devDependencies": { + "@cucumber/message-streams": "^4.0.1", + "@cucumber/messages": "32.3.1", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "^9.31.0", + "@types/chai": "^4.3.0", + "@types/chai-almost": "^1.0.3", + "@types/chai-xml": "^0.3.6", + "@types/luxon": "^3.4.2", + "@types/mocha": "^10.0.6", + "@types/node": "22.19.17", + "@typescript-eslint/eslint-plugin": "8.58.2", + "@typescript-eslint/parser": "8.58.2", + "chai": "^4.3.0", + "chai-almost": "^1.0.1", + "chai-xml": "^0.4.1", + "eslint": "9.39.4", + "eslint-plugin-import": "2.32.0", + "eslint-plugin-n": "17.24.0", + "eslint-plugin-simple-import-sort": "12.1.1", + "globals": "^17.0.0", + "globby": "^11.1.0", + "mocha": "^11.0.0", + "prettier": "3.8.2", + "@tsconfig/recommended": "^1.0.8", + "ts-node": "^10.9.1", + "typescript": "5.9.3" + } +} diff --git a/node_modules/@cucumber/message-streams/LICENSE b/node_modules/@cucumber/message-streams/LICENSE new file mode 100644 index 00000000..a31fbfff --- /dev/null +++ b/node_modules/@cucumber/message-streams/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Cucumber + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/message-streams/README.md b/node_modules/@cucumber/message-streams/README.md new file mode 100644 index 00000000..655f153d --- /dev/null +++ b/node_modules/@cucumber/message-streams/README.md @@ -0,0 +1,4 @@ +# Cucumber Message Streams + +This module contains stream utilities to read/write Cucumber Message objects +to/from streams. diff --git a/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.d.ts b/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.d.ts new file mode 100644 index 00000000..7705b7f0 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.d.ts @@ -0,0 +1,38 @@ +import { Transform, type TransformCallback } from 'node:stream'; +import { type Envelope, IdGenerator } from '@cucumber/messages'; +export interface AttachmentExternalisingStreamOptions { + /** + * Controls which attachments are externalised: + * - `false` (or omitted): pass through all messages unchanged + * - `true`: externalise every attachment + * - `ReadonlyArray`: externalise only attachments whose `mediaType` + * matches one of the given patterns (e.g. `['image/*', 'video/*']`), + * where the subtype may be `*` to match any subtype + * @remarks + * Attachments with certain media types (e.g. `text/x.cucumber.log+plain`) + * are always kept inline regardless of this option. + */ + behaviour?: boolean | ReadonlyArray; + /** + * Directory to write externalised attachment files into + */ + directory: string; + /** + * Function used to generate unique IDs for attachment filenames. Defaults + * to a UUID generator + */ + newId?: IdGenerator.NewId; +} +/** + * A transform stream that externalises attachment bodies from a stream of + * {@link Envelope}s by writing them to files in a given directory and + * replacing each body with a relative URL pointing to the written file. + */ +export declare class AttachmentExternalisingStream extends Transform { + private readonly writeOperations; + private readonly options; + constructor(options: AttachmentExternalisingStreamOptions); + _transform(envelope: Envelope, _encoding: string, callback: TransformCallback): void; + private shouldExternalise; + _flush(callback: TransformCallback): void; +} diff --git a/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.js b/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.js new file mode 100644 index 00000000..31e1c116 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.js @@ -0,0 +1,82 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AttachmentExternalisingStream = void 0; +const promises_1 = require("node:fs/promises"); +const node_path_1 = __importDefault(require("node:path")); +const node_stream_1 = require("node:stream"); +const messages_1 = require("@cucumber/messages"); +const mime_1 = __importDefault(require("mime")); +const alwaysInlinedTypes = ['text/x.cucumber.log+plain', 'text/uri-list']; +const encodingsMap = { + IDENTITY: 'utf-8', + BASE64: 'base64', +}; +/** + * A transform stream that externalises attachment bodies from a stream of + * {@link Envelope}s by writing them to files in a given directory and + * replacing each body with a relative URL pointing to the written file. + */ +class AttachmentExternalisingStream extends node_stream_1.Transform { + writeOperations = []; + options; + constructor(options) { + super({ objectMode: true }); + this.options = { + behaviour: false, + ...options, + newId: options.newId ?? messages_1.IdGenerator.uuid(), + }; + } + _transform(envelope, _encoding, callback) { + if (envelope.attachment && this.shouldExternalise(envelope.attachment)) { + const { attachment, writeOperation } = rewriteAttachment(envelope.attachment, this.options.directory, this.options.newId); + this.push({ ...envelope, attachment }); + if (writeOperation) { + this.writeOperations.push(writeOperation); + } + } + else { + this.push(envelope); + } + callback(); + } + shouldExternalise(attachment) { + const { behaviour } = this.options; + if (Array.isArray(behaviour)) { + return (!alwaysInlinedTypes.includes(attachment.mediaType) && + behaviour.some((pattern) => matchMediaType(attachment.mediaType, pattern))); + } + return behaviour === true; + } + _flush(callback) { + Promise.all(this.writeOperations).then(() => callback(), (err) => callback(err)); + } +} +exports.AttachmentExternalisingStream = AttachmentExternalisingStream; +function matchMediaType(mediaType, pattern) { + const [patternType, patternSubtype] = pattern.split('/'); + const [type, subtype] = mediaType.split('/'); + return patternType === type && (patternSubtype === '*' || patternSubtype === subtype); +} +function rewriteAttachment(original, directory, newId) { + if (alwaysInlinedTypes.includes(original.mediaType)) { + return { attachment: original }; + } + let filename = `attachment-${newId()}`; + const extension = mime_1.default.getExtension(original.mediaType); + if (extension) { + filename += `.${extension}`; + } + const writeOperation = (0, promises_1.writeFile)(node_path_1.default.join(directory, filename), Buffer.from(original.body, encodingsMap[original.contentEncoding])); + const attachment = { + ...original, + contentEncoding: messages_1.AttachmentContentEncoding.IDENTITY, + body: '', + url: `./${filename}`, + }; + return { attachment, writeOperation }; +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXR0YWNobWVudEV4dGVybmFsaXNpbmdTdHJlYW0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvQXR0YWNobWVudEV4dGVybmFsaXNpbmdTdHJlYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsK0NBQTRDO0FBQzVDLDBEQUE0QjtBQUM1Qiw2Q0FBK0Q7QUFFL0QsaURBSzJCO0FBQzNCLGdEQUF1QjtBQUV2QixNQUFNLGtCQUFrQixHQUFHLENBQUMsMkJBQTJCLEVBQUUsZUFBZSxDQUFDLENBQUE7QUFFekUsTUFBTSxZQUFZLEdBQW1DO0lBQ25ELFFBQVEsRUFBRSxPQUFPO0lBQ2pCLE1BQU0sRUFBRSxRQUFRO0NBQ2pCLENBQUE7QUEwQkQ7Ozs7R0FJRztBQUNILE1BQWEsNkJBQThCLFNBQVEsdUJBQVM7SUFDekMsZUFBZSxHQUFvQixFQUFFLENBQUE7SUFDckMsT0FBTyxDQUFnRDtJQUV4RSxZQUFZLE9BQTZDO1FBQ3ZELEtBQUssQ0FBQyxFQUFFLFVBQVUsRUFBRSxJQUFJLEVBQUUsQ0FBQyxDQUFBO1FBQzNCLElBQUksQ0FBQyxPQUFP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yxDQUFDLEVBQUUsQ0FBQztRQUNwRCxPQUFPLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxDQUFBO0lBQ2pDLENBQUM7SUFDRCxJQUFJLFFBQVEsR0FBRyxjQUFjLEtBQUssRUFBRSxFQUFFLENBQUE7SUFDdEMsTUFBTSxTQUFTLEdBQUcsY0FBSSxDQUFDLFlBQVksQ0FBQyxRQUFRLENBQUMsU0FBUyxDQUFDLENBQUE7SUFDdkQsSUFBSSxTQUFTLEVBQUUsQ0FBQztRQUNkLFFBQVEsSUFBSSxJQUFJLFNBQVMsRUFBRSxDQUFBO0lBQzdCLENBQUM7SUFDRCxNQUFNLGNBQWMsR0FBRyxJQUFBLG9CQUFTLEVBQzlCLG1CQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxRQUFRLENBQUMsRUFDOUIsTUFBTSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsSUFBSSxFQUFFLFlBQVksQ0FBQyxRQUFRLENBQUMsZUFBZSxDQUFDLENBQUMsQ0FDbkUsQ0FBQTtJQUNELE1BQU0sVUFBVSxHQUFlO1FBQzdCLEdBQUcsUUFBUTtRQUNYLGVBQWUsRUFBRSxvQ0FBeUIsQ0FBQyxRQUFRO1FBQ25ELElBQUksRUFBRSxFQUFFO1FBQ1IsR0FBRyxFQUFFLEtBQUssUUFBUSxFQUFFO0tBQ3JCLENBQUE7SUFDRCxPQUFPLEVBQUUsVUFBVSxFQUFFLGNBQWMsRUFBRSxDQUFBO0FBQ3ZDLENBQUMifQ== \ No newline at end of file diff --git a/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.spec.d.ts b/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.spec.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.spec.js b/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.spec.js new file mode 100644 index 00000000..077c701d --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/AttachmentExternalisingStream.spec.js @@ -0,0 +1,198 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_assert_1 = __importDefault(require("node:assert")); +const node_fs_1 = __importDefault(require("node:fs")); +const node_os_1 = __importDefault(require("node:os")); +const node_path_1 = __importDefault(require("node:path")); +const messages_1 = require("@cucumber/messages"); +const toArray_1 = __importDefault(require("../test/toArray")); +const AttachmentExternalisingStream_1 = require("./AttachmentExternalisingStream"); +async function collectMessages(envelopes, options) { + const stream = new AttachmentExternalisingStream_1.AttachmentExternalisingStream(options); + for (const envelope of envelopes) { + stream.write(envelope); + } + stream.end(); + return (0, toArray_1.default)(stream); +} +function getAttachment(envelope) { + node_assert_1.default.ok(envelope.attachment, 'expected envelope to have an attachment'); + return envelope.attachment; +} +describe('AttachmentExternalisingStream', () => { + let tmpDir; + beforeEach(() => { + tmpDir = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'cucumber-html-')); + }); + afterEach(() => { + node_fs_1.default.rmSync(tmpDir, { recursive: true }); + }); + it('passes through all messages when behaviour is false', async () => { + const envelopes = [ + { testRunStarted: { timestamp: { seconds: 0, nanos: 0 } } }, + { + attachment: { + body: Buffer.from('hello').toString('base64'), + contentEncoding: messages_1.AttachmentContentEncoding.BASE64, + mediaType: 'image/png', + }, + }, + ]; + const result = await collectMessages(envelopes, { behaviour: false, directory: tmpDir }); + node_assert_1.default.deepStrictEqual(result, envelopes); + node_assert_1.default.deepStrictEqual(node_fs_1.default.readdirSync(tmpDir), []); + }); + it('passes through non-attachment messages unchanged', async () => { + const envelope = { + testRunStarted: { timestamp: { seconds: 0, nanos: 0 } }, + }; + const result = await collectMessages([envelope], { behaviour: true, directory: tmpDir }); + node_assert_1.default.deepStrictEqual(result, [envelope]); + }); + it('externalises a BASE64 attachment', async () => { + const body = Buffer.from('hello').toString('base64'); + const envelope = { + attachment: { + body, + contentEncoding: messages_1.AttachmentContentEncoding.BASE64, + mediaType: 'image/png', + }, + }; + const result = await collectMessages([envelope], { behaviour: true, directory: tmpDir }); + const attachment = getAttachment(result[0]); + node_assert_1.default.strictEqual(attachment.body, ''); + node_assert_1.default.strictEqual(attachment.contentEncoding, messages_1.AttachmentContentEncoding.IDENTITY); + node_assert_1.default.ok(attachment.url); + node_assert_1.default.match(attachment.url, /^\.\/attachment-.*\.png$/); + const written = node_fs_1.default.readFileSync(node_path_1.default.join(tmpDir, attachment.url.slice(2))); + node_assert_1.default.deepStrictEqual(written, Buffer.from('hello')); + }); + it('externalises an IDENTITY attachment', async () => { + const envelope = { + attachment: { + body: '{"some":"json"}', + contentEncoding: messages_1.AttachmentContentEncoding.IDENTITY, + mediaType: 'application/json', + }, + }; + const result = await collectMessages([envelope], { behaviour: true, directory: tmpDir }); + const attachment = getAttachment(result[0]); + node_assert_1.default.strictEqual(attachment.body, ''); + node_assert_1.default.ok(attachment.url); + node_assert_1.default.match(attachment.url, /^\.\/attachment-.*\.json$/); + const written = node_fs_1.default.readFileSync(node_path_1.default.join(tmpDir, attachment.url.slice(2)), 'utf-8'); + node_assert_1.default.strictEqual(written, '{"some":"json"}'); + }); + it('does not externalise text/x.cucumber.log+plain', async () => { + const envelope = { + attachment: { + body: 'some log output', + contentEncoding: messages_1.AttachmentContentEncoding.IDENTITY, + mediaType: 'text/x.cucumber.log+plain', + }, + }; + const result = await collectMessages([envelope], { behaviour: true, directory: tmpDir }); + const attachment = getAttachment(result[0]); + node_assert_1.default.strictEqual(attachment.body, 'some log output'); + node_assert_1.default.strictEqual(attachment.url, undefined); + }); + it('does not externalise text/uri-list', async () => { + const envelope = { + attachment: { + body: 'https://example.com', + contentEncoding: messages_1.AttachmentContentEncoding.IDENTITY, + mediaType: 'text/uri-list', + }, + }; + const result = await collectMessages([envelope], { behaviour: true, directory: tmpDir }); + const attachment = getAttachment(result[0]); + node_assert_1.default.strictEqual(attachment.body, 'https://example.com'); + node_assert_1.default.strictEqual(attachment.url, undefined); + }); + it('externalises only attachments matching the given patterns', async () => { + const envelopes = [ + { + attachment: { + body: Buffer.from('image data').toString('base64'), + contentEncoding: messages_1.AttachmentContentEncoding.BASE64, + mediaType: 'image/png', + }, + }, + { + attachment: { + body: Buffer.from('video data').toString('base64'), + contentEncoding: messages_1.AttachmentContentEncoding.BASE64, + mediaType: 'video/mp4', + }, + }, + { + attachment: { + body: 'some text', + contentEncoding: messages_1.AttachmentContentEncoding.IDENTITY, + mediaType: 'text/plain', + }, + }, + ]; + const result = await collectMessages(envelopes, { + behaviour: ['image/*', 'video/*'], + directory: tmpDir, + }); + const image = getAttachment(result[0]); + node_assert_1.default.strictEqual(image.body, ''); + node_assert_1.default.ok(image.url); + const video = getAttachment(result[1]); + node_assert_1.default.strictEqual(video.body, ''); + node_assert_1.default.ok(video.url); + const text = getAttachment(result[2]); + node_assert_1.default.strictEqual(text.body, 'some text'); + node_assert_1.default.strictEqual(text.url, undefined); + }); + it('supports exact media type in patterns', async () => { + const envelopes = [ + { + attachment: { + body: Buffer.from('png data').toString('base64'), + contentEncoding: messages_1.AttachmentContentEncoding.BASE64, + mediaType: 'image/png', + }, + }, + { + attachment: { + body: Buffer.from('jpeg data').toString('base64'), + contentEncoding: messages_1.AttachmentContentEncoding.BASE64, + mediaType: 'image/jpeg', + }, + }, + ]; + const result = await collectMessages(envelopes, { + behaviour: ['image/png'], + directory: tmpDir, + }); + const png = getAttachment(result[0]); + node_assert_1.default.strictEqual(png.body, ''); + node_assert_1.default.ok(png.url); + const jpeg = getAttachment(result[1]); + node_assert_1.default.strictEqual(jpeg.body, Buffer.from('jpeg data').toString('base64')); + node_assert_1.default.strictEqual(jpeg.url, undefined); + }); + it('does not externalise always-inlined types even when matching patterns', async () => { + const envelope = { + attachment: { + body: 'some log output', + contentEncoding: messages_1.AttachmentContentEncoding.IDENTITY, + mediaType: 'text/x.cucumber.log+plain', + }, + }; + const result = await collectMessages([envelope], { + behaviour: ['text/*'], + directory: tmpDir, + }); + const attachment = getAttachment(result[0]); + node_assert_1.default.strictEqual(attachment.body, 'some log output'); + node_assert_1.default.strictEqual(attachment.url, undefined); + }); +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXR0YWNobWVudEV4dGVybmFsaXNpbmdTdHJlYW0uc3BlYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9BdHRhY2htZW50RXh0ZXJuYWxpc2luZ1N0cmVhbS5zcGVjLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsOERBQWdDO0FBQ2hDLHNEQUF3QjtBQUN4QixzREFBd0I7QUFDeEIsMERBQTRCO0FBRTVCLGlEQUE4RjtBQUM5Riw4REFBcUM7QUFFckMsbUZBQStFO0FBRS9FLEtBQUssVUFBVSxlQUFlLENBQzVCLFNBQXFCLEVBQ3JCLE9BQTZDO0lBRTdDLE1BQU0sTUFBTSxHQUFHLElBQUksNkRBQTZCLENBQUMsT0FBTyxDQUFDLENBQUE7SUFDekQsS0FBSyxNQUFNLFFBQVEsSUFBSSxTQUFTLEVBQUUsQ0FBQztRQUNqQyxNQUFNLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxDQUFBO0lBQ3hCLENBQUM7SUFDRCxNQUFNLENBQUMsR0FBRyxFQUFFLENBQUE7SUFDWixPQUFPLElBQUEsaUJBQU8sRUFBQyxNQUFNLENBQUMsQ0FBQTtBQUN4QixDQUFDO0FBRUQsU0FBUyxhQUFhLENBQUMsUUFBa0I7SUFDdkMscUJBQU0sQ0FBQyxFQUFFLENBQUMsUUFBUSxDQUFDLFVBQVUsRUFBRSx5Q0FBeUMsQ0FBQyxDQUFB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E1BQU0sR0FBRyxNQUFNLGVBQWUsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxFQUFFO1lBQy9DLFNBQVMsRUFBRSxDQUFDLFFBQVEsQ0FBQztZQUNyQixTQUFTLEVBQUUsTUFBTTtTQUNsQixDQUFDLENBQUE7UUFDRixNQUFNLFVBQVUsR0FBRyxhQUFhLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUE7UUFDM0MscUJBQU0sQ0FBQyxXQUFXLENBQUMsVUFBVSxDQUFDLElBQUksRUFBRSxpQkFBaUIsQ0FBQyxDQUFBO1FBQ3RELHFCQUFNLENBQUMsV0FBVyxDQUFDLFVBQVUsQ0FBQyxHQUFHLEVBQUUsU0FBUyxDQUFDLENBQUE7SUFDL0MsQ0FBQyxDQUFDLENBQUE7QUFDSixDQUFDLENBQUMsQ0FBQSJ9 \ No newline at end of file diff --git a/node_modules/@cucumber/message-streams/dist/src/MessageToNdjsonStream.d.ts b/node_modules/@cucumber/message-streams/dist/src/MessageToNdjsonStream.d.ts new file mode 100644 index 00000000..f2db6924 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/MessageToNdjsonStream.d.ts @@ -0,0 +1,9 @@ +import { Transform, type TransformCallback } from 'node:stream'; +import type { Envelope } from '@cucumber/messages'; +/** + * Transforms a stream of message objects to NDJSON + */ +export default class MessageToNdjsonStream extends Transform { + constructor(); + _transform(envelope: Envelope, _encoding: string, callback: TransformCallback): void; +} diff --git a/node_modules/@cucumber/message-streams/dist/src/MessageToNdjsonStream.js b/node_modules/@cucumber/message-streams/dist/src/MessageToNdjsonStream.js new file mode 100644 index 00000000..1a6e88c1 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/MessageToNdjsonStream.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_stream_1 = require("node:stream"); +/** + * Transforms a stream of message objects to NDJSON + */ +class MessageToNdjsonStream extends node_stream_1.Transform { + constructor() { + super({ writableObjectMode: true, readableObjectMode: false }); + } + _transform(envelope, _encoding, callback) { + const json = JSON.stringify(envelope); + this.push(`${json}\n`); + callback(); + } +} +exports.default = MessageToNdjsonStream; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWVzc2FnZVRvTmRqc29uU3RyZWFtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL01lc3NhZ2VUb05kanNvblN0cmVhbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZDQUErRDtBQUcvRDs7R0FFRztBQUNILE1BQXFCLHFCQUFzQixTQUFRLHVCQUFTO0lBQzFEO1FBQ0UsS0FBSyxDQUFDLEVBQUUsa0JBQWtCLEVBQUUsSUFBSSxFQUFFLGtCQUFrQixFQUFFLEtBQUssRUFBRSxDQUFDLENBQUE7SUFDaEUsQ0FBQztJQUVNLFVBQVUsQ0FBQyxRQUFrQixFQUFFLFNBQWlCLEVBQUUsUUFBMkI7UUFDbEYsTUFBTSxJQUFJLEdBQUcsSUFBSSxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsQ0FBQTtRQUNyQyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsSUFBSSxJQUFJLENBQUMsQ0FBQTtRQUN0QixRQUFRLEVBQUUsQ0FBQTtJQUNaLENBQUM7Q0FDRjtBQVZELHdDQVVDIn0= \ No newline at end of file diff --git a/node_modules/@cucumber/message-streams/dist/src/NdjsonToMessageStream.d.ts b/node_modules/@cucumber/message-streams/dist/src/NdjsonToMessageStream.d.ts new file mode 100644 index 00000000..0bcd8b4d --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/NdjsonToMessageStream.d.ts @@ -0,0 +1,17 @@ +import { Transform, type TransformCallback } from 'node:stream'; +import { type Envelope } from '@cucumber/messages'; +/** + * Transforms an NDJSON stream to a stream of message objects + */ +export default class NdjsonToMessageStream extends Transform { + private readonly parseLine; + private buffer; + /** + * Create a new stream + * + * @param parseLine a function that parses a line. This function may ignore a line by returning null. + */ + constructor(parseLine?: (line: string) => Envelope | null); + _transform(chunk: string, _encoding: string, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; +} diff --git a/node_modules/@cucumber/message-streams/dist/src/NdjsonToMessageStream.js b/node_modules/@cucumber/message-streams/dist/src/NdjsonToMessageStream.js new file mode 100644 index 00000000..43587129 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/NdjsonToMessageStream.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const node_stream_1 = require("node:stream"); +const messages_1 = require("@cucumber/messages"); +/** + * Transforms an NDJSON stream to a stream of message objects + */ +class NdjsonToMessageStream extends node_stream_1.Transform { + parseLine; + buffer = ''; + /** + * Create a new stream + * + * @param parseLine a function that parses a line. This function may ignore a line by returning null. + */ + constructor(parseLine = messages_1.parseEnvelope) { + super({ writableObjectMode: false, readableObjectMode: true }); + this.parseLine = parseLine; + } + _transform(chunk, _encoding, callback) { + this.buffer += Buffer.isBuffer(chunk) ? chunk.toString('utf-8') : chunk; + const lines = this.buffer.split('\n'); + if (!lines.length) { + callback(); + return; + } + this.buffer = lines.pop(); + for (const line of lines) { + if (line.trim().length > 0) { + try { + const envelope = this.parseLine(line); + if (envelope !== null) { + this.push(envelope); + } + } + catch (cause) { + callback(new Error(`Not JSON: '${line}'`, { cause })); + return; + } + } + } + callback(); + } + _flush(callback) { + if (this.buffer) { + try { + const object = JSON.parse(this.buffer); + this.push(object); + } + catch { + callback(new Error(`Not JSONs: ${this.buffer}`)); + return; + } + } + callback(); + } +} +exports.default = NdjsonToMessageStream; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTmRqc29uVG9NZXNzYWdlU3RyZWFtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL05kanNvblRvTWVzc2FnZVN0cmVh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NBQVMsQ0FBQyxJQUFJLENBQUMsQ0FBQTtvQkFDckMsSUFBSSxRQUFRLEtBQUssSUFBSSxFQUFFLENBQUM7d0JBQ3RCLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUE7b0JBQ3JCLENBQUM7Z0JBQ0gsQ0FBQztnQkFBQyxPQUFPLEtBQUssRUFBRSxDQUFDO29CQUNmLFFBQVEsQ0FBQyxJQUFJLEtBQUssQ0FBQyxjQUFjLElBQUksR0FBRyxFQUFFLEVBQUUsS0FBSyxFQUFFLENBQUMsQ0FBQyxDQUFBO29CQUNyRCxPQUFNO2dCQUNSLENBQUM7WUFDSCxDQUFDO1FBQ0gsQ0FBQztRQUNELFFBQVEsRUFBRSxDQUFBO0lBQ1osQ0FBQztJQUVNLE1BQU0sQ0FBQyxRQUEyQjtRQUN2QyxJQUFJLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQztZQUNoQixJQUFJLENBQUM7Z0JBQ0gsTUFBTSxNQUFNLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUE7Z0JBQ3RDLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUE7WUFDbkIsQ0FBQztZQUFDLE1BQU0sQ0FBQztnQkFDUCxRQUFRLENBQUMsSUFBSSxLQUFLLENBQUMsY0FBYyxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FBQyxDQUFBO2dCQUNoRCxPQUFNO1lBQ1IsQ0FBQztRQUNILENBQUM7UUFDRCxRQUFRLEVBQUUsQ0FBQTtJQUNaLENBQUM7Q0FDRjtBQWxERCx3Q0FrREMifQ== \ No newline at end of file diff --git a/node_modules/@cucumber/message-streams/dist/src/index.d.ts b/node_modules/@cucumber/message-streams/dist/src/index.d.ts new file mode 100644 index 00000000..1b9c405a --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/index.d.ts @@ -0,0 +1,4 @@ +import MessageToNdjsonStream from './MessageToNdjsonStream'; +import NdjsonToMessageStream from './NdjsonToMessageStream'; +export * from './AttachmentExternalisingStream'; +export { MessageToNdjsonStream, NdjsonToMessageStream }; diff --git a/node_modules/@cucumber/message-streams/dist/src/index.js b/node_modules/@cucumber/message-streams/dist/src/index.js new file mode 100644 index 00000000..e2857798 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/src/index.js @@ -0,0 +1,26 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NdjsonToMessageStream = exports.MessageToNdjsonStream = void 0; +const MessageToNdjsonStream_1 = __importDefault(require("./MessageToNdjsonStream")); +exports.MessageToNdjsonStream = MessageToNdjsonStream_1.default; +const NdjsonToMessageStream_1 = __importDefault(require("./NdjsonToMessageStream")); +exports.NdjsonToMessageStream = NdjsonToMessageStream_1.default; +__exportStar(require("./AttachmentExternalisingStream"), exports); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxvRkFBMkQ7QUFLbEQsZ0NBTEYsK0JBQXFCLENBS0U7QUFKOUIsb0ZBQTJEO0FBSTNCLGdDQUp6QiwrQkFBcUIsQ0FJeUI7QUFGckQsa0VBQStDIn0= \ No newline at end of file diff --git a/node_modules/@cucumber/message-streams/dist/test/toArray.d.ts b/node_modules/@cucumber/message-streams/dist/test/toArray.d.ts new file mode 100644 index 00000000..b2e7e1e9 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/test/toArray.d.ts @@ -0,0 +1,3 @@ +import type { Readable } from 'node:stream'; +import type * as messages from '@cucumber/messages'; +export default function toArray(input: Readable): Promise; diff --git a/node_modules/@cucumber/message-streams/dist/test/toArray.js b/node_modules/@cucumber/message-streams/dist/test/toArray.js new file mode 100644 index 00000000..cc993cf3 --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/test/toArray.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = toArray; +function toArray(input) { + return new Promise((resolve, reject) => { + const result = []; + input.on('data', (wrapper) => result.push(wrapper)); + input.on('end', () => resolve(result)); + input.on('error', (err) => reject(err)); + }); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9BcnJheS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3Rlc3QvdG9BcnJheS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUdBLDBCQU9DO0FBUEQsU0FBd0IsT0FBTyxDQUFDLEtBQWU7SUFDN0MsT0FBTyxJQUFJLE9BQU8sQ0FBQyxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsRUFBRTtRQUNyQyxNQUFNLE1BQU0sR0FBd0IsRUFBRSxDQUFBO1FBQ3RDLEtBQUssQ0FBQyxFQUFFLENBQUMsTUFBTSxFQUFFLENBQUMsT0FBMEIsRUFBRSxFQUFFLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFBO1FBQ3RFLEtBQUssQ0FBQyxFQUFFLENBQUMsS0FBSyxFQUFFLEdBQUcsRUFBRSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFBO1FBQ3RDLEtBQUssQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFFLENBQUMsR0FBVSxFQUFFLEVBQUUsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQTtJQUNoRCxDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMifQ== \ No newline at end of file diff --git a/node_modules/@cucumber/message-streams/dist/tsconfig.build.tsbuildinfo b/node_modules/@cucumber/message-streams/dist/tsconfig.build.tsbuildinfo new file mode 100644 index 00000000..c1cff35c --- /dev/null +++ b/node_modules/@cucumber/message-streams/dist/tsconfig.build.tsbuildinfo @@ -0,0 +1 @@ +{"root":["../src/AttachmentExternalisingStream.spec.ts","../src/AttachmentExternalisingStream.ts","../src/MessageToNdjsonStream.ts","../src/NdjsonToMessageStream.ts","../src/index.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/message-streams/package.json b/node_modules/@cucumber/message-streams/package.json new file mode 100644 index 00000000..6c4f4077 --- /dev/null +++ b/node_modules/@cucumber/message-streams/package.json @@ -0,0 +1,46 @@ +{ + "name": "@cucumber/message-streams", + "version": "4.1.1", + "description": "Streams for reading/writing messages", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "git://github.com/cucumber/message-streams.git" + }, + "author": "Cucumber Limited ", + "license": "MIT", + "scripts": { + "build": "tsc --build tsconfig.build.json", + "fix": "biome check --fix --error-on-warnings", + "lint": "biome check --error-on-warnings", + "test": "mocha \"src/**/*.spec.ts\" \"test/*Test.ts\"", + "prepublishOnly": "npm run build" + }, + "devDependencies": { + "@biomejs/biome": "^2.4.10", + "@cucumber/biome-config": "cucumber/biome-config#v0.1.0", + "@cucumber/messages": "^32.0.0", + "@tsconfig/recommended": "^1.0.13", + "@types/mime": "^3.0.4", + "@types/mocha": "10.0.10", + "@types/node": "22.19.17", + "mocha": "11.7.5", + "tsx": "^4.21.0", + "typescript": "5.9.3" + }, + "peerDependencies": { + "@cucumber/messages": ">=17.1.1" + }, + "bugs": { + "url": "https://github.com/cucumber/message-streams/issues" + }, + "homepage": "https://github.com/cucumber/message-streams#readme", + "keywords": [], + "dependencies": { + "mime": "^3.0.0" + } +} diff --git a/node_modules/@cucumber/messages/LICENSE b/node_modules/@cucumber/messages/LICENSE new file mode 100644 index 00000000..520b896f --- /dev/null +++ b/node_modules/@cucumber/messages/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Cucumber Ltd and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/messages/README.md b/node_modules/@cucumber/messages/README.md new file mode 100644 index 00000000..d9ca4460 --- /dev/null +++ b/node_modules/@cucumber/messages/README.md @@ -0,0 +1,2 @@ +# Cucumber Messages for JavaScript (JSON schema) + diff --git a/node_modules/@cucumber/messages/dist/cjs/package.json b/node_modules/@cucumber/messages/dist/cjs/package.json new file mode 100644 index 00000000..6666e053 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/package.json @@ -0,0 +1,4 @@ +{ + "name": "@cucumber/messages", + "type": "commonjs" +} diff --git a/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts b/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts new file mode 100644 index 00000000..cf2902b7 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts @@ -0,0 +1,4 @@ +export type NewId = () => string; +export declare function uuid(): NewId; +export declare function incrementing(): NewId; +//# sourceMappingURL=IdGenerator.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts.map new file mode 100644 index 00000000..6bf199e6 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"IdGenerator.d.ts","sourceRoot":"","sources":["../../../src/IdGenerator.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,MAAM,MAAM,CAAA;AAEhC,wBAAgB,IAAI,IAAI,KAAK,CAE5B;AAED,wBAAgB,YAAY,IAAI,KAAK,CAGpC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.js b/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.js new file mode 100644 index 00000000..ea39b649 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uuid = uuid; +exports.incrementing = incrementing; +function uuid() { + return function () { return crypto.randomUUID(); }; +} +function incrementing() { + var next = 0; + return function () { return (next++).toString(); }; +} +//# sourceMappingURL=IdGenerator.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.js.map b/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.js.map new file mode 100644 index 00000000..4ac2c968 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IdGenerator.js","sourceRoot":"","sources":["../../../src/IdGenerator.ts"],"names":[],"mappings":";;AAEA,oBAEC;AAED,oCAGC;AAPD,SAAgB,IAAI;IAClB,OAAO,cAAM,OAAA,MAAM,CAAC,UAAU,EAAE,EAAnB,CAAmB,CAAA;AAClC,CAAC;AAED,SAAgB,YAAY;IAC1B,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,OAAO,cAAM,OAAA,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAnB,CAAmB,CAAA;AAClC,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts b/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts new file mode 100644 index 00000000..a4fec1b5 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts @@ -0,0 +1,7 @@ +import * as messages from './messages.js'; +export declare function millisecondsSinceEpochToTimestamp(millisecondsSinceEpoch: number): messages.Timestamp; +export declare function millisecondsToDuration(durationInMilliseconds: number): messages.Duration; +export declare function timestampToMillisecondsSinceEpoch(timestamp: messages.Timestamp): number; +export declare function durationToMilliseconds(duration: messages.Duration): number; +export declare function addDurations(durationA: messages.Duration, durationB: messages.Duration): messages.Duration; +//# sourceMappingURL=TimeConversion.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts.map new file mode 100644 index 00000000..52fb1ca5 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeConversion.d.ts","sourceRoot":"","sources":["../../../src/TimeConversion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAMzC,wBAAgB,iCAAiC,CAC/C,sBAAsB,EAAE,MAAM,GAC7B,QAAQ,CAAC,SAAS,CAEpB;AAED,wBAAgB,sBAAsB,CAAC,sBAAsB,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAExF;AAED,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,GAAG,MAAM,CAGvF;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,UAGjE;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,QAAQ,CAAC,QAAQ,EAC5B,SAAS,EAAE,QAAQ,CAAC,QAAQ,GAC3B,QAAQ,CAAC,QAAQ,CAQnB"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.js b/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.js new file mode 100644 index 00000000..72f39d25 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.millisecondsSinceEpochToTimestamp = millisecondsSinceEpochToTimestamp; +exports.millisecondsToDuration = millisecondsToDuration; +exports.timestampToMillisecondsSinceEpoch = timestampToMillisecondsSinceEpoch; +exports.durationToMilliseconds = durationToMilliseconds; +exports.addDurations = addDurations; +var MILLISECONDS_PER_SECOND = 1e3; +var NANOSECONDS_PER_MILLISECOND = 1e6; +var NANOSECONDS_PER_SECOND = 1e9; +function millisecondsSinceEpochToTimestamp(millisecondsSinceEpoch) { + return toSecondsAndNanos(millisecondsSinceEpoch); +} +function millisecondsToDuration(durationInMilliseconds) { + return toSecondsAndNanos(durationInMilliseconds); +} +function timestampToMillisecondsSinceEpoch(timestamp) { + var seconds = timestamp.seconds, nanos = timestamp.nanos; + return toMillis(seconds, nanos); +} +function durationToMilliseconds(duration) { + var seconds = duration.seconds, nanos = duration.nanos; + return toMillis(seconds, nanos); +} +function addDurations(durationA, durationB) { + var seconds = +durationA.seconds + +durationB.seconds; + var nanos = durationA.nanos + durationB.nanos; + if (nanos >= NANOSECONDS_PER_SECOND) { + seconds += 1; + nanos -= NANOSECONDS_PER_SECOND; + } + return { seconds: seconds, nanos: nanos }; +} +function toSecondsAndNanos(milliseconds) { + var seconds = Math.floor(milliseconds / MILLISECONDS_PER_SECOND); + var nanos = Math.floor((milliseconds % MILLISECONDS_PER_SECOND) * NANOSECONDS_PER_MILLISECOND); + return { seconds: seconds, nanos: nanos }; +} +function toMillis(seconds, nanos) { + var secondMillis = +seconds * MILLISECONDS_PER_SECOND; + var nanoMillis = nanos / NANOSECONDS_PER_MILLISECOND; + return secondMillis + nanoMillis; +} +//# sourceMappingURL=TimeConversion.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.js.map b/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.js.map new file mode 100644 index 00000000..73c1a34b --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeConversion.js","sourceRoot":"","sources":["../../../src/TimeConversion.ts"],"names":[],"mappings":";;AAMA,8EAIC;AAED,wDAEC;AAED,8EAGC;AAED,wDAGC;AAED,oCAWC;AAnCD,IAAM,uBAAuB,GAAG,GAAG,CAAA;AACnC,IAAM,2BAA2B,GAAG,GAAG,CAAA;AACvC,IAAM,sBAAsB,GAAG,GAAG,CAAA;AAElC,SAAgB,iCAAiC,CAC/C,sBAA8B;IAE9B,OAAO,iBAAiB,CAAC,sBAAsB,CAAC,CAAA;AAClD,CAAC;AAED,SAAgB,sBAAsB,CAAC,sBAA8B;IACnE,OAAO,iBAAiB,CAAC,sBAAsB,CAAC,CAAA;AAClD,CAAC;AAED,SAAgB,iCAAiC,CAA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a/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts b/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts new file mode 100644 index 00000000..5eb20d95 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts @@ -0,0 +1,7 @@ +import { TestStepResult } from './messages.js'; +/** + * Gets the worst result + * @param testStepResults + */ +export declare function getWorstTestStepResult(testStepResults: readonly TestStepResult[]): TestStepResult; +//# sourceMappingURL=getWorstTestStepResult.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts.map new file mode 100644 index 00000000..5614fb13 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getWorstTestStepResult.d.ts","sourceRoot":"","sources":["../../../src/getWorstTestStepResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,eAAe,CAAA;AAGpE;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,SAAS,cAAc,EAAE,GAAG,cAAc,CAOjG"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.js b/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.js new file mode 100644 index 00000000..c1580373 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getWorstTestStepResult = getWorstTestStepResult; +var messages_js_1 = require("./messages.js"); +var TimeConversion_js_1 = require("./TimeConversion.js"); +/** + * Gets the worst result + * @param testStepResults + */ +function getWorstTestStepResult(testStepResults) { + return (testStepResults.slice().sort(function (r1, r2) { return ordinal(r2.status) - ordinal(r1.status); })[0] || { + status: messages_js_1.TestStepResultStatus.UNKNOWN, + duration: (0, TimeConversion_js_1.millisecondsToDuration)(0), + }); +} +function ordinal(status) { + return [ + messages_js_1.TestStepResultStatus.UNKNOWN, + messages_js_1.TestStepResultStatus.PASSED, + messages_js_1.TestStepResultStatus.SKIPPED, + messages_js_1.TestStepResultStatus.PENDING, + messages_js_1.TestStepResultStatus.UNDEFINED, + messages_js_1.TestStepResultStatus.AMBIGUOUS, + messages_js_1.TestStepResultStatus.FAILED, + ].indexOf(status); +} +//# sourceMappingURL=getWorstTestStepResult.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.js.map b/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.js.map new file mode 100644 index 00000000..c0782d16 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getWorstTestStepResult.js","sourceRoot":"","sources":["../../../src/getWorstTestStepResult.ts"],"names":[],"mappings":";;AAOA,wDAOC;AAdD,6CAAoE;AACpE,yDAA4D;AAE5D;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,eAA0C;IAC/E,OAAO,CACL,eAAe,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,UAAC,EAAE,EAAE,EAAE,IAAK,OAAA,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAvC,CAAuC,CAAC,CAAC,CAAC,CAAC,IAAI;QACtF,MAAM,EAAE,kCAAoB,CAAC,OAAO;QACpC,QAAQ,EAAE,IAAA,0CAAsB,EAAC,CAAC,CAAC;KACpC,CACF,CAAA;AACH,CAAC;AAED,SAAS,OAAO,CAAC,MAA4B;IAC3C,OAAO;QACL,kCAAoB,CAAC,OAAO;QAC5B,kCAAoB,CAAC,MAAM;QAC3B,kCAAoB,CAAC,OAAO;QAC5B,kCAAoB,CAAC,OAAO;QAC5B,kCAAoB,CAAC,SAAS;QAC9B,kCAAoB,CAAC,SAAS;QAC9B,kCAAoB,CAAC,MAAM;KAC5B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/index.d.ts b/node_modules/@cucumber/messages/dist/cjs/src/index.d.ts new file mode 100644 index 00000000..3564d994 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/index.d.ts @@ -0,0 +1,8 @@ +import * as TimeConversion from './TimeConversion.js'; +import * as IdGenerator from './IdGenerator.js'; +import { parseEnvelope } from './parseEnvelope.js'; +import { getWorstTestStepResult } from './getWorstTestStepResult.js'; +import { version } from './version.js'; +export * from './messages.js'; +export { TimeConversion, IdGenerator, version, parseEnvelope, getWorstTestStepResult }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/index.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/src/index.d.ts.map new file mode 100644 index 00000000..e3cbbd18 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/index.js b/node_modules/@cucumber/messages/dist/cjs/src/index.js new file mode 100644 index 00000000..586bd271 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/index.js @@ -0,0 +1,51 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getWorstTestStepResult = exports.parseEnvelope = exports.version = exports.IdGenerator = exports.TimeConversion = void 0; +var TimeConversion = __importStar(require("./TimeConversion.js")); +exports.TimeConversion = TimeConversion; +var IdGenerator = __importStar(require("./IdGenerator.js")); +exports.IdGenerator = IdGenerator; +var parseEnvelope_js_1 = require("./parseEnvelope.js"); +Object.defineProperty(exports, "parseEnvelope", { enumerable: true, get: function () { return parseEnvelope_js_1.parseEnvelope; } }); +var getWorstTestStepResult_js_1 = require("./getWorstTestStepResult.js"); +Object.defineProperty(exports, "getWorstTestStepResult", { enumerable: true, get: function () { return getWorstTestStepResult_js_1.getWorstTestStepResult; } }); +var version_js_1 = require("./version.js"); +Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_js_1.version; } }); +__exportStar(require("./messages.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/index.js.map b/node_modules/@cucumber/messages/dist/cjs/src/index.js.map new file mode 100644 index 00000000..d02ac367 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAqD;AAQ5C,wCAAc;AAPvB,4DAA+C;AAOtB,kCAAW;AANpC,uDAAkD;AAMH,8FANtC,gCAAa,OAMsC;AAL5D,yEAAoE;AAKN,uGALrD,kDAAsB,OAKqD;AAJpF,2CAAsC;AAIA,wFAJ7B,oBAAO,OAI6B;AAF7C,gDAA6B"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts b/node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts new file mode 100644 index 00000000..2b6aeb5d --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts @@ -0,0 +1,403 @@ +import 'reflect-metadata'; +export declare class Attachment { + body: string; + contentEncoding: AttachmentContentEncoding; + fileName?: string; + mediaType: string; + source?: Source; + testCaseStartedId?: string; + testStepId?: string; + url?: string; + testRunStartedId?: string; + testRunHookStartedId?: string; + timestamp?: Timestamp; +} +export declare class Duration { + seconds: number; + nanos: number; +} +export declare class Envelope { + attachment?: Attachment; + externalAttachment?: ExternalAttachment; + gherkinDocument?: GherkinDocument; + hook?: Hook; + meta?: Meta; + parameterType?: ParameterType; + parseError?: ParseError; + pickle?: Pickle; + suggestion?: Suggestion; + source?: Source; + stepDefinition?: StepDefinition; + testCase?: TestCase; + testCaseFinished?: TestCaseFinished; + testCaseStarted?: TestCaseStarted; + testRunFinished?: TestRunFinished; + testRunStarted?: TestRunStarted; + testStepFinished?: TestStepFinished; + testStepStarted?: TestStepStarted; + testRunHookStarted?: TestRunHookStarted; + testRunHookFinished?: TestRunHookFinished; + undefinedParameterType?: UndefinedParameterType; +} +export declare class Exception { + type: string; + message?: string; + stackTrace?: string; +} +export declare class ExternalAttachment { + url: string; + mediaType: string; + testCaseStartedId?: string; + testStepId?: string; + testRunHookStartedId?: string; + timestamp?: Timestamp; +} +export declare class GherkinDocument { + uri?: string; + feature?: Feature; + comments: readonly Comment[]; +} +export declare class Background { + location: Location; + keyword: string; + name: string; + description: string; + steps: readonly Step[]; + id: string; +} +export declare class Comment { + location: Location; + text: string; +} +export declare class DataTable { + location: Location; + rows: readonly TableRow[]; +} +export declare class DocString { + location: Location; + mediaType?: string; + content: string; + delimiter: string; +} +export declare class Examples { + location: Location; + tags: readonly Tag[]; + keyword: string; + name: string; + description: string; + tableHeader?: TableRow; + tableBody: readonly TableRow[]; + id: string; +} +export declare class Feature { + location: Location; + tags: readonly Tag[]; + language: string; + keyword: string; + name: string; + description: string; + children: readonly FeatureChild[]; +} +export declare class FeatureChild { + rule?: Rule; + background?: Background; + scenario?: Scenario; +} +export declare class Rule { + location: Location; + tags: readonly Tag[]; + keyword: string; + name: string; + description: string; + children: readonly RuleChild[]; + id: string; +} +export declare class RuleChild { + background?: Background; + scenario?: Scenario; +} +export declare class Scenario { + location: Location; + tags: readonly Tag[]; + keyword: string; + name: string; + description: string; + steps: readonly Step[]; + examples: readonly Examples[]; + id: string; +} +export declare class Step { + location: Location; + keyword: string; + keywordType?: StepKeywordType; + text: string; + docString?: DocString; + dataTable?: DataTable; + id: string; +} +export declare class TableCell { + location: Location; + value: string; +} +export declare class TableRow { + location: Location; + cells: readonly TableCell[]; + id: string; +} +export declare class Tag { + location: Location; + name: string; + id: string; +} +export declare class Hook { + id: string; + name?: string; + sourceReference: SourceReference; + tagExpression?: string; + type?: HookType; +} +export declare class Location { + line: number; + column?: number; +} +export declare class Meta { + protocolVersion: string; + implementation: Product; + runtime: Product; + os: Product; + cpu: Product; + ci?: Ci; +} +export declare class Ci { + name: string; + url?: string; + buildNumber?: string; + git?: Git; +} +export declare class Git { + remote: string; + revision: string; + branch?: string; + tag?: string; +} +export declare class Product { + name: string; + version?: string; +} +export declare class ParameterType { + name: string; + regularExpressions: readonly string[]; + preferForRegularExpressionMatch: boolean; + useForSnippets: boolean; + id: string; + sourceReference?: SourceReference; +} +export declare class ParseError { + source: SourceReference; + message: string; +} +export declare class Pickle { + id: string; + uri: string; + location?: Location; + name: string; + language: string; + steps: readonly PickleStep[]; + tags: readonly PickleTag[]; + astNodeIds: readonly string[]; +} +export declare class PickleDocString { + mediaType?: string; + content: string; +} +export declare class PickleStep { + argument?: PickleStepArgument; + astNodeIds: readonly string[]; + id: string; + type?: PickleStepType; + text: string; +} +export declare class PickleStepArgument { + docString?: PickleDocString; + dataTable?: PickleTable; +} +export declare class PickleTable { + rows: readonly PickleTableRow[]; +} +export declare class PickleTableCell { + value: string; +} +export declare class PickleTableRow { + cells: readonly PickleTableCell[]; +} +export declare class PickleTag { + name: string; + astNodeId: string; +} +export declare class Source { + uri: string; + data: string; + mediaType: SourceMediaType; +} +export declare class SourceReference { + uri?: string; + javaMethod?: JavaMethod; + javaStackTraceElement?: JavaStackTraceElement; + location?: Location; +} +export declare class JavaMethod { + className: string; + methodName: string; + methodParameterTypes: readonly string[]; +} +export declare class JavaStackTraceElement { + className: string; + fileName: string; + methodName: string; +} +export declare class StepDefinition { + id: string; + pattern: StepDefinitionPattern; + sourceReference: SourceReference; +} +export declare class StepDefinitionPattern { + source: string; + type: StepDefinitionPatternType; +} +export declare class Suggestion { + id: string; + pickleStepId: string; + snippets: readonly Snippet[]; +} +export declare class Snippet { + language: string; + code: string; +} +export declare class TestCase { + id: string; + pickleId: string; + testSteps: readonly TestStep[]; + testRunStartedId?: string; +} +export declare class Group { + children?: readonly Group[]; + start?: number; + value?: string; +} +export declare class StepMatchArgument { + group: Group; + parameterTypeName?: string; +} +export declare class StepMatchArgumentsList { + stepMatchArguments: readonly StepMatchArgument[]; +} +export declare class TestStep { + hookId?: string; + id: string; + pickleStepId?: string; + stepDefinitionIds?: readonly string[]; + stepMatchArgumentsLists?: readonly StepMatchArgumentsList[]; +} +export declare class TestCaseFinished { + testCaseStartedId: string; + timestamp: Timestamp; + willBeRetried: boolean; +} +export declare class TestCaseStarted { + attempt: number; + id: string; + testCaseId: string; + workerId?: string; + timestamp: Timestamp; +} +export declare class TestRunFinished { + message?: string; + success: boolean; + timestamp: Timestamp; + exception?: Exception; + testRunStartedId?: string; +} +export declare class TestRunHookFinished { + testRunHookStartedId: string; + result: TestStepResult; + timestamp: Timestamp; +} +export declare class TestRunHookStarted { + id: string; + testRunStartedId: string; + hookId: string; + workerId?: string; + timestamp: Timestamp; +} +export declare class TestRunStarted { + timestamp: Timestamp; + id?: string; +} +export declare class TestStepFinished { + testCaseStartedId: string; + testStepId: string; + testStepResult: TestStepResult; + timestamp: Timestamp; +} +export declare class TestStepResult { + duration: Duration; + message?: string; + status: TestStepResultStatus; + exception?: Exception; +} +export declare class TestStepStarted { + testCaseStartedId: string; + testStepId: string; + timestamp: Timestamp; +} +export declare class Timestamp { + seconds: number; + nanos: number; +} +export declare class UndefinedParameterType { + expression: string; + name: string; +} +export declare enum AttachmentContentEncoding { + IDENTITY = "IDENTITY", + BASE64 = "BASE64" +} +export declare enum HookType { + BEFORE_TEST_RUN = "BEFORE_TEST_RUN", + AFTER_TEST_RUN = "AFTER_TEST_RUN", + BEFORE_TEST_CASE = "BEFORE_TEST_CASE", + AFTER_TEST_CASE = "AFTER_TEST_CASE", + BEFORE_TEST_STEP = "BEFORE_TEST_STEP", + AFTER_TEST_STEP = "AFTER_TEST_STEP" +} +export declare enum PickleStepType { + UNKNOWN = "Unknown", + CONTEXT = "Context", + ACTION = "Action", + OUTCOME = "Outcome" +} +export declare enum SourceMediaType { + TEXT_X_CUCUMBER_GHERKIN_PLAIN = "text/x.cucumber.gherkin+plain", + TEXT_X_CUCUMBER_GHERKIN_MARKDOWN = "text/x.cucumber.gherkin+markdown" +} +export declare enum StepDefinitionPatternType { + CUCUMBER_EXPRESSION = "CUCUMBER_EXPRESSION", + REGULAR_EXPRESSION = "REGULAR_EXPRESSION" +} +export declare enum StepKeywordType { + UNKNOWN = "Unknown", + CONTEXT = "Context", + ACTION = "Action", + OUTCOME = "Outcome", + CONJUNCTION = "Conjunction" +} +export declare enum TestStepResultStatus { + UNKNOWN = "UNKNOWN", + PASSED = "PASSED", + SKIPPED = "SKIPPED", + PENDING = "PENDING", + UNDEFINED = "UNDEFINED", + AMBIGUOUS = "AMBIGUOUS", + FAILED = "FAILED" +} +//# sourceMappingURL=messages.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts.map new file mode 100644 index 00000000..f9a7c017 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/messages.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,UAAU;IAErB,IAAI,EAAE,MAAM,CAAK;IAEjB,eAAe,EAAE,yBAAyB,CAAqC;IAE/E,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB,SAAS,EAAE,MAAM,CAAK;IAGtB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAG7B,SAAS,CAAC,EAAE,SAAS,CAAA;CACt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BAAY,eAAe;IACzB,6BAA6B,kCAAkC;IAC/D,gCAAgC,qCAAqC;CACtE;AAED,oBAAY,yBAAyB;IACnC,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;CAC1C;AAED,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,WAAW,gBAAgB;CAC5B;AAED,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/messages.js b/node_modules/@cucumber/messages/dist/cjs/src/messages.js new file mode 100644 index 00000000..8743c5f6 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/messages.js @@ -0,0 +1,872 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TestCaseFinished = exports.TestStep = exports.StepMatchArgumentsList = exports.StepMatchArgument = exports.Group = exports.TestCase = exports.Snippet = exports.Suggestion = exports.StepDefinitionPattern = exports.StepDefinition = exports.JavaStackTraceElement = exports.JavaMethod = exports.SourceReference = exports.Source = exports.PickleTag = exports.PickleTableRow = exports.PickleTableCell = exports.PickleTable = exports.PickleStepArgument = exports.PickleStep = exports.PickleDocString = exports.Pickle = exports.ParseError = exports.ParameterType = exports.Product = exports.Git = exports.Ci = exports.Meta = exports.Location = exports.Hook = exports.Tag = exports.TableRow = exports.TableCell = exports.Step = exports.Scenario = exports.RuleChild = exports.Rule = exports.FeatureChild = exports.Feature = exports.Examples = exports.DocString = exports.DataTable = exports.Comment = exports.Background = exports.GherkinDocument = exports.ExternalAttachment = exports.Exception = exports.Envelope = exports.Duration = exports.Attachment = void 0; +exports.TestStepResultStatus = exports.StepKeywordType = exports.StepDefinitionPatternType = exports.SourceMediaType = exports.PickleStepType = exports.HookType = exports.AttachmentContentEncoding = exports.UndefinedParameterType = exports.Timestamp = exports.TestStepStarted = exports.TestStepResult = exports.TestStepFinished = exports.TestRunStarted = exports.TestRunHookStarted = exports.TestRunHookFinished = exports.TestRunFinished = exports.TestCaseStarted = void 0; +var class_transformer_1 = require("class-transformer"); +require("reflect-metadata"); +var Attachment = /** @class */ (function () { + function Attachment() { + this.body = ''; + this.contentEncoding = AttachmentContentEncoding.IDENTITY; + this.mediaType = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Source; }) + ], Attachment.prototype, "source", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], Attachment.prototype, "timestamp", void 0); + return Attachment; +}()); +exports.Attachment = Attachment; +var Duration = /** @class */ (function () { + function Duration() { + this.seconds = 0; + this.nanos = 0; + } + return Duration; +}()); +exports.Duration = Duration; +var Envelope = /** @class */ (function () { + function Envelope() { + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Attachment; }) + ], Envelope.prototype, "attachment", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return ExternalAttachment; }) + ], Envelope.prototype, "externalAttachment", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return GherkinDocument; }) + ], Envelope.prototype, "gherkinDocument", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Hook; }) + ], Envelope.prototype, "hook", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Meta; }) + ], Envelope.prototype, "meta", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return ParameterType; }) + ], Envelope.prototype, "parameterType", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return ParseError; }) + ], Envelope.prototype, "parseError", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Pickle; }) + ], Envelope.prototype, "pickle", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Suggestion; }) + ], Envelope.prototype, "suggestion", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Source; }) + ], Envelope.prototype, "source", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return StepDefinition; }) + ], Envelope.prototype, "stepDefinition", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestCase; }) + ], Envelope.prototype, "testCase", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestCaseFinished; }) + ], Envelope.prototype, "testCaseFinished", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestCaseStarted; }) + ], Envelope.prototype, "testCaseStarted", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestRunFinished; }) + ], Envelope.prototype, "testRunFinished", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestRunStarted; }) + ], Envelope.prototype, "testRunStarted", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestStepFinished; }) + ], Envelope.prototype, "testStepFinished", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestStepStarted; }) + ], Envelope.prototype, "testStepStarted", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestRunHookStarted; }) + ], Envelope.prototype, "testRunHookStarted", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TestRunHookFinished; }) + ], Envelope.prototype, "testRunHookFinished", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return UndefinedParameterType; }) + ], Envelope.prototype, "undefinedParameterType", void 0); + return Envelope; +}()); +exports.Envelope = Envelope; +var Exception = /** @class */ (function () { + function Exception() { + this.type = ''; + } + return Exception; +}()); +exports.Exception = Exception; +var ExternalAttachment = /** @class */ (function () { + function ExternalAttachment() { + this.url = ''; + this.mediaType = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], ExternalAttachment.prototype, "timestamp", void 0); + return ExternalAttachment; +}()); +exports.ExternalAttachment = ExternalAttachment; +var GherkinDocument = /** @class */ (function () { + function GherkinDocument() { + this.comments = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Feature; }) + ], GherkinDocument.prototype, "feature", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Comment; }) + ], GherkinDocument.prototype, "comments", void 0); + return GherkinDocument; +}()); +exports.GherkinDocument = GherkinDocument; +var Background = /** @class */ (function () { + function Background() { + this.location = new Location(); + this.keyword = ''; + this.name = ''; + this.description = ''; + this.steps = []; + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Background.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Step; }) + ], Background.prototype, "steps", void 0); + return Background; +}()); +exports.Background = Background; +var Comment = /** @class */ (function () { + function Comment() { + this.location = new Location(); + this.text = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Comment.prototype, "location", void 0); + return Comment; +}()); +exports.Comment = Comment; +var DataTable = /** @class */ (function () { + function DataTable() { + this.location = new Location(); + this.rows = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], DataTable.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TableRow; }) + ], DataTable.prototype, "rows", void 0); + return DataTable; +}()); +exports.DataTable = DataTable; +var DocString = /** @class */ (function () { + function DocString() { + this.location = new Location(); + this.content = ''; + this.delimiter = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], DocString.prototype, "location", void 0); + return DocString; +}()); +exports.DocString = DocString; +var Examples = /** @class */ (function () { + function Examples() { + this.location = new Location(); + this.tags = []; + this.keyword = ''; + this.name = ''; + this.description = ''; + this.tableBody = []; + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Examples.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Tag; }) + ], Examples.prototype, "tags", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TableRow; }) + ], Examples.prototype, "tableHeader", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TableRow; }) + ], Examples.prototype, "tableBody", void 0); + return Examples; +}()); +exports.Examples = Examples; +var Feature = /** @class */ (function () { + function Feature() { + this.location = new Location(); + this.tags = []; + this.language = ''; + this.keyword = ''; + this.name = ''; + this.description = ''; + this.children = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Feature.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Tag; }) + ], Feature.prototype, "tags", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return FeatureChild; }) + ], Feature.prototype, "children", void 0); + return Feature; +}()); +exports.Feature = Feature; +var FeatureChild = /** @class */ (function () { + function FeatureChild() { + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Rule; }) + ], FeatureChild.prototype, "rule", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Background; }) + ], FeatureChild.prototype, "background", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Scenario; }) + ], FeatureChild.prototype, "scenario", void 0); + return FeatureChild; +}()); +exports.FeatureChild = FeatureChild; +var Rule = /** @class */ (function () { + function Rule() { + this.location = new Location(); + this.tags = []; + this.keyword = ''; + this.name = ''; + this.description = ''; + this.children = []; + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Rule.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Tag; }) + ], Rule.prototype, "tags", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return RuleChild; }) + ], Rule.prototype, "children", void 0); + return Rule; +}()); +exports.Rule = Rule; +var RuleChild = /** @class */ (function () { + function RuleChild() { + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Background; }) + ], RuleChild.prototype, "background", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Scenario; }) + ], RuleChild.prototype, "scenario", void 0); + return RuleChild; +}()); +exports.RuleChild = RuleChild; +var Scenario = /** @class */ (function () { + function Scenario() { + this.location = new Location(); + this.tags = []; + this.keyword = ''; + this.name = ''; + this.description = ''; + this.steps = []; + this.examples = []; + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Scenario.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Tag; }) + ], Scenario.prototype, "tags", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Step; }) + ], Scenario.prototype, "steps", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Examples; }) + ], Scenario.prototype, "examples", void 0); + return Scenario; +}()); +exports.Scenario = Scenario; +var Step = /** @class */ (function () { + function Step() { + this.location = new Location(); + this.keyword = ''; + this.text = ''; + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Step.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return DocString; }) + ], Step.prototype, "docString", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return DataTable; }) + ], Step.prototype, "dataTable", void 0); + return Step; +}()); +exports.Step = Step; +var TableCell = /** @class */ (function () { + function TableCell() { + this.location = new Location(); + this.value = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], TableCell.prototype, "location", void 0); + return TableCell; +}()); +exports.TableCell = TableCell; +var TableRow = /** @class */ (function () { + function TableRow() { + this.location = new Location(); + this.cells = []; + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], TableRow.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return TableCell; }) + ], TableRow.prototype, "cells", void 0); + return TableRow; +}()); +exports.TableRow = TableRow; +var Tag = /** @class */ (function () { + function Tag() { + this.location = new Location(); + this.name = ''; + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Tag.prototype, "location", void 0); + return Tag; +}()); +exports.Tag = Tag; +var Hook = /** @class */ (function () { + function Hook() { + this.id = ''; + this.sourceReference = new SourceReference(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return SourceReference; }) + ], Hook.prototype, "sourceReference", void 0); + return Hook; +}()); +exports.Hook = Hook; +var Location = /** @class */ (function () { + function Location() { + this.line = 0; + } + return Location; +}()); +exports.Location = Location; +var Meta = /** @class */ (function () { + function Meta() { + this.protocolVersion = ''; + this.implementation = new Product(); + this.runtime = new Product(); + this.os = new Product(); + this.cpu = new Product(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Product; }) + ], Meta.prototype, "implementation", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Product; }) + ], Meta.prototype, "runtime", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Product; }) + ], Meta.prototype, "os", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Product; }) + ], Meta.prototype, "cpu", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Ci; }) + ], Meta.prototype, "ci", void 0); + return Meta; +}()); +exports.Meta = Meta; +var Ci = /** @class */ (function () { + function Ci() { + this.name = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Git; }) + ], Ci.prototype, "git", void 0); + return Ci; +}()); +exports.Ci = Ci; +var Git = /** @class */ (function () { + function Git() { + this.remote = ''; + this.revision = ''; + } + return Git; +}()); +exports.Git = Git; +var Product = /** @class */ (function () { + function Product() { + this.name = ''; + } + return Product; +}()); +exports.Product = Product; +var ParameterType = /** @class */ (function () { + function ParameterType() { + this.name = ''; + this.regularExpressions = []; + this.preferForRegularExpressionMatch = false; + this.useForSnippets = false; + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return SourceReference; }) + ], ParameterType.prototype, "sourceReference", void 0); + return ParameterType; +}()); +exports.ParameterType = ParameterType; +var ParseError = /** @class */ (function () { + function ParseError() { + this.source = new SourceReference(); + this.message = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return SourceReference; }) + ], ParseError.prototype, "source", void 0); + return ParseError; +}()); +exports.ParseError = ParseError; +var Pickle = /** @class */ (function () { + function Pickle() { + this.id = ''; + this.uri = ''; + this.name = ''; + this.language = ''; + this.steps = []; + this.tags = []; + this.astNodeIds = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], Pickle.prototype, "location", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return PickleStep; }) + ], Pickle.prototype, "steps", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return PickleTag; }) + ], Pickle.prototype, "tags", void 0); + return Pickle; +}()); +exports.Pickle = Pickle; +var PickleDocString = /** @class */ (function () { + function PickleDocString() { + this.content = ''; + } + return PickleDocString; +}()); +exports.PickleDocString = PickleDocString; +var PickleStep = /** @class */ (function () { + function PickleStep() { + this.astNodeIds = []; + this.id = ''; + this.text = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return PickleStepArgument; }) + ], PickleStep.prototype, "argument", void 0); + return PickleStep; +}()); +exports.PickleStep = PickleStep; +var PickleStepArgument = /** @class */ (function () { + function PickleStepArgument() { + } + __decorate([ + (0, class_transformer_1.Type)(function () { return PickleDocString; }) + ], PickleStepArgument.prototype, "docString", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return PickleTable; }) + ], PickleStepArgument.prototype, "dataTable", void 0); + return PickleStepArgument; +}()); +exports.PickleStepArgument = PickleStepArgument; +var PickleTable = /** @class */ (function () { + function PickleTable() { + this.rows = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return PickleTableRow; }) + ], PickleTable.prototype, "rows", void 0); + return PickleTable; +}()); +exports.PickleTable = PickleTable; +var PickleTableCell = /** @class */ (function () { + function PickleTableCell() { + this.value = ''; + } + return PickleTableCell; +}()); +exports.PickleTableCell = PickleTableCell; +var PickleTableRow = /** @class */ (function () { + function PickleTableRow() { + this.cells = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return PickleTableCell; }) + ], PickleTableRow.prototype, "cells", void 0); + return PickleTableRow; +}()); +exports.PickleTableRow = PickleTableRow; +var PickleTag = /** @class */ (function () { + function PickleTag() { + this.name = ''; + this.astNodeId = ''; + } + return PickleTag; +}()); +exports.PickleTag = PickleTag; +var Source = /** @class */ (function () { + function Source() { + this.uri = ''; + this.data = ''; + this.mediaType = SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_PLAIN; + } + return Source; +}()); +exports.Source = Source; +var SourceReference = /** @class */ (function () { + function SourceReference() { + } + __decorate([ + (0, class_transformer_1.Type)(function () { return JavaMethod; }) + ], SourceReference.prototype, "javaMethod", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return JavaStackTraceElement; }) + ], SourceReference.prototype, "javaStackTraceElement", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Location; }) + ], SourceReference.prototype, "location", void 0); + return SourceReference; +}()); +exports.SourceReference = SourceReference; +var JavaMethod = /** @class */ (function () { + function JavaMethod() { + this.className = ''; + this.methodName = ''; + this.methodParameterTypes = []; + } + return JavaMethod; +}()); +exports.JavaMethod = JavaMethod; +var JavaStackTraceElement = /** @class */ (function () { + function JavaStackTraceElement() { + this.className = ''; + this.fileName = ''; + this.methodName = ''; + } + return JavaStackTraceElement; +}()); +exports.JavaStackTraceElement = JavaStackTraceElement; +var StepDefinition = /** @class */ (function () { + function StepDefinition() { + this.id = ''; + this.pattern = new StepDefinitionPattern(); + this.sourceReference = new SourceReference(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return StepDefinitionPattern; }) + ], StepDefinition.prototype, "pattern", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return SourceReference; }) + ], StepDefinition.prototype, "sourceReference", void 0); + return StepDefinition; +}()); +exports.StepDefinition = StepDefinition; +var StepDefinitionPattern = /** @class */ (function () { + function StepDefinitionPattern() { + this.source = ''; + this.type = StepDefinitionPatternType.CUCUMBER_EXPRESSION; + } + return StepDefinitionPattern; +}()); +exports.StepDefinitionPattern = StepDefinitionPattern; +var Suggestion = /** @class */ (function () { + function Suggestion() { + this.id = ''; + this.pickleStepId = ''; + this.snippets = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Snippet; }) + ], Suggestion.prototype, "snippets", void 0); + return Suggestion; +}()); +exports.Suggestion = Suggestion; +var Snippet = /** @class */ (function () { + function Snippet() { + this.language = ''; + this.code = ''; + } + return Snippet; +}()); +exports.Snippet = Snippet; +var TestCase = /** @class */ (function () { + function TestCase() { + this.id = ''; + this.pickleId = ''; + this.testSteps = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return TestStep; }) + ], TestCase.prototype, "testSteps", void 0); + return TestCase; +}()); +exports.TestCase = TestCase; +var Group = /** @class */ (function () { + function Group() { + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Group; }) + ], Group.prototype, "children", void 0); + return Group; +}()); +exports.Group = Group; +var StepMatchArgument = /** @class */ (function () { + function StepMatchArgument() { + this.group = new Group(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Group; }) + ], StepMatchArgument.prototype, "group", void 0); + return StepMatchArgument; +}()); +exports.StepMatchArgument = StepMatchArgument; +var StepMatchArgumentsList = /** @class */ (function () { + function StepMatchArgumentsList() { + this.stepMatchArguments = []; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return StepMatchArgument; }) + ], StepMatchArgumentsList.prototype, "stepMatchArguments", void 0); + return StepMatchArgumentsList; +}()); +exports.StepMatchArgumentsList = StepMatchArgumentsList; +var TestStep = /** @class */ (function () { + function TestStep() { + this.id = ''; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return StepMatchArgumentsList; }) + ], TestStep.prototype, "stepMatchArgumentsLists", void 0); + return TestStep; +}()); +exports.TestStep = TestStep; +var TestCaseFinished = /** @class */ (function () { + function TestCaseFinished() { + this.testCaseStartedId = ''; + this.timestamp = new Timestamp(); + this.willBeRetried = false; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], TestCaseFinished.prototype, "timestamp", void 0); + return TestCaseFinished; +}()); +exports.TestCaseFinished = TestCaseFinished; +var TestCaseStarted = /** @class */ (function () { + function TestCaseStarted() { + this.attempt = 0; + this.id = ''; + this.testCaseId = ''; + this.timestamp = new Timestamp(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], TestCaseStarted.prototype, "timestamp", void 0); + return TestCaseStarted; +}()); +exports.TestCaseStarted = TestCaseStarted; +var TestRunFinished = /** @class */ (function () { + function TestRunFinished() { + this.success = false; + this.timestamp = new Timestamp(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], TestRunFinished.prototype, "timestamp", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Exception; }) + ], TestRunFinished.prototype, "exception", void 0); + return TestRunFinished; +}()); +exports.TestRunFinished = TestRunFinished; +var TestRunHookFinished = /** @class */ (function () { + function TestRunHookFinished() { + this.testRunHookStartedId = ''; + this.result = new TestStepResult(); + this.timestamp = new Timestamp(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return TestStepResult; }) + ], TestRunHookFinished.prototype, "result", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], TestRunHookFinished.prototype, "timestamp", void 0); + return TestRunHookFinished; +}()); +exports.TestRunHookFinished = TestRunHookFinished; +var TestRunHookStarted = /** @class */ (function () { + function TestRunHookStarted() { + this.id = ''; + this.testRunStartedId = ''; + this.hookId = ''; + this.timestamp = new Timestamp(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], TestRunHookStarted.prototype, "timestamp", void 0); + return TestRunHookStarted; +}()); +exports.TestRunHookStarted = TestRunHookStarted; +var TestRunStarted = /** @class */ (function () { + function TestRunStarted() { + this.timestamp = new Timestamp(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], TestRunStarted.prototype, "timestamp", void 0); + return TestRunStarted; +}()); +exports.TestRunStarted = TestRunStarted; +var TestStepFinished = /** @class */ (function () { + function TestStepFinished() { + this.testCaseStartedId = ''; + this.testStepId = ''; + this.testStepResult = new TestStepResult(); + this.timestamp = new Timestamp(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return TestStepResult; }) + ], TestStepFinished.prototype, "testStepResult", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], TestStepFinished.prototype, "timestamp", void 0); + return TestStepFinished; +}()); +exports.TestStepFinished = TestStepFinished; +var TestStepResult = /** @class */ (function () { + function TestStepResult() { + this.duration = new Duration(); + this.status = TestStepResultStatus.UNKNOWN; + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Duration; }) + ], TestStepResult.prototype, "duration", void 0); + __decorate([ + (0, class_transformer_1.Type)(function () { return Exception; }) + ], TestStepResult.prototype, "exception", void 0); + return TestStepResult; +}()); +exports.TestStepResult = TestStepResult; +var TestStepStarted = /** @class */ (function () { + function TestStepStarted() { + this.testCaseStartedId = ''; + this.testStepId = ''; + this.timestamp = new Timestamp(); + } + __decorate([ + (0, class_transformer_1.Type)(function () { return Timestamp; }) + ], TestStepStarted.prototype, "timestamp", void 0); + return TestStepStarted; +}()); +exports.TestStepStarted = TestStepStarted; +var Timestamp = /** @class */ (function () { + function Timestamp() { + this.seconds = 0; + this.nanos = 0; + } + return Timestamp; +}()); +exports.Timestamp = Timestamp; +var UndefinedParameterType = /** @class */ (function () { + function UndefinedParameterType() { + this.expression = ''; + this.name = ''; + } + return UndefinedParameterType; +}()); +exports.UndefinedParameterType = UndefinedParameterType; +var AttachmentContentEncoding; +(function (AttachmentContentEncoding) { + AttachmentContentEncoding["IDENTITY"] = "IDENTITY"; + AttachmentContentEncoding["BASE64"] = "BASE64"; +})(AttachmentContentEncoding || (exports.AttachmentContentEncoding = AttachmentContentEncoding = {})); +var HookType; +(function (HookType) { + HookType["BEFORE_TEST_RUN"] = "BEFORE_TEST_RUN"; + HookType["AFTER_TEST_RUN"] = "AFTER_TEST_RUN"; + HookType["BEFORE_TEST_CASE"] = "BEFORE_TEST_CASE"; + HookType["AFTER_TEST_CASE"] = "AFTER_TEST_CASE"; + HookType["BEFORE_TEST_STEP"] = "BEFORE_TEST_STEP"; + HookType["AFTER_TEST_STEP"] = "AFTER_TEST_STEP"; +})(HookType || (exports.HookType = HookType = {})); +var PickleStepType; +(function (PickleStepType) { + PickleStepType["UNKNOWN"] = "Unknown"; + PickleStepType["CONTEXT"] = "Context"; + PickleStepType["ACTION"] = "Action"; + PickleStepType["OUTCOME"] = "Outcome"; +})(PickleStepType || (exports.PickleStepType = PickleStepType = {})); +var SourceMediaType; +(function (SourceMediaType) { + SourceMediaType["TEXT_X_CUCUMBER_GHERKIN_PLAIN"] = "text/x.cucumber.gherkin+plain"; + SourceMediaType["TEXT_X_CUCUMBER_GHERKIN_MARKDOWN"] = "text/x.cucumber.gherkin+markdown"; +})(SourceMediaType || (exports.SourceMediaType = SourceMediaType = {})); +var StepDefinitionPatternType; +(function (StepDefinitionPatternType) { + StepDefinitionPatternType["CUCUMBER_EXPRESSION"] = "CUCUMBER_EXPRESSION"; + StepDefinitionPatternType["REGULAR_EXPRESSION"] = "REGULAR_EXPRESSION"; +})(StepDefinitionPatternType || (exports.StepDefinitionPatternType = StepDefinitionPatternType = {})); +var StepKeywordType; +(function (StepKeywordType) { + StepKeywordType["UNKNOWN"] = "Unknown"; + StepKeywordType["CONTEXT"] = "Context"; + StepKeywordType["ACTION"] = "Action"; + StepKeywordType["OUTCOME"] = "Outcome"; + StepKeywordType["CONJUNCTION"] = "Conjunction"; +})(StepKeywordType || (exports.StepKeywordType = StepKeywordType = {})); +var TestStepResultStatus; +(function (TestStepResultStatus) { + TestStepResultStatus["UNKNOWN"] = "UNKNOWN"; + TestStepResultStatus["PASSED"] = "PASSED"; + TestStepResultStatus["SKIPPED"] = "SKIPPED"; + TestStepResultStatus["PENDING"] = "PENDING"; + TestStepResultStatus["UNDEFINED"] = "UNDEFINED"; + TestStepResultStatus["AMBIGUOUS"] = "AMBIGUOUS"; + TestStepResultStatus["FAILED"] = "FAILED"; +})(TestStepResultStatus || (exports.TestStepResultStatus = TestStepResultStatus = {})); +//# sourceMappingURL=messages.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/messages.js.map b/node_modules/@cucumber/messages/dist/cjs/src/messages.js.map new file mode 100644 index 00000000..ecae330c --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/messages.js.map @@ -0,0 +1 @@ +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/messages.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,uDAAwC;AACxC,4BAAyB;AAEzB;IAAA;QAEE,SAAI,GAAW,EAAE,CAAA;QAEjB,oBAAe,GAA8B,yBAAyB,CAAC,QAAQ,CAAA;QAI/E,cAAS,GAAW,EAAE,CAAA;IAiBxB,CAAC;IAdC;QADC,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;8CACJ;IAaf;QADC,IAAA,wBAAI,EAAC,cAAM,OAAA,SAAS,EAAT,CAAS,CAAC;iDACD;IACvB,iBAAC;CAAA,AAzBD,IAyBC;AAzBY,gCAAU;AA2BvB;IAAA;QAEE,YAAO,GAAW,CAAC,CAAA;QAEnB,UAAK,GAAW,CAAC,CAAA;IACnB,CAAC;IAAD,eAAC;AAAD,CAAC,AALD,IAKC;AALY,4BAAQ;AAOrB;IAAA;IAgEA,CAAC;IA7DC;QADC,IAAA,wBAAI,EAAC,cAAM,OAAA,UAAU,EAAV,CAAU,CAAC;gDACA;IAGvB;QADC,IAAA,wBAAI,EAAC,cAAM,OAAA,kBAAkB,EAAlB,CAAkB,CAAC;wDACQ;IAGvC;QADC,IAAA,wBAAI,EAAC,cAAM,OAAA,eAAe,EAAf,CAAe,CAAC;qDACK;IAGjC;QADC,IAAA,wBAAI,EAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;0CACN;I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B,QAQ/B"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts b/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts new file mode 100644 index 00000000..da998944 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts @@ -0,0 +1,8 @@ +import { Envelope } from './messages.js'; +/** + * Parses JSON into an Envelope object. The difference from JSON.parse + * is that the resulting objects will have default values (defined in the JSON Schema) + * for properties that are absent from the JSON. + */ +export declare function parseEnvelope(json: string): Envelope; +//# sourceMappingURL=parseEnvelope.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts.map new file mode 100644 index 00000000..f73de815 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parseEnvelope.d.ts","sourceRoot":"","sources":["../../../src/parseEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAGpD"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.js b/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.js new file mode 100644 index 00000000..48774383 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseEnvelope = parseEnvelope; +var messages_js_1 = require("./messages.js"); +var class_transformer_1 = require("class-transformer"); +/** + * Parses JSON into an Envelope object. The difference from JSON.parse + * is that the resulting objects will have default values (defined in the JSON Schema) + * for properties that are absent from the JSON. + */ +function parseEnvelope(json) { + var plain = JSON.parse(json); + return (0, class_transformer_1.plainToClass)(messages_js_1.Envelope, plain); +} +//# sourceMappingURL=parseEnvelope.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.js.map b/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.js.map new file mode 100644 index 00000000..e191647a --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parseEnvelope.js","sourceRoot":"","sources":["../../../src/parseEnvelope.ts"],"names":[],"mappings":";;AAQA,sCAGC;AAXD,6CAAwC;AACxC,uDAAgD;AAEhD;;;;GAIG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,OAAO,IAAA,gCAAY,EAAC,sBAAQ,EAAE,KAAK,CAAC,CAAA;AACtC,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/version.d.ts b/node_modules/@cucumber/messages/dist/cjs/src/version.d.ts new file mode 100644 index 00000000..72cb814b --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/version.d.ts @@ -0,0 +1,2 @@ +export declare const version = "32.2.0"; +//# sourceMappingURL=version.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/version.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/src/version.d.ts.map new file mode 100644 index 00000000..042c9575 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/version.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,WAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/version.js b/node_modules/@cucumber/messages/dist/cjs/src/version.js new file mode 100644 index 00000000..523e74d0 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/version.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = void 0; +// This file is automatically generated using npm scripts +exports.version = '32.2.0'; +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/src/version.js.map b/node_modules/@cucumber/messages/dist/cjs/src/version.js.map new file mode 100644 index 00000000..09860f31 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/src/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AAC5C,QAAA,OAAO,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.d.ts b/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.d.ts new file mode 100644 index 00000000..d1488fba --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=IdGeneratorTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.d.ts.map new file mode 100644 index 00000000..93f290bf --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"IdGeneratorTest.d.ts","sourceRoot":"","sources":["../../../test/IdGeneratorTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.js b/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.js new file mode 100644 index 00000000..bfe8e4e4 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.js @@ -0,0 +1,21 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var node_assert_1 = __importDefault(require("node:assert")); +var index_js_1 = require("../src/index.js"); +describe('IdGenerator', function () { + it('generates uuids', function () { + var generator = index_js_1.IdGenerator.uuid(); + var result = generator(); + node_assert_1.default.equal(result.length, 36); + }); + it('increments ids', function () { + var generator = index_js_1.IdGenerator.incrementing(); + node_assert_1.default.equal(generator(), '0'); + node_assert_1.default.equal(generator(), '1'); + node_assert_1.default.equal(generator(), '2'); + }); +}); +//# sourceMappingURL=IdGeneratorTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.js.map b/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.js.map new file mode 100644 index 00000000..4b164b88 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/IdGeneratorTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IdGeneratorTest.js","sourceRoot":"","sources":["../../../test/IdGeneratorTest.ts"],"names":[],"mappings":";;;;;AAAA,4DAAgC;AAChC,4CAA2C;AAE3C,QAAQ,CAAC,aAAa,EAAE;IACtB,EAAE,CAAC,iBAAiB,EAAE;QACpB,IAAM,SAAS,GAAG,sBAAW,CAAC,IAAI,EAAE,CAAA;QACpC,IAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,qBAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;QACnB,IAAM,SAAS,GAAG,sBAAW,CAAC,YAAY,EAAE,CAAA;QAC5C,qBAAM,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,CAAA;QAC9B,qBAAM,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,CAAA;QAC9B,qBAAM,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.d.ts b/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.d.ts new file mode 100644 index 00000000..0ecf182b --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=TimeConversionTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.d.ts.map new file mode 100644 index 00000000..af1bc3b9 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeConversionTest.d.ts","sourceRoot":"","sources":["../../../test/TimeConversionTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.js b/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.js new file mode 100644 index 00000000..d5bd7a49 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.js @@ -0,0 +1,67 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var index_js_1 = require("../src/index.js"); +var TimeConversion_js_1 = require("../src/TimeConversion.js"); +var durationToMilliseconds = index_js_1.TimeConversion.durationToMilliseconds, millisecondsSinceEpochToTimestamp = index_js_1.TimeConversion.millisecondsSinceEpochToTimestamp, millisecondsToDuration = index_js_1.TimeConversion.millisecondsToDuration, timestampToMillisecondsSinceEpoch = index_js_1.TimeConversion.timestampToMillisecondsSinceEpoch; +describe('TimeConversion', function () { + it('converts legacy string seconds', function () { + var duration = { + // @ts-ignore + seconds: '3', + nanos: 40000, + }; + var millis = durationToMilliseconds(duration); + assert_1.default.strictEqual(millis, 3000.04); + }); + it('converts to and from milliseconds since epoch', function () { + var millisecondsSinceEpoch = Date.now(); + var timestamp = millisecondsSinceEpochToTimestamp(millisecondsSinceEpoch); + var jsEpochMillisAgain = timestampToMillisecondsSinceEpoch(timestamp); + assert_1.default.strictEqual(jsEpochMillisAgain, millisecondsSinceEpoch); + }); + it('converts to and from milliseconds duration', function () { + var durationInMilliseconds = 1234; + var duration = millisecondsToDuration(durationInMilliseconds); + var durationMillisAgain = durationToMilliseconds(duration); + assert_1.default.strictEqual(durationMillisAgain, durationInMilliseconds); + }); + it('converts to and from milliseconds duration (with decimal places)', function () { + var durationInMilliseconds = 3.000161; + var duration = millisecondsToDuration(durationInMilliseconds); + var durationMillisAgain = durationToMilliseconds(duration); + assert_1.default.strictEqual(durationMillisAgain, durationInMilliseconds); + }); + it('adds durations (nanos only)', function () { + var durationA = millisecondsToDuration(100); + var durationB = millisecondsToDuration(200); + var sumDuration = (0, TimeConversion_js_1.addDurations)(durationA, durationB); + assert_1.default.deepStrictEqual(sumDuration, { seconds: 0, nanos: 3e8 }); + }); + it('adds durations (seconds only)', function () { + var durationA = millisecondsToDuration(1000); + var durationB = millisecondsToDuration(2000); + var sumDuration = (0, TimeConversion_js_1.addDurations)(durationA, durationB); + assert_1.default.deepStrictEqual(sumDuration, { seconds: 3, nanos: 0 }); + }); + it('adds durations (seconds and nanos)', function () { + var durationA = millisecondsToDuration(1500); + var durationB = millisecondsToDuration(1600); + var sumDuration = (0, TimeConversion_js_1.addDurations)(durationA, durationB); + assert_1.default.deepStrictEqual(sumDuration, { seconds: 3, nanos: 1e8 }); + }); + it('adds durations (seconds and nanos) with legacy string seconds', function () { + var durationA = millisecondsToDuration(1500); + // @ts-ignore + durationA.seconds = String(durationA.seconds); + var durationB = millisecondsToDuration(1600); + // @ts-ignore + durationB.seconds = String(durationB.seconds); + var sumDuration = (0, TimeConversion_js_1.addDurations)(durationA, durationB); + assert_1.default.deepStrictEqual(sumDuration, { seconds: 3, nanos: 1e8 }); + }); +}); +//# sourceMappingURL=TimeConversionTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.js.map b/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.js.map new file mode 100644 index 00000000..c395d3e3 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/TimeConversionTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeConversionTest.js","sourceRoot":"","sources":["../../../test/TimeConversionTest.ts"],"names":[],"mappings":";;;;;AAAA,kDAA2B;AAC3B,4CAA0D;AAC1D,8DAAuD;AAGrD,IAAA,sBAAsB,GAIpB,yBAAc,uBAJM,EACtB,iCAAiC,GAG/B,yBAAc,kCAHiB,EACjC,sBAAsB,GAEpB,yBAAc,uBAFM,EACtB,iCAAiC,GAC/B,yBAAc,kCADiB,CACjB;AAElB,QAAQ,CAAC,gBAAgB,EAAE;IACzB,EAAE,CAAC,gCAAgC,EAAE;QACnC,IAAM,QAAQ,GAAa;YACzB,aAAa;YACb,OAAO,EAAE,GAAG;YACZ,KAAK,EAAE,KAAK;SACb,CAAA;QACD,IAAM,MAAM,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAA;QAE/C,gBAAM,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+CAA+C,EAAE;QAClD,IAAM,sBAAsB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;QACzC,IAAM,SAAS,GAAG,iCAAiC,CAAC,sBAAsB,CAAC,CAAA;QAC3E,IAAM,kBAAkB,GAAG,iCAAiC,CAAC,SAAS,CAAC,CAAA;QAEvE,gBAAM,CAAC,WAAW,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4CAA4C,EAAE;QAC/C,IAAM,sB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AA;IAEF,EAAE,CAAC,oCAAoC,EAAE;QACvC,IAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;QAC9C,IAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;QAC9C,IAAM,WAAW,GAAG,IAAA,gCAAY,EAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAEtD,gBAAM,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+DAA+D,EAAE;QAClE,IAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;QAC9C,aAAa;QACb,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QAC7C,IAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;QAC9C,aAAa;QACb,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QAC7C,IAAM,WAAW,GAAG,IAAA,gCAAY,EAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAEtD,gBAAM,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.d.ts b/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.d.ts new file mode 100644 index 00000000..6fe555da --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=getWorstTestStepResultsTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.d.ts.map new file mode 100644 index 00000000..09c5969d --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getWorstTestStepResultsTest.d.ts","sourceRoot":"","sources":["../../../test/getWorstTestStepResultsTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.js b/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.js new file mode 100644 index 00000000..58a37414 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.js @@ -0,0 +1,28 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var getWorstTestStepResult_js_1 = require("../src/getWorstTestStepResult.js"); +var messages_js_1 = require("../src/messages.js"); +var assert_1 = __importDefault(require("assert")); +describe('getWorstTestStepResult', function () { + it('returns a FAILED result for PASSED,FAILED,PASSED', function () { + var result = (0, getWorstTestStepResult_js_1.getWorstTestStepResult)([ + { + status: messages_js_1.TestStepResultStatus.PASSED, + duration: { seconds: 0, nanos: 0 }, + }, + { + status: messages_js_1.TestStepResultStatus.FAILED, + duration: { seconds: 0, nanos: 0 }, + }, + { + status: messages_js_1.TestStepResultStatus.PASSED, + duration: { seconds: 0, nanos: 0 }, + }, + ]); + assert_1.default.strictEqual(result.status, messages_js_1.TestStepResultStatus.FAILED); + }); +}); +//# sourceMappingURL=getWorstTestStepResultsTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.js.map b/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.js.map new file mode 100644 index 00000000..667b22e2 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/getWorstTestStepResultsTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getWorstTestStepResultsTest.js","sourceRoot":"","sources":["../../../test/getWorstTestStepResultsTest.ts"],"names":[],"mappings":";;;;;AAAA,8EAAyE;AACzE,kDAAyD;AACzD,kDAA2B;AAE3B,QAAQ,CAAC,wBAAwB,EAAE;IACjC,EAAE,CAAC,kDAAkD,EAAE;QACrD,IAAM,MAAM,GAAG,IAAA,kDAAsB,EAAC;YACpC;gBACE,MAAM,EAAE,kCAAoB,CAAC,MAAM;gBACnC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;aACnC;YACD;gBACE,MAAM,EAAE,kCAAoB,CAAC,MAAM;gBACnC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;aACnC;YACD;gBACE,MAAM,EAAE,kCAAoB,CAAC,MAAM;gBACnC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;aACnC;SACF,CAAC,CAAA;QACF,gBAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,kCAAoB,CAAC,MAAM,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.d.ts b/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.d.ts new file mode 100644 index 00000000..7b7022b4 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=messagesTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.d.ts.map b/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.d.ts.map new file mode 100644 index 00000000..601766c6 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"messagesTest.d.ts","sourceRoot":"","sources":["../../../test/messagesTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.js b/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.js new file mode 100644 index 00000000..b0777f1a --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.js @@ -0,0 +1,87 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var index_js_1 = require("../src/index.js"); +describe('messages', function () { + it('defaults missing fields when deserialising from JSON', function () { + // Sample envelope from before we moved from protobuf to JSON Schema + var partialGherkinDocumentEnvelope = { + gherkinDocument: { + feature: { + children: [ + { + scenario: { + id: '1', + keyword: 'Scenario', + location: { column: 3, line: 3 }, + name: 'minimalistic', + steps: [ + { + id: '0', + keyword: 'Given ', + keywordType: index_js_1.StepKeywordType.CONTEXT, + location: { column: 5, line: 4 }, + text: 'the minimalism', + }, + ], + }, + }, + ], + keyword: 'Feature', + language: 'en', + location: { column: 1, line: 1 }, + name: 'Minimal', + }, + uri: 'testdata/good/minimal.feature', + }, + }; + var envelope = (0, index_js_1.parseEnvelope)(JSON.stringify(partialGherkinDocumentEnvelope)); + var expectedEnvelope = { + gherkinDocument: { + // new + comments: [], + feature: { + // new + tags: [], + // new + description: '', + children: [ + { + scenario: { + // new + examples: [], + // new + description: '', + // new + tags: [], + id: '1', + keyword: 'Scenario', + location: { column: 3, line: 3 }, + name: 'minimalistic', + steps: [ + { + id: '0', + keyword: 'Given ', + keywordType: index_js_1.StepKeywordType.CONTEXT, + location: { column: 5, line: 4 }, + text: 'the minimalism', + }, + ], + }, + }, + ], + keyword: 'Feature', + language: 'en', + location: { column: 1, line: 1 }, + name: 'Minimal', + }, + uri: 'testdata/good/minimal.feature', + }, + }; + assert_1.default.deepStrictEqual(JSON.parse(JSON.stringify(envelope)), JSON.parse(JSON.stringify(expectedEnvelope))); + }); +}); +//# sourceMappingURL=messagesTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.js.map b/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.js.map new file mode 100644 index 00000000..39ca2522 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/test/messagesTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"messagesTest.js","sourceRoot":"","sources":["../../../test/messagesTest.ts"],"names":[],"mappings":";;;;;AAAA,kDAA2B;AAC3B,4CAA0E;AAE1E,QAAQ,CAAC,UAAU,EAAE;IACnB,EAAE,CAAC,sDAAsD,EAAE;QACzD,oEAAoE;QACpE,IAAM,8BAA8B,GAAG;YACrC,eAAe,EAAE;gBACf,OAAO,EAAE;oBACP,QAAQ,EAAE;wBACR;4BACE,QAAQ,EAAE;gCACR,EAAE,EAAE,GAAG;gCACP,OAAO,EAAE,UAAU;gCACnB,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;gCAChC,IAAI,EAAE,cAAc;gCACpB,KAAK,EAAE;oCACL;wCACE,EAAE,EAAE,GAAG;wCACP,OAAO,EAAE,QAAQ;wCACjB,WAAW,EAAE,0BAAe,CAAC,OAAO;wCACpC,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;wCAChC,IAAI,EAAE,gBAAgB;qCACvB;iCACF;6BACF;yBACF;qBACF;oBACD,OAAO,EAAE,SAAS;oBAClB,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;oBAChC,IAAI,EAAE,SAAS;iBAChB;gBACD,GAAG,EAAE,+BAA+B;aACrC;SACF,CAAA;QAED,IAAM,QAAQ,GAAa,IAAA,wBA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a/node_modules/@cucumber/messages/dist/cjs/tsconfig.build-cjs.tsbuildinfo b/node_modules/@cucumber/messages/dist/cjs/tsconfig.build-cjs.tsbuildinfo new file mode 100644 index 00000000..3ec55a96 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/cjs/tsconfig.build-cjs.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/IdGenerator.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/expose-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/exclude-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/transform-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/type-discriminator-descriptor.interface.d.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/type-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/exclude-metadata.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/expose-metadata.interface.d.ts","../../node_modules/class-transformer/types/enums/transformation-type.enum.d.ts","../../node_modules/class-transformer/types/enums/index.d.ts","../../node_modules/class-transformer/types/interfaces/target-map.interface.d.ts","../../node_modules/class-transformer/types/interfaces/class-transformer-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/transform-fn-params.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/transform-metadata.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/type-metadata.interface.d.ts","../../node_modules/class-transformer/types/interfaces/class-constructor.type.d.ts","../../node_modules/class-transformer/types/interfaces/type-help-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/index.d.ts","../../node_modules/class-transformer/types/ClassTransformer.d.ts","../../node_modules/class-transformer/types/decorators/exclude.decorator.d.ts","../../node_modules/class-transformer/types/decorators/expose.decorator.d.ts","../../node_modules/class-transformer/types/decorators/transform-instance-to-instance.decorator.d.ts","../../node_modules/class-transformer/types/decorators/transform-instance-to-plain.decorator.d.ts","../../node_modules/class-transformer/types/decorators/transform-plain-to-instance.decorator.d.ts","../../node_modules/class-transformer/types/decorators/transform.decorator.d.ts","../../node_modules/class-transformer/types/decorators/type.decorator.d.ts","../../node_modules/class-transformer/types/decorators/index.d.ts","../../node_modules/class-transformer/types/index.d.ts","../../node_modules/reflect-metadata/index.d.ts","../../src/messages.ts","../../src/TimeConversion.ts","../../src/getWorstTestStepResult.ts","../../src/parseEnvelope.ts","../../src/version.ts","../../src/index.ts","../../test/IdGeneratorTest.ts","../../test/TimeConversionTest.ts","../../test/getWorstTestStepResultsTest.ts","../../test/messagesTest.ts","../../node_modules/@types/mocha/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/@types/node/web-globals/events.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/inspector.generated.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/sqlite.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[91,139,156,157],[91,136,137,139,156,157],[91,138,139,156,157],[139,156,157],[91,139,144,156,157,174],[91,139,140,145,150,156,157,159,171,182],[91,139,140,141,150,156,157,159],[86,87,88,91,139,156,157],[91,139,142,156,157,183],[91,139,143,144,151,156,157,160],[91,139,144,156,157,171,179],[91,139,145,147,150,156,157,159],[91,138,139,146,156,157],[91,139,147,148,156,157],[91,139,149,150,156,157],[91,138,139,150,156,157],[91,139,150,151,152,156,157,171,182],[91,139,150,151,152,156,157,166,171,174],[91,132,139,147,150,153,156,157,159,171,182],[91,139,150,151,153,154,156,157,159,171,179,182],[91,139,153,155,156,157,171,179,182],[89,90,91,92,93,94,95,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188],[91,139,150,156,157],[91,139,156,157,158,182],[91,139,147,150,156,157,159,171],[91,139,156,157,160],[91,139,156,157,161],[91,138,139,156,157,162],[91,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188],[91,139,156,157,164],[91,139,156,157,165],[91,139,150,156,157,166,167],[91,139,156,157,166,168,183,185],[91,139,151,156,157],[91,139,150,156,157,171,172,174],[91,139,156,157,173,174],[91,139,156,157,171,172],[91,139,156,157,174],[91,139,156,157,175],[91,136,139,156,157,171,176,182],[91,139,150,156,157,177,178],[91,139,156,157,177,178],[91,139,144,156,157,159,171,179],[91,139,156,157,180],[91,139,156,157,159,181],[91,139,153,156,157,165,182],[91,139,144,156,157,183],[91,139,156,157,171,184],[91,139,156,157,158,185],[91,139,156,157,186],[91,132,139,156,157],[91,132,139,150,152,156,157,162,171,174,182,184,185,187],[91,139,156,157,171,188],[63,91,139,156,157],[65,66,67,68,69,70,71,91,139,156,157],[54,91,139,156,157],[55,63,64,72,91,139,156,157],[56,91,139,156,157],[50,91,139,156,157],[47,48,49,50,51,52,53,56,57,58,59,60,61,62,91,139,156,157],[55,57,91,139,156,157],[58,63,91,139,156,157],[91,104,108,139,156,157,182],[91,104,139,156,157,171,182],[91,99,139,156,157],[91,101,104,139,156,157,179,182],[91,139,156,157,159,179],[91,139,156,157,189],[91,99,139,156,157,189],[91,101,104,139,156,157,159,182],[91,96,97,100,103,139,150,156,157,171,182],[91,104,111,139,156,157],[91,96,102,139,156,157],[91,104,125,126,139,156,157],[91,100,104,139,156,157,174,182,189],[91,125,139,156,157,189],[91,98,99,139,156,157,189],[91,104,139,156,157],[91,98,99,100,101,102,103,104,105,106,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,126,127,128,129,130,131,139,156,157],[91,104,119,139,156,157],[91,104,111,112,139,156,157],[91,102,104,112,113,139,156,157],[91,103,139,156,157],[91,96,99,104,139,156,157],[91,104,108,112,113,139,156,157],[91,108,139,156,157],[91,102,104,107,139,156,157,182],[91,96,101,104,111,139,156,157],[91,139,156,157,171],[91,99,104,125,139,156,157,187,189],[75,91,139,156,157],[75,76,91,139,156,157],[46,75,76,77,78,79,91,139,156,157],[73,74,91,139,156,157],[73,75,91,139,156,157],[80,91,136,139,156,157],[76,80,91,136,139,156,157],[75,77,91,136,139,156,157]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c97c731e5cc47991e603bf2fb9f1793105494bcc0847092998bd88b6b1934da","signature":"44716259b743dacde932f7f1922ac85f533af74e3ed82a078ba505414f6f6b53"},{"version":"b6e995b5ef6661f5636ff738e67e4ec90150768ef119ad74b473c404304408a1","impliedFormat":1},{"version":"5d470930bf6142d7cbda81c157869024527dc7911ba55d90b8387ef6e1585aa1","impliedFormat":1},{"version":"074483fdbf20b30bd450e54e6892e96ea093430c313e61be5fdfe51588baa2d6","impliedFormat":1},{"version":"b7e6a6a3495301360edb9e1474702db73d18be7803b3f5c6c05571212acccd16","impliedFormat":1},{"version":"aa7527285c94043f21baf6e337bc60a92c20b6efaa90859473f6476954ac5f79","impliedFormat":1},{"version":"dd3be6d9dcd79e46d192175a756546630f2dc89dab28073823c936557b977f26","impliedFormat":1},{"version":"8d0566152618a1da6536c75a5659c139522d67c63a9ae27e8228d76ab0420584","impliedFormat":1},{"version":"ba06bf784edafe0db0e2bd1f6ecf3465b81f6b1819871bf190a0e0137b5b7f18","impliedFormat":1},{"version":"a0500233cb989bcb78f5f1a81f51eabc06b5c39e3042c560a7489f022f1f55a3","impliedFormat":1},{"version":"220508b3fb6b773f49d8fb0765b04f90ef15caacf0f3d260e3412ed38f71ef09","impliedFormat":1},{"version":"1ad113089ad5c188fec4c9a339cb53d1bcbb65682407d6937557bb23a6e1d4e5","impliedFormat":1},{"version":"e56427c055602078cbf0e58e815960541136388f4fc62554813575508def98b6","impliedFormat":1},{"version":"1f58b0676a80db38df1ce19d15360c20ce9e983b35298a5d0b4aa4eb4fb67e0f","impliedFormat":1},{"version":"3d67e7eb73c6955ee27f1d845cae88923f75c8b0830d4b5440eea2339958e8ec","impliedFormat":1},{"version":"11fec302d58b56033ab07290a3abc29e9908e29d504db9468544b15c4cd7670d","impliedFormat":1},{"version":"c66d6817c931633650edf19a8644eea61aeeb84190c7219911cefa8ddea8bd9a","impliedFormat":1},{"version":"ab1359707e4fc610c5f37f1488063af65cda3badca6b692d44b95e8380e0f6c2","impliedFormat":1},{"version":"37deda160549729287645b3769cf126b0a17e7e2218737352676705a01d5957e","impliedFormat":1},{"version":"d80ffdd55e7f4bc69cde66933582b8592d3736d3b0d1d8cc63995a7b2bcca579","impliedFormat":1},{"version":"c9b71952b2178e8737b63079dba30e1b29872240b122905cbaba756cb60b32f5","impliedFormat":1},{"version":"b596585338b0d870f0e19e6b6bcbf024f76328f2c4f4e59745714e38ee9b0582","impliedFormat":1},{"version":"e6717fc103dfa1635947bf2b41161b5e4f2fabbcaf555754cc1b4340ec4ca587","impliedFormat":1},{"version":"c36186d7bdf1f525b7685ee5bf639e4b157b1e803a70c25f234d4762496f771f","impliedFormat":1},{"version":"026726932a4964341ab8544f12b912c8dfaa388d2936b71cc3eca0cffb49cc1d","impliedFormat":1},{"version":"83188d037c81bd27076218934ba9e1742ddb69cd8cc64cdb8a554078de38eb12","impliedFormat":1},{"version":"7d82f2d6a89f07c46c7e3e9071ab890124f95931d9c999ba8f865fa6ef6cbf72","impliedFormat":1},{"version":"4fc523037d14d9bb6ddb586621a93dd05b6c6d8d59919a40c436ca3ac29d9716","impliedFormat":1},{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true,"impliedFormat":1},{"version":"c270488bdcc10c20550452f9bf6fcc1bd01eab0dfc7f0c6747abc19a2acd5f0e","signature":"a1387533f292cc1377923ba182557241ca949a2ca8495866dec169038c9e45a2"},{"version":"fd9ae11ee76d8d1993309456c4536d7024cecec15fc77dc1b4d7619556abc324","signature":"d9f4ec5156491a24eee340452d7e87e432512d5ebde23fe18c2ceb5a31c1720b"},{"version":"0e865bcd7cf3c305aeee04f6c76dd77de0f7e4b3173cf960bd4018b213525547","signature":"497efde09001124a1bfab8ea16409b6908fe8a49ae8d5d69082910838150fbfd"},{"version":"4866672a66505bfc3f8bd7f5f9cdbcd3927080b43095f73b6bfdf6a045d04fdf","signature":"653dc417862cf079d590653212a8d48ace7c89ff7b73c239791099afc25dca96"},{"version":"4112cfafe102f4a4cc44adb81a17cd895a854102130231735409a706570d22f6","signature":"881d8c5d323b9a03009e467e1fb7bc2a32da16a567ca29c9d484518cb02ce3f7"},{"version":"e6af11bf85a123ea9f9aee37c1e94008650a2609ac323f70eea1845a79d39a28","signature":"5ed925f9d0dfcb0fde32518c7ae42f88461fd8eabb015a35183fac5ce95bbc6c"},{"version":"9e4cf44d1d002801603e3a3883a5b338db29123a32143dfd8c703094998c8e4e","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"d32ac673e19a27547e53e00df484de018a9146acee28847619abd913088b4fc8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2717ea2c81ce0dc3855fe0647da5b0486b6ba0e3e7d9863b7e0491fcfa803d24","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"27acb37346bf964bc845b5cc6a9f3fc09d9002271c7dd144469ff00d2cfe923f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"58647d85d0f722a1ce9de50955df60a7489f0593bf1a7015521efe901c06d770","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6f137d651076822d4fe884287e68fd61785a0d3d1fdb250a5059b691fa897db","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"bceb58df66ab8fb00170df20cd813978c5ab84be1d285710c4eb005d8e9d8efb","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"80523c00b8544a2000ae0143e4a90a00b47f99823eb7926c1e03c494216fc363","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"746911b62b329587939560deb5c036aca48aece03147b021fa680223255d5183","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c8d3e5a18ba35629954e48c4cc8f11dc88224650067a172685c736b27a34a4dc","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"2b55d426ff2b9087485e52ac4bc7cfafe1dc420fc76dad926cd46526567c501a","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"358765d5ea8afd285d4fd1532e78b88273f18cb3f87403a9b16fef61ac9fdcfe","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1}],"root":[46,[75,84]],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"noImplicitAny":true,"outDir":"./","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":1},"referencedMap":[[85,1],[136,2],[137,2],[138,3],[91,4],[139,5],[140,6],[141,7],[86,1],[89,8],[87,1],[88,1],[142,9],[143,10],[144,11],[145,12],[146,13],[147,14],[148,14],[149,15],[150,16],[151,17],[152,18],[92,1],[90,1],[153,19],[154,20],[155,21],[189,22],[156,23],[157,1],[158,24],[159,25],[160,26],[161,27],[162,28],[163,29],[164,30],[165,31],[166,32],[167,32],[168,33],[169,1],[170,34],[171,35],[173,36],[172,37],[174,38],[175,39],[176,40],[177,41],[178,42],[179,43],[180,44],[181,45],[182,46],[183,47],[184,48],[185,49],[186,50],[93,1],[94,1],[95,1],[133,51],[134,1],[135,1],[187,52],[188,53],[64,54],[65,54],[66,54],[72,55],[67,54],[68,54],[69,54],[70,54],[71,54],[55,56],[54,1],[73,57],[61,1],[57,58],[48,1],[47,1],[49,1],[50,54],[51,59],[63,60],[52,54],[53,54],[58,61],[59,62],[60,54],[56,1],[62,1],[74,1],[44,1],[45,1],[9,1],[8,1],[2,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[3,1],[18,1],[19,1],[4,1],[20,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[35,1],[32,1],[33,1],[34,1],[36,1],[7,1],[37,1],[42,1],[43,1],[38,1],[39,1],[40,1],[41,1],[1,1],[111,63],[121,64],[110,63],[131,65],[102,66],[101,67],[130,68],[124,69],[129,70],[104,71],[118,72],[103,73],[127,74],[99,75],[98,68],[128,76],[100,77],[105,78],[106,1],[109,78],[96,1],[132,79],[122,80],[113,81],[114,82],[116,83],[112,84],[115,85],[125,68],[107,86],[108,87],[117,88],[97,89],[120,80],[119,78],[123,1],[126,90],[46,1],[76,91],[77,92],[80,93],[75,94],[78,95],[79,1],[81,96],[82,97],[83,98],[84,96]],"latestChangedDtsFile":"./test/messagesTest.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.d.ts b/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.d.ts new file mode 100644 index 00000000..cf2902b7 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.d.ts @@ -0,0 +1,4 @@ +export type NewId = () => string; +export declare function uuid(): NewId; +export declare function incrementing(): NewId; +//# sourceMappingURL=IdGenerator.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.d.ts.map b/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.d.ts.map new file mode 100644 index 00000000..6bf199e6 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"IdGenerator.d.ts","sourceRoot":"","sources":["../../../src/IdGenerator.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,MAAM,MAAM,CAAA;AAEhC,wBAAgB,IAAI,IAAI,KAAK,CAE5B;AAED,wBAAgB,YAAY,IAAI,KAAK,CAGpC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.js b/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.js new file mode 100644 index 00000000..98ef2362 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.js @@ -0,0 +1,8 @@ +export function uuid() { + return () => crypto.randomUUID(); +} +export function incrementing() { + let next = 0; + return () => (next++).toString(); +} +//# sourceMappingURL=IdGenerator.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.js.map b/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.js.map new file mode 100644 index 00000000..2ab75dd9 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/IdGenerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IdGenerator.js","sourceRoot":"","sources":["../../../src/IdGenerator.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,IAAI;IAClB,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;AAClC,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAA;AAClC,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.d.ts b/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.d.ts new file mode 100644 index 00000000..a4fec1b5 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.d.ts @@ -0,0 +1,7 @@ +import * as messages from './messages.js'; +export declare function millisecondsSinceEpochToTimestamp(millisecondsSinceEpoch: number): messages.Timestamp; +export declare function millisecondsToDuration(durationInMilliseconds: number): messages.Duration; +export declare function timestampToMillisecondsSinceEpoch(timestamp: messages.Timestamp): number; +export declare function durationToMilliseconds(duration: messages.Duration): number; +export declare function addDurations(durationA: messages.Duration, durationB: messages.Duration): messages.Duration; +//# sourceMappingURL=TimeConversion.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.d.ts.map b/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.d.ts.map new file mode 100644 index 00000000..52fb1ca5 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeConversion.d.ts","sourceRoot":"","sources":["../../../src/TimeConversion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAMzC,wBAAgB,iCAAiC,CAC/C,sBAAsB,EAAE,MAAM,GAC7B,QAAQ,CAAC,SAAS,CAEpB;AAED,wBAAgB,sBAAsB,CAAC,sBAAsB,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAExF;AAED,wBAAgB,iCAAiC,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,GAAG,MAAM,CAGvF;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,UAGjE;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,QAAQ,CAAC,QAAQ,EAC5B,SAAS,EAAE,QAAQ,CAAC,QAAQ,GAC3B,QAAQ,CAAC,QAAQ,CAQnB"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.js b/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.js new file mode 100644 index 00000000..0df2ff42 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.js @@ -0,0 +1,37 @@ +const MILLISECONDS_PER_SECOND = 1e3; +const NANOSECONDS_PER_MILLISECOND = 1e6; +const NANOSECONDS_PER_SECOND = 1e9; +export function millisecondsSinceEpochToTimestamp(millisecondsSinceEpoch) { + return toSecondsAndNanos(millisecondsSinceEpoch); +} +export function millisecondsToDuration(durationInMilliseconds) { + return toSecondsAndNanos(durationInMilliseconds); +} +export function timestampToMillisecondsSinceEpoch(timestamp) { + const { seconds, nanos } = timestamp; + return toMillis(seconds, nanos); +} +export function durationToMilliseconds(duration) { + const { seconds, nanos } = duration; + return toMillis(seconds, nanos); +} +export function addDurations(durationA, durationB) { + let seconds = +durationA.seconds + +durationB.seconds; + let nanos = durationA.nanos + durationB.nanos; + if (nanos >= NANOSECONDS_PER_SECOND) { + seconds += 1; + nanos -= NANOSECONDS_PER_SECOND; + } + return { seconds, nanos }; +} +function toSecondsAndNanos(milliseconds) { + const seconds = Math.floor(milliseconds / MILLISECONDS_PER_SECOND); + const nanos = Math.floor((milliseconds % MILLISECONDS_PER_SECOND) * NANOSECONDS_PER_MILLISECOND); + return { seconds, nanos }; +} +function toMillis(seconds, nanos) { + const secondMillis = +seconds * MILLISECONDS_PER_SECOND; + const nanoMillis = nanos / NANOSECONDS_PER_MILLISECOND; + return secondMillis + nanoMillis; +} +//# sourceMappingURL=TimeConversion.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.js.map b/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.js.map new file mode 100644 index 00000000..46e45a20 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/TimeConversion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeConversion.js","sourceRoot":"","sources":["../../../src/TimeConversion.ts"],"names":[],"mappings":"AAEA,MAAM,uBAAuB,GAAG,GAAG,CAAA;AACnC,MAAM,2BAA2B,GAAG,GAAG,CAAA;AACvC,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAElC,MAAM,UAAU,iCAAiC,CAC/C,sBAA8B;IAE9B,OAAO,iBAAiB,CAAC,sBAAsB,CAAC,CAAA;AAClD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,sBAA8B;IACnE,OAAO,iBAAiB,CAAC,sBAAsB,CAAC,CAAA;AAClD,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,SAA6B;IAC7E,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,SAAS,CAAA;IACpC,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,QAA2B;IAChE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAA;IACnC,OAAO,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,SAA4B,EAC5B,SAA4B;IAE5B,IAAI,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,GAAG,CAAC,SAAS,CAAC,OAAO,CAAA;IACrD,IAAI,KAAK,GAAG,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAA;IAC7C,IAAI,KAAK,IAAI,sBAAsB,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC,CAAA;QACZ,KAAK,IAAI,sBAAsB,CAAA;IACjC,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;AAC3B,CAAC;AAED,SAAS,iBAAiB,CAAC,YAAoB;IAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,uBAAuB,CAAC,CAAA;IAClE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,uBAAuB,CAAC,GAAG,2BAA2B,CAAC,CAAA;IAChG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;AAC3B,CAAC;AAED,SAAS,QAAQ,CAAC,OAAe,EAAE,KAAa;IAC9C,MAAM,YAAY,GAAG,CAAC,OAAO,GAAG,uBAAuB,CAAA;IACvD,MAAM,UAAU,GAAG,KAAK,GAAG,2BAA2B,CAAA;IACtD,OAAO,YAAY,GAAG,UAAU,CAAA;AAClC,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.d.ts b/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.d.ts new file mode 100644 index 00000000..5eb20d95 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.d.ts @@ -0,0 +1,7 @@ +import { TestStepResult } from './messages.js'; +/** + * Gets the worst result + * @param testStepResults + */ +export declare function getWorstTestStepResult(testStepResults: readonly TestStepResult[]): TestStepResult; +//# sourceMappingURL=getWorstTestStepResult.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.d.ts.map b/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.d.ts.map new file mode 100644 index 00000000..5614fb13 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getWorstTestStepResult.d.ts","sourceRoot":"","sources":["../../../src/getWorstTestStepResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,eAAe,CAAA;AAGpE;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,SAAS,cAAc,EAAE,GAAG,cAAc,CAOjG"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.js b/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.js new file mode 100644 index 00000000..1f545785 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.js @@ -0,0 +1,24 @@ +import { TestStepResultStatus } from './messages.js'; +import { millisecondsToDuration } from './TimeConversion.js'; +/** + * Gets the worst result + * @param testStepResults + */ +export function getWorstTestStepResult(testStepResults) { + return (testStepResults.slice().sort((r1, r2) => ordinal(r2.status) - ordinal(r1.status))[0] || { + status: TestStepResultStatus.UNKNOWN, + duration: millisecondsToDuration(0), + }); +} +function ordinal(status) { + return [ + TestStepResultStatus.UNKNOWN, + TestStepResultStatus.PASSED, + TestStepResultStatus.SKIPPED, + TestStepResultStatus.PENDING, + TestStepResultStatus.UNDEFINED, + TestStepResultStatus.AMBIGUOUS, + TestStepResultStatus.FAILED, + ].indexOf(status); +} +//# sourceMappingURL=getWorstTestStepResult.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.js.map b/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.js.map new file mode 100644 index 00000000..266ec2db --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/getWorstTestStepResult.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getWorstTestStepResult.js","sourceRoot":"","sources":["../../../src/getWorstTestStepResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE5D;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,eAA0C;IAC/E,OAAO,CACL,eAAe,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;QACtF,MAAM,EAAE,oBAAoB,CAAC,OAAO;QACpC,QAAQ,EAAE,sBAAsB,CAAC,CAAC,CAAC;KACpC,CACF,CAAA;AACH,CAAC;AAED,SAAS,OAAO,CAAC,MAA4B;IAC3C,OAAO;QACL,oBAAoB,CAAC,OAAO;QAC5B,oBAAoB,CAAC,MAAM;QAC3B,oBAAoB,CAAC,OAAO;QAC5B,oBAAoB,CAAC,OAAO;QAC5B,oBAAoB,CAAC,SAAS;QAC9B,oBAAoB,CAAC,SAAS;QAC9B,oBAAoB,CAAC,MAAM;KAC5B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/index.d.ts b/node_modules/@cucumber/messages/dist/esm/src/index.d.ts new file mode 100644 index 00000000..3564d994 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/index.d.ts @@ -0,0 +1,8 @@ +import * as TimeConversion from './TimeConversion.js'; +import * as IdGenerator from './IdGenerator.js'; +import { parseEnvelope } from './parseEnvelope.js'; +import { getWorstTestStepResult } from './getWorstTestStepResult.js'; +import { version } from './version.js'; +export * from './messages.js'; +export { TimeConversion, IdGenerator, version, parseEnvelope, getWorstTestStepResult }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/index.d.ts.map b/node_modules/@cucumber/messages/dist/esm/src/index.d.ts.map new file mode 100644 index 00000000..e3cbbd18 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/index.js b/node_modules/@cucumber/messages/dist/esm/src/index.js new file mode 100644 index 00000000..c1040d50 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/index.js @@ -0,0 +1,8 @@ +import * as TimeConversion from './TimeConversion.js'; +import * as IdGenerator from './IdGenerator.js'; +import { parseEnvelope } from './parseEnvelope.js'; +import { getWorstTestStepResult } from './getWorstTestStepResult.js'; +import { version } from './version.js'; +export * from './messages.js'; +export { TimeConversion, IdGenerator, version, parseEnvelope, getWorstTestStepResult }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/index.js.map b/node_modules/@cucumber/messages/dist/esm/src/index.js.map new file mode 100644 index 00000000..d2b42d95 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/messages.d.ts b/node_modules/@cucumber/messages/dist/esm/src/messages.d.ts new file mode 100644 index 00000000..2b6aeb5d --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/messages.d.ts @@ -0,0 +1,403 @@ +import 'reflect-metadata'; +export declare class Attachment { + body: string; + contentEncoding: AttachmentContentEncoding; + fileName?: string; + mediaType: string; + source?: Source; + testCaseStartedId?: string; + testStepId?: string; + url?: string; + testRunStartedId?: string; + testRunHookStartedId?: string; + timestamp?: Timestamp; +} +export declare class Duration { + seconds: number; + nanos: number; +} +export declare class Envelope { + attachment?: Attachment; + externalAttachment?: ExternalAttachment; + gherkinDocument?: GherkinDocument; + hook?: Hook; + meta?: Meta; + parameterType?: ParameterType; + parseError?: ParseError; + pickle?: Pickle; + suggestion?: Suggestion; + source?: Source; + stepDefinition?: StepDefinition; + testCase?: TestCase; + testCaseFinished?: TestCaseFinished; + testCaseStarted?: TestCaseStarted; + testRunFinished?: TestRunFinished; + testRunStarted?: TestRunStarted; + testStepFinished?: TestStepFinished; + testStepStarted?: TestStepStarted; + testRunHookStarted?: TestRunHookStarted; + testRunHookFinished?: TestRunHookFinished; + undefinedParameterType?: UndefinedParameterType; +} +export declare class Exception { + type: string; + message?: string; + stackTrace?: string; +} +export declare class ExternalAttachment { + url: string; + mediaType: string; + testCaseStartedId?: string; + testStepId?: string; + testRunHookStartedId?: string; + timestamp?: Timestamp; +} +export declare class GherkinDocument { + uri?: string; + feature?: Feature; + comments: readonly Comment[]; +} +export declare class Background { + location: Location; + keyword: string; + name: string; + description: string; + steps: readonly Step[]; + id: string; +} +export declare class Comment { + location: Location; + text: string; +} +export declare class DataTable { + location: Location; + rows: readonly TableRow[]; +} +export declare class DocString { + location: Location; + mediaType?: string; + content: string; + delimiter: string; +} +export declare class Examples { + location: Location; + tags: readonly Tag[]; + keyword: string; + name: string; + description: string; + tableHeader?: TableRow; + tableBody: readonly TableRow[]; + id: string; +} +export declare class Feature { + location: Location; + tags: readonly Tag[]; + language: string; + keyword: string; + name: string; + description: string; + children: readonly FeatureChild[]; +} +export declare class FeatureChild { + rule?: Rule; + background?: Background; + scenario?: Scenario; +} +export declare class Rule { + location: Location; + tags: readonly Tag[]; + keyword: string; + name: string; + description: string; + children: readonly RuleChild[]; + id: string; +} +export declare class RuleChild { + background?: Background; + scenario?: Scenario; +} +export declare class Scenario { + location: Location; + tags: readonly Tag[]; + keyword: string; + name: string; + description: string; + steps: readonly Step[]; + examples: readonly Examples[]; + id: string; +} +export declare class Step { + location: Location; + keyword: string; + keywordType?: StepKeywordType; + text: string; + docString?: DocString; + dataTable?: DataTable; + id: string; +} +export declare class TableCell { + location: Location; + value: string; +} +export declare class TableRow { + location: Location; + cells: readonly TableCell[]; + id: string; +} +export declare class Tag { + location: Location; + name: string; + id: string; +} +export declare class Hook { + id: string; + name?: string; + sourceReference: SourceReference; + tagExpression?: string; + type?: HookType; +} +export declare class Location { + line: number; + column?: number; +} +export declare class Meta { + protocolVersion: string; + implementation: Product; + runtime: Product; + os: Product; + cpu: Product; + ci?: Ci; +} +export declare class Ci { + name: string; + url?: string; + buildNumber?: string; + git?: Git; +} +export declare class Git { + remote: string; + revision: string; + branch?: string; + tag?: string; +} +export declare class Product { + name: string; + version?: string; +} +export declare class ParameterType { + name: string; + regularExpressions: readonly string[]; + preferForRegularExpressionMatch: boolean; + useForSnippets: boolean; + id: string; + sourceReference?: SourceReference; +} +export declare class ParseError { + source: SourceReference; + message: string; +} +export declare class Pickle { + id: string; + uri: string; + location?: Location; + name: string; + language: string; + steps: readonly PickleStep[]; + tags: readonly PickleTag[]; + astNodeIds: readonly string[]; +} +export declare class PickleDocString { + mediaType?: string; + content: string; +} +export declare class PickleStep { + argument?: PickleStepArgument; + astNodeIds: readonly string[]; + id: string; + type?: PickleStepType; + text: string; +} +export declare class PickleStepArgument { + docString?: PickleDocString; + dataTable?: PickleTable; +} +export declare class PickleTable { + rows: readonly PickleTableRow[]; +} +export declare class PickleTableCell { + value: string; +} +export declare class PickleTableRow { + cells: readonly PickleTableCell[]; +} +export declare class PickleTag { + name: string; + astNodeId: string; +} +export declare class Source { + uri: string; + data: string; + mediaType: SourceMediaType; +} +export declare class SourceReference { + uri?: string; + javaMethod?: JavaMethod; + javaStackTraceElement?: JavaStackTraceElement; + location?: Location; +} +export declare class JavaMethod { + className: string; + methodName: string; + methodParameterTypes: readonly string[]; +} +export declare class JavaStackTraceElement { + className: string; + fileName: string; + methodName: string; +} +export declare class StepDefinition { + id: string; + pattern: StepDefinitionPattern; + sourceReference: SourceReference; +} +export declare class StepDefinitionPattern { + source: string; + type: StepDefinitionPatternType; +} +export declare class Suggestion { + id: string; + pickleStepId: string; + snippets: readonly Snippet[]; +} +export declare class Snippet { + language: string; + code: string; +} +export declare class TestCase { + id: string; + pickleId: string; + testSteps: readonly TestStep[]; + testRunStartedId?: string; +} +export declare class Group { + children?: readonly Group[]; + start?: number; + value?: string; +} +export declare class StepMatchArgument { + group: Group; + parameterTypeName?: string; +} +export declare class StepMatchArgumentsList { + stepMatchArguments: readonly StepMatchArgument[]; +} +export declare class TestStep { + hookId?: string; + id: string; + pickleStepId?: string; + stepDefinitionIds?: readonly string[]; + stepMatchArgumentsLists?: readonly StepMatchArgumentsList[]; +} +export declare class TestCaseFinished { + testCaseStartedId: string; + timestamp: Timestamp; + willBeRetried: boolean; +} +export declare class TestCaseStarted { + attempt: number; + id: string; + testCaseId: string; + workerId?: string; + timestamp: Timestamp; +} +export declare class TestRunFinished { + message?: string; + success: boolean; + timestamp: Timestamp; + exception?: Exception; + testRunStartedId?: string; +} +export declare class TestRunHookFinished { + testRunHookStartedId: string; + result: TestStepResult; + timestamp: Timestamp; +} +export declare class TestRunHookStarted { + id: string; + testRunStartedId: string; + hookId: string; + workerId?: string; + timestamp: Timestamp; +} +export declare class TestRunStarted { + timestamp: Timestamp; + id?: string; +} +export declare class TestStepFinished { + testCaseStartedId: string; + testStepId: string; + testStepResult: TestStepResult; + timestamp: Timestamp; +} +export declare class TestStepResult { + duration: Duration; + message?: string; + status: TestStepResultStatus; + exception?: Exception; +} +export declare class TestStepStarted { + testCaseStartedId: string; + testStepId: string; + timestamp: Timestamp; +} +export declare class Timestamp { + seconds: number; + nanos: number; +} +export declare class UndefinedParameterType { + expression: string; + name: string; +} +export declare enum AttachmentContentEncoding { + IDENTITY = "IDENTITY", + BASE64 = "BASE64" +} +export declare enum HookType { + BEFORE_TEST_RUN = "BEFORE_TEST_RUN", + AFTER_TEST_RUN = "AFTER_TEST_RUN", + BEFORE_TEST_CASE = "BEFORE_TEST_CASE", + AFTER_TEST_CASE = "AFTER_TEST_CASE", + BEFORE_TEST_STEP = "BEFORE_TEST_STEP", + AFTER_TEST_STEP = "AFTER_TEST_STEP" +} +export declare enum PickleStepType { + UNKNOWN = "Unknown", + CONTEXT = "Context", + ACTION = "Action", + OUTCOME = "Outcome" +} +export declare enum SourceMediaType { + TEXT_X_CUCUMBER_GHERKIN_PLAIN = "text/x.cucumber.gherkin+plain", + TEXT_X_CUCUMBER_GHERKIN_MARKDOWN = "text/x.cucumber.gherkin+markdown" +} +export declare enum StepDefinitionPatternType { + CUCUMBER_EXPRESSION = "CUCUMBER_EXPRESSION", + REGULAR_EXPRESSION = "REGULAR_EXPRESSION" +} +export declare enum StepKeywordType { + UNKNOWN = "Unknown", + CONTEXT = "Context", + ACTION = "Action", + OUTCOME = "Outcome", + CONJUNCTION = "Conjunction" +} +export declare enum TestStepResultStatus { + UNKNOWN = "UNKNOWN", + PASSED = "PASSED", + SKIPPED = "SKIPPED", + PENDING = "PENDING", + UNDEFINED = "UNDEFINED", + AMBIGUOUS = "AMBIGUOUS", + FAILED = "FAILED" +} +//# sourceMappingURL=messages.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/messages.d.ts.map b/node_modules/@cucumber/messages/dist/esm/src/messages.d.ts.map new file mode 100644 index 00000000..f9a7c017 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/messages.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/messages.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,UAAU;IAErB,IAAI,EAAE,MAAM,CAAK;IAEjB,eAAe,EAAE,yBAAyB,CAAqC;IAE/E,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB,SAAS,EAAE,MAAM,CAAK;IAGtB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAG7B,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,qBAAa,QAAQ;IAEnB,OAAO,EAAE,MAAM,CAAI;IAEnB,KAAK,EAAE,MAAM,CAAI;CAClB;AAED,qBAAa,QAAQ;IAGnB,UAAU,CAAC,EAAE,UAAU,CAAA;IAGvB,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IAGvC,eAAe,CAAC,EAAE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ACjB,OAAO,YAAY;IACnB,WAAW,gBAAgB;CAC5B;AAED,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/messages.js b/node_modules/@cucumber/messages/dist/esm/src/messages.js new file mode 100644 index 00000000..102a8f3b --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/messages.js @@ -0,0 +1,736 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +import { Type } from 'class-transformer'; +import 'reflect-metadata'; +export class Attachment { + constructor() { + this.body = ''; + this.contentEncoding = AttachmentContentEncoding.IDENTITY; + this.mediaType = ''; + } +} +__decorate([ + Type(() => Source) +], Attachment.prototype, "source", void 0); +__decorate([ + Type(() => Timestamp) +], Attachment.prototype, "timestamp", void 0); +export class Duration { + constructor() { + this.seconds = 0; + this.nanos = 0; + } +} +export class Envelope { +} +__decorate([ + Type(() => Attachment) +], Envelope.prototype, "attachment", void 0); +__decorate([ + Type(() => ExternalAttachment) +], Envelope.prototype, "externalAttachment", void 0); +__decorate([ + Type(() => GherkinDocument) +], Envelope.prototype, "gherkinDocument", void 0); +__decorate([ + Type(() => Hook) +], Envelope.prototype, "hook", void 0); +__decorate([ + Type(() => Meta) +], Envelope.prototype, "meta", void 0); +__decorate([ + Type(() => ParameterType) +], Envelope.prototype, "parameterType", void 0); +__decorate([ + Type(() => ParseError) +], Envelope.prototype, "parseError", void 0); +__decorate([ + Type(() => Pickle) +], Envelope.prototype, "pickle", void 0); +__decorate([ + Type(() => Suggestion) +], Envelope.prototype, "suggestion", void 0); +__decorate([ + Type(() => Source) +], Envelope.prototype, "source", void 0); +__decorate([ + Type(() => StepDefinition) +], Envelope.prototype, "stepDefinition", void 0); +__decorate([ + Type(() => TestCase) +], Envelope.prototype, "testCase", void 0); +__decorate([ + Type(() => TestCaseFinished) +], Envelope.prototype, "testCaseFinished", void 0); +__decorate([ + Type(() => TestCaseStarted) +], Envelope.prototype, "testCaseStarted", void 0); +__decorate([ + Type(() => TestRunFinished) +], Envelope.prototype, "testRunFinished", void 0); +__decorate([ + Type(() => TestRunStarted) +], Envelope.prototype, "testRunStarted", void 0); +__decorate([ + Type(() => TestStepFinished) +], Envelope.prototype, "testStepFinished", void 0); +__decorate([ + Type(() => TestStepStarted) +], Envelope.prototype, "testStepStarted", void 0); +__decorate([ + Type(() => TestRunHookStarted) +], Envelope.prototype, "testRunHookStarted", void 0); +__decorate([ + Type(() => TestRunHookFinished) +], Envelope.prototype, "testRunHookFinished", void 0); +__decorate([ + Type(() => UndefinedParameterType) +], Envelope.prototype, "undefinedParameterType", void 0); +export class Exception { + constructor() { + this.type = ''; + } +} +export class ExternalAttachment { + constructor() { + this.url = ''; + this.mediaType = ''; + } +} +__decorate([ + Type(() => Timestamp) +], ExternalAttachment.prototype, "timestamp", void 0); +export class GherkinDocument { + constructor() { + this.comments = []; + } +} +__decorate([ + Type(() => Feature) +], GherkinDocument.prototype, "feature", void 0); +__decorate([ + Type(() => Comment) +], GherkinDocument.prototype, "comments", void 0); +export class Background { + constructor() { + this.location = new Location(); + this.keyword = ''; + this.name = ''; + this.description = ''; + this.steps = []; + this.id = ''; + } +} +__decorate([ + Type(() => Location) +], Background.prototype, "location", void 0); +__decorate([ + Type(() => Step) +], Background.prototype, "steps", void 0); +export class Comment { + constructor() { + this.location = new Location(); + this.text = ''; + } +} +__decorate([ + Type(() => Location) +], Comment.prototype, "location", void 0); +export class DataTable { + constructor() { + this.location = new Location(); + this.rows = []; + } +} +__decorate([ + Type(() => Location) +], DataTable.prototype, "location", void 0); +__decorate([ + Type(() => TableRow) +], DataTable.prototype, "rows", void 0); +export class DocString { + constructor() { + this.location = new Location(); + this.content = ''; + this.delimiter = ''; + } +} +__decorate([ + Type(() => Location) +], DocString.prototype, "location", void 0); +export class Examples { + constructor() { + this.location = new Location(); + this.tags = []; + this.keyword = ''; + this.name = ''; + this.description = ''; + this.tableBody = []; + this.id = ''; + } +} +__decorate([ + Type(() => Location) +], Examples.prototype, "location", void 0); +__decorate([ + Type(() => Tag) +], Examples.prototype, "tags", void 0); +__decorate([ + Type(() => TableRow) +], Examples.prototype, "tableHeader", void 0); +__decorate([ + Type(() => TableRow) +], Examples.prototype, "tableBody", void 0); +export class Feature { + constructor() { + this.location = new Location(); + this.tags = []; + this.language = ''; + this.keyword = ''; + this.name = ''; + this.description = ''; + this.children = []; + } +} +__decorate([ + Type(() => Location) +], Feature.prototype, "location", void 0); +__decorate([ + Type(() => Tag) +], Feature.prototype, "tags", void 0); +__decorate([ + Type(() => FeatureChild) +], Feature.prototype, "children", void 0); +export class FeatureChild { +} +__decorate([ + Type(() => Rule) +], FeatureChild.prototype, "rule", void 0); +__decorate([ + Type(() => Background) +], FeatureChild.prototype, "background", void 0); +__decorate([ + Type(() => Scenario) +], FeatureChild.prototype, "scenario", void 0); +export class Rule { + constructor() { + this.location = new Location(); + this.tags = []; + this.keyword = ''; + this.name = ''; + this.description = ''; + this.children = []; + this.id = ''; + } +} +__decorate([ + Type(() => Location) +], Rule.prototype, "location", void 0); +__decorate([ + Type(() => Tag) +], Rule.prototype, "tags", void 0); +__decorate([ + Type(() => RuleChild) +], Rule.prototype, "children", void 0); +export class RuleChild { +} +__decorate([ + Type(() => Background) +], RuleChild.prototype, "background", void 0); +__decorate([ + Type(() => Scenario) +], RuleChild.prototype, "scenario", void 0); +export class Scenario { + constructor() { + this.location = new Location(); + this.tags = []; + this.keyword = ''; + this.name = ''; + this.description = ''; + this.steps = []; + this.examples = []; + this.id = ''; + } +} +__decorate([ + Type(() => Location) +], Scenario.prototype, "location", void 0); +__decorate([ + Type(() => Tag) +], Scenario.prototype, "tags", void 0); +__decorate([ + Type(() => Step) +], Scenario.prototype, "steps", void 0); +__decorate([ + Type(() => Examples) +], Scenario.prototype, "examples", void 0); +export class Step { + constructor() { + this.location = new Location(); + this.keyword = ''; + this.text = ''; + this.id = ''; + } +} +__decorate([ + Type(() => Location) +], Step.prototype, "location", void 0); +__decorate([ + Type(() => DocString) +], Step.prototype, "docString", void 0); +__decorate([ + Type(() => DataTable) +], Step.prototype, "dataTable", void 0); +export class TableCell { + constructor() { + this.location = new Location(); + this.value = ''; + } +} +__decorate([ + Type(() => Location) +], TableCell.prototype, "location", void 0); +export class TableRow { + constructor() { + this.location = new Location(); + this.cells = []; + this.id = ''; + } +} +__decorate([ + Type(() => Location) +], TableRow.prototype, "location", void 0); +__decorate([ + Type(() => TableCell) +], TableRow.prototype, "cells", void 0); +export class Tag { + constructor() { + this.location = new Location(); + this.name = ''; + this.id = ''; + } +} +__decorate([ + Type(() => Location) +], Tag.prototype, "location", void 0); +export class Hook { + constructor() { + this.id = ''; + this.sourceReference = new SourceReference(); + } +} +__decorate([ + Type(() => SourceReference) +], Hook.prototype, "sourceReference", void 0); +export class Location { + constructor() { + this.line = 0; + } +} +export class Meta { + constructor() { + this.protocolVersion = ''; + this.implementation = new Product(); + this.runtime = new Product(); + this.os = new Product(); + this.cpu = new Product(); + } +} +__decorate([ + Type(() => Product) +], Meta.prototype, "implementation", void 0); +__decorate([ + Type(() => Product) +], Meta.prototype, "runtime", void 0); +__decorate([ + Type(() => Product) +], Meta.prototype, "os", void 0); +__decorate([ + Type(() => Product) +], Meta.prototype, "cpu", void 0); +__decorate([ + Type(() => Ci) +], Meta.prototype, "ci", void 0); +export class Ci { + constructor() { + this.name = ''; + } +} +__decorate([ + Type(() => Git) +], Ci.prototype, "git", void 0); +export class Git { + constructor() { + this.remote = ''; + this.revision = ''; + } +} +export class Product { + constructor() { + this.name = ''; + } +} +export class ParameterType { + constructor() { + this.name = ''; + this.regularExpressions = []; + this.preferForRegularExpressionMatch = false; + this.useForSnippets = false; + this.id = ''; + } +} +__decorate([ + Type(() => SourceReference) +], ParameterType.prototype, "sourceReference", void 0); +export class ParseError { + constructor() { + this.source = new SourceReference(); + this.message = ''; + } +} +__decorate([ + Type(() => SourceReference) +], ParseError.prototype, "source", void 0); +export class Pickle { + constructor() { + this.id = ''; + this.uri = ''; + this.name = ''; + this.language = ''; + this.steps = []; + this.tags = []; + this.astNodeIds = []; + } +} +__decorate([ + Type(() => Location) +], Pickle.prototype, "location", void 0); +__decorate([ + Type(() => PickleStep) +], Pickle.prototype, "steps", void 0); +__decorate([ + Type(() => PickleTag) +], Pickle.prototype, "tags", void 0); +export class PickleDocString { + constructor() { + this.content = ''; + } +} +export class PickleStep { + constructor() { + this.astNodeIds = []; + this.id = ''; + this.text = ''; + } +} +__decorate([ + Type(() => PickleStepArgument) +], PickleStep.prototype, "argument", void 0); +export class PickleStepArgument { +} +__decorate([ + Type(() => PickleDocString) +], PickleStepArgument.prototype, "docString", void 0); +__decorate([ + Type(() => PickleTable) +], PickleStepArgument.prototype, "dataTable", void 0); +export class PickleTable { + constructor() { + this.rows = []; + } +} +__decorate([ + Type(() => PickleTableRow) +], PickleTable.prototype, "rows", void 0); +export class PickleTableCell { + constructor() { + this.value = ''; + } +} +export class PickleTableRow { + constructor() { + this.cells = []; + } +} +__decorate([ + Type(() => PickleTableCell) +], PickleTableRow.prototype, "cells", void 0); +export class PickleTag { + constructor() { + this.name = ''; + this.astNodeId = ''; + } +} +export class Source { + constructor() { + this.uri = ''; + this.data = ''; + this.mediaType = SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_PLAIN; + } +} +export class SourceReference { +} +__decorate([ + Type(() => JavaMethod) +], SourceReference.prototype, "javaMethod", void 0); +__decorate([ + Type(() => JavaStackTraceElement) +], SourceReference.prototype, "javaStackTraceElement", void 0); +__decorate([ + Type(() => Location) +], SourceReference.prototype, "location", void 0); +export class JavaMethod { + constructor() { + this.className = ''; + this.methodName = ''; + this.methodParameterTypes = []; + } +} +export class JavaStackTraceElement { + constructor() { + this.className = ''; + this.fileName = ''; + this.methodName = ''; + } +} +export class StepDefinition { + constructor() { + this.id = ''; + this.pattern = new StepDefinitionPattern(); + this.sourceReference = new SourceReference(); + } +} +__decorate([ + Type(() => StepDefinitionPattern) +], StepDefinition.prototype, "pattern", void 0); +__decorate([ + Type(() => SourceReference) +], StepDefinition.prototype, "sourceReference", void 0); +export class StepDefinitionPattern { + constructor() { + this.source = ''; + this.type = StepDefinitionPatternType.CUCUMBER_EXPRESSION; + } +} +export class Suggestion { + constructor() { + this.id = ''; + this.pickleStepId = ''; + this.snippets = []; + } +} +__decorate([ + Type(() => Snippet) +], Suggestion.prototype, "snippets", void 0); +export class Snippet { + constructor() { + this.language = ''; + this.code = ''; + } +} +export class TestCase { + constructor() { + this.id = ''; + this.pickleId = ''; + this.testSteps = []; + } +} +__decorate([ + Type(() => TestStep) +], TestCase.prototype, "testSteps", void 0); +export class Group { +} +__decorate([ + Type(() => Group) +], Group.prototype, "children", void 0); +export class StepMatchArgument { + constructor() { + this.group = new Group(); + } +} +__decorate([ + Type(() => Group) +], StepMatchArgument.prototype, "group", void 0); +export class StepMatchArgumentsList { + constructor() { + this.stepMatchArguments = []; + } +} +__decorate([ + Type(() => StepMatchArgument) +], StepMatchArgumentsList.prototype, "stepMatchArguments", void 0); +export class TestStep { + constructor() { + this.id = ''; + } +} +__decorate([ + Type(() => StepMatchArgumentsList) +], TestStep.prototype, "stepMatchArgumentsLists", void 0); +export class TestCaseFinished { + constructor() { + this.testCaseStartedId = ''; + this.timestamp = new Timestamp(); + this.willBeRetried = false; + } +} +__decorate([ + Type(() => Timestamp) +], TestCaseFinished.prototype, "timestamp", void 0); +export class TestCaseStarted { + constructor() { + this.attempt = 0; + this.id = ''; + this.testCaseId = ''; + this.timestamp = new Timestamp(); + } +} +__decorate([ + Type(() => Timestamp) +], TestCaseStarted.prototype, "timestamp", void 0); +export class TestRunFinished { + constructor() { + this.success = false; + this.timestamp = new Timestamp(); + } +} +__decorate([ + Type(() => Timestamp) +], TestRunFinished.prototype, "timestamp", void 0); +__decorate([ + Type(() => Exception) +], TestRunFinished.prototype, "exception", void 0); +export class TestRunHookFinished { + constructor() { + this.testRunHookStartedId = ''; + this.result = new TestStepResult(); + this.timestamp = new Timestamp(); + } +} +__decorate([ + Type(() => TestStepResult) +], TestRunHookFinished.prototype, "result", void 0); +__decorate([ + Type(() => Timestamp) +], TestRunHookFinished.prototype, "timestamp", void 0); +export class TestRunHookStarted { + constructor() { + this.id = ''; + this.testRunStartedId = ''; + this.hookId = ''; + this.timestamp = new Timestamp(); + } +} +__decorate([ + Type(() => Timestamp) +], TestRunHookStarted.prototype, "timestamp", void 0); +export class TestRunStarted { + constructor() { + this.timestamp = new Timestamp(); + } +} +__decorate([ + Type(() => Timestamp) +], TestRunStarted.prototype, "timestamp", void 0); +export class TestStepFinished { + constructor() { + this.testCaseStartedId = ''; + this.testStepId = ''; + this.testStepResult = new TestStepResult(); + this.timestamp = new Timestamp(); + } +} +__decorate([ + Type(() => TestStepResult) +], TestStepFinished.prototype, "testStepResult", void 0); +__decorate([ + Type(() => Timestamp) +], TestStepFinished.prototype, "timestamp", void 0); +export class TestStepResult { + constructor() { + this.duration = new Duration(); + this.status = TestStepResultStatus.UNKNOWN; + } +} +__decorate([ + Type(() => Duration) +], TestStepResult.prototype, "duration", void 0); +__decorate([ + Type(() => Exception) +], TestStepResult.prototype, "exception", void 0); +export class TestStepStarted { + constructor() { + this.testCaseStartedId = ''; + this.testStepId = ''; + this.timestamp = new Timestamp(); + } +} +__decorate([ + Type(() => Timestamp) +], TestStepStarted.prototype, "timestamp", void 0); +export class Timestamp { + constructor() { + this.seconds = 0; + this.nanos = 0; + } +} +export class UndefinedParameterType { + constructor() { + this.expression = ''; + this.name = ''; + } +} +export var AttachmentContentEncoding; +(function (AttachmentContentEncoding) { + AttachmentContentEncoding["IDENTITY"] = "IDENTITY"; + AttachmentContentEncoding["BASE64"] = "BASE64"; +})(AttachmentContentEncoding || (AttachmentContentEncoding = {})); +export var HookType; +(function (HookType) { + HookType["BEFORE_TEST_RUN"] = "BEFORE_TEST_RUN"; + HookType["AFTER_TEST_RUN"] = "AFTER_TEST_RUN"; + HookType["BEFORE_TEST_CASE"] = "BEFORE_TEST_CASE"; + HookType["AFTER_TEST_CASE"] = "AFTER_TEST_CASE"; + HookType["BEFORE_TEST_STEP"] = "BEFORE_TEST_STEP"; + HookType["AFTER_TEST_STEP"] = "AFTER_TEST_STEP"; +})(HookType || (HookType = {})); +export var PickleStepType; +(function (PickleStepType) { + PickleStepType["UNKNOWN"] = "Unknown"; + PickleStepType["CONTEXT"] = "Context"; + PickleStepType["ACTION"] = "Action"; + PickleStepType["OUTCOME"] = "Outcome"; +})(PickleStepType || (PickleStepType = {})); +export var SourceMediaType; +(function (SourceMediaType) { + SourceMediaType["TEXT_X_CUCUMBER_GHERKIN_PLAIN"] = "text/x.cucumber.gherkin+plain"; + SourceMediaType["TEXT_X_CUCUMBER_GHERKIN_MARKDOWN"] = "text/x.cucumber.gherkin+markdown"; +})(SourceMediaType || (SourceMediaType = {})); +export var StepDefinitionPatternType; +(function (StepDefinitionPatternType) { + StepDefinitionPatternType["CUCUMBER_EXPRESSION"] = "CUCUMBER_EXPRESSION"; + StepDefinitionPatternType["REGULAR_EXPRESSION"] = "REGULAR_EXPRESSION"; +})(StepDefinitionPatternType || (StepDefinitionPatternType = {})); +export var StepKeywordType; +(function (StepKeywordType) { + StepKeywordType["UNKNOWN"] = "Unknown"; + StepKeywordType["CONTEXT"] = "Context"; + StepKeywordType["ACTION"] = "Action"; + StepKeywordType["OUTCOME"] = "Outcome"; + StepKeywordType["CONJUNCTION"] = "Conjunction"; +})(StepKeywordType || (StepKeywordType = {})); +export var TestStepResultStatus; +(function (TestStepResultStatus) { + TestStepResultStatus["UNKNOWN"] = "UNKNOWN"; + TestStepResultStatus["PASSED"] = "PASSED"; + TestStepResultStatus["SKIPPED"] = "SKIPPED"; + TestStepResultStatus["PENDING"] = "PENDING"; + TestStepResultStatus["UNDEFINED"] = "UNDEFINED"; + TestStepResultStatus["AMBIGUOUS"] = "AMBIGUOUS"; + TestStepResultStatus["FAILED"] = "FAILED"; +})(TestStepResultStatus || (TestStepResultStatus = {})); +//# sourceMappingURL=messages.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/messages.js.map b/node_modules/@cucumber/messages/dist/esm/src/messages.js.map new file mode 100644 index 00000000..e52de679 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/messages.js.map @@ -0,0 +1 @@ +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/messages.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,kBAAkB,CAAA;AAEzB,MAAM,OAAO,UAAU;IAAvB;QAEE,SAAI,GAAW,EAAE,CAAA;QAEjB,oBAAe,GAA8B,yBAAyB,CAAC,QAAQ,CAAA;QAI/E,cAAS,GAAW,EAAE,CAAA;IAiBxB,CAAC;CAAA;AAdC;IADC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;0CACJ;AAaf;IADC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;6CACD;AAGvB,MAAM,OAAO,QAAQ;IAArB;QAEE,YAAO,GAAW,CAAC,CAAA;QAEnB,UAAK,GAAW,CAAC,CAAA;IACnB,CAAC;CAAA;AAED,MAAM,OAAO,QAAQ;CAgEpB;AA7DC;IADC,IAAI,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC;4CACA;AAGvB;IADC,IAAI,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC;oDACQ;AAGvC;IADC,IAAI,CAAC,GAAG,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,EARW,oBAAoB,KAApB,oBAAoB,QAQ/B"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.d.ts b/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.d.ts new file mode 100644 index 00000000..da998944 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.d.ts @@ -0,0 +1,8 @@ +import { Envelope } from './messages.js'; +/** + * Parses JSON into an Envelope object. The difference from JSON.parse + * is that the resulting objects will have default values (defined in the JSON Schema) + * for properties that are absent from the JSON. + */ +export declare function parseEnvelope(json: string): Envelope; +//# sourceMappingURL=parseEnvelope.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.d.ts.map b/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.d.ts.map new file mode 100644 index 00000000..f73de815 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parseEnvelope.d.ts","sourceRoot":"","sources":["../../../src/parseEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAGpD"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.js b/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.js new file mode 100644 index 00000000..ac8d7bf4 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.js @@ -0,0 +1,12 @@ +import { Envelope } from './messages.js'; +import { plainToClass } from 'class-transformer'; +/** + * Parses JSON into an Envelope object. The difference from JSON.parse + * is that the resulting objects will have default values (defined in the JSON Schema) + * for properties that are absent from the JSON. + */ +export function parseEnvelope(json) { + const plain = JSON.parse(json); + return plainToClass(Envelope, plain); +} +//# sourceMappingURL=parseEnvelope.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.js.map b/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.js.map new file mode 100644 index 00000000..0466d0ee --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/parseEnvelope.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parseEnvelope.js","sourceRoot":"","sources":["../../../src/parseEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC9B,OAAO,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AACtC,CAAC"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/version.d.ts b/node_modules/@cucumber/messages/dist/esm/src/version.d.ts new file mode 100644 index 00000000..72cb814b --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/version.d.ts @@ -0,0 +1,2 @@ +export declare const version = "32.2.0"; +//# sourceMappingURL=version.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/version.d.ts.map b/node_modules/@cucumber/messages/dist/esm/src/version.d.ts.map new file mode 100644 index 00000000..042c9575 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/version.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,WAAW,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/version.js b/node_modules/@cucumber/messages/dist/esm/src/version.js new file mode 100644 index 00000000..67426831 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/version.js @@ -0,0 +1,3 @@ +// This file is automatically generated using npm scripts +export const version = '32.2.0'; +//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/src/version.js.map b/node_modules/@cucumber/messages/dist/esm/src/version.js.map new file mode 100644 index 00000000..12a37079 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/src/version.js.map @@ -0,0 +1 @@ +{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/version.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.d.ts b/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.d.ts new file mode 100644 index 00000000..d1488fba --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=IdGeneratorTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.d.ts.map b/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.d.ts.map new file mode 100644 index 00000000..93f290bf --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"IdGeneratorTest.d.ts","sourceRoot":"","sources":["../../../test/IdGeneratorTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.js b/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.js new file mode 100644 index 00000000..a80a5bdd --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.js @@ -0,0 +1,16 @@ +import assert from "node:assert"; +import { IdGenerator } from "../src/index.js"; +describe('IdGenerator', () => { + it('generates uuids', () => { + const generator = IdGenerator.uuid(); + const result = generator(); + assert.equal(result.length, 36); + }); + it('increments ids', () => { + const generator = IdGenerator.incrementing(); + assert.equal(generator(), '0'); + assert.equal(generator(), '1'); + assert.equal(generator(), '2'); + }); +}); +//# sourceMappingURL=IdGeneratorTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.js.map b/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.js.map new file mode 100644 index 00000000..889efaa2 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/IdGeneratorTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IdGeneratorTest.js","sourceRoot":"","sources":["../../../test/IdGeneratorTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAA;AAE3C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;QACzB,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,EAAE,CAAA;QACpC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;QACxB,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,EAAE,CAAA;QAC5C,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,CAAA;QAC9B,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,CAAA;QAC9B,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.d.ts b/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.d.ts new file mode 100644 index 00000000..0ecf182b --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=TimeConversionTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.d.ts.map b/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.d.ts.map new file mode 100644 index 00000000..af1bc3b9 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeConversionTest.d.ts","sourceRoot":"","sources":["../../../test/TimeConversionTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.js b/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.js new file mode 100644 index 00000000..b5f9d11a --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.js @@ -0,0 +1,62 @@ +import assert from 'assert'; +import { TimeConversion } from '../src/index.js'; +import { addDurations } from '../src/TimeConversion.js'; +const { durationToMilliseconds, millisecondsSinceEpochToTimestamp, millisecondsToDuration, timestampToMillisecondsSinceEpoch, } = TimeConversion; +describe('TimeConversion', () => { + it('converts legacy string seconds', () => { + const duration = { + // @ts-ignore + seconds: '3', + nanos: 40000, + }; + const millis = durationToMilliseconds(duration); + assert.strictEqual(millis, 3000.04); + }); + it('converts to and from milliseconds since epoch', () => { + const millisecondsSinceEpoch = Date.now(); + const timestamp = millisecondsSinceEpochToTimestamp(millisecondsSinceEpoch); + const jsEpochMillisAgain = timestampToMillisecondsSinceEpoch(timestamp); + assert.strictEqual(jsEpochMillisAgain, millisecondsSinceEpoch); + }); + it('converts to and from milliseconds duration', () => { + const durationInMilliseconds = 1234; + const duration = millisecondsToDuration(durationInMilliseconds); + const durationMillisAgain = durationToMilliseconds(duration); + assert.strictEqual(durationMillisAgain, durationInMilliseconds); + }); + it('converts to and from milliseconds duration (with decimal places)', () => { + const durationInMilliseconds = 3.000161; + const duration = millisecondsToDuration(durationInMilliseconds); + const durationMillisAgain = durationToMilliseconds(duration); + assert.strictEqual(durationMillisAgain, durationInMilliseconds); + }); + it('adds durations (nanos only)', () => { + const durationA = millisecondsToDuration(100); + const durationB = millisecondsToDuration(200); + const sumDuration = addDurations(durationA, durationB); + assert.deepStrictEqual(sumDuration, { seconds: 0, nanos: 3e8 }); + }); + it('adds durations (seconds only)', () => { + const durationA = millisecondsToDuration(1000); + const durationB = millisecondsToDuration(2000); + const sumDuration = addDurations(durationA, durationB); + assert.deepStrictEqual(sumDuration, { seconds: 3, nanos: 0 }); + }); + it('adds durations (seconds and nanos)', () => { + const durationA = millisecondsToDuration(1500); + const durationB = millisecondsToDuration(1600); + const sumDuration = addDurations(durationA, durationB); + assert.deepStrictEqual(sumDuration, { seconds: 3, nanos: 1e8 }); + }); + it('adds durations (seconds and nanos) with legacy string seconds', () => { + const durationA = millisecondsToDuration(1500); + // @ts-ignore + durationA.seconds = String(durationA.seconds); + const durationB = millisecondsToDuration(1600); + // @ts-ignore + durationB.seconds = String(durationB.seconds); + const sumDuration = addDurations(durationA, durationB); + assert.deepStrictEqual(sumDuration, { seconds: 3, nanos: 1e8 }); + }); +}); +//# sourceMappingURL=TimeConversionTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.js.map b/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.js.map new file mode 100644 index 00000000..fcc674ce --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/TimeConversionTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeConversionTest.js","sourceRoot":"","sources":["../../../test/TimeConversionTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAY,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEvD,MAAM,EACJ,sBAAsB,E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AI,CAAC,CAAA;QAC9C,aAAa;QACb,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QAC7C,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAA;QAC9C,aAAa;QACb,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;QAC7C,MAAM,WAAW,GAAG,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAEtD,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.d.ts b/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.d.ts new file mode 100644 index 00000000..6fe555da --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=getWorstTestStepResultsTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.d.ts.map b/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.d.ts.map new file mode 100644 index 00000000..09c5969d --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getWorstTestStepResultsTest.d.ts","sourceRoot":"","sources":["../../../test/getWorstTestStepResultsTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.js b/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.js new file mode 100644 index 00000000..70cb25f3 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.js @@ -0,0 +1,23 @@ +import { getWorstTestStepResult } from '../src/getWorstTestStepResult.js'; +import { TestStepResultStatus } from '../src/messages.js'; +import assert from 'assert'; +describe('getWorstTestStepResult', () => { + it('returns a FAILED result for PASSED,FAILED,PASSED', () => { + const result = getWorstTestStepResult([ + { + status: TestStepResultStatus.PASSED, + duration: { seconds: 0, nanos: 0 }, + }, + { + status: TestStepResultStatus.FAILED, + duration: { seconds: 0, nanos: 0 }, + }, + { + status: TestStepResultStatus.PASSED, + duration: { seconds: 0, nanos: 0 }, + }, + ]); + assert.strictEqual(result.status, TestStepResultStatus.FAILED); + }); +}); +//# sourceMappingURL=getWorstTestStepResultsTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.js.map b/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.js.map new file mode 100644 index 00000000..9c4984ea --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/getWorstTestStepResultsTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getWorstTestStepResultsTest.js","sourceRoot":"","sources":["../../../test/getWorstTestStepResultsTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,MAAM,GAAG,sBAAsB,CAAC;YACpC;gBACE,MAAM,EAAE,oBAAoB,CAAC,MAAM;gBACnC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;aACnC;YACD;gBACE,MAAM,EAAE,oBAAoB,CAAC,MAAM;gBACnC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;aACnC;YACD;gBACE,MAAM,EAAE,oBAAoB,CAAC,MAAM;gBACnC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;aACnC;SACF,CAAC,CAAA;QACF,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/messagesTest.d.ts b/node_modules/@cucumber/messages/dist/esm/test/messagesTest.d.ts new file mode 100644 index 00000000..7b7022b4 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/messagesTest.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=messagesTest.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/messagesTest.d.ts.map b/node_modules/@cucumber/messages/dist/esm/test/messagesTest.d.ts.map new file mode 100644 index 00000000..601766c6 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/messagesTest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"messagesTest.d.ts","sourceRoot":"","sources":["../../../test/messagesTest.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/messagesTest.js b/node_modules/@cucumber/messages/dist/esm/test/messagesTest.js new file mode 100644 index 00000000..338286f0 --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/messagesTest.js @@ -0,0 +1,82 @@ +import assert from 'assert'; +import { parseEnvelope, StepKeywordType } from '../src/index.js'; +describe('messages', () => { + it('defaults missing fields when deserialising from JSON', () => { + // Sample envelope from before we moved from protobuf to JSON Schema + const partialGherkinDocumentEnvelope = { + gherkinDocument: { + feature: { + children: [ + { + scenario: { + id: '1', + keyword: 'Scenario', + location: { column: 3, line: 3 }, + name: 'minimalistic', + steps: [ + { + id: '0', + keyword: 'Given ', + keywordType: StepKeywordType.CONTEXT, + location: { column: 5, line: 4 }, + text: 'the minimalism', + }, + ], + }, + }, + ], + keyword: 'Feature', + language: 'en', + location: { column: 1, line: 1 }, + name: 'Minimal', + }, + uri: 'testdata/good/minimal.feature', + }, + }; + const envelope = parseEnvelope(JSON.stringify(partialGherkinDocumentEnvelope)); + const expectedEnvelope = { + gherkinDocument: { + // new + comments: [], + feature: { + // new + tags: [], + // new + description: '', + children: [ + { + scenario: { + // new + examples: [], + // new + description: '', + // new + tags: [], + id: '1', + keyword: 'Scenario', + location: { column: 3, line: 3 }, + name: 'minimalistic', + steps: [ + { + id: '0', + keyword: 'Given ', + keywordType: StepKeywordType.CONTEXT, + location: { column: 5, line: 4 }, + text: 'the minimalism', + }, + ], + }, + }, + ], + keyword: 'Feature', + language: 'en', + location: { column: 1, line: 1 }, + name: 'Minimal', + }, + uri: 'testdata/good/minimal.feature', + }, + }; + assert.deepStrictEqual(JSON.parse(JSON.stringify(envelope)), JSON.parse(JSON.stringify(expectedEnvelope))); + }); +}); +//# sourceMappingURL=messagesTest.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/test/messagesTest.js.map b/node_modules/@cucumber/messages/dist/esm/test/messagesTest.js.map new file mode 100644 index 00000000..cf46fcff --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/test/messagesTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"messagesTest.js","sourceRoot":"","sources":["../../../test/messagesTest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAY,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAE1E,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,oEAAoE;QACpE,MAAM,8BAA8B,GAAG;YACrC,eAAe,EAAE;gBACf,OAAO,EAAE;oBACP,QAAQ,EAAE;w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ACP,OAAO,EAAE,QAAQ;wCACjB,WAAW,EAAE,eAAe,CAAC,OAAO;wCACpC,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;wCAChC,IAAI,EAAE,gBAAgB;qCACvB;iCACF;6BACF;yBACF;qBACF;oBACD,OAAO,EAAE,SAAS;oBAClB,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;oBAChC,IAAI,EAAE,SAAS;iBAChB;gBACD,GAAG,EAAE,+BAA+B;aACrC;SACF,CAAA;QAED,MAAM,CAAC,eAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAC7C,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/dist/esm/tsconfig.build-esm.tsbuildinfo b/node_modules/@cucumber/messages/dist/esm/tsconfig.build-esm.tsbuildinfo new file mode 100644 index 00000000..aa72bdfd --- /dev/null +++ b/node_modules/@cucumber/messages/dist/esm/tsconfig.build-esm.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/IdGenerator.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/expose-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/exclude-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/transform-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/type-discriminator-descriptor.interface.d.ts","../../node_modules/class-transformer/types/interfaces/decorator-options/type-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/exclude-metadata.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/expose-metadata.interface.d.ts","../../node_modules/class-transformer/types/enums/transformation-type.enum.d.ts","../../node_modules/class-transformer/types/enums/index.d.ts","../../node_modules/class-transformer/types/interfaces/target-map.interface.d.ts","../../node_modules/class-transformer/types/interfaces/class-transformer-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/transform-fn-params.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/transform-metadata.interface.d.ts","../../node_modules/class-transformer/types/interfaces/metadata/type-metadata.interface.d.ts","../../node_modules/class-transformer/types/interfaces/class-constructor.type.d.ts","../../node_modules/class-transformer/types/interfaces/type-help-options.interface.d.ts","../../node_modules/class-transformer/types/interfaces/index.d.ts","../../node_modules/class-transformer/types/ClassTransformer.d.ts","../../node_modules/class-transformer/types/decorators/exclude.decorator.d.ts","../../node_modules/class-transformer/types/decorators/expose.decorator.d.ts","../../node_modules/class-transformer/types/decorators/transform-instance-to-instance.decorator.d.ts","../../node_modules/class-transformer/types/decorators/transform-instance-to-plain.decorator.d.ts","../../node_modules/class-transformer/types/decorators/transform-plain-to-instance.decorator.d.ts","../../node_modules/class-transformer/types/decorators/transform.decorator.d.ts","../../node_modules/class-transformer/types/decorators/type.decorator.d.ts","../../node_modules/class-transformer/types/decorators/index.d.ts","../../node_modules/class-transformer/types/index.d.ts","../../node_modules/reflect-metadata/index.d.ts","../../src/messages.ts","../../src/TimeConversion.ts","../../src/getWorstTestStepResult.ts","../../src/parseEnvelope.ts","../../src/version.ts","../../src/index.ts","../../test/IdGeneratorTest.ts","../../test/TimeConversionTest.ts","../../test/getWorstTestStepResultsTest.ts","../../test/messagesTest.ts","../../node_modules/@types/mocha/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/@types/node/web-globals/events.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/inspector.generated.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/sqlite.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[91,139,156,157],[91,136,137,139,156,157],[91,138,139,156,157],[139,156,157],[91,139,144,156,157,174],[91,139,140,145,150,156,157,159,171,182],[91,139,140,141,150,156,157,159],[86,87,88,91,139,156,157],[91,139,142,156,157,183],[91,139,143,144,151,156,157,160],[91,139,144,156,157,171,179],[91,139,145,147,150,156,157,159],[91,138,139,146,156,157],[91,139,147,148,156,157],[91,139,149,150,156,157],[91,138,139,150,156,157],[91,139,150,151,152,156,157,171,182],[91,139,150,151,152,156,157,166,171,174],[91,132,139,147,150,153,156,157,159,171,182],[91,139,150,151,153,154,156,157,159,171,179,182],[91,139,153,155,156,157,171,179,182],[89,90,91,92,93,94,95,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188],[91,139,150,156,157],[91,139,156,157,158,182],[91,139,147,150,156,157,159,171],[91,139,156,157,160],[91,139,156,157,161],[91,138,139,156,157,162],[91,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188],[91,139,156,157,164],[91,139,156,157,165],[91,139,150,156,157,166,167],[91,139,156,157,166,168,183,185],[91,139,151,156,157],[91,139,150,156,157,171,172,174],[91,139,156,157,173,174],[91,139,156,157,171,172],[91,139,156,157,174],[91,139,156,157,175],[91,136,139,156,157,171,176,182],[91,139,150,156,157,177,178],[91,139,156,157,177,178],[91,139,144,156,157,159,171,179],[91,139,156,157,180],[91,139,156,157,159,181],[91,139,153,156,157,165,182],[91,139,144,156,157,183],[91,139,156,157,171,184],[91,139,156,157,158,185],[91,139,156,157,186],[91,132,139,156,157],[91,132,139,150,152,156,157,162,171,174,182,184,185,187],[91,139,156,157,171,188],[63,91,139,156,157],[65,66,67,68,69,70,71,91,139,156,157],[54,91,139,156,157],[55,63,64,72,91,139,156,157],[56,91,139,156,157],[50,91,139,156,157],[47,48,49,50,51,52,53,56,57,58,59,60,61,62,91,139,156,157],[55,57,91,139,156,157],[58,63,91,139,156,157],[91,104,108,139,156,157,182],[91,104,139,156,157,171,182],[91,99,139,156,157],[91,101,104,139,156,157,179,182],[91,139,156,157,159,179],[91,139,156,157,189],[91,99,139,156,157,189],[91,101,104,139,156,157,159,182],[91,96,97,100,103,139,150,156,157,171,182],[91,104,111,139,156,157],[91,96,102,139,156,157],[91,104,125,126,139,156,157],[91,100,104,139,156,157,174,182,189],[91,125,139,156,157,189],[91,98,99,139,156,157,189],[91,104,139,156,157],[91,98,99,100,101,102,103,104,105,106,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,126,127,128,129,130,131,139,156,157],[91,104,119,139,156,157],[91,104,111,112,139,156,157],[91,102,104,112,113,139,156,157],[91,103,139,156,157],[91,96,99,104,139,156,157],[91,104,108,112,113,139,156,157],[91,108,139,156,157],[91,102,104,107,139,156,157,182],[91,96,101,104,111,139,156,157],[91,139,156,157,171],[91,99,104,125,139,156,157,187,189],[75,91,139,156,157],[75,76,91,139,156,157],[46,75,76,77,78,79,91,139,156,157],[73,74,91,139,156,157],[73,75,91,139,156,157],[80,91,136,139,156,157],[76,80,91,136,139,156,157],[75,77,91,136,139,156,157]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c97c731e5cc47991e603bf2fb9f1793105494bcc0847092998bd88b6b1934da","signature":"44716259b743dacde932f7f1922ac85f533af74e3ed82a078ba505414f6f6b53"},{"version":"b6e995b5ef6661f5636ff738e67e4ec90150768ef119ad74b473c404304408a1","impliedFormat":1},{"version":"5d470930bf6142d7cbda81c157869024527dc7911ba55d90b8387ef6e1585aa1","impliedFormat":1},{"version":"074483fdbf20b30bd450e54e6892e96ea093430c313e61be5fdfe51588baa2d6","impliedFormat":1},{"version":"b7e6a6a3495301360edb9e1474702db73d18be7803b3f5c6c05571212acccd16","impliedFormat":1},{"version":"aa7527285c94043f21baf6e337bc60a92c20b6efaa90859473f6476954ac5f79","impliedFormat":1},{"version":"dd3be6d9dcd79e46d192175a756546630f2dc89dab28073823c936557b977f26","impliedFormat":1},{"version":"8d0566152618a1da6536c75a5659c139522d67c63a9ae27e8228d76ab0420584","impliedFormat":1},{"version":"ba06bf784edafe0db0e2bd1f6ecf3465b81f6b1819871bf190a0e0137b5b7f18","impliedFormat":1},{"version":"a0500233cb989bcb78f5f1a81f51eabc06b5c39e3042c560a7489f022f1f55a3","impliedFormat":1},{"version":"220508b3fb6b773f49d8fb0765b04f90ef15caacf0f3d260e3412ed38f71ef09","impliedFormat":1},{"version":"1ad113089ad5c188fec4c9a339cb53d1bcbb65682407d6937557bb23a6e1d4e5","impliedFormat":1},{"version":"e56427c055602078cbf0e58e815960541136388f4fc62554813575508def98b6","impliedFormat":1},{"version":"1f58b0676a80db38df1ce19d15360c20ce9e983b35298a5d0b4aa4eb4fb67e0f","impliedFormat":1},{"version":"3d67e7eb73c6955ee27f1d845cae88923f75c8b0830d4b5440eea2339958e8ec","impliedFormat":1},{"version":"11fec302d58b56033ab07290a3abc29e9908e29d504db9468544b15c4cd7670d","impliedFormat":1},{"version":"c66d6817c931633650edf19a8644eea61aeeb84190c7219911cefa8ddea8bd9a","impliedFormat":1},{"version":"ab1359707e4fc610c5f37f1488063af65cda3badca6b692d44b95e8380e0f6c2","impliedFormat":1},{"version":"37deda160549729287645b3769cf126b0a17e7e2218737352676705a01d5957e","impliedFormat":1},{"version":"d80ffdd55e7f4bc69cde66933582b8592d3736d3b0d1d8cc63995a7b2bcca579","impliedFormat":1},{"version":"c9b71952b2178e8737b63079dba30e1b29872240b122905cbaba756cb60b32f5","impliedFormat":1},{"version":"b596585338b0d870f0e19e6b6bcbf024f76328f2c4f4e59745714e38ee9b0582","impliedFormat":1},{"version":"e6717fc103dfa1635947bf2b41161b5e4f2fabbcaf555754cc1b4340ec4ca587","impliedFormat":1},{"version":"c36186d7bdf1f525b7685ee5bf639e4b157b1e803a70c25f234d4762496f771f","impliedFormat":1},{"version":"026726932a4964341ab8544f12b912c8dfaa388d2936b71cc3eca0cffb49cc1d","impliedFormat":1},{"version":"83188d037c81bd27076218934ba9e1742ddb69cd8cc64cdb8a554078de38eb12","impliedFormat":1},{"version":"7d82f2d6a89f07c46c7e3e9071ab890124f95931d9c999ba8f865fa6ef6cbf72","impliedFormat":1},{"version":"4fc523037d14d9bb6ddb586621a93dd05b6c6d8d59919a40c436ca3ac29d9716","impliedFormat":1},{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true,"impliedFormat":1},{"version":"c270488bdcc10c20550452f9bf6fcc1bd01eab0dfc7f0c6747abc19a2acd5f0e","signature":"a1387533f292cc1377923ba182557241ca949a2ca8495866dec169038c9e45a2"},{"version":"fd9ae11ee76d8d1993309456c4536d7024cecec15fc77dc1b4d7619556abc324","signature":"d9f4ec5156491a24eee340452d7e87e432512d5ebde23fe18c2ceb5a31c1720b"},{"version":"0e865bcd7cf3c305aeee04f6c76dd77de0f7e4b3173cf960bd4018b213525547","signature":"497efde09001124a1bfab8ea16409b6908fe8a49ae8d5d69082910838150fbfd"},{"version":"4866672a66505bfc3f8bd7f5f9cdbcd3927080b43095f73b6bfdf6a045d04fdf","signature":"653dc417862cf079d590653212a8d48ace7c89ff7b73c239791099afc25dca96"},{"version":"4112cfafe102f4a4cc44adb81a17cd895a854102130231735409a706570d22f6","signature":"881d8c5d323b9a03009e467e1fb7bc2a32da16a567ca29c9d484518cb02ce3f7"},{"version":"e6af11bf85a123ea9f9aee37c1e94008650a2609ac323f70eea1845a79d39a28","signature":"5ed925f9d0dfcb0fde32518c7ae42f88461fd8eabb015a35183fac5ce95bbc6c"},{"version":"9e4cf44d1d002801603e3a3883a5b338db29123a32143dfd8c703094998c8e4e","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"d32ac673e19a27547e53e00df484de018a9146acee28847619abd913088b4fc8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"2717ea2c81ce0dc3855fe0647da5b0486b6ba0e3e7d9863b7e0491fcfa803d24","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"27acb37346bf964bc845b5cc6a9f3fc09d9002271c7dd144469ff00d2cfe923f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"58647d85d0f722a1ce9de50955df60a7489f0593bf1a7015521efe901c06d770","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"a6f137d651076822d4fe884287e68fd61785a0d3d1fdb250a5059b691fa897db","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"bceb58df66ab8fb00170df20cd813978c5ab84be1d285710c4eb005d8e9d8efb","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"80523c00b8544a2000ae0143e4a90a00b47f99823eb7926c1e03c494216fc363","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"746911b62b329587939560deb5c036aca48aece03147b021fa680223255d5183","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c8d3e5a18ba35629954e48c4cc8f11dc88224650067a172685c736b27a34a4dc","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"2b55d426ff2b9087485e52ac4bc7cfafe1dc420fc76dad926cd46526567c501a","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"358765d5ea8afd285d4fd1532e78b88273f18cb3f87403a9b16fef61ac9fdcfe","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1}],"root":[46,[75,84]],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":5,"noImplicitAny":true,"outDir":"./","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":2},"referencedMap":[[85,1],[136,2],[137,2],[138,3],[91,4],[139,5],[140,6],[141,7],[86,1],[89,8],[87,1],[88,1],[142,9],[143,10],[144,11],[145,12],[146,13],[147,14],[148,14],[149,15],[150,16],[151,17],[152,18],[92,1],[90,1],[153,19],[154,20],[155,21],[189,22],[156,23],[157,1],[158,24],[159,25],[160,26],[161,27],[162,28],[163,29],[164,30],[165,31],[166,32],[167,32],[168,33],[169,1],[170,34],[171,35],[173,36],[172,37],[174,38],[175,39],[176,40],[177,41],[178,42],[179,43],[180,44],[181,45],[182,46],[183,47],[184,48],[185,49],[186,50],[93,1],[94,1],[95,1],[133,51],[134,1],[135,1],[187,52],[188,53],[64,54],[65,54],[66,54],[72,55],[67,54],[68,54],[69,54],[70,54],[71,54],[55,56],[54,1],[73,57],[61,1],[57,58],[48,1],[47,1],[49,1],[50,54],[51,59],[63,60],[52,54],[53,54],[58,61],[59,62],[60,54],[56,1],[62,1],[74,1],[44,1],[45,1],[9,1],[8,1],[2,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[3,1],[18,1],[19,1],[4,1],[20,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[35,1],[32,1],[33,1],[34,1],[36,1],[7,1],[37,1],[42,1],[43,1],[38,1],[39,1],[40,1],[41,1],[1,1],[111,63],[121,64],[110,63],[131,65],[102,66],[101,67],[130,68],[124,69],[129,70],[104,71],[118,72],[103,73],[127,74],[99,75],[98,68],[128,76],[100,77],[105,78],[106,1],[109,78],[96,1],[132,79],[122,80],[113,81],[114,82],[116,83],[112,84],[115,85],[125,68],[107,86],[108,87],[117,88],[97,89],[120,80],[119,78],[123,1],[126,90],[46,1],[76,91],[77,92],[80,93],[75,94],[78,95],[79,1],[81,96],[82,97],[83,98],[84,96]],"latestChangedDtsFile":"./test/messagesTest.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/messages.schema.json b/node_modules/@cucumber/messages/messages.schema.json new file mode 100644 index 00000000..7a7ae7ea --- /dev/null +++ b/node_modules/@cucumber/messages/messages.schema.json @@ -0,0 +1,1709 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Envelope.schema.json", + "additionalProperties": false, + "properties": { + "attachment": { + "$ref": "./Attachment.schema.json" + }, + "externalAttachment": { + "$ref": "./ExternalAttachment.schema.json" + }, + "gherkinDocument": { + "$ref": "./GherkinDocument.schema.json" + }, + "hook": { + "$ref": "./Hook.schema.json" + }, + "meta": { + "$ref": "./Meta.schema.json" + }, + "parameterType": { + "$ref": "./ParameterType.schema.json" + }, + "parseError": { + "$ref": "./ParseError.schema.json" + }, + "pickle": { + "$ref": "./Pickle.schema.json" + }, + "suggestion": { + "$ref": "./Suggestion.schema.json" + }, + "source": { + "$ref": "./Source.schema.json" + }, + "stepDefinition": { + "$ref": "./StepDefinition.schema.json" + }, + "testCase": { + "$ref": "./TestCase.schema.json" + }, + "testCaseFinished": { + "$ref": "./TestCaseFinished.schema.json" + }, + "testCaseStarted": { + "$ref": "./TestCaseStarted.schema.json" + }, + "testRunFinished": { + "$ref": "./TestRunFinished.schema.json" + }, + "testRunStarted": { + "$ref": "./TestRunStarted.schema.json" + }, + "testStepFinished": { + "$ref": "./TestStepFinished.schema.json" + }, + "testStepStarted": { + "$ref": "./TestStepStarted.schema.json" + }, + "testRunHookStarted": { + "$ref": "TestRunHookStarted.schema.json" + }, + "testRunHookFinished": { + "$ref": "TestRunHookFinished.schema.json" + }, + "undefinedParameterType": { + "$ref": "./UndefinedParameterType.schema.json" + } + }, + "type": "object", + "$defs": { + "https://cucumber.io/schema/Attachment.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Attachment.schema.json", + "additionalProperties": false, + "description": "Attachments (parse errors, execution errors, screenshots, links...)\n\nAn attachment represents any kind of data associated with a line in a\n[Source](#io.cucumber.messages.Source) file. It can be used for:\n\n* Syntax errors during parse time\n* Screenshots captured and attached during execution\n* Logs captured and attached during execution\n\nIt is not to be used for runtime errors raised/thrown during execution. This\nis captured in `TestResult`.", + "required": [ + "body", + "contentEncoding", + "mediaType" + ], + "properties": { + "body": { + "description": "The body of the attachment. If `contentEncoding` is `IDENTITY`, the attachment\nis simply the string. If it's `BASE64`, the string should be Base64 decoded to\nobtain the attachment.", + "type": "string" + }, + "contentEncoding": { + "description": "Whether to interpret `body` \"as-is\" (IDENTITY) or if it needs to be Base64-decoded (BASE64).\n\nContent encoding is *not* determined by the media type, but rather by the type\nof the object being attached:\n\n- string: IDENTITY\n- byte array: BASE64\n- stream: BASE64", + "enum": [ + "IDENTITY", + "BASE64" + ], + "type": "string" + }, + "fileName": { + "description": "Suggested file name of the attachment. (Provided by the user as an argument to `attach`)", + "type": "string" + }, + "mediaType": { + "description": "The media type of the data. This can be any valid\n[IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)\nas well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`\nand `text/x.cucumber.stacktrace+plain`", + "type": "string" + }, + "source": { + "$ref": "./Source.schema.json", + "deprecated": true + }, + "testCaseStartedId": { + "description": "The identifier of the test case attempt if the attachment was created during the execution of a test step", + "type": "string" + }, + "testStepId": { + "description": "The identifier of the test step if the attachment was created during the execution of a test step", + "type": "string" + }, + "url": { + "description": "A URL where the attachment can be retrieved. This field should not be set by Cucumber.\nIt should be set by a program that reads a message stream and does the following for\neach Attachment message:\n\n- Writes the body (after base64 decoding if necessary) to a new file.\n- Sets `body` and `contentEncoding` to `null`\n- Writes out the new attachment message\n\nThis will result in a smaller message stream, which can improve performance and\nreduce bandwidth of message consumers. It also makes it easier to process and download attachments\nseparately from reports.\n\nDeprecated; use ExternalAttachment instead.", + "type": "string", + "deprecated": true + }, + "testRunStartedId": { + "description": "Not used; implementers should instead populate `testRunHookStartedId` if an attachment was created during the execution of a test run hook", + "type": "string", + "deprecated": true + }, + "testRunHookStartedId": { + "description": "The identifier of the test run hook execution if the attachment was created during the execution of a test run hook", + "type": "string" + }, + "timestamp": { + "description": "When the attachment was created", + "$ref": "./Timestamp.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/Source.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Source.schema.json", + "additionalProperties": false, + "description": "A source file, typically a Gherkin document or Java/Ruby/JavaScript source code", + "required": [ + "uri", + "data", + "mediaType" + ], + "properties": { + "uri": { + "description": "The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)\nof the source, typically a file path relative to the root directory", + "type": "string" + }, + "data": { + "description": "The contents of the file", + "type": "string" + }, + "mediaType": { + "description": "The media type of the file. Can be used to specify custom types, such as\ntext/x.cucumber.gherkin+plain", + "type": "string", + "enum": [ + "text/x.cucumber.gherkin+plain", + "text/x.cucumber.gherkin+markdown" + ] + } + }, + "type": "object" + }, + "https://cucumber.io/schema/Timestamp.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Timestamp.schema.json", + "additionalProperties": false, + "required": [ + "seconds", + "nanos" + ], + "properties": { + "seconds": { + "description": "Represents seconds of UTC time since Unix epoch\n1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n9999-12-31T23:59:59Z inclusive.", + "type": "integer" + }, + "nanos": { + "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive.", + "type": "integer", + "minimum": 0, + "maximum": 999999999 + } + }, + "type": "object" + }, + "https://cucumber.io/schema/ExternalAttachment.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/ExternalAttachment.schema.json", + "additionalProperties": false, + "description": "Represents an attachment that is stored externally rather than embedded in the message stream.\n\nThis message type is used for large attachments (e.g., video files) that are already\non the filesystem and should not be loaded into memory. Instead of embedding the content,\nonly a URL reference is stored.\n\nA formatter or other consumer of messages may replace an Attachment with an ExternalAttachment if it makes sense to do so.", + "required": [ + "url", + "mediaType" + ], + "properties": { + "url": { + "description": "A URL where the attachment can be retrieved. This could be a file:// URL for\nlocal filesystem paths, or an http(s):// URL for remote resources.", + "type": "string" + }, + "mediaType": { + "description": "The media type of the data. This can be any valid\n[IANA Media Type](https://www.iana.org/assignments/media-types/media-types.xhtml)\nas well as Cucumber-specific media types such as `text/x.cucumber.gherkin+plain`\nand `text/x.cucumber.stacktrace+plain`", + "type": "string" + }, + "testCaseStartedId": { + "description": "The identifier of the test case attempt if the attachment was created during the execution of a test step", + "type": "string" + }, + "testStepId": { + "description": "The identifier of the test step if the attachment was created during the execution of a test step", + "type": "string" + }, + "testRunHookStartedId": { + "description": "The identifier of the test run hook execution if the attachment was created during the execution of a test run hook", + "type": "string" + }, + "timestamp": { + "description": "When the attachment was created", + "$ref": "./Timestamp.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/GherkinDocument.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/GherkinDocument.schema.json", + "additionalProperties": false, + "definitions": { + "Background": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "required": [ + "location", + "keyword", + "name", + "description", + "steps", + "id" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the `Background` keyword" + }, + "keyword": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "steps": { + "items": { + "$ref": "#/definitions/Step", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "id": { + "type": "string" + } + }, + "type": "object" + }, + "Comment": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A comment in a Gherkin document", + "required": [ + "location", + "text" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the comment" + }, + "text": { + "description": "The text of the comment", + "type": "string" + } + }, + "type": "object" + }, + "DataTable": { + "additionalProperties": false, + "required": [ + "location", + "rows" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json" + }, + "rows": { + "items": { + "$ref": "#/definitions/TableRow" + }, + "type": "array" + } + }, + "type": "object" + }, + "DocString": { + "additionalProperties": false, + "required": [ + "location", + "content", + "delimiter" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json" + }, + "mediaType": { + "type": "string" + }, + "content": { + "type": "string" + }, + "delimiter": { + "type": "string" + } + }, + "type": "object" + }, + "Examples": { + "additionalProperties": false, + "required": [ + "location", + "tags", + "keyword", + "name", + "tableBody", + "description", + "id" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the `Examples` keyword" + }, + "tags": { + "items": { + "$ref": "#/definitions/Tag", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "keyword": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tableHeader": { + "$ref": "#/definitions/TableRow" + }, + "tableBody": { + "items": { + "$ref": "#/definitions/TableRow", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "id": { + "type": "string" + } + }, + "type": "object" + }, + "Feature": { + "additionalProperties": false, + "required": [ + "location", + "tags", + "language", + "keyword", + "name", + "description", + "children" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the `Feature` keyword" + }, + "tags": { + "description": "All the tags placed above the `Feature` keyword", + "items": { + "$ref": "#/definitions/Tag", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "language": { + "description": "The [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code of the Gherkin document", + "type": "string" + }, + "keyword": { + "description": "The text of the `Feature` keyword (in the language specified by `language`)", + "type": "string" + }, + "name": { + "description": "The name of the feature (the text following the `keyword`)", + "type": "string" + }, + "description": { + "description": "The line(s) underneath the line with the `keyword` that are used as description", + "type": "string" + }, + "children": { + "description": "Zero or more children", + "items": { + "$ref": "#/definitions/FeatureChild" + }, + "type": "array" + } + }, + "type": "object" + }, + "FeatureChild": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A child node of a `Feature` node", + "properties": { + "rule": { + "$ref": "#/definitions/Rule" + }, + "background": { + "$ref": "#/definitions/Background" + }, + "scenario": { + "$ref": "#/definitions/Scenario" + } + }, + "type": "object" + }, + "Rule": { + "additionalProperties": false, + "required": [ + "location", + "tags", + "keyword", + "name", + "description", + "children", + "id" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the `Rule` keyword" + }, + "tags": { + "description": "All the tags placed above the `Rule` keyword", + "items": { + "$ref": "#/definitions/Tag", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "keyword": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "children": { + "items": { + "$ref": "#/definitions/RuleChild" + }, + "type": "array" + }, + "id": { + "type": "string" + } + }, + "type": "object" + }, + "RuleChild": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A child node of a `Rule` node", + "properties": { + "background": { + "$ref": "#/definitions/Background" + }, + "scenario": { + "$ref": "#/definitions/Scenario" + } + }, + "type": "object" + }, + "Scenario": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "required": [ + "location", + "tags", + "keyword", + "name", + "description", + "steps", + "examples", + "id" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the `Scenario` keyword" + }, + "tags": { + "items": { + "$ref": "#/definitions/Tag", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "keyword": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "steps": { + "items": { + "$ref": "#/definitions/Step", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "examples": { + "items": { + "$ref": "#/definitions/Examples", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "id": { + "type": "string" + } + }, + "type": "object" + }, + "Step": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A step", + "required": [ + "location", + "keyword", + "text", + "id" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the steps' `keyword`" + }, + "keyword": { + "description": "The actual keyword as it appeared in the source.", + "type": "string" + }, + "keywordType": { + "description": "The test phase signalled by the keyword: Context definition (Given), Action performance (When), Outcome assertion (Then). Other keywords signal Continuation (And and But) from a prior keyword. Please note that all translations which a dialect maps to multiple keywords (`*` is in this category for all dialects), map to 'Unknown'.", + "type": "string", + "enum": [ + "Unknown", + "Context", + "Action", + "Outcome", + "Conjunction" + ] + }, + "text": { + "type": "string" + }, + "docString": { + "$ref": "#/definitions/DocString" + }, + "dataTable": { + "$ref": "#/definitions/DataTable" + }, + "id": { + "description": "Unique ID to be able to reference the Step from PickleStep", + "type": "string" + } + }, + "type": "object" + }, + "TableCell": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A cell in a `TableRow`", + "required": [ + "location", + "value" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the cell" + }, + "value": { + "description": "The value of the cell", + "type": "string" + } + }, + "type": "object" + }, + "TableRow": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A row in a table", + "required": [ + "location", + "cells", + "id" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "The location of the first cell in the row" + }, + "cells": { + "description": "Cells in the row", + "items": { + "$ref": "#/definitions/TableCell", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "id": { + "type": "string" + } + }, + "type": "object" + }, + "Tag": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A tag", + "required": [ + "location", + "name", + "id" + ], + "properties": { + "location": { + "$ref": "./Location.schema.json", + "description": "Location of the tag" + }, + "name": { + "description": "The name of the tag (including the leading `@`)", + "type": "string" + }, + "id": { + "description": "Unique ID to be able to reference the Tag from PickleTag", + "type": "string" + } + }, + "type": "object" + } + }, + "description": "The [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) of a Gherkin document.\nCucumber implementations should *not* depend on `GherkinDocument` or any of its\nchildren for execution - use [Pickle](#io.cucumber.messages.Pickle) instead.\n\nThe only consumers of `GherkinDocument` should only be formatters that produce\n\"rich\" output, resembling the original Gherkin document.", + "required": [ + "comments" + ], + "properties": { + "uri": { + "description": "The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)\nof the source, typically a file path relative to the root directory", + "type": "string" + }, + "feature": { + "$ref": "#/definitions/Feature" + }, + "comments": { + "description": "All the comments in the Gherkin document", + "items": { + "$ref": "#/definitions/Comment" + }, + "type": "array" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/Location.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Location.schema.json", + "additionalProperties": false, + "description": "Points to a line and a column in a text file", + "properties": { + "line": { + "type": "integer", + "minimum": 1, + "maximum": 2147483647 + }, + "column": { + "type": "integer", + "minimum": 1, + "maximum": 2147483647 + } + }, + "required": [ + "line" + ], + "type": "object" + }, + "https://cucumber.io/schema/Hook.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Hook.schema.json", + "additionalProperties": false, + "required": [ + "id", + "sourceReference" + ], + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "sourceReference": { + "$ref": "./SourceReference.schema.json" + }, + "tagExpression": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "BEFORE_TEST_RUN", + "AFTER_TEST_RUN", + "BEFORE_TEST_CASE", + "AFTER_TEST_CASE", + "BEFORE_TEST_STEP", + "AFTER_TEST_STEP" + ] + } + }, + "type": "object" + }, + "https://cucumber.io/schema/SourceReference.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/SourceReference.schema.json", + "additionalProperties": false, + "definitions": { + "JavaMethod": { + "additionalProperties": false, + "required": [ + "className", + "methodName", + "methodParameterTypes" + ], + "properties": { + "className": { + "type": "string" + }, + "methodName": { + "type": "string" + }, + "methodParameterTypes": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "JavaStackTraceElement": { + "additionalProperties": false, + "required": [ + "className", + "fileName", + "methodName" + ], + "properties": { + "className": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "methodName": { + "type": "string" + } + }, + "type": "object" + } + }, + "description": "Points to a [Source](#io.cucumber.messages.Source) identified by `uri` and a\n[Location](#io.cucumber.messages.Location) within that file.", + "properties": { + "uri": { + "type": "string" + }, + "javaMethod": { + "$ref": "#/definitions/JavaMethod" + }, + "javaStackTraceElement": { + "$ref": "#/definitions/JavaStackTraceElement" + }, + "location": { + "$ref": "./Location.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/Meta.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Meta.schema.json", + "additionalProperties": false, + "definitions": { + "Ci": { + "additionalProperties": false, + "description": "CI environment", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "Name of the CI product, e.g. \"Jenkins\", \"CircleCI\" etc.", + "type": "string" + }, + "url": { + "description": "Link to the build", + "type": "string" + }, + "buildNumber": { + "description": "The build number. Some CI servers use non-numeric build numbers, which is why this is a string", + "type": "string" + }, + "git": { + "$ref": "#/definitions/Git" + } + }, + "type": "object" + }, + "Git": { + "additionalProperties": false, + "description": "Information about Git, provided by the Build/CI server as environment\nvariables.", + "required": [ + "remote", + "revision" + ], + "properties": { + "remote": { + "type": "string" + }, + "revision": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + }, + "Product": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Used to describe various properties of Meta", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "The product name", + "type": "string" + }, + "version": { + "description": "The product version", + "type": "string" + } + }, + "type": "object" + } + }, + "description": "This message contains meta information about the environment. Consumers can use\nthis for various purposes.", + "required": [ + "protocolVersion", + "implementation", + "runtime", + "os", + "cpu" + ], + "properties": { + "protocolVersion": { + "description": "The [SEMVER](https://semver.org/) version number of the protocol", + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/Product", + "description": "SpecFlow, Cucumber-JVM, Cucumber.js, Cucumber-Ruby, Behat etc." + }, + "runtime": { + "$ref": "#/definitions/Product", + "description": "Java, Ruby, Node.js etc" + }, + "os": { + "$ref": "#/definitions/Product", + "description": "Windows, Linux, MacOS etc" + }, + "cpu": { + "$ref": "#/definitions/Product", + "description": "386, arm, amd64 etc" + }, + "ci": { + "$ref": "#/definitions/Ci" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/ParameterType.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/ParameterType.schema.json", + "additionalProperties": false, + "required": [ + "id", + "name", + "preferForRegularExpressionMatch", + "regularExpressions", + "useForSnippets" + ], + "properties": { + "name": { + "description": "The name is unique, so we don't need an id.", + "type": "string" + }, + "regularExpressions": { + "items": { + "type": "string" + }, + "type": "array", + "minItems": 1 + }, + "preferForRegularExpressionMatch": { + "type": "boolean" + }, + "useForSnippets": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "sourceReference": { + "$ref": "./SourceReference.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/ParseError.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/ParseError.schema.json", + "additionalProperties": false, + "required": [ + "source", + "message" + ], + "properties": { + "source": { + "$ref": "./SourceReference.schema.json" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/Pickle.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Pickle.schema.json", + "additionalProperties": false, + "definitions": { + "PickleDocString": { + "additionalProperties": false, + "required": [ + "content" + ], + "properties": { + "mediaType": { + "type": "string" + }, + "content": { + "type": "string" + } + }, + "type": "object" + }, + "PickleStep": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "An executable step", + "required": [ + "astNodeIds", + "id", + "text" + ], + "properties": { + "argument": { + "$ref": "#/definitions/PickleStepArgument" + }, + "astNodeIds": { + "description": "References the IDs of the source of the step. For Gherkin, this can be\nthe ID of a Step, and possibly also the ID of a TableRow", + "items": { + "type": "string" + }, + "type": "array", + "minItems": 1 + }, + "id": { + "description": "A unique ID for the PickleStep", + "type": "string" + }, + "type": { + "description": "The context in which the step was specified: context (Given), action (When) or outcome (Then).\n\nNote that the keywords `But` and `And` inherit their meaning from prior steps and the `*` 'keyword' doesn't have specific meaning (hence Unknown)", + "type": "string", + "enum": [ + "Unknown", + "Context", + "Action", + "Outcome" + ] + }, + "text": { + "type": "string" + } + }, + "type": "object" + }, + "PickleStepArgument": { + "additionalProperties": false, + "description": "An optional argument", + "properties": { + "docString": { + "$ref": "#/definitions/PickleDocString" + }, + "dataTable": { + "$ref": "#/definitions/PickleTable" + } + }, + "type": "object" + }, + "PickleTable": { + "additionalProperties": false, + "required": [ + "rows" + ], + "properties": { + "rows": { + "items": { + "$ref": "#/definitions/PickleTableRow" + }, + "type": "array" + } + }, + "type": "object" + }, + "PickleTableCell": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string" + } + }, + "type": "object" + }, + "PickleTableRow": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "required": [ + "cells" + ], + "properties": { + "cells": { + "items": { + "$ref": "#/definitions/PickleTableCell" + }, + "type": "array", + "minItems": 1 + } + }, + "type": "object" + }, + "PickleTag": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A tag", + "required": [ + "name", + "astNodeId" + ], + "properties": { + "name": { + "type": "string" + }, + "astNodeId": { + "description": "Points to the AST node this was created from", + "type": "string" + } + }, + "type": "object" + } + }, + "description": "A `Pickle` represents a template for a `TestCase`. It is typically derived\nfrom another format, such as [GherkinDocument](#io.cucumber.messages.GherkinDocument).\nIn the future a `Pickle` may be derived from other formats such as Markdown or\nExcel files.\n\nBy making `Pickle` the main data structure Cucumber uses for execution, the\nimplementation of Cucumber itself becomes simpler, as it doesn't have to deal\nwith the complex structure of a [GherkinDocument](#io.cucumber.messages.GherkinDocument).\n\nEach `PickleStep` of a `Pickle` is matched with a `StepDefinition` to create a `TestCase`", + "required": [ + "id", + "uri", + "name", + "language", + "steps", + "tags", + "astNodeIds" + ], + "properties": { + "id": { + "description": "A unique id for the pickle", + "type": "string" + }, + "uri": { + "description": "The uri of the source file", + "type": "string" + }, + "location": { + "description": "The location of this pickle in source file. A pickle constructed from `Examples` will point to the example row.", + "$ref": "./Location.schema.json" + }, + "name": { + "description": "The name of the pickle", + "type": "string" + }, + "language": { + "description": "The language of the pickle", + "type": "string" + }, + "steps": { + "description": "One or more steps", + "items": { + "$ref": "#/definitions/PickleStep" + }, + "type": "array" + }, + "tags": { + "description": "One or more tags. If this pickle is constructed from a Gherkin document,\nIt includes inherited tags from the `Feature` as well.", + "items": { + "$ref": "#/definitions/PickleTag" + }, + "type": "array" + }, + "astNodeIds": { + "description": "Points to the AST node locations of the pickle. The last one represents the unique\nid of the pickle. A pickle constructed from `Examples` will have the first\nid originating from the `Scenario` AST node, and the second from the `TableRow` AST node.", + "items": { + "type": "string" + }, + "type": "array", + "minItems": 1 + } + }, + "type": "object" + }, + "https://cucumber.io/schema/Suggestion.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Suggestion.schema.json", + "additionalProperties": false, + "definitions": { + "Snippet": { + "additionalProperties": false, + "required": [ + "language", + "code" + ], + "properties": { + "language": { + "description": "The programming language of the code.\n\nThis must be formatted as an all lowercase identifier such that syntax highlighters like [Prism](https://prismjs.com/#supported-languages) or [Highlight.js](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) can recognize it.\nFor example: `cpp`, `cs`, `go`, `java`, `javascript`, `php`, `python`, `ruby`, `scala`.", + "type": "string" + }, + "code": { + "description": "A snippet of code", + "type": "string" + } + }, + "type": "object" + } + }, + "description": "A suggested fragment of code to implement an undefined step", + "required": [ + "id", + "pickleStepId", + "snippets" + ], + "properties": { + "id": { + "description": "A unique id for this suggestion", + "type": "string" + }, + "pickleStepId": { + "description": "The ID of the `PickleStep` this `Suggestion` was created for.", + "type": "string" + }, + "snippets": { + "description": "A collection of code snippets that could implement the undefined step", + "minItems": 1, + "type": "array", + "items": { + "$ref": "#/definitions/Snippet" + } + } + }, + "type": "object" + }, + "https://cucumber.io/schema/StepDefinition.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/StepDefinition.schema.json", + "additionalProperties": false, + "definitions": { + "StepDefinitionPattern": { + "additionalProperties": false, + "required": [ + "source", + "type" + ], + "properties": { + "source": { + "type": "string" + }, + "type": { + "enum": [ + "CUCUMBER_EXPRESSION", + "REGULAR_EXPRESSION" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "id", + "pattern", + "sourceReference" + ], + "properties": { + "id": { + "type": "string" + }, + "pattern": { + "$ref": "#/definitions/StepDefinitionPattern" + }, + "sourceReference": { + "$ref": "./SourceReference.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestCase.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestCase.schema.json", + "additionalProperties": false, + "definitions": { + "Group": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "properties": { + "children": { + "description": "The nested capture groups of an argument.\nAbsent if the group has no nested capture groups.", + "items": { + "$ref": "#/definitions/Group", + "$schema": "https://json-schema.org/draft/2020-12/schema" + }, + "type": "array" + }, + "start": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647 + }, + "value": { + "type": "string" + } + }, + "type": "object" + }, + "StepMatchArgument": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Represents a single argument extracted from a step match and passed to a step definition.\nThis is used for the following purposes:\n- Construct an argument to pass to a step definition (possibly through a parameter type transform)\n- Highlight the matched parameter in rich formatters such as the HTML formatter\n\nThis message closely matches the `Argument` class in the `cucumber-expressions` library.", + "required": [ + "group" + ], + "properties": { + "group": { + "$ref": "#/definitions/Group", + "description": "Represents the outermost capture group of an argument. This message closely matches the\n`Group` class in the `cucumber-expressions` library." + }, + "parameterTypeName": { + "type": "string" + } + }, + "type": "object" + }, + "StepMatchArgumentsList": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "required": [ + "stepMatchArguments" + ], + "properties": { + "stepMatchArguments": { + "items": { + "$ref": "#/definitions/StepMatchArgument" + }, + "type": "array" + } + }, + "type": "object" + }, + "TestStep": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "A `TestStep` is derived from either a `PickleStep` combined with a `StepDefinition`, or from a `Hook`.\n\nWhen derived from a PickleStep:\n * For `UNDEFINED` steps `stepDefinitionIds` and `stepMatchArgumentsLists` will be empty.\n * For `AMBIGUOUS` steps, there will be multiple entries in `stepDefinitionIds` and `stepMatchArgumentsLists`. The first entry in the stepMatchArgumentsLists holds the list of arguments for the first matching step definition, the second entry for the second, etc", + "required": [ + "id" + ], + "properties": { + "hookId": { + "description": "Pointer to the `Hook` (if derived from a Hook)", + "type": "string" + }, + "id": { + "type": "string" + }, + "pickleStepId": { + "description": "Pointer to the `PickleStep` (if derived from a `PickleStep`)", + "type": "string" + }, + "stepDefinitionIds": { + "description": "Pointer to all the matching `StepDefinition`s (if derived from a `PickleStep`).\n\nEach element represents a matching step definition.", + "items": { + "type": "string" + }, + "type": "array" + }, + "stepMatchArgumentsLists": { + "description": "A list of list of StepMatchArgument (if derived from a `PickleStep`).\n\nEach element represents the arguments for a matching step definition.", + "items": { + "$ref": "#/definitions/StepMatchArgumentsList" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "description": "A `TestCase` contains a sequence of `TestStep`s.", + "required": [ + "id", + "pickleId", + "testSteps" + ], + "properties": { + "id": { + "type": "string" + }, + "pickleId": { + "description": "The ID of the `Pickle` this `TestCase` is derived from.", + "type": "string" + }, + "testSteps": { + "items": { + "$ref": "#/definitions/TestStep" + }, + "type": "array" + }, + "testRunStartedId": { + "description": "Identifier for the test run that this test case belongs to", + "type": "string" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestCaseFinished.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestCaseFinished.schema.json", + "additionalProperties": false, + "required": [ + "testCaseStartedId", + "timestamp", + "willBeRetried" + ], + "properties": { + "testCaseStartedId": { + "type": "string" + }, + "timestamp": { + "$ref": "./Timestamp.schema.json" + }, + "willBeRetried": { + "type": "boolean" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestCaseStarted.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestCaseStarted.schema.json", + "additionalProperties": false, + "required": [ + "attempt", + "id", + "testCaseId", + "timestamp" + ], + "properties": { + "attempt": { + "description": "The first attempt should have value 0, and for each retry the value\nshould increase by 1.", + "type": "integer", + "minimum": 0 + }, + "id": { + "description": "Because a `TestCase` can be run multiple times (in case of a retry),\nwe use this field to group messages relating to the same attempt.", + "type": "string" + }, + "testCaseId": { + "type": "string" + }, + "workerId": { + "description": "An identifier for the worker process running this test case, if test cases are being run in parallel. The identifier will be unique per worker, but no particular format is defined - it could be an index, uuid, machine name etc - and as such should be assumed that it's not human readable.", + "type": "string" + }, + "timestamp": { + "$ref": "./Timestamp.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestRunFinished.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestRunFinished.schema.json", + "additionalProperties": false, + "required": [ + "success", + "timestamp" + ], + "properties": { + "message": { + "description": "An informative message about the test run. Typically additional information about failure, but not necessarily.", + "type": "string" + }, + "success": { + "description": "A test run is successful if all steps are either passed or skipped, all before/after hooks passed and no other exceptions where thrown.", + "type": "boolean" + }, + "timestamp": { + "$ref": "./Timestamp.schema.json", + "description": "Timestamp when the TestRun is finished" + }, + "exception": { + "$ref": "./Exception.schema.json", + "description": "Any exception thrown during the test run, if any. Does not include exceptions thrown while executing steps." + }, + "testRunStartedId": { + "type": "string" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/Exception.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Exception.schema.json", + "additionalProperties": false, + "description": "A simplified representation of an exception", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "description": "The type of the exception that caused this result. E.g. \"Error\" or \"org.opentest4j.AssertionFailedError\"" + }, + "message": { + "type": "string", + "description": "The message of exception that caused this result. E.g. expected: \"a\" but was: \"b\"" + }, + "stackTrace": { + "type": "string", + "description": "The stringified stack trace of the exception that caused this result" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestRunStarted.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestRunStarted.schema.json", + "additionalProperties": false, + "required": [ + "timestamp" + ], + "properties": { + "timestamp": { + "$ref": "./Timestamp.schema.json" + }, + "id": { + "type": "string" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestStepFinished.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestStepFinished.schema.json", + "additionalProperties": false, + "required": [ + "testCaseStartedId", + "testStepId", + "testStepResult", + "timestamp" + ], + "properties": { + "testCaseStartedId": { + "type": "string" + }, + "testStepId": { + "type": "string" + }, + "testStepResult": { + "$ref": "./TestStepResult.schema.json" + }, + "timestamp": { + "$ref": "./Timestamp.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestStepResult.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestStepResult.schema.json", + "additionalProperties": false, + "required": [ + "duration", + "status" + ], + "properties": { + "duration": { + "$ref": "./Duration.schema.json" + }, + "message": { + "type": "string", + "description": "An arbitrary bit of information that explains this result. If there was an exception, this should include a stringified representation of it including type, message and stack trace (the exact format will vary by platform)." + }, + "status": { + "enum": [ + "UNKNOWN", + "PASSED", + "SKIPPED", + "PENDING", + "UNDEFINED", + "AMBIGUOUS", + "FAILED" + ], + "type": "string" + }, + "exception": { + "$ref": "./Exception.schema.json", + "description": "Exception thrown while executing this step, if any." + } + }, + "type": "object" + }, + "https://cucumber.io/schema/Duration.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/Duration.schema.json", + "additionalProperties": false, + "description": "The structure is pretty close of the Timestamp one. For clarity, a second type\nof message is used.", + "required": [ + "seconds", + "nanos" + ], + "properties": { + "seconds": { + "type": "integer" + }, + "nanos": { + "description": "Non-negative fractions of a second at nanosecond resolution. Negative\nsecond values with fractions must still have non-negative nanos values\nthat count forward in time. Must be from 0 to 999,999,999\ninclusive.", + "type": "integer", + "minimum": 0, + "maximum": 999999999 + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestStepStarted.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestStepStarted.schema.json", + "additionalProperties": false, + "required": [ + "testCaseStartedId", + "testStepId", + "timestamp" + ], + "properties": { + "testCaseStartedId": { + "type": "string" + }, + "testStepId": { + "type": "string" + }, + "timestamp": { + "$ref": "./Timestamp.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestRunHookStarted.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestRunHookStarted.schema.json", + "additionalProperties": false, + "required": [ + "id", + "testRunStartedId", + "hookId", + "timestamp" + ], + "properties": { + "id": { + "description": "Unique identifier for this hook execution", + "type": "string" + }, + "testRunStartedId": { + "description": "Identifier for the test run that this hook execution belongs to", + "type": "string" + }, + "hookId": { + "description": "Identifier for the hook that will be executed", + "type": "string" + }, + "workerId": { + "description": "An identifier for the worker process running this hook, if parallel workers are in use. The identifier will be unique per worker, but no particular format is defined - it could be an index, uuid, machine name etc - and as such should be assumed that it's not human readable.", + "type": "string" + }, + "timestamp": { + "$ref": "./Timestamp.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/TestRunHookFinished.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/TestRunHookFinished.schema.json", + "additionalProperties": false, + "required": [ + "testRunHookStartedId", + "result", + "timestamp" + ], + "properties": { + "testRunHookStartedId": { + "description": "Identifier for the hook execution that has finished", + "type": "string" + }, + "result": { + "$ref": "./TestStepResult.schema.json" + }, + "timestamp": { + "$ref": "./Timestamp.schema.json" + } + }, + "type": "object" + }, + "https://cucumber.io/schema/UndefinedParameterType.schema.json": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://cucumber.io/schema/UndefinedParameterType.schema.json", + "additionalProperties": false, + "required": [ + "expression", + "name" + ], + "properties": { + "expression": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + } + } +} \ No newline at end of file diff --git a/node_modules/@cucumber/messages/package.json b/node_modules/@cucumber/messages/package.json new file mode 100644 index 00000000..8f583558 --- /dev/null +++ b/node_modules/@cucumber/messages/package.json @@ -0,0 +1,60 @@ +{ + "name": "@cucumber/messages", + "version": "32.3.1", + "description": "JSON schema-based messages for Cucumber's inter-process communication", + "type": "module", + "main": "dist/cjs/src/index.js", + "types": "dist/cjs/src/index.d.ts", + "files": [ + "dist/cjs", + "dist/esm", + "messages.schema.json" + ], + "module": "dist/esm/src/index.js", + "exports": { + ".": { + "import": "./dist/esm/src/index.js", + "require": "./dist/cjs/src/index.js" + }, + "./schema": "./messages.schema.json" + }, + "repository": { + "type": "git", + "url": "git://github.com/cucumber/messages.git" + }, + "author": "Cucumber Limited ", + "license": "MIT", + "scripts": { + "build": "npm run build:cjs && npm run build:esm", + "build:cjs": "tsc --build tsconfig.build-cjs.json", + "build:esm": "tsc --build tsconfig.build-esm.json", + "postbuild:cjs": "cp package.cjs.json dist/cjs/package.json", + "copy-schemas": "shx cp ../jsonschema/messages.schema.json ./messages.schema.json", + "prepare": "make generate", + "test": "mocha && npm run test:cjs", + "test:cjs": "npm run build:cjs && mocha --no-config dist/cjs/test", + "version": "shx echo \"// This file is automatically generated using npm scripts\" > src/version.ts && echo \"export const version = '${npm_package_version}'\" >> src/version.ts", + "prepublishOnly": "npm run build && npm run copy-schemas" + }, + "dependencies": { + "class-transformer": "0.5.1", + "reflect-metadata": "0.2.2" + }, + "devDependencies": { + "@types/mocha": "10.0.10", + "@types/node": "22.19.17", + "copyfiles": "2.4.1", + "mocha": "11.7.5", + "shx": "^0.4.0", + "ts-node": "10.9.2", + "typescript": "5.9.3" + }, + "bugs": { + "url": "https://github.com/cucumber/messages/issues" + }, + "homepage": "https://github.com/cucumber/messages#readme", + "directories": { + "test": "test" + }, + "keywords": [] +} diff --git a/node_modules/@cucumber/pretty-formatter/LICENSE b/node_modules/@cucumber/pretty-formatter/LICENSE new file mode 100644 index 00000000..b4bf37ad --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Ilya Kozhevnikov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/pretty-formatter/README.md b/node_modules/@cucumber/pretty-formatter/README.md new file mode 100644 index 00000000..a81de9ad --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/README.md @@ -0,0 +1,130 @@ +# Official Cucumber.js Pretty Formatter + +[![build][build-badge]][build] +[![npm][version]][npm] +[![npm][downloads]][npm] + +[build]: https://github.com/jbpros/cucumber-pretty-formatter/actions?query=workflow%3Abuild +[build-badge]: https://github.com/jbpros/cucumber-pretty-formatter/workflows/build/badge.svg +[npm]: https://www.npmjs.com/package/@cucumber/pretty-formatter +[version]: https://img.shields.io/npm/v/@cucumber/pretty-formatter.svg +[downloads]: https://img.shields.io/npm/dm/@cucumber/pretty-formatter.svg + +The Cucumber.js pretty formatter logs your feature suite in its original Gherkin form. It offers custom style themes. + +## Install + +The pretty formatter requires: + +- Node.js 10, 12, 14 or 15. +- [Cucumber.js](https://www.npmjs.com/package/@cucumber/cucumber) 7.0 and above. + + npm install --save-dev @cucumber/pretty-formatter @cucumber/cucumber + +There are pretty formatters for [older versions of Cucumber](#older-cucumber-versions). + +## Usage + + cucumber-js -f @cucumber/pretty-formatter + +We recommend using [Cucumber profiles](https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md#profiles) to [specify formatters](https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md#formats). + +## Theme customisation + +You can define your own colors by passing a `theme` format option: + + --format-options '{"theme": }' + +Where `THEME_JSON` is in the following shape: + +```json +{"feature keyword": ["magenta", "bold"], "scenario keyword": ["red"]} +``` + +The customisable theme items are: + +* `datatable border` +* `datatable content` +* `datatable`: all data table elements (border and content) +* `docstring content`: multiline argument content +* `docstring delimiter`: multiline argument delimiter: `"""` +* `feature description` +* `feature keyword` +* `feature name` +* `location`: location comments added to the right of feature and scenario names +* `rule keyword` +* `rule name` +* `scenario keyword` +* `scenario name` +* `step keyword` +* `step message`: usually a failing step error message and stack trace +* `step status`: additional styles added to the built-in styles applied by Cucumber to non-passing steps status. Foreground colors have no effects on this item, background and modifiers do. +* `step text` +* `tag` + +You can combine all the styles you'd like from [modifiers, foreground colors and background colors exposed by ansi-styles](https://github.com/chalk/ansi-styles#styles). + +### Extending the Default Theme + +If you just want to tweak a few things about the default theme without redefining it entirely, you can grab the default theme in your `cucumber.js` config file and use it as the base for yours: + +```js +const { DEFAULT_THEME } = require('@cucumber/pretty-formatter') + +module.exports = { + default: { + formatOptions: { + theme: { + ...DEFAULT_THEME, + 'step text': 'magenta' + } + } + } +} +``` + +### Example Themes + +#### _Matrix_ + +It could be called *eco-friendly*, cuz it's very green: + + --format-options '{"theme":{"datatable border":["green"],"datatable content":["green","italic"],"docstring content":["green","italic"],"docstring delimiter":["green"],"feature description":["green"],"feature keyword":["bold","green"],"rule keyword":["yellow"],"scenario keyword":["greenBright"],"scenario name":["green","underline"],"step keyword":["bgGreen","black","italic"],"step text":["greenBright","italic"],"tag":["green"]}}' + +#### _Legacy pretty_ + +This was the theme offered by [Ilya Kozhevnikov](http://kozhevnikov.com/)'s pretty formatter, pre-Cucumber.js 7.x. + + + + + --format-options '{"theme":{"feature keyword":["magenta","bold"],"scenario keyword":["magenta","bold"],"step keyword":["bold"]}}' + +### We need more themes + +Please share your creations by forking, adding the theme to this section of the README and [opening a pull request](https://github.com/jbpros/cucumber-pretty-formatter/pulls). + +## Older Cucumber versions + +If you're using an older version of Cucumber.js, you'll need to use one of the previous pretty formatters: + +### Cucumber.js 1 → 2 + +The original pretty formatter used to ship with Cucumber. Simply specify it when invoking Cucumber: + + cucumber-js -f pretty + +### Cucumber.js 3 → 6 + +You can install [`cucumber-pretty`](https://www.npmjs.com/package/cucumber-pretty), created by [Ilya Kozhevnikov](http://kozhevnikov.com/). + +- Cucumber.js 3, 4, 5: `npm i --save-dev cucumber-pretty@1.5` +- Cucumber.js 6: `npm i --save-dev cucumber-pretty@6` + +Tell Cucumber to use it: + + cucumber-js -f cucumber-pretty + +## Credits + +This project is based on the [original work](https://github.com/kozhevnikov/cucumber-pretty) of [Ilya Kozhevnikov](http://kozhevnikov.com/). It got migrated to TypeScript, upgraded for Cucumber.js 7+ that exposes [cucumber-messages](https://github.com/cucumber/cucumber/tree/master/messages) and is currently maintained by [Julien Biezemans](https://github.com/jbpros/) and the [Cucumber team](https://github.com/cucumber). diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.d.ts b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.d.ts new file mode 100644 index 00000000..98ee4b61 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.d.ts @@ -0,0 +1,3 @@ +import { TextStyle } from './styleText'; +export declare const indentStyleText: (indent: number, text: string, styles?: TextStyle[]) => string; +//# sourceMappingURL=indentStyleText.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.d.ts.map b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.d.ts.map new file mode 100644 index 00000000..db68d969 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"indentStyleText.d.ts","sourceRoot":"","sources":["../../src/indentStyleText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe,WAClB,MAAM,QACR,MAAM,WACJ,SAAS,EAAE,KAClB,MAKA,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.js b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.js new file mode 100644 index 00000000..d53d542a --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indentStyleText = void 0; +const styleText_1 = require("./styleText"); +const indentStyleText = (indent, text, styles = []) => text.replace(/^(.+)$/gm, (subText) => subText.trim().length === 0 + ? '' + : `${' '.repeat(indent)}${styleText_1.styleText(subText.trimRight(), ...styles)}`); +exports.indentStyleText = indentStyleText; +//# sourceMappingURL=indentStyleText.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.js.map b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.js.map new file mode 100644 index 00000000..0598e176 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indentStyleText.js","sourceRoot":"","sources":["../../src/indentStyleText.ts"],"names":[],"mappings":";;;AAAA,2CAAkD;AAE3C,MAAM,eAAe,GAAG,CAC7B,MAAc,EACd,IAAY,EACZ,SAAsB,EAAE,EAChB,EAAE,CACV,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CACnC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;IACzB,CAAC,CAAC,EAAE;IACJ,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,qBAAS,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,GAAG,MAAM,CAAC,EAAE,CACxE,CAAA;AATU,QAAA,eAAe,mBASzB"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.d.ts b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.d.ts new file mode 100644 index 00000000..fdc9ef05 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.d.ts @@ -0,0 +1,2 @@ +import 'should'; +//# sourceMappingURL=indentStyleText.spec.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.d.ts.map b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.d.ts.map new file mode 100644 index 00000000..9216085c --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"indentStyleText.spec.d.ts","sourceRoot":"","sources":["../../src/indentStyleText.spec.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.js b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.js new file mode 100644 index 00000000..3db862ca --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +require("should"); +const indentStyleText_1 = require("./indentStyleText"); +const styleText_1 = require("./styleText"); +describe('indentStyleText', () => { + it('leaves text unstyled', () => { + indentStyleText_1.indentStyleText(0, 'some text').should.eql('some text'); + }); + it('trims text on the right', () => { + indentStyleText_1.indentStyleText(0, ' \t some text ').should.eql(' \t some text'); + }); + it('indents text', () => { + indentStyleText_1.indentStyleText(2, 'some text').should.eql(' some text'); + }); + it('indents and trims text on the right', () => { + indentStyleText_1.indentStyleText(2, ' some text ').should.eql(' some text'); + }); + it('trims multiline text', () => { + indentStyleText_1.indentStyleText(0, ' \t \n some \t \n \t more text \n ').should.eql('\n some\n \t more text\n'); + }); + it('indents multiline text', () => { + indentStyleText_1.indentStyleText(3, ' \n some \n \t more text \n ').should.eql('\n some\n \t more text\n'); + }); + it("doesn't indent only whitespace-lines", () => { + indentStyleText_1.indentStyleText(3, '\n \n \t').should.eql('\n\n'); + }); + it('applies styles to the text', () => { + indentStyleText_1.indentStyleText(0, 'some text', ['red']).should.eql(styleText_1.styleText('some text', 'red')); + }); + it('applies styles separately to lines', () => { + indentStyleText_1.indentStyleText(0, 'some text\nmore text', ['red']).should.eql(`${styleText_1.styleText('some text', 'red')}\n${styleText_1.styleText('more text', 'red')}`); + }); + it('applies styles separately to indented lines', () => { + indentStyleText_1.indentStyleText(2, 'some text\nmore text', ['red']).should.eql(` ${styleText_1.styleText('some text', 'red')}\n ${styleText_1.styleText('more text', 'red')}`); + }); +}); +//# sourceMappingURL=indentStyleText.spec.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.js.map b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.js.map new file mode 100644 index 00000000..ede062a9 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/indentStyleText.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indentStyleText.spec.js","sourceRoot":"","sources":["../../src/indentStyleText.spec.ts"],"names":[],"mappings":";;AAAA,kBAAe;AAEf,uDAAmD;AACnD,2CAAuC;AAEvC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAC9B,iCAAe,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IACzD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,iCAAe,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IACpE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;QACtB,iCAAe,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IAC3D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,iCAAe,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;IACpE,CAAC,CAAC,CAAA;IAEF,EAAE,C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,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/index.d.ts b/node_modules/@cucumber/pretty-formatter/lib/src/index.d.ts new file mode 100644 index 00000000..f5972367 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/index.d.ts @@ -0,0 +1,24 @@ +import { SummaryFormatter, IFormatterOptions } from '@cucumber/cucumber'; +import { ThemeStyles } from './theme'; +export declare const DEFAULT_THEME: ThemeStyles; +export default class PrettyFormatter extends SummaryFormatter { + private uri?; + private lastRuleId?; + private indentOffset; + private logItem; + private styleItem; + private tableLayout; + constructor(options: IFormatterOptions); + private parseEnvelope; + private onTestCaseStarted; + private onTestStepStarted; + private onTestStepFinished; + private onTestCaseFinished; + private renderTags; + private renderFeatureHead; + private renderRule; + private renderScenarioHead; + private renderLocation; + private newline; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/index.d.ts.map b/node_modules/@cucumber/pretty-formatter/lib/src/index.d.ts.map new file mode 100644 index 00000000..eb048e40 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,oBAAoB,CAAA;AAO3B,OAAO,EAAwB,WAAW,EAAE,MAAM,SAAS,CAAA;AAsC3D,eAAO,MAAM,aAAa,EAAE,WAmB3B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,gBAAgB;IAC3D,OAAO,CAAC,GAAG,CAAC,CAAQ;IACpB,OAAO,CAAC,UAAU,CAAC,CAAQ;IAC3B,OAAO,CAAC,YAAY,CAAI;IACxB,OAAO,CAAC,OAAO,CAA8C;IAC7D,OAAO,CAAC,SAAS,CAIN;IACX,OAAO,CAAC,WAAW,CAAmC;gBAE1C,OAAO,EAAE,iBAAiB;IAoDtC,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,iBAAiB;IAmDzB,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,UAAU;IAgBlB,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,OAAO;CAGhB"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/index.js b/node_modules/@cucumber/pretty-formatter/lib/src/index.js new file mode 100644 index 00000000..4de30b17 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/index.js @@ -0,0 +1,237 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_THEME = void 0; +const cucumber_1 = require("@cucumber/cucumber"); +const CliTable3 = require("cli-table3"); +const figures_1 = require("figures"); +const os_1 = require("os"); +const ts_dedent_1 = require("ts-dedent"); +const theme_1 = require("./theme"); +const { formatLocation, GherkinDocumentParser, PickleParser } = cucumber_1.formatterHelpers; +const { getGherkinExampleRuleMap, getGherkinScenarioMap, getGherkinStepMap } = GherkinDocumentParser; +const { getPickleStepMap } = PickleParser; +const marks = { + [cucumber_1.Status.AMBIGUOUS]: figures_1.cross, + [cucumber_1.Status.FAILED]: figures_1.cross, + [cucumber_1.Status.PASSED]: figures_1.tick, + [cucumber_1.Status.PENDING]: '?', + [cucumber_1.Status.SKIPPED]: '-', + [cucumber_1.Status.UNDEFINED]: '?', + [cucumber_1.Status.UNKNOWN]: '?', +}; +const themeItemIndentations = { + [theme_1.ThemeItem.DataTable]: 6, + [theme_1.ThemeItem.DataTableBorder]: 0, + [theme_1.ThemeItem.DataTableContent]: 0, + [theme_1.ThemeItem.DocStringContent]: 6, + [theme_1.ThemeItem.DocStringDelimiter]: 6, + [theme_1.ThemeItem.FeatureDescription]: 2, + [theme_1.ThemeItem.FeatureKeyword]: 0, + [theme_1.ThemeItem.FeatureName]: 0, + [theme_1.ThemeItem.Location]: 0, + [theme_1.ThemeItem.RuleKeyword]: 2, + [theme_1.ThemeItem.RuleName]: 0, + [theme_1.ThemeItem.ScenarioKeyword]: 2, + [theme_1.ThemeItem.ScenarioName]: 0, + [theme_1.ThemeItem.StepKeyword]: 4, + [theme_1.ThemeItem.StepMessage]: 6, + [theme_1.ThemeItem.StepStatus]: 4, + [theme_1.ThemeItem.StepText]: 0, + [theme_1.ThemeItem.Tag]: 0, +}; +exports.DEFAULT_THEME = { + [theme_1.ThemeItem.DataTable]: [], + [theme_1.ThemeItem.DataTableBorder]: ['gray'], + [theme_1.ThemeItem.DataTableContent]: ['gray', 'italic'], + [theme_1.ThemeItem.DocStringContent]: ['gray', 'italic'], + [theme_1.ThemeItem.DocStringDelimiter]: ['gray'], + [theme_1.ThemeItem.FeatureDescription]: ['gray'], + [theme_1.ThemeItem.FeatureKeyword]: ['blueBright', 'bold'], + [theme_1.ThemeItem.FeatureName]: ['blueBright', 'underline'], + [theme_1.ThemeItem.Location]: ['dim'], + [theme_1.ThemeItem.RuleKeyword]: ['blueBright', 'bold'], + [theme_1.ThemeItem.RuleName]: ['blueBright', 'underline'], + [theme_1.ThemeItem.ScenarioKeyword]: ['cyan', 'bold'], + [theme_1.ThemeItem.ScenarioName]: ['cyan', 'underline'], + [theme_1.ThemeItem.StepKeyword]: ['cyan'], + [theme_1.ThemeItem.StepMessage]: [], + [theme_1.ThemeItem.StepStatus]: [], + [theme_1.ThemeItem.StepText]: [], + [theme_1.ThemeItem.Tag]: ['cyan'], +}; +class PrettyFormatter extends cucumber_1.SummaryFormatter { + constructor(options) { + super(options); + this.indentOffset = 0; + const theme = theme_1.makeTheme(!!options.parsedArgvOptions.colorsEnabled + ? options.parsedArgvOptions.theme || exports.DEFAULT_THEME + : {}); + this.styleItem = (indent, item, ...text) => { + if (indent > 0 && this.indentOffset > 0) + indent = indent + this.indentOffset; + return theme.indentStyleText(indent, item, ...text); + }; + this.logItem = (item, ...text) => this.log(this.styleItem(themeItemIndentations[item], item, ...text)); + this.parseEnvelope = this.parseEnvelope.bind(this); + const tableFrameChar = theme.indentStyleText(0, theme_1.ThemeItem.DataTableBorder, '│'); + this.tableLayout = { + chars: { + left: tableFrameChar, + middle: tableFrameChar, + right: tableFrameChar, + top: '', + 'top-left': '', + 'top-mid': '', + 'top-right': '', + mid: '', + 'left-mid': '', + 'mid-mid': '', + 'right-mid': '', + bottom: '', + 'bottom-left': '', + 'bottom-mid': '', + 'bottom-right': '', + }, + style: { + head: [], + border: [], + }, + }; + options.eventBroadcaster.on('envelope', this.parseEnvelope); + } + parseEnvelope(envelope) { + if (envelope.testCaseStarted) + this.onTestCaseStarted(envelope.testCaseStarted); + if (envelope.testStepStarted) + this.onTestStepStarted(envelope.testStepStarted); + if (envelope.testStepFinished) + this.onTestStepFinished(envelope.testStepFinished); + if (envelope.testCaseFinished) + this.onTestCaseFinished(envelope.testCaseFinished); + } + onTestCaseStarted(testCaseStarted) { + const { gherkinDocument, pickle } = this.eventDataCollector.getTestCaseAttempt(testCaseStarted.id || ''); + const { feature } = gherkinDocument; + if (this.uri !== gherkinDocument.uri && feature) { + this.indentOffset = 0; + this.uri = gherkinDocument.uri || ''; + this.lastRuleId = undefined; + this.renderFeatureHead(feature); + } + const gherkinExampleRuleMap = getGherkinExampleRuleMap(gherkinDocument); + if (!pickle.astNodeIds) + throw new Error('Pickle AST nodes missing'); + const rule = gherkinExampleRuleMap[pickle.astNodeIds[0]]; + if (rule && rule.id !== this.lastRuleId) { + this.indentOffset = 0; + this.renderRule(rule); + this.lastRuleId = rule.id; + this.indentOffset = 2; + } + this.renderScenarioHead(gherkinDocument, pickle); + } + onTestStepStarted(testStepStarted) { + const { gherkinDocument, pickle, testCase } = this.eventDataCollector.getTestCaseAttempt(testStepStarted.testCaseStartedId || ''); + const pickleStepMap = getPickleStepMap(pickle); + const gherkinStepMap = getGherkinStepMap(gherkinDocument); + const testStep = (testCase.testSteps || []).find((item) => item.id === testStepStarted.testStepId); + if (testStep && testStep.pickleStepId) { + const pickleStep = pickleStepMap[testStep.pickleStepId]; + const astNodeId = pickleStep.astNodeIds[0]; + const gherkinStep = gherkinStepMap[astNodeId]; + this.logItem(theme_1.ThemeItem.StepKeyword, gherkinStep.keyword); + this.log(' '); + this.logItem(theme_1.ThemeItem.StepText, pickleStep.text); + this.newline(); + if (gherkinStep.docString) { + this.logItem(theme_1.ThemeItem.DocStringDelimiter, gherkinStep.docString.delimiter); + this.newline(); + this.logItem(theme_1.ThemeItem.DocStringContent, gherkinStep.docString.content); + this.newline(); + this.logItem(theme_1.ThemeItem.DocStringDelimiter, gherkinStep.docString.delimiter); + this.newline(); + } + if (gherkinStep.dataTable) { + const datatable = new CliTable3(this.tableLayout); + datatable.push(...gherkinStep.dataTable.rows.map((row) => (row.cells || []).map((cell) => this.styleItem(0, theme_1.ThemeItem.DataTableContent, cell.value || '')))); + this.logItem(theme_1.ThemeItem.DataTable, datatable.toString()); + this.newline(); + } + } + } + onTestStepFinished(testStepFinished) { + const { message, status } = testStepFinished.testStepResult || {}; + if (status && status !== cucumber_1.Status.PASSED) { + this.logItem(theme_1.ThemeItem.StepStatus, this.colorFns.forStatus(status)(`${marks[status]} ${cucumber_1.Status[status].toLowerCase()}`)); + this.newline(); + if (message) { + this.logItem(theme_1.ThemeItem.StepMessage, message); + this.newline(); + } + } + } + onTestCaseFinished(_testCaseFinished) { + this.newline(); + } + renderTags(indent, tags) { + const tagStrings = tags.reduce((tags, tag) => (tag.name ? [...tags, tag.name] : tags), []); + if (tagStrings.length > 0) { + const firstTag = tagStrings.shift(); + this.log(this.styleItem(indent, theme_1.ThemeItem.Tag, firstTag)); + tagStrings.forEach((tag) => { + this.log(' '); + this.logItem(theme_1.ThemeItem.Tag, tag); + }); + this.newline(); + } + } + renderFeatureHead(feature) { + var _a; + this.renderTags(0, feature.tags || []); + this.logItem(theme_1.ThemeItem.FeatureKeyword, feature.keyword || '[feature]', ':'); + this.log(' '); + this.logItem(theme_1.ThemeItem.FeatureName, feature.name || ''); + if (feature.location) { + this.log(' '); + this.renderLocation(((_a = feature.location) === null || _a === void 0 ? void 0 : _a.line) || -1); + } + this.newline(); + if (feature.description) { + this.newline(); + this.logItem(theme_1.ThemeItem.FeatureDescription, ts_dedent_1.default(feature.description.trim())); + this.newline(); + } + this.newline(); + } + renderRule(rule) { + this.logItem(theme_1.ThemeItem.RuleKeyword, rule.keyword, ':'); + this.log(' '); + this.logItem(theme_1.ThemeItem.RuleName, rule.name || ''); + this.newline(); + this.newline(); + } + renderScenarioHead(gherkinDocument, pickle) { + var _a; + this.renderTags(2, pickle.tags || []); + const gherkinScenarioMap = getGherkinScenarioMap(gherkinDocument); + if (!pickle.astNodeIds) + throw new Error('Pickle AST nodes missing'); + const scenario = gherkinScenarioMap[pickle.astNodeIds[0]]; + this.logItem(theme_1.ThemeItem.ScenarioKeyword, scenario.keyword || '???', ':'); + this.log(' '); + this.logItem(theme_1.ThemeItem.ScenarioName, pickle.name || ''); + if (gherkinScenarioMap[pickle.astNodeIds[0]]) { + this.log(' '); + this.renderLocation(((_a = scenario.location) === null || _a === void 0 ? void 0 : _a.line) || -1); + } + this.newline(); + } + renderLocation(line) { + this.logItem(theme_1.ThemeItem.Location, '# ', formatLocation({ uri: this.uri || '', line }, process.cwd())); + } + newline() { + this.log(os_1.EOL); + } +} +exports.default = PrettyFormatter; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/index.js.map b/node_modules/@cucumber/pretty-formatter/lib/src/index.js.map new file mode 100644 index 00000000..72f81c4f --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAK2B;AAE3B,wCAAuC;AACvC,qCAAq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C,YAAY,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA;QACvD,IAAI,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;YAC5C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACb,IAAI,CAAC,cAAc,CAAC,OAAA,QAAQ,CAAC,QAAQ,0CAAE,IAAI,KAAI,CAAC,CAAC,CAAC,CAAA;SACnD;QACD,IAAI,CAAC,OAAO,EAAE,CAAA;IAChB,CAAC;IAEO,cAAc,CAAC,IAAY;QACjC,IAAI,CAAC,OAAO,CACV,iBAAS,CAAC,QAAQ,EAClB,IAAI,EACJ,cAAc,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAC7D,CAAA;IACH,CAAC;IAEO,OAAO;QACb,IAAI,CAAC,GAAG,CAAC,QAAC,CAAC,CAAA;IACb,CAAC;CACF;AAzPD,kCAyPC"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/styleText.d.ts b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.d.ts new file mode 100644 index 00000000..9c98cce5 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.d.ts @@ -0,0 +1,4 @@ +import { BackgroundColor, ForegroundColor, Modifier } from 'ansi-styles'; +export declare type TextStyle = keyof BackgroundColor | keyof ForegroundColor | keyof Modifier; +export declare const styleText: (text: string, ...styles: TextStyle[]) => string; +//# sourceMappingURL=styleText.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/styleText.d.ts.map b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.d.ts.map new file mode 100644 index 00000000..c4264b3f --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"styleText.d.ts","sourceRoot":"","sources":["../../src/styleText.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAIf,eAAe,EAEf,QAAQ,EACT,MAAM,aAAa,CAAA;AAEpB,oBAAY,SAAS,GACjB,MAAM,eAAe,GACrB,MAAM,eAAe,GACrB,MAAM,QAAQ,CAAA;AASlB,eAAO,MAAM,SAAS,SAAU,MAAM,aAAa,SAAS,EAAE,KAAG,MAGhE,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/styleText.js b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.js new file mode 100644 index 00000000..e5d3b89e --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.styleText = void 0; +const ansi_styles_1 = require("ansi-styles"); +const styleDefs = { + ...ansi_styles_1.bgColor, + ...ansi_styles_1.color, + ...ansi_styles_1.modifier, +}; +const styleText = (text, ...styles) => { + validateStyles(styles); + return applyStyles(...styles)(text); +}; +exports.styleText = styleText; +const validateStyles = (styles) => { + styles.forEach((style) => { + if (!(style in styleDefs)) + throw new Error(`Unknown style "${style}"`); + }); +}; +const applyStyles = (...styles) => styles.reduce((fn, style) => (text) => fn(`${styleDefs[style].open}${text}${styleDefs[style].close}`), (text) => text); +//# sourceMappingURL=styleText.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/styleText.js.map b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.js.map new file mode 100644 index 00000000..25f4ff71 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.js.map @@ -0,0 +1 @@ +{"version":3,"file":"styleText.js","sourceRoot":"","sources":["../../src/styleText.ts"],"names":[],"mappings":";;;AAAA,6CAQoB;AAQpB,MAAM,SAAS,GAAmC;IAChD,GAAG,qBAAO;IACV,GAAG,mBAAK;IACR,GAAG,sBAAQ;CACZ,CAAA;AAEM,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,GAAG,MAAmB,EAAU,EAAE;IACxE,cAAc,CAAC,MAAM,CAAC,CAAA;IACtB,OAAO,WAAW,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAHY,QAAA,SAAS,aAGrB;AAED,MAAM,cAAc,GAAG,CAAC,MAAmB,EAAE,EAAE;IAC7C,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,IAAI,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,GAAG,CAAC,CAAA;IACxE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,GAAG,MAAmB,EAAiB,EAAE,CAC5D,MAAM,CAAC,MAAM,CACX,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CACtB,EAAE,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,EAChE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CACf,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.d.ts b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.d.ts new file mode 100644 index 00000000..b1304dde --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.d.ts @@ -0,0 +1,2 @@ +import 'should'; +//# sourceMappingURL=styleText.spec.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.d.ts.map b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.d.ts.map new file mode 100644 index 00000000..1179f43d --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"styleText.spec.d.ts","sourceRoot":"","sources":["../../src/styleText.spec.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.js b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.js new file mode 100644 index 00000000..7d8ed899 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +require("should"); +const styleText_1 = require("./styleText"); +describe('styleText()', () => { + it('applies modifiers', () => { + styleText_1.styleText('Burpless 26', 'bold').should.containEql('\u001b[1mBurpless 26\u001b[22m'); + styleText_1.styleText('Burpless 26', 'italic').should.containEql('\u001b[3mBurpless 26\u001b[23m'); + }); + it('applies foreground colors (red)', () => { + styleText_1.styleText('Burpless 26', 'red').should.containEql('\u001b[31mBurpless 26\u001b[39m'); + }); + it('applies foreground colors (green)', () => { + styleText_1.styleText('Burpless 26', 'green').should.containEql('\u001b[32mBurpless 26\u001b[39m'); + }); + it('applies foreground colors (blue)', () => { + styleText_1.styleText('Burpless 26', 'blue').should.containEql('\u001b[34mBurpless 26\u001b[39m'); + }); + it('applies bright foreground colors (red)', () => { + styleText_1.styleText('Burpless 26', 'redBright').should.containEql('\u001b[91mBurpless 26\u001b[39m'); + }); + it('applies bright foreground colors (green)', () => { + styleText_1.styleText('Burpless 26', 'greenBright').should.containEql('\u001b[92mBurpless 26\u001b[39m'); + }); + it('applies bright foreground colors (blue)', () => { + styleText_1.styleText('Burpless 26', 'blueBright').should.containEql('\u001b[94mBurpless 26\u001b[39m'); + }); + it('applies background colors (red)', () => { + styleText_1.styleText('Burpless 26', 'bgRed').should.containEql('\u001b[41mBurpless 26\u001b[49m'); + }); + it('applies background colors (green)', () => { + styleText_1.styleText('Burpless 26', 'bgGreen').should.containEql('\u001b[42mBurpless 26\u001b[49m'); + }); + it('applies background colors (blue)', () => { + styleText_1.styleText('Burpless 26', 'bgBlue').should.containEql('\u001b[44mBurpless 26\u001b[49m'); + }); + it('applies bright background colors (red)', () => { + styleText_1.styleText('Burpless 26', 'bgRedBright').should.containEql('\u001b[101mBurpless 26\u001b[49m'); + }); + it('applies bright background colors (green)', () => { + styleText_1.styleText('Burpless 26', 'bgGreenBright').should.containEql('\u001b[102mBurpless 26\u001b[49m'); + }); + it('applies bright background colors (blue)', () => { + styleText_1.styleText('Burpless 26', 'bgBlueBright').should.containEql('\u001b[104mBurpless 26\u001b[49m'); + }); + it('combines modifiers, foreground and background colors', () => { + styleText_1.styleText('Burpless 26', 'redBright', 'bgBlueBright', 'bold').should.containEql('\u001b[91m\u001b[104m\u001b[1mBurpless 26\u001b[22m\u001b[49m\u001b[39m'); + }); + it('fails with a clear error on unknown styles', () => { + ; + (() => + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + styleText_1.styleText('Burpless 26', 'ultraviolet')).should.throwError('Unknown style "ultraviolet"'); + }); +}); +//# sourceMappingURL=styleText.spec.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.js.map b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.js.map new file mode 100644 index 00000000..81bbbcc7 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/styleText.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"styleText.spec.js","sourceRoot":"","sources":["../../src/styleText.spec.ts"],"names":[],"mappings":";;AAAA,kBAAe;AAEf,2CAAuC;AAEvC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3B,qBAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,UAAU,CAChD,gCAAgC,CACjC,CAAA;QACD,qBAAS,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,CAClD,gCAAgC,CAC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.ts b/node_modules/@cucumber/pretty-formatter/lib/src/theme.d.ts new file mode 100644 index 00000000..f2fd2751 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/theme.d.ts @@ -0,0 +1,30 @@ +import { TextStyle } from './styleText'; +export declare enum ThemeItem { + DataTable = "datatable", + DataTableBorder = "datatable border", + DataTableContent = "datatable content", + DocStringContent = "docstring content", + DocStringDelimiter = "docstring delimiter", + FeatureDescription = "feature description", + FeatureKeyword = "feature keyword", + FeatureName = "feature name", + Location = "location", + RuleKeyword = "rule keyword", + RuleName = "rule name", + ScenarioKeyword = "scenario keyword", + ScenarioName = "scenario name", + StepKeyword = "step keyword", + StepMessage = "step message", + StepStatus = "step status", + StepText = "step text", + Tag = "tag" +} +export declare type ThemeStyles = { + [key in ThemeItem]: TextStyle[]; +}; +export declare const makeTheme: (styles: Partial) => ThemeHelpers; +export declare type IndentStyleThemeItem = (indent: number, item: ThemeItem, ...text: string[]) => string; +export declare type ThemeHelpers = { + indentStyleText: IndentStyleThemeItem; +}; +//# sourceMappingURL=theme.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/theme.d.ts.map b/node_modules/@cucumber/pretty-formatter/lib/src/theme.d.ts.map new file mode 100644 index 00000000..002b52da --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/theme.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,eAAe,qBAAqB;IACpC,gBAAgB,sBAAsB;IACtC,gBAAgB,sBAAsB;IACtC,kBAAkB,wBAAwB;IAC1C,kBAAkB,wBAAwB;IAC1C,cAAc,oBAAoB;IAClC,WAAW,iBAAiB;IAC5B,QAAQ,aAAa;IACrB,WAAW,iBAAiB;IAC5B,QAAQ,cAAc;IACtB,eAAe,qBAAqB;IACpC,YAAY,kBAAkB;IAC9B,WAAW,iBAAiB;IAC5B,WAAW,iBAAiB;IAC5B,UAAU,gBAAgB;IAC1B,QAAQ,cAAc;IACtB,GAAG,QAAQ;CACZ;AACD,oBAAY,WAAW,GAAG;KAAG,GAAG,IAAI,SAAS,GAAG,SAAS,EAAE;CAAE,CAAA;AAuB7D,eAAO,MAAM,SAAS,WAAY,QAAQ,WAAW,CAAC,KAAG,YAkBxD,CAAA;AAED,oBAAY,oBAAoB,GAAG,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,GAAG,IAAI,EAAE,MAAM,EAAE,KACd,MAAM,CAAA;AACX,oBAAY,YAAY,GAAG;IACzB,eAAe,EAAE,oBAAoB,CAAA;CACtC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/theme.js b/node_modules/@cucumber/pretty-formatter/lib/src/theme.js new file mode 100644 index 00000000..bcae1e9e --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/theme.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeTheme = exports.ThemeItem = void 0; +const indentStyleText_1 = require("./indentStyleText"); +var ThemeItem; +(function (ThemeItem) { + ThemeItem["DataTable"] = "datatable"; + ThemeItem["DataTableBorder"] = "datatable border"; + ThemeItem["DataTableContent"] = "datatable content"; + ThemeItem["DocStringContent"] = "docstring content"; + ThemeItem["DocStringDelimiter"] = "docstring delimiter"; + ThemeItem["FeatureDescription"] = "feature description"; + ThemeItem["FeatureKeyword"] = "feature keyword"; + ThemeItem["FeatureName"] = "feature name"; + ThemeItem["Location"] = "location"; + ThemeItem["RuleKeyword"] = "rule keyword"; + ThemeItem["RuleName"] = "rule name"; + ThemeItem["ScenarioKeyword"] = "scenario keyword"; + ThemeItem["ScenarioName"] = "scenario name"; + ThemeItem["StepKeyword"] = "step keyword"; + ThemeItem["StepMessage"] = "step message"; + ThemeItem["StepStatus"] = "step status"; + ThemeItem["StepText"] = "step text"; + ThemeItem["Tag"] = "tag"; +})(ThemeItem = exports.ThemeItem || (exports.ThemeItem = {})); +const unstyledTheme = { + [ThemeItem.DataTable]: [], + [ThemeItem.DataTableBorder]: [], + [ThemeItem.DataTableContent]: [], + [ThemeItem.DocStringContent]: [], + [ThemeItem.DocStringDelimiter]: [], + [ThemeItem.FeatureDescription]: [], + [ThemeItem.FeatureKeyword]: [], + [ThemeItem.FeatureName]: [], + [ThemeItem.Location]: [], + [ThemeItem.RuleKeyword]: [], + [ThemeItem.RuleName]: [], + [ThemeItem.ScenarioKeyword]: [], + [ThemeItem.ScenarioName]: [], + [ThemeItem.StepKeyword]: [], + [ThemeItem.StepMessage]: [], + [ThemeItem.StepStatus]: [], + [ThemeItem.StepText]: [], + [ThemeItem.Tag]: [], +}; +const makeTheme = (styles) => { + const validateItemExists = (item) => { + if (!Object.values(ThemeItem).includes(item)) + throw new Error(`Unknown theme item "${item}"`); + }; + Object.keys(styles).forEach(validateItemExists); + return { + indentStyleText: (indent, item, ...text) => { + validateItemExists(item); + return indentStyleText_1.indentStyleText(indent, text.join(''), { ...unstyledTheme, ...styles }[item]); + }, + }; +}; +exports.makeTheme = makeTheme; +//# sourceMappingURL=theme.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/theme.js.map b/node_modules/@cucumber/pretty-formatter/lib/src/theme.js.map new file mode 100644 index 00000000..f4e96503 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/theme.js.map @@ -0,0 +1 @@ +{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AAGnD,IAAY,SAmBX;AAnBD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,iDAAoC,CAAA;IACpC,mDAAsC,CAAA;IACtC,mDAAsC,CAAA;IACtC,uDAA0C,CAAA;IAC1C,uDAA0C,CAAA;IAC1C,+CAAkC,CAA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SAAS,GAAG,CAAC,MAA4B,EAAgB,EAAE;IACtE,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE;QAC1C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,IAAiB,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,GAAG,CAAC,CAAA;IACnD,CAAC,CAAA;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAE/C,OAAO;QACL,eAAe,EAAE,CAAC,MAAc,EAAE,IAAe,EAAE,GAAG,IAAc,EAAE,EAAE;YACtE,kBAAkB,CAAC,IAAI,CAAC,CAAA;YACxB,OAAO,iCAAe,CACpB,MAAM,EACN,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EACb,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CACtC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA;AAlBY,QAAA,SAAS,aAkBrB"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.d.ts b/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.d.ts new file mode 100644 index 00000000..12764372 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.d.ts @@ -0,0 +1,2 @@ +import 'should'; +//# sourceMappingURL=theme.spec.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.d.ts.map b/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.d.ts.map new file mode 100644 index 00000000..991d8f2e --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"theme.spec.d.ts","sourceRoot":"","sources":["../../src/theme.spec.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.js b/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.js new file mode 100644 index 00000000..1ffc7a93 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.js @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +require("should"); +const styleText_1 = require("./styleText"); +const theme_1 = require("./theme"); +describe('Theme', () => { + let styleThemeItem; + beforeEach(() => { + const styles = { + [theme_1.ThemeItem.DataTable]: ['bgRed'], + [theme_1.ThemeItem.DataTableBorder]: ['red'], + [theme_1.ThemeItem.DataTableContent]: ['blue'], + [theme_1.ThemeItem.DocStringContent]: ['green'], + [theme_1.ThemeItem.DocStringDelimiter]: ['red'], + [theme_1.ThemeItem.FeatureDescription]: ['white'], + [theme_1.ThemeItem.FeatureKeyword]: ['red'], + [theme_1.ThemeItem.FeatureName]: ['yellow'], + [theme_1.ThemeItem.Location]: ['bgWhite', 'black'], + [theme_1.ThemeItem.RuleKeyword]: ['green'], + [theme_1.ThemeItem.RuleName]: ['bgRed'], + [theme_1.ThemeItem.ScenarioKeyword]: ['blue'], + [theme_1.ThemeItem.ScenarioName]: ['blue', 'underline'], + [theme_1.ThemeItem.StepKeyword]: ['magenta'], + [theme_1.ThemeItem.StepMessage]: ['bgCyan'], + [theme_1.ThemeItem.StepStatus]: ['bgRed'], + [theme_1.ThemeItem.StepText]: ['bgYellow'], + [theme_1.ThemeItem.Tag]: ['bgRed'], + }; + styleThemeItem = theme_1.makeTheme(styles).indentStyleText; + }); + it('applies styles to Feature keywords', () => { + styleThemeItem(0, theme_1.ThemeItem.FeatureKeyword, 'Fonctionnalité:').should.containEql(styleText_1.styleText('Fonctionnalité:', 'red')); + }); + it('applies styles to Feature names', () => { + styleThemeItem(0, theme_1.ThemeItem.FeatureName, 'my feature').should.containEql(styleText_1.styleText('my feature', 'yellow')); + }); + it('applies styles to feature descriptions', () => { + styleThemeItem(2, theme_1.ThemeItem.FeatureDescription, 'This is some\ndescription...').should.containEql(` ${styleText_1.styleText('This is some', 'white')}\n` + + ` ${styleText_1.styleText('description...', 'white')}`); + }); + it('applies styles to locations', () => { + styleThemeItem(0, theme_1.ThemeItem.Location, '# path/to/file.feature:12').should.containEql(styleText_1.styleText('# path/to/file.feature:12', 'bgWhite', 'black')); + }); + it('applies styles to Rule keywords', () => { + styleThemeItem(0, theme_1.ThemeItem.RuleKeyword, 'Règle:').should.containEql(styleText_1.styleText('Règle:', 'green')); + }); + it('applies styles to Rule names', () => { + styleThemeItem(0, theme_1.ThemeItem.RuleName, 'my rules').should.containEql(styleText_1.styleText('my rules', 'bgRed')); + }); + it('applies styles to Scenario keywords', () => { + styleThemeItem(0, theme_1.ThemeItem.ScenarioKeyword, 'Scénario:').should.containEql(styleText_1.styleText('Scénario:', 'blue')); + }); + it('applies styles to Scenario names', () => { + styleThemeItem(0, theme_1.ThemeItem.ScenarioName, 'my scenario').should.containEql(styleText_1.styleText('my scenario', 'blue', 'underline')); + }); + it('applies styles to Step keywords', () => { + styleThemeItem(0, theme_1.ThemeItem.StepKeyword, 'Etant donné').should.containEql(styleText_1.styleText('Etant donné', 'magenta')); + }); + it('applies styles to Step text', () => { + styleThemeItem(0, theme_1.ThemeItem.StepText, 'some cucumbers').should.containEql(styleText_1.styleText('some cucumbers', 'bgYellow')); + }); + it('applies styles to Step statuses', () => { + styleThemeItem(0, theme_1.ThemeItem.StepStatus, '? undefined step').should.containEql(styleText_1.styleText('? undefined step', 'bgRed')); + }); + it('applies styles to Step messages', () => { + styleThemeItem(0, theme_1.ThemeItem.StepMessage, 'step message').should.containEql(styleText_1.styleText('step message', 'bgCyan')); + }); + it('applies styles to DocString content', () => { + styleThemeItem(0, theme_1.ThemeItem.DocStringContent, 'this is some docstring').should.containEql(styleText_1.styleText('this is some docstring', 'green')); + }); + it('applies styles to DocString delimiters', () => { + styleThemeItem(0, theme_1.ThemeItem.DocStringDelimiter, '"""').should.containEql(styleText_1.styleText('"""', 'red')); + }); + it('applies styles to DataTable', () => { + styleThemeItem(0, theme_1.ThemeItem.DataTable, '| foo | bar |\n| baz | oof |').should.containEql(`${styleText_1.styleText('| foo | bar |', 'bgRed')}\n${styleText_1.styleText('| baz | oof |', 'bgRed')}`); + }); + it('applies styles to DataTable borders', () => { + styleThemeItem(0, theme_1.ThemeItem.DataTableBorder, '|').should.containEql(styleText_1.styleText('|', 'red')); + }); + it('applies styles to DataTable content', () => { + styleThemeItem(0, theme_1.ThemeItem.DataTableContent, 'foo').should.containEql(styleText_1.styleText('foo', 'blue')); + }); + it('applies styles to feature tags', () => { + styleThemeItem(0, theme_1.ThemeItem.Tag, '@someTag').should.containEql(styleText_1.styleText('@someTag', 'bgRed')); + }); + it('concatenates multiple strings', () => { + styleThemeItem(0, theme_1.ThemeItem.StepKeyword, 'Etant', ' donné', ' que').should.containEql(styleText_1.styleText('Etant donné que', 'magenta')); + }); + it('fails when applying styles to unknown theme items', () => { + ; + (() => styleThemeItem(0, + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + 'unknown theme item', 'text')).should.throw(); + }); + it('fails when making a theme with unknown theme items', () => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + ; + (() => theme_1.makeTheme({ 'random item': ['red'] })).should.throwError('Unknown theme item "random item"'); + }); + it('defaults to unstyled items', () => { + styleThemeItem = theme_1.makeTheme({}).indentStyleText; + styleThemeItem(0, theme_1.ThemeItem.FeatureKeyword, 'Feature').should.eql('Feature'); + styleThemeItem(0, theme_1.ThemeItem.RuleKeyword, 'Rule').should.eql('Rule'); + styleThemeItem(0, theme_1.ThemeItem.ScenarioKeyword, 'Scenario').should.eql('Scenario'); + styleThemeItem(0, theme_1.ThemeItem.StepKeyword, 'Given').should.eql('Given'); + }); + it('allows some defined and some missing styles', () => { + styleThemeItem = theme_1.makeTheme({ + [theme_1.ThemeItem.FeatureKeyword]: ['red'], + }).indentStyleText; + styleThemeItem(0, theme_1.ThemeItem.FeatureKeyword, 'Feature').should.containEql(styleText_1.styleText('Feature', 'red')); + styleThemeItem(0, theme_1.ThemeItem.RuleKeyword, 'Rule').should.eql('Rule'); + styleThemeItem(0, theme_1.ThemeItem.ScenarioKeyword, 'Scenario').should.eql('Scenario'); + styleThemeItem(0, theme_1.ThemeItem.StepKeyword, 'Given').should.eql('Given'); + }); +}); +//# sourceMappingURL=theme.spec.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.js.map b/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.js.map new file mode 100644 index 00000000..c45965f0 --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/lib/src/theme.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"theme.spec.js","sourceRoot":"","sources":["../../src/theme.spec.ts"],"names":[],"mappings":";;AAAA,kBAAe;AACf,2CAAuC;AAEvC,mCAKgB;AAEhB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,IAAI,cAAoC,CAAA;IAExC,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,MAAM,GAAgB;YAC1B,CAAC,iBAAS,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC;YAChC,CAAC,iBAAS,CAAC,eAAe,CAAC,EAAE,CAAC,KAAK,CAAC;YACpC,CAAC,iBAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC,MAAM,CAAC;YACtC,CAAC,iBAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC,OAAO,CAAC;YACvC,CAAC,iBAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC,KAAK,CAAC;YACvC,CAAC,iBAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC,OAAO,CAAC;YACzC,CAAC,iBAAS,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC;YACnC,CAAC,iBAAS,CAAC,WAAW,CAAC,EAAE,CAAC,QAAQ,CAAC;YACnC,CAAC,iBAAS,CAAC,QAAQ,CAAC,EAAE,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YACzB,CAAC,iBAAS,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC;SACpC,CAAC,CAAC,eAAe,CAAA;QAClB,cAAc,CAAC,CAAC,EAAE,iBAAS,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,UAAU,CACtE,qBAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAC5B,CAAA;QACD,cAAc,CAAC,CAAC,EAAE,iBAAS,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACnE,cAAc,CAAC,CAAC,EAAE,iBAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,GAAG,CACjE,UAAU,CACX,CAAA;QACD,cAAc,CAAC,CAAC,EAAE,iBAAS,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/pretty-formatter/package.json b/node_modules/@cucumber/pretty-formatter/package.json new file mode 100644 index 00000000..9be865bb --- /dev/null +++ b/node_modules/@cucumber/pretty-formatter/package.json @@ -0,0 +1,67 @@ +{ + "name": "@cucumber/pretty-formatter", + "version": "1.0.1", + "description": "Official Cucumber.js Pretty Formatter", + "repository": "https://github.com/cucumber/cucumber-js-pretty-formatter", + "maintainers": [ + "Julien Biezemans " + ], + "contributors": [ + "Ilya Kozhevnikov ", + "Julien Biezemans " + ], + "license": "MIT", + "main": "lib/src/index.js", + "types": "lib/src/index.d.ts", + "files": [ + "lib/src" + ], + "directories": { + "lib": "lib" + }, + "scripts": { + "build:clean:tests": "rm -rf lib/test", + "build:clean": "rm -rf lib", + "build:release": "npm run build && npm run test:nobuild && npm run build:clean:tests", + "build:watch": "tsc -p tsconfig.node.json --watch", + "build": "tsc -p tsconfig.node.json", + "lint:fix": "eslint --fix \"src/**/*.ts\" \"test/**/*.ts\"", + "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"", + "test:mocha:wip:watch": "mocha -w -g wip", + "test:mocha:wip": "mocha -g wip", + "test:mocha": "mocha", + "test:nobuild": "npm run test:mocha", + "test": "npm run build && npm run test:mocha", + "update-dependencies": "npx npm-check-updates --upgrade --dep prod,dev,optional,bundle" + }, + "dependencies": { + "ansi-styles": "^5.0.0", + "cli-table3": "^0.6.0", + "figures": "^3.2.0", + "ts-dedent": "^2.0.0" + }, + "peerDependencies": { + "@cucumber/cucumber": ">=7.0.0", + "@cucumber/messages": "*" + }, + "devDependencies": { + "@cucumber/cucumber": "^8.3.1", + "@cucumber/messages": "^24.0.0", + "@types/glob": "^8.0.0", + "@types/mocha": "^10.0.0", + "@types/node": "^18.0.0", + "@typescript-eslint/eslint-plugin": "^7.0.0", + "@typescript-eslint/parser": "^7.0.0", + "colors": "^1.4.0", + "eslint": "^8.0.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-import": "^2.22.1", + "eslint-plugin-prettier": "^5.0.0", + "glob": "^10.0.0", + "mocha": "^10.0.0", + "prettier": "^3.0.0", + "should": "^13.2.3", + "stream-to-string": "^1.2.0", + "typescript": "^4.1.3" + } +} diff --git a/node_modules/@cucumber/query/.mocharc.json b/node_modules/@cucumber/query/.mocharc.json new file mode 100644 index 00000000..b2ba4bc1 --- /dev/null +++ b/node_modules/@cucumber/query/.mocharc.json @@ -0,0 +1,7 @@ +{ + "require": ["ts-node/register", "source-map-support/register"], + "extension": ["ts", "tsx"], + "recursive": true, + "spec": ["src/**/*.spec.*"], + "timeout": 10000 +} diff --git a/node_modules/@cucumber/query/.prettierrc.json b/node_modules/@cucumber/query/.prettierrc.json new file mode 100644 index 00000000..8e95b098 --- /dev/null +++ b/node_modules/@cucumber/query/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "trailingComma": "es5", + "semi": false, + "singleQuote": true, + "printWidth": 100 +} \ No newline at end of file diff --git a/node_modules/@cucumber/query/LICENSE b/node_modules/@cucumber/query/LICENSE new file mode 100644 index 00000000..1c022048 --- /dev/null +++ b/node_modules/@cucumber/query/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Cucumber Ltd + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/query/dist/src/Lineage.d.ts b/node_modules/@cucumber/query/dist/src/Lineage.d.ts new file mode 100644 index 00000000..0b40690e --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/Lineage.d.ts @@ -0,0 +1,32 @@ +import { Background, Examples, Feature, GherkinDocument, Pickle, Rule, Scenario, TableRow } from '@cucumber/messages'; +export interface Lineage { + gherkinDocument?: GherkinDocument; + feature?: Feature; + background?: Background; + rule?: Rule; + ruleBackground?: Background; + scenario?: Scenario; + examples?: Examples; + examplesIndex?: number; + example?: TableRow; + exampleIndex?: number; +} +export interface LineageReducer { + reduce: (lineage: Lineage, pickle: Pickle) => T; +} +export type NamingStrategy = LineageReducer; +export declare enum NamingStrategyLength { + LONG = "LONG", + SHORT = "SHORT" +} +export declare enum NamingStrategyFeatureName { + INCLUDE = "INCLUDE", + EXCLUDE = "EXCLUDE" +} +export declare enum NamingStrategyExampleName { + NUMBER = "NUMBER", + PICKLE = "PICKLE", + NUMBER_AND_PICKLE_IF_PARAMETERIZED = "NUMBER_AND_PICKLE_IF_PARAMETERIZED" +} +export declare function namingStrategy(length: NamingStrategyLength, featureName?: NamingStrategyFeatureName, exampleName?: NamingStrategyExampleName): NamingStrategy; +//# sourceMappingURL=Lineage.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/Lineage.d.ts.map b/node_modules/@cucumber/query/dist/src/Lineage.d.ts.map new file mode 100644 index 00000000..18d77fcc --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/Lineage.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Lineage.d.ts","sourceRoot":"","sources":["../../src/Lineage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,eAAe,EACf,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,QAAQ,EACT,MAAM,oBAAoB,CAAA;AAE3B,MAAM,WAAW,OAAO;IACtB,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,cAAc,CAAC,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,QAAQ,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC,CAAA;CAChD;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;AAEnD,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,oBAAY,yBAAyB;IACnC,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,oBAAY,yBAAyB;IACnC,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,kCAAkC,uCAAuC;CAC1E;AA8DD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,oBAAoB,EAC5B,WAAW,GAAE,yBAA6D,EAC1E,WAAW,GAAE,yBAAwF,GACpG,cAAc,CAEhB"} \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/Lineage.js b/node_modules/@cucumber/query/dist/src/Lineage.js new file mode 100644 index 00000000..5bd64389 --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/Lineage.js @@ -0,0 +1,78 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NamingStrategyExampleName = exports.NamingStrategyFeatureName = exports.NamingStrategyLength = void 0; +exports.namingStrategy = namingStrategy; +var NamingStrategyLength; +(function (NamingStrategyLength) { + NamingStrategyLength["LONG"] = "LONG"; + NamingStrategyLength["SHORT"] = "SHORT"; +})(NamingStrategyLength || (exports.NamingStrategyLength = NamingStrategyLength = {})); +var NamingStrategyFeatureName; +(function (NamingStrategyFeatureName) { + NamingStrategyFeatureName["INCLUDE"] = "INCLUDE"; + NamingStrategyFeatureName["EXCLUDE"] = "EXCLUDE"; +})(NamingStrategyFeatureName || (exports.NamingStrategyFeatureName = NamingStrategyFeatureName = {})); +var NamingStrategyExampleName; +(function (NamingStrategyExampleName) { + NamingStrategyExampleName["NUMBER"] = "NUMBER"; + NamingStrategyExampleName["PICKLE"] = "PICKLE"; + NamingStrategyExampleName["NUMBER_AND_PICKLE_IF_PARAMETERIZED"] = "NUMBER_AND_PICKLE_IF_PARAMETERIZED"; +})(NamingStrategyExampleName || (exports.NamingStrategyExampleName = NamingStrategyExampleName = {})); +class BuiltinNamingStrategy { + constructor(length, featureName, exampleName) { + this.length = length; + this.featureName = featureName; + this.exampleName = exampleName; + } + reduce(lineage, pickle) { + var _a, _b, _c, _d, _e, _f, _g; + const parts = []; + if (((_a = lineage.feature) === null || _a === void 0 ? void 0 : _a.name) && this.featureName === NamingStrategyFeatureName.INCLUDE) { + parts.push(lineage.feature.name); + } + if ((_b = lineage.rule) === null || _b === void 0 ? void 0 : _b.name) { + parts.push(lineage.rule.name); + } + if ((_c = lineage.scenario) === null || _c === void 0 ? void 0 : _c.name) { + parts.push(lineage.scenario.name); + } + else { + parts.push(pickle.name); + } + if ((_d = lineage.examples) === null || _d === void 0 ? void 0 : _d.name) { + parts.push(lineage.examples.name); + } + if (lineage.example) { + const exampleNumber = [ + '#', + ((_e = lineage.examplesIndex) !== null && _e !== void 0 ? _e : 0) + 1, + '.', + ((_f = lineage.exampleIndex) !== null && _f !== void 0 ? _f : 0) + 1, + ].join(''); + switch (this.exampleName) { + case NamingStrategyExampleName.NUMBER: + parts.push(exampleNumber); + break; + case NamingStrategyExampleName.NUMBER_AND_PICKLE_IF_PARAMETERIZED: + if (((_g = lineage.scenario) === null || _g === void 0 ? void 0 : _g.name) !== pickle.name) { + parts.push(exampleNumber + ': ' + pickle.name); + } + else { + parts.push(exampleNumber); + } + break; + case NamingStrategyExampleName.PICKLE: + parts.push(pickle.name); + break; + } + } + if (this.length === NamingStrategyLength.SHORT) { + return parts.at(-1); + } + return parts.filter((part) => !!part).join(' - '); + } +} +function namingStrategy(length, featureName = NamingStrategyFeatureName.INCLUDE, exampleName = NamingStrategyExampleName.NUMBER_AND_PICKLE_IF_PARAMETERIZED) { + return new BuiltinNamingStrategy(length, featureName, exampleName); +} +//# sourceMappingURL=Lineage.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/Lineage.js.map b/node_modules/@cucumber/query/dist/src/Lineage.js.map new file mode 100644 index 00000000..d05045eb --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/Lineage.js.map @@ -0,0 +1 @@ +{"version":3,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D,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACnD,CAAC;CACF;AAED,SAAgB,cAAc,CAC5B,MAA4B,EAC5B,cAAyC,yBAAyB,CAAC,OAAO,EAC1E,cAAyC,yBAAyB,CAAC,kCAAkC;IAErG,OAAO,IAAI,qBAAqB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;AACpE,CAAC","sourcesContent":["import {\n Background,\n Examples,\n Feature,\n GherkinDocument,\n Pickle,\n Rule,\n Scenario,\n TableRow,\n} from '@cucumber/messages'\n\nexport interface Lineage {\n gherkinDocument?: GherkinDocument\n feature?: Feature\n background?: Background\n rule?: Rule\n ruleBackground?: Background\n scenario?: Scenario\n examples?: Examples\n examplesIndex?: number\n example?: TableRow\n exampleIndex?: number\n}\n\nexport interface LineageReducer {\n reduce: (lineage: Lineage, pickle: Pickle) => T\n}\n\nexport type NamingStrategy = LineageReducer\n\nexport enum NamingStrategyLength {\n LONG = 'LONG',\n SHORT = 'SHORT',\n}\n\nexport enum NamingStrategyFeatureName {\n INCLUDE = 'INCLUDE',\n EXCLUDE = 'EXCLUDE',\n}\n\nexport enum NamingStrategyExampleName {\n NUMBER = 'NUMBER',\n PICKLE = 'PICKLE',\n NUMBER_AND_PICKLE_IF_PARAMETERIZED = 'NUMBER_AND_PICKLE_IF_PARAMETERIZED',\n}\n\nclass BuiltinNamingStrategy implements NamingStrategy {\n constructor(\n private readonly length: NamingStrategyLength,\n private readonly featureName: NamingStrategyFeatureName,\n private readonly exampleName: NamingStrategyExampleName\n ) {}\n\n reduce(lineage: Lineage, pickle: Pickle): string {\n const parts: string[] = []\n\n if (lineage.feature?.name && this.featureName === NamingStrategyFeatureName.INCLUDE) {\n parts.push(lineage.feature.name)\n }\n\n if (lineage.rule?.name) {\n parts.push(lineage.rule.name)\n }\n\n if (lineage.scenario?.name) {\n parts.push(lineage.scenario.name)\n } else {\n parts.push(pickle.name)\n }\n\n if (lineage.examples?.name) {\n parts.push(lineage.examples.name)\n }\n\n if (lineage.example) {\n const exampleNumber = [\n '#',\n (lineage.examplesIndex ?? 0) + 1,\n '.',\n (lineage.exampleIndex ?? 0) + 1,\n ].join('')\n\n switch (this.exampleName) {\n case NamingStrategyExampleName.NUMBER:\n parts.push(exampleNumber)\n break\n case NamingStrategyExampleName.NUMBER_AND_PICKLE_IF_PARAMETERIZED:\n if (lineage.scenario?.name !== pickle.name) {\n parts.push(exampleNumber + ': ' + pickle.name)\n } else {\n parts.push(exampleNumber)\n }\n break\n case NamingStrategyExampleName.PICKLE:\n parts.push(pickle.name)\n break\n }\n }\n\n if (this.length === NamingStrategyLength.SHORT) {\n return parts.at(-1) as string\n }\n return parts.filter((part) => !!part).join(' - ')\n }\n}\n\nexport function namingStrategy(\n length: NamingStrategyLength,\n featureName: NamingStrategyFeatureName = NamingStrategyFeatureName.INCLUDE,\n exampleName: NamingStrategyExampleName = NamingStrategyExampleName.NUMBER_AND_PICKLE_IF_PARAMETERIZED\n): NamingStrategy {\n return new BuiltinNamingStrategy(length, featureName, exampleName)\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/Query.d.ts b/node_modules/@cucumber/query/dist/src/Query.d.ts new file mode 100644 index 00000000..e44c073b --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/Query.d.ts @@ -0,0 +1,84 @@ +import * as messages from '@cucumber/messages'; +import { Attachment, Duration, Hook, Location, Meta, Pickle, PickleStep, Step, StepDefinition, Suggestion, TestCase, TestCaseFinished, TestCaseStarted, TestRunFinished, TestRunHookFinished, TestRunHookStarted, TestRunStarted, TestStep, TestStepFinished, TestStepResult, TestStepResultStatus, TestStepStarted, UndefinedParameterType } from '@cucumber/messages'; +import { Lineage } from './Lineage'; +export default class Query { + private meta; + private testRunStarted; + private testRunFinished; + private readonly testCaseStartedById; + private readonly lineageById; + private readonly stepById; + private readonly pickleById; + private readonly pickleStepById; + private readonly hookById; + private readonly stepDefinitionById; + private readonly testCaseById; + private readonly testStepById; + private readonly testCaseFinishedByTestCaseStartedId; + private readonly testRunHookStartedById; + private readonly testRunHookFinishedByTestRunHookStartedId; + private readonly testStepStartedByTestCaseStartedId; + private readonly testStepFinishedByTestCaseStartedId; + private readonly attachmentsByTestCaseStartedId; + private readonly attachmentsByTestRunHookStartedId; + private readonly suggestionsByPickleStepId; + private readonly undefinedParameterTypes; + update(envelope: messages.Envelope): void; + private updateGherkinDocument; + private updateFeature; + private updateRule; + private updateScenario; + private updateSteps; + private updatePickle; + private updateTestRunHookStarted; + private updateTestRunHookFinished; + private updateTestCase; + private updateTestCaseStarted; + private updateTestStepStarted; + private updateAttachment; + private updateTestStepFinished; + private updateTestCaseFinished; + private updateSuggestion; + private updateUndefinedParameterType; + countMostSevereTestStepResultStatus(): Record; + countTestCasesStarted(): number; + findAllPickles(): ReadonlyArray; + findAllPickleSteps(): ReadonlyArray; + findAllStepDefinitions(): ReadonlyArray; + findAllTestCaseStarted(): ReadonlyArray; + findAllTestCaseFinished(): ReadonlyArray; + findAllTestCaseStartedOrderBy(findOrderBy: (query: Query, testCaseStarted: TestCaseStarted) => T | undefined, order: (a: T, b: T) => number): ReadonlyArray; + findAllTestCaseFinishedOrderBy(findOrderBy: (query: Query, testCaseFinished: TestCaseFinished) => T | undefined, order: (a: T, b: T) => number): ReadonlyArray; + findAllTestSteps(): ReadonlyArray; + findAllTestStepStarted(): ReadonlyArray; + findAllTestStepFinished(): ReadonlyArray; + findAllTestRunHookStarted(): ReadonlyArray; + findAllTestRunHookFinished(): ReadonlyArray; + findAllUndefinedParameterTypes(): ReadonlyArray; + findAttachmentsBy(element: TestStepFinished | TestRunHookFinished): ReadonlyArray; + findHookBy(item: TestStep | TestRunHookStarted | TestRunHookFinished): Hook | undefined; + findMeta(): Meta | undefined; + findMostSevereTestStepResultBy(element: TestCaseStarted | TestCaseFinished): TestStepResult | undefined; + findLocationOf(pickle: Pickle): Location | undefined; + findPickleBy(element: TestCaseStarted | TestCaseFinished | TestStepStarted): Pickle | undefined; + findPickleStepBy(testStep: TestStep): PickleStep | undefined; + findStepBy(pickleStep: PickleStep): Step | undefined; + findStepDefinitionsBy(testStep: TestStep): ReadonlyArray; + findSuggestionsBy(element: PickleStep | Pickle): ReadonlyArray; + findUnambiguousStepDefinitionBy(testStep: TestStep): StepDefinition | undefined; + findTestCaseBy(element: TestCaseStarted | TestCaseFinished | TestStepStarted | TestStepFinished): TestCase | undefined; + findTestCaseDurationBy(element: TestCaseStarted | TestCaseFinished): Duration | undefined; + findTestCaseStartedBy(element: TestCaseFinished | TestStepStarted | TestStepFinished): TestCaseStarted | undefined; + findTestCaseFinishedBy(testCaseStarted: TestCaseStarted): TestCaseFinished | undefined; + findTestRunHookStartedBy(testRunHookFinished: TestRunHookFinished): TestRunHookStarted | undefined; + findTestRunHookFinishedBy(testRunHookStarted: TestRunHookStarted): TestRunHookFinished | undefined; + findTestRunDuration(): Duration | undefined; + findTestRunFinished(): TestRunFinished | undefined; + findTestRunStarted(): TestRunStarted | undefined; + findTestStepBy(element: TestStepStarted | TestStepFinished): TestStep | undefined; + findTestStepsStartedBy(element: TestCaseStarted | TestCaseFinished): ReadonlyArray; + findTestStepsFinishedBy(element: TestCaseStarted | TestCaseFinished): ReadonlyArray; + findTestStepFinishedAndTestStepBy(testCaseStarted: TestCaseStarted): ReadonlyArray<[TestStepFinished, TestStep]>; + findLineageBy(element: Pickle | TestCaseStarted | TestCaseFinished): Lineage | undefined; +} +//# sourceMappingURL=Query.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/Query.d.ts.map b/node_modules/@cucumber/query/dist/src/Query.d.ts.map new file mode 100644 index 00000000..d4683fe7 --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/Query.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../src/Query.ts"],"names":[],"mappings":"AAAA,O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AG,cAAc,GAAG,SAAS;IAO/E,cAAc,CACnB,OAAO,EAAE,eAAe,GAAG,gBAAgB,GAAG,eAAe,GAAG,gBAAgB,GAC/E,QAAQ,GAAG,SAAS;IAOhB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,GAAG,QAAQ,GAAG,SAAS;IAmBzF,qBAAqB,CAC1B,OAAO,EAAE,gBAAgB,GAAG,eAAe,GAAG,gBAAgB,GAC7D,eAAe,GAAG,SAAS;IAIvB,sBAAsB,CAAC,eAAe,EAAE,eAAe,GAAG,gBAAgB,GAAG,SAAS;IAItF,wBAAwB,CAC7B,mBAAmB,EAAE,mBAAmB,GACvC,kBAAkB,GAAG,SAAS;IAI1B,yBAAyB,CAC9B,kBAAkB,EAAE,kBAAkB,GACrC,mBAAmB,GAAG,SAAS;IAI3B,mBAAmB,IAAI,QAAQ,GAAG,SAAS;IAU3C,mBAAmB,IAAI,eAAe,GAAG,SAAS;IAIlD,kBAAkB,IAAI,cAAc,GAAG,SAAS;IAIhD,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,GAAG,QAAQ,GAAG,SAAS;IAIjF,sBAAsB,CAC3B,OAAO,EAAE,eAAe,GAAG,gBAAgB,GAC1C,aAAa,CAAC,eAAe,CAAC;IAO1B,uBAAuB,CAC5B,OAAO,EAAE,eAAe,GAAG,gBAAgB,GAC1C,aAAa,CAAC,gBAAgB,CAAC;IAO3B,iCAAiC,CACtC,eAAe,EAAE,eAAe,GAC/B,aAAa,CAAC,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IAUvC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,gBAAgB,GAAG,OAAO,GAAG,SAAS;CAMhG"} \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/Query.js b/node_modules/@cucumber/query/dist/src/Query.js new file mode 100644 index 00000000..f809f3aa --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/Query.js @@ -0,0 +1,422 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const messages_1 = require("@cucumber/messages"); +const multimaps_1 = require("@teppeis/multimaps"); +const lodash_sortby_1 = __importDefault(require("lodash.sortby")); +const helpers_1 = require("./helpers"); +class Query { + constructor() { + this.testCaseStartedById = new Map(); + this.lineageById = new Map(); + this.stepById = new Map(); + this.pickleById = new Map(); + this.pickleStepById = new Map(); + this.hookById = new Map(); + this.stepDefinitionById = new Map(); + this.testCaseById = new Map(); + this.testStepById = new Map(); + this.testCaseFinishedByTestCaseStartedId = new Map(); + this.testRunHookStartedById = new Map(); + this.testRunHookFinishedByTestRunHookStartedId = new Map(); + this.testStepStartedByTestCaseStartedId = new multimaps_1.ArrayMultimap(); + this.testStepFinishedByTestCaseStartedId = new multimaps_1.ArrayMultimap(); + this.attachmentsByTestCaseStartedId = new multimaps_1.ArrayMultimap(); + this.attachmentsByTestRunHookStartedId = new multimaps_1.ArrayMultimap(); + this.suggestionsByPickleStepId = new multimaps_1.ArrayMultimap(); + this.undefinedParameterTypes = []; + } + update(envelope) { + if (envelope.meta) { + this.meta = envelope.meta; + } + if (envelope.gherkinDocument) { + this.updateGherkinDocument(envelope.gherkinDocument); + } + if (envelope.pickle) { + this.updatePickle(envelope.pickle); + } + if (envelope.hook) { + this.hookById.set(envelope.hook.id, envelope.hook); + } + if (envelope.stepDefinition) { + this.stepDefinitionById.set(envelope.stepDefinition.id, envelope.stepDefinition); + } + if (envelope.testRunStarted) { + this.testRunStarted = envelope.testRunStarted; + } + if (envelope.testRunHookStarted) { + this.updateTestRunHookStarted(envelope.testRunHookStarted); + } + if (envelope.testRunHookFinished) { + this.updateTestRunHookFinished(envelope.testRunHookFinished); + } + if (envelope.testCase) { + this.updateTestCase(envelope.testCase); + } + if (envelope.testCaseStarted) { + this.updateTestCaseStarted(envelope.testCaseStarted); + } + if (envelope.testStepStarted) { + this.updateTestStepStarted(envelope.testStepStarted); + } + if (envelope.attachment) { + this.updateAttachment(envelope.attachment); + } + if (envelope.testStepFinished) { + this.updateTestStepFinished(envelope.testStepFinished); + } + if (envelope.testCaseFinished) { + this.updateTestCaseFinished(envelope.testCaseFinished); + } + if (envelope.testRunFinished) { + this.testRunFinished = envelope.testRunFinished; + } + if (envelope.suggestion) { + this.updateSuggestion(envelope.suggestion); + } + if (envelope.undefinedParameterType) { + this.updateUndefinedParameterType(envelope.undefinedParameterType); + } + } + updateGherkinDocument(gherkinDocument) { + if (gherkinDocument.feature) { + this.updateFeature(gherkinDocument.feature, { + gherkinDocument, + }); + } + } + updateFeature(feature, lineage) { + feature.children.forEach((featureChild) => { + if (featureChild.background) { + lineage.background = featureChild.background; + this.updateSteps(featureChild.background.steps); + } + if (featureChild.scenario) { + this.updateScenario(featureChild.scenario, Object.assign(Object.assign({}, lineage), { feature })); + } + if (featureChild.rule) { + this.updateRule(featureChild.rule, Object.assign(Object.assign({}, lineage), { feature })); + } + }); + } + updateRule(rule, lineage) { + rule.children.forEach((ruleChild) => { + if (ruleChild.background) { + lineage.ruleBackground = ruleChild.background; + this.updateSteps(ruleChild.background.steps); + } + if (ruleChild.scenario) { + this.updateScenario(ruleChild.scenario, Object.assign(Object.assign({}, lineage), { rule })); + } + }); + } + updateScenario(scenario, lineage) { + this.lineageById.set(scenario.id, Object.assign(Object.assign({}, lineage), { scenario })); + scenario.examples.forEach((examples, examplesIndex) => { + this.lineageById.set(examples.id, Object.assign(Object.assign({}, lineage), { scenario, + examples, + examplesIndex })); + examples.tableBody.forEach((example, exampleIndex) => { + this.lineageById.set(example.id, Object.assign(Object.assign({}, lineage), { scenario, + examples, + examplesIndex, + example, + exampleIndex })); + }); + }); + this.updateSteps(scenario.steps); + } + updateSteps(steps) { + steps.forEach((step) => this.stepById.set(step.id, step)); + } + updatePickle(pickle) { + this.pickleById.set(pickle.id, pickle); + pickle.steps.forEach((pickleStep) => this.pickleStepById.set(pickleStep.id, pickleStep)); + } + updateTestRunHookStarted(testRunHookStarted) { + this.testRunHookStartedById.set(testRunHookStarted.id, testRunHookStarted); + } + updateTestRunHookFinished(testRunHookFinished) { + this.testRunHookFinishedByTestRunHookStartedId.set(testRunHookFinished.testRunHookStartedId, testRunHookFinished); + } + updateTestCase(testCase) { + this.testCaseById.set(testCase.id, testCase); + testCase.testSteps.forEach((testStep) => { + this.testStepById.set(testStep.id, testStep); + }); + } + updateTestCaseStarted(testCaseStarted) { + this.testCaseStartedById.set(testCaseStarted.id, testCaseStarted); + } + updateTestStepStarted(testStepStarted) { + this.testStepStartedByTestCaseStartedId.put(testStepStarted.testCaseStartedId, testStepStarted); + } + updateAttachment(attachment) { + if (attachment.testCaseStartedId) { + this.attachmentsByTestCaseStartedId.put(attachment.testCaseStartedId, attachment); + } + if (attachment.testRunHookStartedId) { + this.attachmentsByTestRunHookStartedId.put(attachment.testRunHookStartedId, attachment); + } + } + updateTestStepFinished(testStepFinished) { + this.testStepFinishedByTestCaseStartedId.put(testStepFinished.testCaseStartedId, testStepFinished); + } + updateTestCaseFinished(testCaseFinished) { + this.testCaseFinishedByTestCaseStartedId.set(testCaseFinished.testCaseStartedId, testCaseFinished); + } + updateSuggestion(suggestion) { + this.suggestionsByPickleStepId.put(suggestion.pickleStepId, suggestion); + } + updateUndefinedParameterType(undefinedParameterType) { + this.undefinedParameterTypes.push(undefinedParameterType); + } + countMostSevereTestStepResultStatus() { + const result = { + [messages_1.TestStepResultStatus.AMBIGUOUS]: 0, + [messages_1.TestStepResultStatus.FAILED]: 0, + [messages_1.TestStepResultStatus.PASSED]: 0, + [messages_1.TestStepResultStatus.PENDING]: 0, + [messages_1.TestStepResultStatus.SKIPPED]: 0, + [messages_1.TestStepResultStatus.UNDEFINED]: 0, + [messages_1.TestStepResultStatus.UNKNOWN]: 0, + }; + for (const testCaseStarted of this.findAllTestCaseStarted()) { + const mostSevereResult = (0, lodash_sortby_1.default)(this.findTestStepFinishedAndTestStepBy(testCaseStarted).map(([testStepFinished]) => testStepFinished.testStepResult), [(testStepResult) => (0, helpers_1.statusOrdinal)(testStepResult.status)]).at(-1); + if (mostSevereResult) { + result[mostSevereResult.status]++; + } + } + return result; + } + countTestCasesStarted() { + return this.findAllTestCaseStarted().length; + } + findAllPickles() { + return [...this.pickleById.values()]; + } + findAllPickleSteps() { + return [...this.pickleStepById.values()]; + } + findAllStepDefinitions() { + return [...this.stepDefinitionById.values()]; + } + findAllTestCaseStarted() { + return (0, lodash_sortby_1.default)([...this.testCaseStartedById.values()].filter((testCaseStarted) => { + const testCaseFinished = this.testCaseFinishedByTestCaseStartedId.get(testCaseStarted.id); + // only include if not yet finished OR won't be retried + return !(testCaseFinished === null || testCaseFinished === void 0 ? void 0 : testCaseFinished.willBeRetried); + }), [ + (testCaseStarted) => messages_1.TimeConversion.timestampToMillisecondsSinceEpoch(testCaseStarted.timestamp), + 'id', + ]); + } + findAllTestCaseFinished() { + return (0, lodash_sortby_1.default)([...this.testCaseFinishedByTestCaseStartedId.values()].filter((testCaseFinished) => { + // only include if not yet finished OR won't be retried + return !(testCaseFinished === null || testCaseFinished === void 0 ? void 0 : testCaseFinished.willBeRetried); + }), [ + (testCaseFinished) => messages_1.TimeConversion.timestampToMillisecondsSinceEpoch(testCaseFinished.timestamp), + 'id', + ]); + } + findAllTestCaseStartedOrderBy(findOrderBy, order) { + const withOrderBy = this.findAllTestCaseStarted().map((testCaseStarted) => ({ + testCaseStarted, + orderBy: findOrderBy(this, testCaseStarted), + })); + const sorted = withOrderBy.sort((a, b) => { + if (a.orderBy === undefined && b.orderBy === undefined) + return 0; + if (a.orderBy === undefined) + return 1; + if (b.orderBy === undefined) + return -1; + return order(a.orderBy, b.orderBy); + }); + return sorted.map((item) => item.testCaseStarted); + } + findAllTestCaseFinishedOrderBy(findOrderBy, order) { + const withOrderBy = this.findAllTestCaseFinished().map((testCaseFinished) => ({ + testCaseFinished, + orderBy: findOrderBy(this, testCaseFinished), + })); + const sorted = withOrderBy.sort((a, b) => { + if (a.orderBy === undefined && b.orderBy === undefined) + return 0; + if (a.orderBy === undefined) + return 1; + if (b.orderBy === undefined) + return -1; + return order(a.orderBy, b.orderBy); + }); + return sorted.map((item) => item.testCaseFinished); + } + findAllTestSteps() { + return [...this.testStepById.values()]; + } + findAllTestStepStarted() { + return [...this.testStepStartedByTestCaseStartedId.values()]; + } + findAllTestStepFinished() { + return [...this.testStepFinishedByTestCaseStartedId.values()]; + } + findAllTestRunHookStarted() { + return [...this.testRunHookStartedById.values()]; + } + findAllTestRunHookFinished() { + return [...this.testRunHookFinishedByTestRunHookStartedId.values()]; + } + findAllUndefinedParameterTypes() { + return [...this.undefinedParameterTypes]; + } + findAttachmentsBy(element) { + if ('testStepId' in element) { + return this.attachmentsByTestCaseStartedId + .get(element.testCaseStartedId) + .filter((attachment) => attachment.testStepId === element.testStepId); + } + else { + return this.attachmentsByTestRunHookStartedId.get(element.testRunHookStartedId); + } + } + findHookBy(item) { + if ('testRunHookStartedId' in item) { + const testRunHookStarted = this.findTestRunHookStartedBy(item); + helpers_1.assert.ok(testRunHookStarted, 'Expected to find TestRunHookStarted from TestRunHookFinished'); + return this.findHookBy(testRunHookStarted); + } + if (!item.hookId) { + return undefined; + } + return this.hookById.get(item.hookId); + } + findMeta() { + return this.meta; + } + findMostSevereTestStepResultBy(element) { + const testCaseStarted = 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element; + return (0, lodash_sortby_1.default)(this.findTestStepFinishedAndTestStepBy(testCaseStarted).map(([testStepFinished]) => testStepFinished.testStepResult), [(testStepResult) => (0, helpers_1.statusOrdinal)(testStepResult.status)]).at(-1); + } + findLocationOf(pickle) { + var _a; + const lineage = this.findLineageBy(pickle); + if (lineage === null || lineage === void 0 ? void 0 : lineage.example) { + return lineage.example.location; + } + return (_a = lineage === null || lineage === void 0 ? void 0 : lineage.scenario) === null || _a === void 0 ? void 0 : _a.location; + } + findPickleBy(element) { + const testCase = this.findTestCaseBy(element); + helpers_1.assert.ok(testCase, 'Expected to find TestCase from TestCaseStarted'); + return this.pickleById.get(testCase.pickleId); + } + findPickleStepBy(testStep) { + if (!testStep.pickleStepId) { + return undefined; + } + return this.pickleStepById.get(testStep.pickleStepId); + } + findStepBy(pickleStep) { + const [astNodeId] = pickleStep.astNodeIds; + helpers_1.assert.ok(astNodeId, 'Expected PickleStep to have an astNodeId'); + return this.stepById.get(astNodeId); + } + findStepDefinitionsBy(testStep) { + var _a; + return ((_a = testStep.stepDefinitionIds) !== null && _a !== void 0 ? _a : []).map((id) => this.stepDefinitionById.get(id)); + } + findSuggestionsBy(element) { + if ('steps' in element) { + return element.steps.flatMap((value) => this.findSuggestionsBy(value)); + } + return this.suggestionsByPickleStepId.get(element.id); + } + findUnambiguousStepDefinitionBy(testStep) { + var _a; + if (((_a = testStep.stepDefinitionIds) === null || _a === void 0 ? void 0 : _a.length) === 1) { + return this.stepDefinitionById.get(testStep.stepDefinitionIds[0]); + } + return undefined; + } + findTestCaseBy(element) { + const testCaseStarted = 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element; + helpers_1.assert.ok(testCaseStarted, 'Expected to find TestCaseStarted by TestStepStarted'); + return this.testCaseById.get(testCaseStarted.testCaseId); + } + findTestCaseDurationBy(element) { + let testCaseStarted; + let testCaseFinished; + if ('testCaseStartedId' in element) { + testCaseStarted = this.findTestCaseStartedBy(element); + testCaseFinished = element; + } + else { + testCaseStarted = element; + testCaseFinished = this.findTestCaseFinishedBy(element); + } + if (!testCaseFinished) { + return undefined; + } + return messages_1.TimeConversion.millisecondsToDuration(messages_1.TimeConversion.timestampToMillisecondsSinceEpoch(testCaseFinished.timestamp) - + messages_1.TimeConversion.timestampToMillisecondsSinceEpoch(testCaseStarted.timestamp)); + } + findTestCaseStartedBy(element) { + return this.testCaseStartedById.get(element.testCaseStartedId); + } + findTestCaseFinishedBy(testCaseStarted) { + return this.testCaseFinishedByTestCaseStartedId.get(testCaseStarted.id); + } + findTestRunHookStartedBy(testRunHookFinished) { + return this.testRunHookStartedById.get(testRunHookFinished.testRunHookStartedId); + } + findTestRunHookFinishedBy(testRunHookStarted) { + return this.testRunHookFinishedByTestRunHookStartedId.get(testRunHookStarted.id); + } + findTestRunDuration() { + if (!this.testRunStarted || !this.testRunFinished) { + return undefined; + } + return messages_1.TimeConversion.millisecondsToDuration(messages_1.TimeConversion.timestampToMillisecondsSinceEpoch(this.testRunFinished.timestamp) - + messages_1.TimeConversion.timestampToMillisecondsSinceEpoch(this.testRunStarted.timestamp)); + } + findTestRunFinished() { + return this.testRunFinished; + } + findTestRunStarted() { + return this.testRunStarted; + } + findTestStepBy(element) { + return this.testStepById.get(element.testStepId); + } + findTestStepsStartedBy(element) { + const testCaseStartedId = 'testCaseStartedId' in element ? element.testCaseStartedId : element.id; + // multimaps `get` implements `getOrDefault([])` behaviour internally + return [...this.testStepStartedByTestCaseStartedId.get(testCaseStartedId)]; + } + findTestStepsFinishedBy(element) { + const testCaseStarted = 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element; + // multimaps `get` implements `getOrDefault([])` behaviour internally + return [...this.testStepFinishedByTestCaseStartedId.get(testCaseStarted.id)]; + } + findTestStepFinishedAndTestStepBy(testCaseStarted) { + return this.testStepFinishedByTestCaseStartedId + .get(testCaseStarted.id) + .map((testStepFinished) => { + const testStep = this.findTestStepBy(testStepFinished); + helpers_1.assert.ok(testStep, 'Expected to find TestStep by TestStepFinished'); + return [testStepFinished, testStep]; + }); + } + findLineageBy(element) { + const pickle = 'astNodeIds' in element ? element : this.findPickleBy(element); + const deepestAstNodeId = pickle.astNodeIds.at(-1); + helpers_1.assert.ok(deepestAstNodeId, 'Expected Pickle to have at least one astNodeId'); + return this.lineageById.get(deepestAstNodeId); + } +} +exports.default = Query; +//# sourceMappingURL=Query.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/Query.js.map b/node_modules/@cucumber/query/dist/src/Query.js.map new file mode 100644 index 00000000..9bd64d32 --- /dev/null +++ b/node_modules/@cucumber/query/dist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AC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9E,CAAC;IAEM,iCAAiC,CACtC,eAAgC;QAEhC,OAAO,IAAI,CAAC,mCAAmC;aAC5C,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;aACvB,GAAG,CAAC,CAAC,gBAAgB,EAAE,EAAE;YACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAA;YACtD,gBAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,+CAA+C,CAAC,CAAA;YACpE,OAAO,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAA;QACrC,CAAC,CAAC,CAAA;IACN,CAAC;IAEM,aAAa,CAAC,OAAoD;QACvE,MAAM,MAAM,GAAG,YAAY,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;QAC7E,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;QACjD,gBAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,gDAAgD,CAAC,CAAA;QAC7E,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAC/C,CAAC;CACF;AAliBD,wBAkiBC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport {\n Attachment,\n Duration,\n Feature,\n GherkinDocument,\n Hook,\n Location,\n Meta,\n Pickle,\n PickleStep,\n Rule,\n Scenario,\n Step,\n StepDefinition,\n Suggestion,\n TestCase,\n TestCaseFinished,\n TestCaseStarted,\n TestRunFinished,\n TestRunHookFinished,\n TestRunHookStarted,\n TestRunStarted,\n TestStep,\n TestStepFinished,\n TestStepResult,\n TestStepResultStatus,\n TestStepStarted,\n TimeConversion,\n UndefinedParameterType,\n} from '@cucumber/messages'\nimport { ArrayMultimap } from '@teppeis/multimaps'\nimport sortBy from 'lodash.sortby'\n\nimport { assert, statusOrdinal } from './helpers'\nimport { Lineage } from './Lineage'\n\nexport default class Query {\n private meta: Meta\n private testRunStarted: TestRunStarted\n private testRunFinished: TestRunFinished\n private readonly testCaseStartedById: Map = new Map()\n private readonly lineageById: Map = new Map()\n private readonly stepById: Map = new Map()\n private readonly pickleById: Map = new Map()\n private readonly pickleStepById: Map = new Map()\n private readonly hookById: Map = new Map()\n private readonly stepDefinitionById: Map = new Map()\n private readonly testCaseById: Map = new Map()\n private readonly testStepById: Map = new Map()\n private readonly testCaseFinishedByTestCaseStartedId: Map = new Map()\n private readonly testRunHookStartedById: Map = new Map()\n private readonly testRunHookFinishedByTestRunHookStartedId: Map =\n new Map()\n private readonly testStepStartedByTestCaseStartedId: ArrayMultimap =\n new ArrayMultimap()\n private readonly testStepFinishedByTestCaseStartedId: ArrayMultimap =\n new ArrayMultimap()\n private readonly attachmentsByTestCaseStartedId: ArrayMultimap =\n new ArrayMultimap()\n private readonly attachmentsByTestRunHookStartedId: ArrayMultimap =\n new ArrayMultimap()\n private readonly suggestionsByPickleStepId: ArrayMultimap =\n new ArrayMultimap()\n private readonly undefinedParameterTypes: UndefinedParameterType[] = []\n\n public update(envelope: messages.Envelope) {\n if (envelope.meta) {\n this.meta = envelope.meta\n }\n if (envelope.gherkinDocument) {\n this.updateGherkinDocument(envelope.gherkinDocument)\n }\n if (envelope.pickle) {\n this.updatePickle(envelope.pickle)\n }\n if (envelope.hook) {\n this.hookById.set(envelope.hook.id, envelope.hook)\n }\n if (envelope.stepDefinition) {\n this.stepDefinitionById.set(envelope.stepDefinition.id, envelope.stepDefinition)\n }\n if (envelope.testRunStarted) {\n this.testRunStarted = envelope.testRunStarted\n }\n if (envelope.testRunHookStarted) {\n this.updateTestRunHookStarted(envelope.testRunHookStarted)\n }\n if (envelope.testRunHookFinished) {\n this.updateTestRunHookFinished(envelope.testRunHookFinished)\n }\n if (envelope.testCase) {\n this.updateTestCase(envelope.testCase)\n }\n if (envelope.testCaseStarted) {\n this.updateTestCaseStarted(envelope.testCaseStarted)\n }\n if (envelope.testStepStarted) {\n this.updateTestStepStarted(envelope.testStepStarted)\n }\n if (envelope.attachment) {\n this.updateAttachment(envelope.attachment)\n }\n if (envelope.testStepFinished) {\n this.updateTestStepFinished(envelope.testStepFinished)\n }\n if (envelope.testCaseFinished) {\n this.updateTestCaseFinished(envelope.testCaseFinished)\n }\n if (envelope.testRunFinished) {\n this.testRunFinished = envelope.testRunFinished\n }\n if (envelope.suggestion) {\n this.updateSuggestion(envelope.suggestion)\n }\n if (envelope.undefinedParameterType) {\n this.updateUndefinedParameterType(envelope.undefinedParameterType)\n }\n }\n\n private updateGherkinDocument(gherkinDocument: GherkinDocument) {\n if (gherkinDocument.feature) {\n this.updateFeature(gherkinDocument.feature, {\n gherkinDocument,\n })\n }\n }\n\n private updateFeature(feature: Feature, lineage: Lineage) {\n feature.children.forEach((featureChild) => {\n if (featureChild.background) {\n lineage.background = featureChild.background\n this.updateSteps(featureChild.background.steps)\n }\n if (featureChild.scenario) {\n this.updateScenario(featureChild.scenario, {\n ...lineage,\n feature,\n })\n }\n if (featureChild.rule) {\n this.updateRule(featureChild.rule, {\n ...lineage,\n feature,\n })\n }\n })\n }\n\n private updateRule(rule: Rule, lineage: Lineage) {\n rule.children.forEach((ruleChild) => {\n if (ruleChild.background) {\n lineage.ruleBackground = ruleChild.background\n this.updateSteps(ruleChild.background.steps)\n }\n if (ruleChild.scenario) {\n this.updateScenario(ruleChild.scenario, {\n ...lineage,\n rule,\n })\n }\n })\n }\n\n private updateScenario(scenario: Scenario, lineage: Lineage) {\n this.lineageById.set(scenario.id, {\n ...lineage,\n scenario,\n })\n scenario.examples.forEach((examples, examplesIndex) => {\n this.lineageById.set(examples.id, {\n ...lineage,\n scenario,\n examples,\n examplesIndex,\n })\n examples.tableBody.forEach((example, exampleIndex) => {\n this.lineageById.set(example.id, {\n ...lineage,\n scenario,\n examples,\n examplesIndex,\n example,\n exampleIndex,\n })\n })\n })\n this.updateSteps(scenario.steps)\n }\n\n private updateSteps(steps: ReadonlyArray) {\n steps.forEach((step) => this.stepById.set(step.id, step))\n }\n\n private updatePickle(pickle: Pickle) {\n this.pickleById.set(pickle.id, pickle)\n pickle.steps.forEach((pickleStep) => this.pickleStepById.set(pickleStep.id, pickleStep))\n }\n\n private updateTestRunHookStarted(testRunHookStarted: TestRunHookStarted) {\n this.testRunHookStartedById.set(testRunHookStarted.id, testRunHookStarted)\n }\n\n private updateTestRunHookFinished(testRunHookFinished: TestRunHookFinished) {\n this.testRunHookFinishedByTestRunHookStartedId.set(\n testRunHookFinished.testRunHookStartedId,\n testRunHookFinished\n )\n }\n\n private updateTestCase(testCase: TestCase) {\n this.testCaseById.set(testCase.id, testCase)\n testCase.testSteps.forEach((testStep) => {\n this.testStepById.set(testStep.id, testStep)\n })\n }\n\n private updateTestCaseStarted(testCaseStarted: TestCaseStarted) {\n this.testCaseStartedById.set(testCaseStarted.id, testCaseStarted)\n }\n\n private updateTestStepStarted(testStepStarted: TestStepStarted) {\n this.testStepStartedByTestCaseStartedId.put(testStepStarted.testCaseStartedId, testStepStarted)\n }\n\n private updateAttachment(attachment: Attachment) {\n if (attachment.testCaseStartedId) {\n this.attachmentsByTestCaseStartedId.put(attachment.testCaseStartedId, attachment)\n }\n if (attachment.testRunHookStartedId) {\n this.attachmentsByTestRunHookStartedId.put(attachment.testRunHookStartedId, attachment)\n }\n }\n\n private updateTestStepFinished(testStepFinished: TestStepFinished) {\n this.testStepFinishedByTestCaseStartedId.put(\n testStepFinished.testCaseStartedId,\n testStepFinished\n )\n }\n\n private updateTestCaseFinished(testCaseFinished: TestCaseFinished) {\n this.testCaseFinishedByTestCaseStartedId.set(\n testCaseFinished.testCaseStartedId,\n testCaseFinished\n )\n }\n\n private updateSuggestion(suggestion: Suggestion) {\n this.suggestionsByPickleStepId.put(suggestion.pickleStepId, suggestion)\n }\n\n private updateUndefinedParameterType(undefinedParameterType: UndefinedParameterType) {\n this.undefinedParameterTypes.push(undefinedParameterType)\n }\n\n public countMostSevereTestStepResultStatus(): Record {\n const result: Record = {\n [TestStepResultStatus.AMBIGUOUS]: 0,\n [TestStepResultStatus.FAILED]: 0,\n [TestStepResultStatus.PASSED]: 0,\n [TestStepResultStatus.PENDING]: 0,\n [TestStepResultStatus.SKIPPED]: 0,\n [TestStepResultStatus.UNDEFINED]: 0,\n [TestStepResultStatus.UNKNOWN]: 0,\n }\n for (const testCaseStarted of this.findAllTestCaseStarted()) {\n const mostSevereResult = sortBy(\n this.findTestStepFinishedAndTestStepBy(testCaseStarted).map(\n ([testStepFinished]) => testStepFinished.testStepResult\n ),\n [(testStepResult) => statusOrdinal(testStepResult.status)]\n ).at(-1)\n if (mostSevereResult) {\n result[mostSevereResult.status]++\n }\n }\n return result\n }\n\n public countTestCasesStarted(): number {\n return this.findAllTestCaseStarted().length\n }\n\n public findAllPickles(): ReadonlyArray {\n return [...this.pickleById.values()]\n }\n\n public findAllPickleSteps(): ReadonlyArray {\n return [...this.pickleStepById.values()]\n }\n\n public findAllStepDefinitions(): ReadonlyArray {\n return [...this.stepDefinitionById.values()]\n }\n\n public findAllTestCaseStarted(): ReadonlyArray {\n return sortBy(\n [...this.testCaseStartedById.values()].filter((testCaseStarted) => {\n const testCaseFinished = this.testCaseFinishedByTestCaseStartedId.get(testCaseStarted.id)\n // only include if not yet finished OR won't be retried\n return !testCaseFinished?.willBeRetried\n }),\n [\n (testCaseStarted) =>\n TimeConversion.timestampToMillisecondsSinceEpoch(testCaseStarted.timestamp),\n 'id',\n ]\n )\n }\n\n public findAllTestCaseFinished(): ReadonlyArray {\n return sortBy(\n [...this.testCaseFinishedByTestCaseStartedId.values()].filter((testCaseFinished) => {\n // only include if not yet finished OR won't be retried\n return !testCaseFinished?.willBeRetried\n }),\n [\n (testCaseFinished) =>\n TimeConversion.timestampToMillisecondsSinceEpoch(testCaseFinished.timestamp),\n 'id',\n ]\n )\n }\n\n public findAllTestCaseStartedOrderBy(\n findOrderBy: (query: Query, testCaseStarted: TestCaseStarted) => T | undefined,\n order: (a: T, b: T) => number\n ): ReadonlyArray {\n const withOrderBy = this.findAllTestCaseStarted().map((testCaseStarted) => ({\n testCaseStarted,\n orderBy: findOrderBy(this, testCaseStarted),\n }))\n\n const sorted = withOrderBy.sort((a, b) => {\n if (a.orderBy === undefined && b.orderBy === undefined) return 0\n if (a.orderBy === undefined) return 1\n if (b.orderBy === undefined) return -1\n return order(a.orderBy, b.orderBy)\n })\n\n return sorted.map((item) => item.testCaseStarted)\n }\n\n public findAllTestCaseFinishedOrderBy(\n findOrderBy: (query: Query, testCaseFinished: TestCaseFinished) => T | undefined,\n order: (a: T, b: T) => number\n ): ReadonlyArray {\n const withOrderBy = this.findAllTestCaseFinished().map((testCaseFinished) => ({\n testCaseFinished,\n orderBy: findOrderBy(this, testCaseFinished),\n }))\n\n const sorted = withOrderBy.sort((a, b) => {\n if (a.orderBy === undefined && b.orderBy === undefined) return 0\n if (a.orderBy === undefined) return 1\n if (b.orderBy === undefined) return -1\n return order(a.orderBy, b.orderBy)\n })\n\n return sorted.map((item) => item.testCaseFinished)\n }\n\n public findAllTestSteps(): ReadonlyArray {\n return [...this.testStepById.values()]\n }\n\n public findAllTestStepStarted(): ReadonlyArray {\n return [...this.testStepStartedByTestCaseStartedId.values()]\n }\n\n public findAllTestStepFinished(): ReadonlyArray {\n return [...this.testStepFinishedByTestCaseStartedId.values()]\n }\n\n public findAllTestRunHookStarted(): ReadonlyArray {\n return [...this.testRunHookStartedById.values()]\n }\n\n public findAllTestRunHookFinished(): ReadonlyArray {\n return [...this.testRunHookFinishedByTestRunHookStartedId.values()]\n }\n\n public findAllUndefinedParameterTypes(): ReadonlyArray {\n return [...this.undefinedParameterTypes]\n }\n\n public findAttachmentsBy(\n element: TestStepFinished | TestRunHookFinished\n ): ReadonlyArray {\n if ('testStepId' in element) {\n return this.attachmentsByTestCaseStartedId\n .get(element.testCaseStartedId)\n .filter((attachment) => attachment.testStepId === element.testStepId)\n } else {\n return this.attachmentsByTestRunHookStartedId.get(element.testRunHookStartedId)\n }\n }\n\n public findHookBy(item: TestStep | TestRunHookStarted | TestRunHookFinished): Hook | undefined {\n if ('testRunHookStartedId' in item) {\n const testRunHookStarted = this.findTestRunHookStartedBy(item)\n assert.ok(testRunHookStarted, 'Expected to find TestRunHookStarted from TestRunHookFinished')\n return this.findHookBy(testRunHookStarted)\n }\n if (!item.hookId) {\n return undefined\n }\n return this.hookById.get(item.hookId)\n }\n\n public findMeta(): Meta | undefined {\n return this.meta\n }\n\n public findMostSevereTestStepResultBy(\n element: TestCaseStarted | TestCaseFinished\n ): TestStepResult | undefined {\n const testCaseStarted =\n 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element\n return sortBy(\n this.findTestStepFinishedAndTestStepBy(testCaseStarted).map(\n ([testStepFinished]) => testStepFinished.testStepResult\n ),\n [(testStepResult) => statusOrdinal(testStepResult.status)]\n ).at(-1)\n }\n\n public findLocationOf(pickle: Pickle): Location | undefined {\n const lineage = this.findLineageBy(pickle)\n if (lineage?.example) {\n return lineage.example.location\n }\n return lineage?.scenario?.location\n }\n\n public findPickleBy(\n element: TestCaseStarted | TestCaseFinished | TestStepStarted\n ): Pickle | undefined {\n const testCase = this.findTestCaseBy(element)\n assert.ok(testCase, 'Expected to find TestCase from TestCaseStarted')\n return this.pickleById.get(testCase.pickleId)\n }\n\n public findPickleStepBy(testStep: TestStep): PickleStep | undefined {\n if (!testStep.pickleStepId) {\n return undefined\n }\n return this.pickleStepById.get(testStep.pickleStepId)\n }\n\n public findStepBy(pickleStep: PickleStep): Step | undefined {\n const [astNodeId] = pickleStep.astNodeIds\n assert.ok(astNodeId, 'Expected PickleStep to have an astNodeId')\n return this.stepById.get(astNodeId)\n }\n\n public findStepDefinitionsBy(testStep: TestStep): ReadonlyArray {\n return (testStep.stepDefinitionIds ?? []).map((id) => this.stepDefinitionById.get(id))\n }\n\n findSuggestionsBy(element: PickleStep | Pickle): ReadonlyArray {\n if ('steps' in element) {\n return element.steps.flatMap((value) => this.findSuggestionsBy(value))\n }\n return this.suggestionsByPickleStepId.get(element.id)\n }\n\n public findUnambiguousStepDefinitionBy(testStep: TestStep): StepDefinition | undefined {\n if (testStep.stepDefinitionIds?.length === 1) {\n return this.stepDefinitionById.get(testStep.stepDefinitionIds[0])\n }\n return undefined\n }\n\n public findTestCaseBy(\n element: TestCaseStarted | TestCaseFinished | TestStepStarted | TestStepFinished\n ): TestCase | undefined {\n const testCaseStarted =\n 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element\n assert.ok(testCaseStarted, 'Expected to find TestCaseStarted by TestStepStarted')\n return this.testCaseById.get(testCaseStarted.testCaseId)\n }\n\n public findTestCaseDurationBy(element: TestCaseStarted | TestCaseFinished): Duration | undefined {\n let testCaseStarted: TestCaseStarted\n let testCaseFinished: TestCaseFinished\n if ('testCaseStartedId' in element) {\n testCaseStarted = this.findTestCaseStartedBy(element)\n testCaseFinished = element\n } else {\n testCaseStarted = element\n testCaseFinished = this.findTestCaseFinishedBy(element)\n }\n if (!testCaseFinished) {\n return undefined\n }\n return TimeConversion.millisecondsToDuration(\n TimeConversion.timestampToMillisecondsSinceEpoch(testCaseFinished.timestamp) -\n TimeConversion.timestampToMillisecondsSinceEpoch(testCaseStarted.timestamp)\n )\n }\n\n public findTestCaseStartedBy(\n element: TestCaseFinished | TestStepStarted | TestStepFinished\n ): TestCaseStarted | undefined {\n return this.testCaseStartedById.get(element.testCaseStartedId)\n }\n\n public findTestCaseFinishedBy(testCaseStarted: TestCaseStarted): TestCaseFinished | undefined {\n return this.testCaseFinishedByTestCaseStartedId.get(testCaseStarted.id)\n }\n\n public findTestRunHookStartedBy(\n testRunHookFinished: TestRunHookFinished\n ): TestRunHookStarted | undefined {\n return this.testRunHookStartedById.get(testRunHookFinished.testRunHookStartedId)\n }\n\n public findTestRunHookFinishedBy(\n testRunHookStarted: TestRunHookStarted\n ): TestRunHookFinished | undefined {\n return this.testRunHookFinishedByTestRunHookStartedId.get(testRunHookStarted.id)\n }\n\n public findTestRunDuration(): Duration | undefined {\n if (!this.testRunStarted || !this.testRunFinished) {\n return undefined\n }\n return TimeConversion.millisecondsToDuration(\n TimeConversion.timestampToMillisecondsSinceEpoch(this.testRunFinished.timestamp) -\n TimeConversion.timestampToMillisecondsSinceEpoch(this.testRunStarted.timestamp)\n )\n }\n\n public findTestRunFinished(): TestRunFinished | undefined {\n return this.testRunFinished\n }\n\n public findTestRunStarted(): TestRunStarted | undefined {\n return this.testRunStarted\n }\n\n public findTestStepBy(element: TestStepStarted | TestStepFinished): TestStep | undefined {\n return this.testStepById.get(element.testStepId)\n }\n\n public findTestStepsStartedBy(\n element: TestCaseStarted | TestCaseFinished\n ): ReadonlyArray {\n const testCaseStartedId =\n 'testCaseStartedId' in element ? element.testCaseStartedId : element.id\n // multimaps `get` implements `getOrDefault([])` behaviour internally\n return [...this.testStepStartedByTestCaseStartedId.get(testCaseStartedId)]\n }\n\n public findTestStepsFinishedBy(\n element: TestCaseStarted | TestCaseFinished\n ): ReadonlyArray {\n const testCaseStarted =\n 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element\n // multimaps `get` implements `getOrDefault([])` behaviour internally\n return [...this.testStepFinishedByTestCaseStartedId.get(testCaseStarted.id)]\n }\n\n public findTestStepFinishedAndTestStepBy(\n testCaseStarted: TestCaseStarted\n ): ReadonlyArray<[TestStepFinished, TestStep]> {\n return this.testStepFinishedByTestCaseStartedId\n .get(testCaseStarted.id)\n .map((testStepFinished) => {\n const testStep = this.findTestStepBy(testStepFinished)\n assert.ok(testStep, 'Expected to find TestStep by TestStepFinished')\n return [testStepFinished, testStep]\n })\n }\n\n public findLineageBy(element: Pickle | TestCaseStarted | TestCaseFinished): Lineage | undefined {\n const pickle = 'astNodeIds' in element ? element : this.findPickleBy(element)\n const deepestAstNodeId = pickle.astNodeIds.at(-1)\n assert.ok(deepestAstNodeId, 'Expected Pickle to have at least one astNodeId')\n return this.lineageById.get(deepestAstNodeId)\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/helpers.d.ts b/node_modules/@cucumber/query/dist/src/helpers.d.ts new file mode 100644 index 00000000..60a49482 --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/helpers.d.ts @@ -0,0 +1,6 @@ +import { TestStepResultStatus } from '@cucumber/messages'; +export declare function statusOrdinal(status: TestStepResultStatus): number; +export declare const assert: { + ok(target: unknown, message: string): void; +}; +//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/helpers.d.ts.map b/node_modules/@cucumber/query/dist/src/helpers.d.ts.map new file mode 100644 index 00000000..703195f9 --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/helpers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAEzD,wBAAgB,aAAa,CAAC,MAAM,EAAE,oBAAoB,UAUzD;AAED,eAAO,MAAM,MAAM;eACN,OAAO,WAAW,MAAM;CAKpC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/helpers.js b/node_modules/@cucumber/query/dist/src/helpers.js new file mode 100644 index 00000000..bb7bc3f4 --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/helpers.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assert = void 0; +exports.statusOrdinal = statusOrdinal; +const messages_1 = require("@cucumber/messages"); +function statusOrdinal(status) { + return [ + messages_1.TestStepResultStatus.UNKNOWN, + messages_1.TestStepResultStatus.PASSED, + messages_1.TestStepResultStatus.SKIPPED, + messages_1.TestStepResultStatus.PENDING, + messages_1.TestStepResultStatus.UNDEFINED, + messages_1.TestStepResultStatus.AMBIGUOUS, + messages_1.TestStepResultStatus.FAILED, + ].indexOf(status); +} +exports.assert = { + ok(target, message) { + if (!target) { + throw new Error(message); + } + }, +}; +//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/helpers.js.map b/node_modules/@cucumber/query/dist/src/helpers.js.map new file mode 100644 index 00000000..a830224f --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;;AAEA,sCAUC;AAZD,iDAAyD;AAEzD,SAAgB,aAAa,CAAC,MAA4B;IACxD,OAAO;QACL,+BAAoB,CAAC,OAAO;QAC5B,+BAAoB,CAAC,MAAM;QAC3B,+BAAoB,CAAC,OAAO;QAC5B,+BAAoB,CAAC,OAAO;QAC5B,+BAAoB,CAAC,SAAS;QAC9B,+BAAoB,CAAC,SAAS;QAC9B,+BAAoB,CAAC,MAAM;KAC5B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;AACnB,CAAC;AAEY,QAAA,MAAM,GAAG;IACpB,EAAE,CAAC,MAAe,EAAE,OAAe;QACjC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;QAC1B,CAAC;IACH,CAAC;CACF,CAAA","sourcesContent":["import { TestStepResultStatus } from '@cucumber/messages'\n\nexport function statusOrdinal(status: TestStepResultStatus) {\n return [\n TestStepResultStatus.UNKNOWN,\n TestStepResultStatus.PASSED,\n TestStepResultStatus.SKIPPED,\n TestStepResultStatus.PENDING,\n TestStepResultStatus.UNDEFINED,\n TestStepResultStatus.AMBIGUOUS,\n TestStepResultStatus.FAILED,\n ].indexOf(status)\n}\n\nexport const assert = {\n ok(target: unknown, message: string) {\n if (!target) {\n throw new Error(message)\n }\n },\n}\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/index.d.ts b/node_modules/@cucumber/query/dist/src/index.d.ts new file mode 100644 index 00000000..0470b897 --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/index.d.ts @@ -0,0 +1,4 @@ +import Query from './Query'; +export * from './Lineage'; +export { Query }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/index.d.ts.map b/node_modules/@cucumber/query/dist/src/index.d.ts.map new file mode 100644 index 00000000..f108c228 --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,KAAK,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/index.js b/node_modules/@cucumber/query/dist/src/index.js new file mode 100644 index 00000000..b953d2e2 --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/index.js @@ -0,0 +1,24 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Query = void 0; +const Query_1 = __importDefault(require("./Query")); +exports.Query = Query_1.default; +__exportStar(require("./Lineage"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/src/index.js.map b/node_modules/@cucumber/query/dist/src/index.js.map new file mode 100644 index 00000000..7b35bb9f --- /dev/null +++ b/node_modules/@cucumber/query/dist/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,oDAA2B;AAGlB,gBAHF,eAAK,CAGE;AAFd,4CAAyB","sourcesContent":["import Query from './Query'\nexport * from './Lineage'\n\nexport { Query }\n"]} \ No newline at end of file diff --git a/node_modules/@cucumber/query/dist/tsconfig.build.tsbuildinfo b/node_modules/@cucumber/query/dist/tsconfig.build.tsbuildinfo new file mode 100644 index 00000000..89466d9a --- /dev/null +++ b/node_modules/@cucumber/query/dist/tsconfig.build.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/reflect-metadata/index.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/messages.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/TimeConversion.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/IdGenerator.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/parseEnvelope.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/getWorstTestStepResult.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/version.d.ts","../node_modules/@cucumber/messages/dist/cjs/src/index.d.ts","../src/Lineage.ts","../node_modules/@teppeis/multimaps/dist/cjs/multimap.d.ts","../node_modules/@teppeis/multimaps/dist/cjs/arraymultimap.d.ts","../node_modules/@teppeis/multimaps/dist/cjs/setmultimap.d.ts","../node_modules/@teppeis/multimaps/dist/cjs/index.d.ts","../node_modules/@types/lodash/common/common.d.ts","../node_modules/@types/lodash/common/array.d.ts","../node_modules/@types/lodash/common/collection.d.ts","../node_modules/@types/lodash/common/date.d.ts","../node_modules/@types/lodash/common/function.d.ts","../node_modules/@types/lodash/common/lang.d.ts","../node_modules/@types/lodash/common/math.d.ts","../node_modules/@types/lodash/common/number.d.ts","../node_modules/@types/lodash/common/object.d.ts","../node_modules/@types/lodash/common/seq.d.ts","../node_modules/@types/lodash/common/string.d.ts","../node_modules/@types/lodash/common/util.d.ts","../node_modules/@types/lodash/index.d.ts","../node_modules/@types/lodash.sortby/index.d.ts","../src/helpers.ts","../src/Query.ts","../src/index.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/json5/index.d.ts","../node_modules/@types/mocha/index.d.ts","../node_modules/@types/node/compatibility/disposable.d.ts","../node_modules/@types/node/compatibility/indexable.d.ts","../node_modules/@types/node/compatibility/iterators.d.ts","../node_modules/@types/node/compatibility/index.d.ts","../node_modules/@types/node/globals.typedarray.d.ts","../node_modules/@types/node/buffer.buffer.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/web-globals/abortcontroller.d.ts","../node_modules/@types/node/web-globals/domexception.d.ts","../node_modules/@types/node/web-globals/events.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/env-http-proxy-agent.d.ts","../node_modules/undici-types/retry-handler.d.ts","../node_modules/undici-types/retry-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/util.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/eventsource.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/web-globals/fetch.d.ts","../node_modules/@types/node/web-globals/navigator.d.ts","../node_modules/@types/node/web-globals/storage.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/inspector.generated.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/sea.d.ts","../node_modules/@types/node/sqlite.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/index.d.ts"],"fileIdsList":[[86,134,151,152],[48,86,134,151,152],[48,49,50,51,52,53,86,134,151,152],[47,86,134,151,152],[56,86,134,151,152],[57,58,86,134,151,152],[72,86,134,151,152],[60,62,63,64,65,66,67,68,69,70,71,72,86,134,151,152],[60,61,63,64,65,66,67,68,69,70,71,72,86,134,151,152],[61,62,63,64,65,66,67,68,69,70,71,72,86,134,151,152],[60,61,62,64,65,66,67,68,69,70,71,72,86,134,151,152],[60,61,62,63,65,66,67,68,69,70,71,72,86,134,151,152],[60,61,62,63,64,66,67,68,69,70,71,72,86,134,151,152],[60,61,62,63,64,65,67,68,69,70,71,72,86,134,151,152],[60,61,62,63,64,65,66,68,69,70,71,72,86,134,151,152],[60,61,62,63,64,65,66,67,69,70,71,72,86,134,151,152],[60,61,62,63,64,65,66,67,68,70,71,72,86,134,151,152],[60,61,62,63,64,65,66,67,68,69,71,72,86,134,151,152],[60,61,62,63,64,65,66,67,68,69,70,72,86,134,151,152],[60,61,62,63,64,65,66,67,68,69,70,71,86,134,151,152],[86,131,132,134,151,152],[86,133,134,151,152],[134,151,152],[86,134,139,151,152,169],[86,134,135,140,145,151,152,154,166,177],[86,134,135,136,145,151,152,154],[81,82,83,86,134,151,152],[86,134,137,151,152,178],[86,134,138,139,146,151,152,155],[86,134,139,151,152,166,174],[86,134,140,142,145,151,152,154],[86,133,134,141,151,152],[86,134,142,143,151,152],[86,134,144,145,151,152],[86,133,134,145,151,152],[86,134,145,146,147,151,152,166,177],[86,134,145,146,147,151,152,161,166,169],[86,127,134,142,145,148,151,152,154,166,177],[86,134,145,146,148,149,151,152,154,166,174,177],[86,134,148,150,151,152,166,174,177],[84,85,86,87,88,89,90,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183],[86,134,145,151,152],[86,134,151,152,153,177],[86,134,142,145,151,152,154,166],[86,134,151,152,155],[86,134,151,152,156],[86,133,134,151,152,157],[86,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183],[86,134,151,152,159],[86,134,151,152,160],[86,134,145,151,152,161,162],[86,134,151,152,161,163,178,180],[86,134,146,151,152],[86,134,145,151,152,166,167,169],[86,134,151,152,168,169],[86,134,151,152,166,167],[86,134,151,152,169],[86,134,151,152,170],[86,131,134,151,152,166,171],[86,134,145,151,152,172,173],[86,134,151,152,172,173],[86,134,139,151,152,154,166,174],[86,134,151,152,175],[86,134,151,152,154,176],[86,134,148,151,152,160,177],[86,134,139,151,152,178],[86,134,151,152,166,179],[86,134,151,152,153,180],[86,134,151,152,181],[86,127,134,151,152],[86,127,134,145,147,151,152,157,166,169,177,179,180,182],[86,134,151,152,166,183],[86,99,103,134,151,152,177],[86,99,134,151,152,166,177],[86,94,134,151,152],[86,96,99,134,151,152,174,177],[86,134,151,152,154,174],[86,134,151,152,184],[86,94,134,151,152,184],[86,96,99,134,151,152,154,177],[86,91,92,95,98,134,145,151,152,166,177],[86,99,106,134,151,152],[86,91,97,134,151,152],[86,99,120,121,134,151,152],[86,95,99,134,151,152,169,177,184],[86,120,134,151,152,184],[86,93,94,134,151,152,184],[86,99,134,151,152],[86,93,94,95,96,97,98,99,100,101,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,121,122,123,124,125,126,134,151,152],[86,99,114,134,151,152],[86,99,106,107,134,151,152],[86,97,99,107,108,134,151,152],[86,98,134,151,152],[86,91,94,99,134,151,152],[86,99,103,107,108,134,151,152],[86,103,134,151,152],[86,97,99,102,134,151,152,177],[86,91,96,99,106,134,151,152],[86,134,151,152,166],[86,94,99,120,134,151,152,182,184],[54,86,134,151,152],[54,55,59,73,74,86,134,151,152],[55,75,86,134,151,152]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d6d51a5118d000ed3bfe6e1dd1335bebfff3fef23cd2af2f84a24d30f90cc90","affectsGlobalScope":true,"impliedFormat":1},{"version":"a00b906da89edb0af666db49ce2e609015d6b529a48c2f632b9410b97235301e","impliedFormat":1},{"version":"d9f4ec5156491a24eee340452d7e87e432512d5ebde23fe18c2ceb5a31c1720b","impliedFormat":1},{"version":"44716259b743dacde932f7f1922ac85f533af74e3ed82a078ba505414f6f6b53","impliedFormat":1},{"version":"653dc417862cf079d590653212a8d48ace7c89ff7b73c239791099afc25dca96","impliedFormat":1},{"version":"497efde09001124a1bfab8ea16409b6908fe8a49ae8d5d69082910838150fbfd","impliedFormat":1},{"version":"99a429217f764353e1ed84e91a382a0e0ed946b200076e7ae885e0ed78fe5d3a","impliedFormat":1},{"version":"5ed925f9d0dfcb0fde32518c7ae42f88461fd8eabb015a35183fac5ce95bbc6c","impliedFormat":1},{"version":"db41e768b4790b9c8991223d26363fff283cb1cdd5d093b4b338049ccd169620","signature":"f91fa6b7d7b917cb13abba172f09cb9322c4d4c6d3235c57fbd54a2db497efa0"},{"version":"fe47c64a7b50057df1e1a8458112c50a8e0d3c71aa53a674f5525b79b1c4935a","impliedFormat":1},{"version":"a452e0a97df99e857b9da0f2857724f603e08e65f631a45738822536772f360f","impliedFormat":1},{"version":"55cb5f9fdd66fdc372a2c866a0eaa2d7e521bc14afb191eb8186acb8cc5612b5","impliedFormat":1},{"version":"14cb3da610d378546b6898621c586c27d7ed5b5a8af9f1c72d831275012b4fc5","impliedFormat":1},{"version":"7220461ab7f6d600b313ce621346c315c3a0ebc65b5c6f268488c5c55b68d319","impliedFormat":1},{"version":"b14c272987c82d49f0f12184c9d8d07a7f71767be99cb76faa125b777c70e962","impliedFormat":1},{"version":"fcf79300e5257a23ed3bacaa6861d7c645139c6f7ece134d15e6669447e5e6db","impliedFormat":1},{"version":"187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","impliedFormat":1},{"version":"aa2c18a1b5a086bbcaae10a4efba409cc95ba7287d8cf8f2591b53704fea3dea","impliedFormat":1},{"version":"b88749bdb18fc1398370e33aa72bc4f88274118f4960e61ce26605f9b33c5ba2","impliedFormat":1},{"version":"0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","impliedFormat":1},{"version":"00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","impliedFormat":1},{"version":"a873c50d3e47c21aa09fbe1e2023d9a44efb07cc0cb8c72f418bf301b0771fd3","impliedFormat":1},{"version":"7c14ccd2eaa82619fffc1bfa877eb68a012e9fb723d07ee98db451fadb618906","impliedFormat":1},{"version":"49c36529ee09ea9ce19525af5bb84985ea8e782cb7ee8c493d9e36d027a3d019","impliedFormat":1},{"version":"df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9","impliedFormat":1},{"version":"4f6a12044ee6f458db11964153830abbc499e73d065c51c329ec97407f4b13dd","impliedFormat":1},{"version":"eeb8fb8a15f093ba78d59ff2a2cd36b040f6e7480a442d1e72149b00b9348e6f","impliedFormat":1},{"version":"37299ab615dc61ab75f64943b1c545c57008edaaf57d4859298d9baff37cc45e","signature":"f18e0443a0e14ea93b75e7d557df950f7ab654ffc57df68d47d38cfd2ea7320b"},{"version":"953f35203665b64babd4721158d9cbfbbeacf0e887edf3b3c7b6680264dc810d","signature":"0b17ba1214d60974a7f28729da417368ba63d6ffd622b6d2935005e4ced5da68"},{"version":"5b797b43253a62004fe0c4b7260e0f20c4b6779dfbf29181c37e692200f3f500","signature":"7ea405f18742e9ca5cdea12c391b58a16a5f12e2a8faf29f1af8da53b49d5adc"},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"bb45cd435da536500f1d9692a9b49d0c570b763ccbf00473248b777f5c1f353b","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bc7425ef40526650d6db7e072c1ff4a51101c3ac2cc4b666623b19496a6e27","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c959a391a75be9789b43c8468f71e3fa06488b4d691d5729dde1416dcd38225b","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"0dba70b3fb0dcd713fda33c2df64fa6751fff6460e536971cee917260fb17882","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1}],"root":[55,[74,76]],"options":{"allowJs":false,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"inlineSources":true,"jsx":2,"module":1,"noImplicitAny":true,"outDir":"./","rootDir":"..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":false,"target":2},"referencedMap":[[50,1],[49,2],[52,2],[54,3],[48,4],[51,2],[53,1],[57,5],[59,6],[56,1],[58,5],[77,1],[78,1],[79,1],[73,7],[61,8],[62,9],[60,10],[63,11],[64,12],[65,13],[66,14],[67,15],[68,16],[69,17],[70,18],[71,19],[72,20],[80,1],[131,21],[132,21],[133,22],[86,23],[134,24],[135,25],[136,26],[81,1],[84,27],[82,1],[83,1],[137,28],[138,29],[139,30],[140,31],[141,32],[142,33],[143,33],[144,34],[145,35],[146,36],[147,37],[87,1],[85,1],[148,38],[149,39],[150,40],[184,41],[151,42],[152,1],[153,43],[154,44],[155,45],[156,46],[157,47],[158,48],[159,49],[160,50],[161,51],[162,51],[163,52],[164,1],[165,53],[166,54],[168,55],[167,56],[169,57],[170,58],[171,59],[172,60],[173,61],[174,62],[175,63],[176,64],[177,65],[178,66],[179,67],[180,68],[181,69],[88,1],[89,1],[90,1],[128,70],[129,1],[130,1],[182,71],[183,72],[47,1],[45,1],[46,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[19,1],[20,1],[4,1],[21,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[106,73],[116,74],[105,73],[126,75],[97,76],[96,77],[125,78],[119,79],[124,80],[99,81],[113,82],[98,83],[122,84],[94,85],[93,78],[123,86],[95,87],[100,88],[101,1],[104,88],[91,1],[127,89],[117,90],[108,91],[109,92],[111,93],[107,94],[110,95],[120,78],[102,96],[103,97],[112,98],[92,99],[115,90],[114,88],[118,1],[121,100],[55,101],[75,102],[74,101],[76,103]],"latestChangedDtsFile":"./src/index.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/query/eslint.config.mjs b/node_modules/@cucumber/query/eslint.config.mjs new file mode 100644 index 00000000..31e717c5 --- /dev/null +++ b/node_modules/@cucumber/query/eslint.config.mjs @@ -0,0 +1,67 @@ +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +import { fixupConfigRules, fixupPluginRules } from "@eslint/compat"; +import { FlatCompat } from "@eslint/eslintrc"; +import js from "@eslint/js"; +import typescriptEslint from "@typescript-eslint/eslint-plugin"; +import tsParser from "@typescript-eslint/parser"; +import _import from "eslint-plugin-import"; +import n from "eslint-plugin-n"; +import simpleImportSort from "eslint-plugin-simple-import-sort"; +import globals from "globals"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...fixupConfigRules(compat.extends( + "eslint:recommended", + "plugin:import/typescript", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", +)), { + plugins: { + import: fixupPluginRules(_import), + "simple-import-sort": simpleImportSort, + n, + "@typescript-eslint": fixupPluginRules(typescriptEslint), + }, + + languageOptions: { + globals: { + ...globals.browser, + ...globals.node, + }, + + parser: tsParser, + ecmaVersion: 5, + sourceType: "module", + }, + + rules: { + "import/no-cycle": "error", + "n/no-extraneous-import": "error", + "@typescript-eslint/ban-ts-ignore": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/interface-name-prefix": "off", + "@typescript-eslint/member-delimiter-style": "off", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-non-null-assertion": "error", + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error", + }, +}, { + files: ["src/**/*.spec.ts"], + + rules: { + "@typescript-eslint/no-non-null-assertion": "off", + }, +}]; \ No newline at end of file diff --git a/node_modules/@cucumber/query/package.json b/node_modules/@cucumber/query/package.json new file mode 100644 index 00000000..f83458d7 --- /dev/null +++ b/node_modules/@cucumber/query/package.json @@ -0,0 +1,66 @@ +{ + "name": "@cucumber/query", + "version": "15.0.1", + "description": "Cucumber Query - query messages", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --build tsconfig.build.json", + "clean": "rm -rf dist", + "fix": "eslint --max-warnings 0 src --fix src && prettier --write src", + "lint": "eslint --max-warnings 0 src && prettier --check src", + "test": "mocha", + "prepublishOnly": "tsc --build tsconfig.build.json" + }, + "repository": { + "type": "git", + "url": "git://github.com/cucumber/query.git" + }, + "keywords": [ + "cucumber" + ], + "author": "Cucumber Limited ", + "license": "MIT", + "bugs": { + "url": "https://github.com/cucumber/query/issues" + }, + "homepage": "https://github.com/cucumber/query#readme", + "devDependencies": { + "@cucumber/compatibility-kit": "^27.0.0", + "@cucumber/message-streams": "^4.0.1", + "@cucumber/messages": "32.0.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "^9.21.0", + "@types/lodash.sortby": "^4.7.9", + "@types/mocha": "10.0.10", + "@types/node": "22.19.7", + "@typescript-eslint/eslint-plugin": "^8.43.0", + "@typescript-eslint/parser": "^8.43.0", + "ajv": "8.17.1", + "ajv-cli": "5.0.0", + "eslint": "^9.21.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-simple-import-sort": "^12.1.1", + "glob": "^13.0.0", + "globals": "^17.0.0", + "mocha": "11.7.5", + "prettier": "^3.5.2", + "pretty-quick": "4.2.2", + "rimraf": "^6.0.0", + "ts-node": "10.9.2", + "tsconfig-paths": "4.2.0", + "typescript": "5.9.3" + }, + "peerDependencies": { + "@cucumber/messages": "*" + }, + "dependencies": { + "@teppeis/multimaps": "3.0.0", + "lodash.sortby": "^4.7.0" + }, + "overrides": { + "@cucumber/messages": "32.0.0" + } +} diff --git a/node_modules/@cucumber/query/src/Lineage.ts b/node_modules/@cucumber/query/src/Lineage.ts new file mode 100644 index 00000000..bc6b6eb5 --- /dev/null +++ b/node_modules/@cucumber/query/src/Lineage.ts @@ -0,0 +1,113 @@ +import { + Background, + Examples, + Feature, + GherkinDocument, + Pickle, + Rule, + Scenario, + TableRow, +} from '@cucumber/messages' + +export interface Lineage { + gherkinDocument?: GherkinDocument + feature?: Feature + background?: Background + rule?: Rule + ruleBackground?: Background + scenario?: Scenario + examples?: Examples + examplesIndex?: number + example?: TableRow + exampleIndex?: number +} + +export interface LineageReducer { + reduce: (lineage: Lineage, pickle: Pickle) => T +} + +export type NamingStrategy = LineageReducer + +export enum NamingStrategyLength { + LONG = 'LONG', + SHORT = 'SHORT', +} + +export enum NamingStrategyFeatureName { + INCLUDE = 'INCLUDE', + EXCLUDE = 'EXCLUDE', +} + +export enum NamingStrategyExampleName { + NUMBER = 'NUMBER', + PICKLE = 'PICKLE', + NUMBER_AND_PICKLE_IF_PARAMETERIZED = 'NUMBER_AND_PICKLE_IF_PARAMETERIZED', +} + +class BuiltinNamingStrategy implements NamingStrategy { + constructor( + private readonly length: NamingStrategyLength, + private readonly featureName: NamingStrategyFeatureName, + private readonly exampleName: NamingStrategyExampleName + ) {} + + reduce(lineage: Lineage, pickle: Pickle): string { + const parts: string[] = [] + + if (lineage.feature?.name && this.featureName === NamingStrategyFeatureName.INCLUDE) { + parts.push(lineage.feature.name) + } + + if (lineage.rule?.name) { + parts.push(lineage.rule.name) + } + + if (lineage.scenario?.name) { + parts.push(lineage.scenario.name) + } else { + parts.push(pickle.name) + } + + if (lineage.examples?.name) { + parts.push(lineage.examples.name) + } + + if (lineage.example) { + const exampleNumber = [ + '#', + (lineage.examplesIndex ?? 0) + 1, + '.', + (lineage.exampleIndex ?? 0) + 1, + ].join('') + + switch (this.exampleName) { + case NamingStrategyExampleName.NUMBER: + parts.push(exampleNumber) + break + case NamingStrategyExampleName.NUMBER_AND_PICKLE_IF_PARAMETERIZED: + if (lineage.scenario?.name !== pickle.name) { + parts.push(exampleNumber + ': ' + pickle.name) + } else { + parts.push(exampleNumber) + } + break + case NamingStrategyExampleName.PICKLE: + parts.push(pickle.name) + break + } + } + + if (this.length === NamingStrategyLength.SHORT) { + return parts.at(-1) as string + } + return parts.filter((part) => !!part).join(' - ') + } +} + +export function namingStrategy( + length: NamingStrategyLength, + featureName: NamingStrategyFeatureName = NamingStrategyFeatureName.INCLUDE, + exampleName: NamingStrategyExampleName = NamingStrategyExampleName.NUMBER_AND_PICKLE_IF_PARAMETERIZED +): NamingStrategy { + return new BuiltinNamingStrategy(length, featureName, exampleName) +} diff --git a/node_modules/@cucumber/query/src/Query.spec.ts b/node_modules/@cucumber/query/src/Query.spec.ts new file mode 100644 index 00000000..9a2ebe40 --- /dev/null +++ b/node_modules/@cucumber/query/src/Query.spec.ts @@ -0,0 +1,175 @@ +import assert from 'node:assert' +import fs from 'node:fs/promises' +import path from 'node:path' + +import { Envelope, TestCaseStarted } from '@cucumber/messages' + +import { Lineage } from './Lineage' +import Query from './Query' + +describe('Query', () => { + let cucumberQuery: Query + beforeEach(() => { + cucumberQuery = new Query() + }) + + describe('#findAllTestCaseStarted', () => { + it('retains timestamp order', () => { + const testCasesStarted: TestCaseStarted[] = [ + { + id: '1', + testCaseId: '1', + attempt: 0, + timestamp: { + seconds: 1, + nanos: 1, + }, + }, + { + id: '2', + testCaseId: '2', + attempt: 0, + timestamp: { + seconds: 2, + nanos: 1, + }, + }, + { + id: '3', + testCaseId: '3', + attempt: 0, + timestamp: { + seconds: 2, + nanos: 3, + }, + }, + ] + + testCasesStarted + .map((testCaseStarted) => ({ testCaseStarted })) + .reverse() + .forEach((envelope) => { + cucumberQuery.update(envelope) + }) + + assert.deepStrictEqual(cucumberQuery.findAllTestCaseStarted(), testCasesStarted) + }) + + it('uses id as tie breaker', () => { + const testCasesStarted: TestCaseStarted[] = [ + { + id: '1', + testCaseId: '1', + attempt: 0, + timestamp: { + seconds: 1, + nanos: 1, + }, + }, + { + id: '2', + testCaseId: '2', + attempt: 0, + timestamp: { + seconds: 1, + nanos: 1, + }, + }, + ] + + testCasesStarted + .map((testCaseStarted) => ({ testCaseStarted })) + .reverse() + .forEach((envelope) => { + cucumberQuery.update(envelope) + }) + + assert.deepStrictEqual(cucumberQuery.findAllTestCaseStarted(), testCasesStarted) + }) + }) + + describe('#findLineageBy', () => { + it('returns correct lineage for a minimal scenario', async () => { + const envelopes: ReadonlyArray = ( + await fs.readFile(path.join(__dirname, '../../testdata/src/minimal.ndjson'), { + encoding: 'utf-8', + }) + ) + .split('\n') + .filter((line) => !!line) + .map((line) => JSON.parse(line)) + envelopes.forEach((envelope) => cucumberQuery.update(envelope)) + + const gherkinDocument = envelopes.find((envelope) => envelope.gherkinDocument).gherkinDocument + const feature = gherkinDocument.feature + const scenario = feature.children.find((child) => child.scenario).scenario + const pickle = envelopes.find((envelope) => envelope.pickle).pickle + + assert.deepStrictEqual(cucumberQuery.findLineageBy(pickle), { + gherkinDocument, + feature, + scenario, + } satisfies Lineage) + }) + + it('returns correct lineage for a pickle from an examples table', async () => { + const envelopes: ReadonlyArray = ( + await fs.readFile(path.join(__dirname, '../../testdata/src/examples-tables.ndjson'), { + encoding: 'utf-8', + }) + ) + .split('\n') + .filter((line) => !!line) + .map((line) => JSON.parse(line)) + envelopes.forEach((envelope) => cucumberQuery.update(envelope)) + + const gherkinDocument = envelopes.find((envelope) => envelope.gherkinDocument).gherkinDocument + const feature = gherkinDocument.feature + const scenario = feature.children.find((child) => child.scenario).scenario + const pickle = envelopes.find((envelope) => envelope.pickle).pickle + const examples = scenario.examples[0] + const example = examples.tableBody[0] + + assert.deepStrictEqual(cucumberQuery.findLineageBy(pickle), { + gherkinDocument, + feature, + scenario, + examples, + examplesIndex: 0, + example, + exampleIndex: 0, + } satisfies Lineage) + }) + + it('returns correct lineage for a pickle with background-derived steps', async () => { + const envelopes: ReadonlyArray = ( + await fs.readFile(path.join(__dirname, '../../testdata/src/rules-backgrounds.ndjson'), { + encoding: 'utf-8', + }) + ) + .split('\n') + .filter((line) => !!line) + .map((line) => JSON.parse(line)) + envelopes.forEach((envelope) => cucumberQuery.update(envelope)) + + const gherkinDocument = envelopes.find((envelope) => envelope.gherkinDocument).gherkinDocument + const feature = gherkinDocument.feature + const background = gherkinDocument.feature.children.find( + (child) => child.background + ).background + const rule = feature.children.find((child) => child.rule).rule + const ruleBackground = rule.children.find((child) => child.background).background + const scenario = rule.children.find((child) => child.scenario).scenario + const pickle = envelopes.find((envelope) => envelope.pickle).pickle + + assert.deepStrictEqual(cucumberQuery.findLineageBy(pickle), { + gherkinDocument, + feature, + background, + rule, + ruleBackground, + scenario, + } satisfies Lineage) + }) + }) +}) diff --git a/node_modules/@cucumber/query/src/Query.ts b/node_modules/@cucumber/query/src/Query.ts new file mode 100644 index 00000000..e040a061 --- /dev/null +++ b/node_modules/@cucumber/query/src/Query.ts @@ -0,0 +1,584 @@ +import * as messages from '@cucumber/messages' +import { + Attachment, + Duration, + Feature, + GherkinDocument, + Hook, + Location, + Meta, + Pickle, + PickleStep, + Rule, + Scenario, + Step, + StepDefinition, + Suggestion, + TestCase, + TestCaseFinished, + TestCaseStarted, + TestRunFinished, + TestRunHookFinished, + TestRunHookStarted, + TestRunStarted, + TestStep, + TestStepFinished, + TestStepResult, + TestStepResultStatus, + TestStepStarted, + TimeConversion, + UndefinedParameterType, +} from '@cucumber/messages' +import { ArrayMultimap } from '@teppeis/multimaps' +import sortBy from 'lodash.sortby' + +import { assert, statusOrdinal } from './helpers' +import { Lineage } from './Lineage' + +export default class Query { + private meta: Meta + private testRunStarted: TestRunStarted + private testRunFinished: TestRunFinished + private readonly testCaseStartedById: Map = new Map() + private readonly lineageById: Map = new Map() + private readonly stepById: Map = new Map() + private readonly pickleById: Map = new Map() + private readonly pickleStepById: Map = new Map() + private readonly hookById: Map = new Map() + private readonly stepDefinitionById: Map = new Map() + private readonly testCaseById: Map = new Map() + private readonly testStepById: Map = new Map() + private readonly testCaseFinishedByTestCaseStartedId: Map = new Map() + private readonly testRunHookStartedById: Map = new Map() + private readonly testRunHookFinishedByTestRunHookStartedId: Map = + new Map() + private readonly testStepStartedByTestCaseStartedId: ArrayMultimap = + new ArrayMultimap() + private readonly testStepFinishedByTestCaseStartedId: ArrayMultimap = + new ArrayMultimap() + private readonly attachmentsByTestCaseStartedId: ArrayMultimap = + new ArrayMultimap() + private readonly attachmentsByTestRunHookStartedId: ArrayMultimap = + new ArrayMultimap() + private readonly suggestionsByPickleStepId: ArrayMultimap = + new ArrayMultimap() + private readonly undefinedParameterTypes: UndefinedParameterType[] = [] + + public update(envelope: messages.Envelope) { + if (envelope.meta) { + this.meta = envelope.meta + } + if (envelope.gherkinDocument) { + this.updateGherkinDocument(envelope.gherkinDocument) + } + if (envelope.pickle) { + this.updatePickle(envelope.pickle) + } + if (envelope.hook) { + this.hookById.set(envelope.hook.id, envelope.hook) + } + if (envelope.stepDefinition) { + this.stepDefinitionById.set(envelope.stepDefinition.id, envelope.stepDefinition) + } + if (envelope.testRunStarted) { + this.testRunStarted = envelope.testRunStarted + } + if (envelope.testRunHookStarted) { + this.updateTestRunHookStarted(envelope.testRunHookStarted) + } + if (envelope.testRunHookFinished) { + this.updateTestRunHookFinished(envelope.testRunHookFinished) + } + if (envelope.testCase) { + this.updateTestCase(envelope.testCase) + } + if (envelope.testCaseStarted) { + this.updateTestCaseStarted(envelope.testCaseStarted) + } + if (envelope.testStepStarted) { + this.updateTestStepStarted(envelope.testStepStarted) + } + if (envelope.attachment) { + this.updateAttachment(envelope.attachment) + } + if (envelope.testStepFinished) { + this.updateTestStepFinished(envelope.testStepFinished) + } + if (envelope.testCaseFinished) { + this.updateTestCaseFinished(envelope.testCaseFinished) + } + if (envelope.testRunFinished) { + this.testRunFinished = envelope.testRunFinished + } + if (envelope.suggestion) { + this.updateSuggestion(envelope.suggestion) + } + if (envelope.undefinedParameterType) { + this.updateUndefinedParameterType(envelope.undefinedParameterType) + } + } + + private updateGherkinDocument(gherkinDocument: GherkinDocument) { + if (gherkinDocument.feature) { + this.updateFeature(gherkinDocument.feature, { + gherkinDocument, + }) + } + } + + private updateFeature(feature: Feature, lineage: Lineage) { + feature.children.forEach((featureChild) => { + if (featureChild.background) { + lineage.background = featureChild.background + this.updateSteps(featureChild.background.steps) + } + if (featureChild.scenario) { + this.updateScenario(featureChild.scenario, { + ...lineage, + feature, + }) + } + if (featureChild.rule) { + this.updateRule(featureChild.rule, { + ...lineage, + feature, + }) + } + }) + } + + private updateRule(rule: Rule, lineage: Lineage) { + rule.children.forEach((ruleChild) => { + if (ruleChild.background) { + lineage.ruleBackground = ruleChild.background + this.updateSteps(ruleChild.background.steps) + } + if (ruleChild.scenario) { + this.updateScenario(ruleChild.scenario, { + ...lineage, + rule, + }) + } + }) + } + + private updateScenario(scenario: Scenario, lineage: Lineage) { + this.lineageById.set(scenario.id, { + ...lineage, + scenario, + }) + scenario.examples.forEach((examples, examplesIndex) => { + this.lineageById.set(examples.id, { + ...lineage, + scenario, + examples, + examplesIndex, + }) + examples.tableBody.forEach((example, exampleIndex) => { + this.lineageById.set(example.id, { + ...lineage, + scenario, + examples, + examplesIndex, + example, + exampleIndex, + }) + }) + }) + this.updateSteps(scenario.steps) + } + + private updateSteps(steps: ReadonlyArray) { + steps.forEach((step) => this.stepById.set(step.id, step)) + } + + private updatePickle(pickle: Pickle) { + this.pickleById.set(pickle.id, pickle) + pickle.steps.forEach((pickleStep) => this.pickleStepById.set(pickleStep.id, pickleStep)) + } + + private updateTestRunHookStarted(testRunHookStarted: TestRunHookStarted) { + this.testRunHookStartedById.set(testRunHookStarted.id, testRunHookStarted) + } + + private updateTestRunHookFinished(testRunHookFinished: TestRunHookFinished) { + this.testRunHookFinishedByTestRunHookStartedId.set( + testRunHookFinished.testRunHookStartedId, + testRunHookFinished + ) + } + + private updateTestCase(testCase: TestCase) { + this.testCaseById.set(testCase.id, testCase) + testCase.testSteps.forEach((testStep) => { + this.testStepById.set(testStep.id, testStep) + }) + } + + private updateTestCaseStarted(testCaseStarted: TestCaseStarted) { + this.testCaseStartedById.set(testCaseStarted.id, testCaseStarted) + } + + private updateTestStepStarted(testStepStarted: TestStepStarted) { + this.testStepStartedByTestCaseStartedId.put(testStepStarted.testCaseStartedId, testStepStarted) + } + + private updateAttachment(attachment: Attachment) { + if (attachment.testCaseStartedId) { + this.attachmentsByTestCaseStartedId.put(attachment.testCaseStartedId, attachment) + } + if (attachment.testRunHookStartedId) { + this.attachmentsByTestRunHookStartedId.put(attachment.testRunHookStartedId, attachment) + } + } + + private updateTestStepFinished(testStepFinished: TestStepFinished) { + this.testStepFinishedByTestCaseStartedId.put( + testStepFinished.testCaseStartedId, + testStepFinished + ) + } + + private updateTestCaseFinished(testCaseFinished: TestCaseFinished) { + this.testCaseFinishedByTestCaseStartedId.set( + testCaseFinished.testCaseStartedId, + testCaseFinished + ) + } + + private updateSuggestion(suggestion: Suggestion) { + this.suggestionsByPickleStepId.put(suggestion.pickleStepId, suggestion) + } + + private updateUndefinedParameterType(undefinedParameterType: UndefinedParameterType) { + this.undefinedParameterTypes.push(undefinedParameterType) + } + + public countMostSevereTestStepResultStatus(): Record { + const result: Record = { + [TestStepResultStatus.AMBIGUOUS]: 0, + [TestStepResultStatus.FAILED]: 0, + [TestStepResultStatus.PASSED]: 0, + [TestStepResultStatus.PENDING]: 0, + [TestStepResultStatus.SKIPPED]: 0, + [TestStepResultStatus.UNDEFINED]: 0, + [TestStepResultStatus.UNKNOWN]: 0, + } + for (const testCaseStarted of this.findAllTestCaseStarted()) { + const mostSevereResult = sortBy( + this.findTestStepFinishedAndTestStepBy(testCaseStarted).map( + ([testStepFinished]) => testStepFinished.testStepResult + ), + [(testStepResult) => statusOrdinal(testStepResult.status)] + ).at(-1) + if (mostSevereResult) { + result[mostSevereResult.status]++ + } + } + return result + } + + public countTestCasesStarted(): number { + return this.findAllTestCaseStarted().length + } + + public findAllPickles(): ReadonlyArray { + return [...this.pickleById.values()] + } + + public findAllPickleSteps(): ReadonlyArray { + return [...this.pickleStepById.values()] + } + + public findAllStepDefinitions(): ReadonlyArray { + return [...this.stepDefinitionById.values()] + } + + public findAllTestCaseStarted(): ReadonlyArray { + return sortBy( + [...this.testCaseStartedById.values()].filter((testCaseStarted) => { + const testCaseFinished = this.testCaseFinishedByTestCaseStartedId.get(testCaseStarted.id) + // only include if not yet finished OR won't be retried + return !testCaseFinished?.willBeRetried + }), + [ + (testCaseStarted) => + TimeConversion.timestampToMillisecondsSinceEpoch(testCaseStarted.timestamp), + 'id', + ] + ) + } + + public findAllTestCaseFinished(): ReadonlyArray { + return sortBy( + [...this.testCaseFinishedByTestCaseStartedId.values()].filter((testCaseFinished) => { + // only include if not yet finished OR won't be retried + return !testCaseFinished?.willBeRetried + }), + [ + (testCaseFinished) => + TimeConversion.timestampToMillisecondsSinceEpoch(testCaseFinished.timestamp), + 'id', + ] + ) + } + + public findAllTestCaseStartedOrderBy( + findOrderBy: (query: Query, testCaseStarted: TestCaseStarted) => T | undefined, + order: (a: T, b: T) => number + ): ReadonlyArray { + const withOrderBy = this.findAllTestCaseStarted().map((testCaseStarted) => ({ + testCaseStarted, + orderBy: findOrderBy(this, testCaseStarted), + })) + + const sorted = withOrderBy.sort((a, b) => { + if (a.orderBy === undefined && b.orderBy === undefined) return 0 + if (a.orderBy === undefined) return 1 + if (b.orderBy === undefined) return -1 + return order(a.orderBy, b.orderBy) + }) + + return sorted.map((item) => item.testCaseStarted) + } + + public findAllTestCaseFinishedOrderBy( + findOrderBy: (query: Query, testCaseFinished: TestCaseFinished) => T | undefined, + order: (a: T, b: T) => number + ): ReadonlyArray { + const withOrderBy = this.findAllTestCaseFinished().map((testCaseFinished) => ({ + testCaseFinished, + orderBy: findOrderBy(this, testCaseFinished), + })) + + const sorted = withOrderBy.sort((a, b) => { + if (a.orderBy === undefined && b.orderBy === undefined) return 0 + if (a.orderBy === undefined) return 1 + if (b.orderBy === undefined) return -1 + return order(a.orderBy, b.orderBy) + }) + + return sorted.map((item) => item.testCaseFinished) + } + + public findAllTestSteps(): ReadonlyArray { + return [...this.testStepById.values()] + } + + public findAllTestStepStarted(): ReadonlyArray { + return [...this.testStepStartedByTestCaseStartedId.values()] + } + + public findAllTestStepFinished(): ReadonlyArray { + return [...this.testStepFinishedByTestCaseStartedId.values()] + } + + public findAllTestRunHookStarted(): ReadonlyArray { + return [...this.testRunHookStartedById.values()] + } + + public findAllTestRunHookFinished(): ReadonlyArray { + return [...this.testRunHookFinishedByTestRunHookStartedId.values()] + } + + public findAllUndefinedParameterTypes(): ReadonlyArray { + return [...this.undefinedParameterTypes] + } + + public findAttachmentsBy( + element: TestStepFinished | TestRunHookFinished + ): ReadonlyArray { + if ('testStepId' in element) { + return this.attachmentsByTestCaseStartedId + .get(element.testCaseStartedId) + .filter((attachment) => attachment.testStepId === element.testStepId) + } else { + return this.attachmentsByTestRunHookStartedId.get(element.testRunHookStartedId) + } + } + + public findHookBy(item: TestStep | TestRunHookStarted | TestRunHookFinished): Hook | undefined { + if ('testRunHookStartedId' in item) { + const testRunHookStarted = this.findTestRunHookStartedBy(item) + assert.ok(testRunHookStarted, 'Expected to find TestRunHookStarted from TestRunHookFinished') + return this.findHookBy(testRunHookStarted) + } + if (!item.hookId) { + return undefined + } + return this.hookById.get(item.hookId) + } + + public findMeta(): Meta | undefined { + return this.meta + } + + public findMostSevereTestStepResultBy( + element: TestCaseStarted | TestCaseFinished + ): TestStepResult | undefined { + const testCaseStarted = + 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element + return sortBy( + this.findTestStepFinishedAndTestStepBy(testCaseStarted).map( + ([testStepFinished]) => testStepFinished.testStepResult + ), + [(testStepResult) => statusOrdinal(testStepResult.status)] + ).at(-1) + } + + public findLocationOf(pickle: Pickle): Location | undefined { + const lineage = this.findLineageBy(pickle) + if (lineage?.example) { + return lineage.example.location + } + return lineage?.scenario?.location + } + + public findPickleBy( + element: TestCaseStarted | TestCaseFinished | TestStepStarted + ): Pickle | undefined { + const testCase = this.findTestCaseBy(element) + assert.ok(testCase, 'Expected to find TestCase from TestCaseStarted') + return this.pickleById.get(testCase.pickleId) + } + + public findPickleStepBy(testStep: TestStep): PickleStep | undefined { + if (!testStep.pickleStepId) { + return undefined + } + return this.pickleStepById.get(testStep.pickleStepId) + } + + public findStepBy(pickleStep: PickleStep): Step | undefined { + const [astNodeId] = pickleStep.astNodeIds + assert.ok(astNodeId, 'Expected PickleStep to have an astNodeId') + return this.stepById.get(astNodeId) + } + + public findStepDefinitionsBy(testStep: TestStep): ReadonlyArray { + return (testStep.stepDefinitionIds ?? []).map((id) => this.stepDefinitionById.get(id)) + } + + findSuggestionsBy(element: PickleStep | Pickle): ReadonlyArray { + if ('steps' in element) { + return element.steps.flatMap((value) => this.findSuggestionsBy(value)) + } + return this.suggestionsByPickleStepId.get(element.id) + } + + public findUnambiguousStepDefinitionBy(testStep: TestStep): StepDefinition | undefined { + if (testStep.stepDefinitionIds?.length === 1) { + return this.stepDefinitionById.get(testStep.stepDefinitionIds[0]) + } + return undefined + } + + public findTestCaseBy( + element: TestCaseStarted | TestCaseFinished | TestStepStarted | TestStepFinished + ): TestCase | undefined { + const testCaseStarted = + 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element + assert.ok(testCaseStarted, 'Expected to find TestCaseStarted by TestStepStarted') + return this.testCaseById.get(testCaseStarted.testCaseId) + } + + public findTestCaseDurationBy(element: TestCaseStarted | TestCaseFinished): Duration | undefined { + let testCaseStarted: TestCaseStarted + let testCaseFinished: TestCaseFinished + if ('testCaseStartedId' in element) { + testCaseStarted = this.findTestCaseStartedBy(element) + testCaseFinished = element + } else { + testCaseStarted = element + testCaseFinished = this.findTestCaseFinishedBy(element) + } + if (!testCaseFinished) { + return undefined + } + return TimeConversion.millisecondsToDuration( + TimeConversion.timestampToMillisecondsSinceEpoch(testCaseFinished.timestamp) - + TimeConversion.timestampToMillisecondsSinceEpoch(testCaseStarted.timestamp) + ) + } + + public findTestCaseStartedBy( + element: TestCaseFinished | TestStepStarted | TestStepFinished + ): TestCaseStarted | undefined { + return this.testCaseStartedById.get(element.testCaseStartedId) + } + + public findTestCaseFinishedBy(testCaseStarted: TestCaseStarted): TestCaseFinished | undefined { + return this.testCaseFinishedByTestCaseStartedId.get(testCaseStarted.id) + } + + public findTestRunHookStartedBy( + testRunHookFinished: TestRunHookFinished + ): TestRunHookStarted | undefined { + return this.testRunHookStartedById.get(testRunHookFinished.testRunHookStartedId) + } + + public findTestRunHookFinishedBy( + testRunHookStarted: TestRunHookStarted + ): TestRunHookFinished | undefined { + return this.testRunHookFinishedByTestRunHookStartedId.get(testRunHookStarted.id) + } + + public findTestRunDuration(): Duration | undefined { + if (!this.testRunStarted || !this.testRunFinished) { + return undefined + } + return TimeConversion.millisecondsToDuration( + TimeConversion.timestampToMillisecondsSinceEpoch(this.testRunFinished.timestamp) - + TimeConversion.timestampToMillisecondsSinceEpoch(this.testRunStarted.timestamp) + ) + } + + public findTestRunFinished(): TestRunFinished | undefined { + return this.testRunFinished + } + + public findTestRunStarted(): TestRunStarted | undefined { + return this.testRunStarted + } + + public findTestStepBy(element: TestStepStarted | TestStepFinished): TestStep | undefined { + return this.testStepById.get(element.testStepId) + } + + public findTestStepsStartedBy( + element: TestCaseStarted | TestCaseFinished + ): ReadonlyArray { + const testCaseStartedId = + 'testCaseStartedId' in element ? element.testCaseStartedId : element.id + // multimaps `get` implements `getOrDefault([])` behaviour internally + return [...this.testStepStartedByTestCaseStartedId.get(testCaseStartedId)] + } + + public findTestStepsFinishedBy( + element: TestCaseStarted | TestCaseFinished + ): ReadonlyArray { + const testCaseStarted = + 'testCaseStartedId' in element ? this.findTestCaseStartedBy(element) : element + // multimaps `get` implements `getOrDefault([])` behaviour internally + return [...this.testStepFinishedByTestCaseStartedId.get(testCaseStarted.id)] + } + + public findTestStepFinishedAndTestStepBy( + testCaseStarted: TestCaseStarted + ): ReadonlyArray<[TestStepFinished, TestStep]> { + return this.testStepFinishedByTestCaseStartedId + .get(testCaseStarted.id) + .map((testStepFinished) => { + const testStep = this.findTestStepBy(testStepFinished) + assert.ok(testStep, 'Expected to find TestStep by TestStepFinished') + return [testStepFinished, testStep] + }) + } + + public findLineageBy(element: Pickle | TestCaseStarted | TestCaseFinished): Lineage | undefined { + const pickle = 'astNodeIds' in element ? element : this.findPickleBy(element) + const deepestAstNodeId = pickle.astNodeIds.at(-1) + assert.ok(deepestAstNodeId, 'Expected Pickle to have at least one astNodeId') + return this.lineageById.get(deepestAstNodeId) + } +} diff --git a/node_modules/@cucumber/query/src/acceptance.spec.ts b/node_modules/@cucumber/query/src/acceptance.spec.ts new file mode 100644 index 00000000..43815378 --- /dev/null +++ b/node_modules/@cucumber/query/src/acceptance.spec.ts @@ -0,0 +1,339 @@ +import assert from 'node:assert' +import fs from 'node:fs' +import * as path from 'node:path' +import { Writable } from 'node:stream' +import { pipeline } from 'node:stream/promises' + +import { NdjsonToMessageStream } from '@cucumber/message-streams' +import { Envelope, Pickle } from '@cucumber/messages' + +import Query from './Query' + +const reversePickleComparator = (a: Pickle, b: Pickle): number => { + if (a.uri !== b.uri) { + return b.uri.localeCompare(a.uri) + } + if (a.location.line !== b.location.line) { + return b.location.line - a.location.line + } + return b.location.column - a.location.column +} + +describe('Acceptance Tests', async () => { + const sources = [ + path.join(__dirname, '../../testdata/src/attachments.ndjson'), + path.join(__dirname, '../../testdata/src/empty.ndjson'), + path.join(__dirname, '../../testdata/src/global-hooks.ndjson'), + path.join(__dirname, '../../testdata/src/global-hooks-attachments.ndjson'), + path.join(__dirname, '../../testdata/src/hooks.ndjson'), + path.join(__dirname, '../../testdata/src/minimal.ndjson'), + path.join(__dirname, '../../testdata/src/rules.ndjson'), + path.join(__dirname, '../../testdata/src/examples-tables.ndjson'), + path.join(__dirname, '../../testdata/src/unknown-parameter-type.ndjson'), + ] + const queries: Queries = { + countMostSevereTestStepResultStatus: (query: Query) => + query.countMostSevereTestStepResultStatus(), + countTestCasesStarted: (query: Query) => query.countTestCasesStarted(), + findAllPickles: (query: Query) => query.findAllPickles().length, + findAllPickleSteps: (query: Query) => query.findAllPickleSteps().length, + findAllStepDefinitions: (query: Query) => query.findAllStepDefinitions().length, + findAllTestCaseStarted: (query: Query) => query.findAllTestCaseStarted().length, + findAllTestCaseStartedOrderBy: (query: Query) => + query + .findAllTestCaseStartedOrderBy( + (q, testCaseStarted) => q.findPickleBy(testCaseStarted), + reversePickleComparator + ) + .map((testCaseStarted) => testCaseStarted.id), + findAllTestCaseFinished: (query: Query) => query.findAllTestCaseFinished().length, + findAllTestCaseFinishedOrderBy: (query: Query) => + query + .findAllTestCaseFinishedOrderBy( + (q, testCaseFinished) => q.findPickleBy(testCaseFinished), + reversePickleComparator + ) + .map((testCaseFinished) => testCaseFinished.testCaseStartedId), + findAllTestRunHookStarted: (query: Query) => query.findAllTestRunHookStarted().length, + findAllTestRunHookFinished: (query: Query) => query.findAllTestRunHookFinished().length, + findTestRunHookStartedBy: (query: Query) => + query + .findAllTestRunHookFinished() + .map((testRunHookFinished) => query.findTestRunHookStartedBy(testRunHookFinished)) + .map((testRunHookStarted) => testRunHookStarted?.id), + findTestRunHookFinishedBy: (query: Query) => + query + .findAllTestRunHookStarted() + .map((testRunHookStarted) => query.findTestRunHookFinishedBy(testRunHookStarted)) + .map((testRunHookFinished) => testRunHookFinished?.testRunHookStartedId), + findAllTestSteps: (query: Query) => query.findAllTestSteps().length, + findAttachmentsBy: (query: Query) => ({ + testStepFinished: query + .findAllTestCaseStarted() + .map((testCaseStarted) => query.findTestStepsFinishedBy(testCaseStarted)) + .map((testStepFinisheds) => + testStepFinisheds.map((testStepFinished) => query.findAttachmentsBy(testStepFinished)) + ) + .flat(2) + .map((attachment) => [ + attachment.testStepId, + attachment.testCaseStartedId, + attachment.mediaType, + attachment.contentEncoding, + ]), + testRunHookFinished: query + .findAllTestRunHookFinished() + .map((testRunHookFinished) => query.findAttachmentsBy(testRunHookFinished)) + .flat() + .map((attachment) => [ + attachment.testRunHookStartedId, + attachment.mediaType, + attachment.contentEncoding, + ]), + }), + + findHookBy: (query: Query) => { + return { + testStep: query + .findAllTestSteps() + .map((testStep) => query.findHookBy(testStep)) + .map((hook) => hook?.id) + .filter((value) => !!value), + testRunHookStarted: query + .findAllTestRunHookStarted() + .map((testStep) => query.findHookBy(testStep)) + .map((hook) => hook?.id) + .filter((value) => !!value), + testRunHookFinished: query + .findAllTestRunHookFinished() + .map((testStep) => query.findHookBy(testStep)) + .map((hook) => hook?.id) + .filter((value) => !!value), + } + }, + + findMeta: (query: Query) => query.findMeta()?.implementation?.name, + findMostSevereTestStepResultBy: (query: Query) => { + return { + testCaseStarted: query + .findAllTestCaseStarted() + .map((testCaseStarted) => query.findMostSevereTestStepResultBy(testCaseStarted)) + .map((testStepResult) => testStepResult?.status) + .filter((value) => value), + testCaseFinished: query + .findAllTestCaseFinished() + .map((testCaseStarted) => query.findMostSevereTestStepResultBy(testCaseStarted)) + .map((testStepResult) => testStepResult?.status) + .filter((value) => value), + } + }, + findLocationOf: (query: Query) => + query.findAllPickles().map((pickle) => query.findLocationOf(pickle)), + + findPickleBy: (query: Query) => { + return { + testCaseStarted: query + .findAllTestCaseStarted() + .map((testCaseStarted) => query.findPickleBy(testCaseStarted)) + .map((pickle) => pickle?.name), + testCaseFinished: query + .findAllTestCaseFinished() + .map((testCaseFinished) => query.findPickleBy(testCaseFinished)) + .map((pickle) => pickle?.name), + testStepStarted: query + .findAllTestStepFinished() + .map((testCaseStarted) => query.findPickleBy(testCaseStarted)) + .map((pickle) => pickle?.name), + testStepFinished: query + .findAllTestStepFinished() + .map((testCaseFinished) => query.findPickleBy(testCaseFinished)) + .map((pickle) => pickle?.name), + } + }, + findPickleStepBy: (query: Query) => + query + .findAllTestSteps() + .map((testStep) => query.findPickleStepBy(testStep)) + .map((pickleStep) => pickleStep?.text) + .filter((value) => !!value), + findStepBy: (query: Query) => + query + .findAllPickleSteps() + .map((pickleStep) => query.findStepBy(pickleStep)) + .map((step) => step?.text), + findStepDefinitionsBy: (query: Query) => + query + .findAllTestSteps() + .map((pickleStep) => + query.findStepDefinitionsBy(pickleStep).map((stepDefinition) => stepDefinition?.id) + ), + findSuggestionsBy: (query: Query) => { + return { + pickleStep: query + .findAllPickleSteps() + .flatMap((pickleStep) => query.findSuggestionsBy(pickleStep)) + .map((suggestion) => suggestion.id), + pickle: query + .findAllPickles() + .flatMap((pickle) => query.findSuggestionsBy(pickle)) + .map((suggestion) => suggestion.id), + } + }, + findUnambiguousStepDefinitionBy: (query: Query) => + query + .findAllTestSteps() + .map((pickleStep) => query.findUnambiguousStepDefinitionBy(pickleStep)) + .filter((stepDefinition) => !!stepDefinition) + .map((stepDefinition) => stepDefinition.id), + findTestCaseStartedBy: (query: Query) => { + return { + testCaseFinished: query + .findAllTestCaseFinished() + .map((testCaseFinished) => query.findTestCaseStartedBy(testCaseFinished)) + .map((testCase) => testCase?.id), + testStepStarted: query + .findAllTestStepStarted() + .map((testStepStarted) => query.findTestCaseStartedBy(testStepStarted)) + .map((testCase) => testCase?.id), + testStepFinished: query + .findAllTestStepFinished() + .map((testStepFinished) => query.findTestCaseStartedBy(testStepFinished)) + .map((testCase) => testCase?.id), + } + }, + findTestCaseBy: (query: Query) => { + return { + testCaseStarted: query + .findAllTestCaseStarted() + .map((testCaseStarted) => query.findTestCaseBy(testCaseStarted)) + .map((testCase) => testCase?.id), + testCaseFinished: query + .findAllTestCaseFinished() + .map((testCaseFinished) => query.findTestCaseBy(testCaseFinished)) + .map((testCase) => testCase?.id), + testStepStarted: query + .findAllTestStepStarted() + .map((testStepStarted) => query.findTestCaseBy(testStepStarted)) + .map((testCase) => testCase?.id), + testStepFinished: query + .findAllTestStepFinished() + .map((testStepFinished) => query.findTestCaseBy(testStepFinished)) + .map((testCase) => testCase?.id), + } + }, + findTestCaseDurationBy: (query: Query) => { + return { + testCaseStarted: query + .findAllTestCaseStarted() + .map((testCaseStarted) => query.findTestCaseDurationBy(testCaseStarted)), + testCaseFinished: query + .findAllTestCaseFinished() + .map((testCaseFinished) => query.findTestCaseDurationBy(testCaseFinished)), + } + }, + findTestCaseFinishedBy: (query: Query) => + query + .findAllTestCaseStarted() + .map((testCaseStarted) => query.findTestCaseFinishedBy(testCaseStarted)) + .map((testCaseFinished) => testCaseFinished?.testCaseStartedId), + findTestRunDuration: (query: Query) => query.findTestRunDuration(), + findTestRunFinished: (query: Query) => query.findTestRunFinished(), + findTestRunStarted: (query: Query) => query.findTestRunStarted(), + findTestStepBy: (query: Query) => + query + .findAllTestCaseStarted() + .flatMap((testCaseStarted) => query.findTestStepsStartedBy(testCaseStarted)) + .map((testStepStarted) => query.findTestStepBy(testStepStarted)) + .map((testStep) => testStep?.id), + findTestStepsStartedBy: (query: Query) => { + return { + testCaseStarted: query + .findAllTestCaseStarted() + .map((testCaseStarted) => query.findTestStepsStartedBy(testCaseStarted)) + .map((testStepsStarted) => + testStepsStarted.map((testStepStarted) => testStepStarted.testStepId) + ), + testCaseFinished: query + .findAllTestCaseFinished() + .map((testCaseFinished) => query.findTestStepsStartedBy(testCaseFinished)) + .map((testStepsStarted) => + testStepsStarted.map((testStepStarted) => testStepStarted.testStepId) + ), + } + }, + findTestStepByTestStepFinished: (query: Query) => { + return { + testCaseStarted: query + .findAllTestCaseStarted() + .flatMap((testCaseStarted) => query.findTestStepsFinishedBy(testCaseStarted)) + .map((testStepFinished) => query.findTestStepBy(testStepFinished)) + .map((testStep) => testStep?.id), + testCaseFinished: query + .findAllTestCaseFinished() + .flatMap((testCaseFinished) => query.findTestStepsFinishedBy(testCaseFinished)) + .map((testStepFinished) => query.findTestStepBy(testStepFinished)) + .map((testStep) => testStep?.id), + } + }, + findTestStepsFinishedBy: (query: Query) => + query + .findAllTestCaseStarted() + .map((testCaseStarted) => query.findTestStepsFinishedBy(testCaseStarted)) + .map((testStepFinisheds) => + testStepFinisheds.map((testStepFinished) => testStepFinished?.testStepId) + ), + findTestStepFinishedAndTestStepBy: (query: Query) => + query + .findAllTestCaseStarted() + .flatMap((testCaseStarted) => query.findTestStepFinishedAndTestStepBy(testCaseStarted)) + .map(([testStepFinished, testStep]) => [testStepFinished.testStepId, testStep.id]), + findAllUndefinedParameterTypes: (query: Query) => + query + .findAllUndefinedParameterTypes() + .map((undefinedParameterType) => [ + undefinedParameterType.name, + undefinedParameterType.expression, + ]), + } + + for (const source of sources) { + for (const methodName in queries) { + const [suiteName] = path.basename(source).split('.') + + it(suiteName + ' -> ' + methodName, async () => { + const query = new Query() + + await pipeline( + fs.createReadStream(source, { encoding: 'utf-8' }), + new NdjsonToMessageStream(), + new Writable({ + objectMode: true, + write(envelope: Envelope, _: BufferEncoding, callback) { + query.update(envelope) + callback() + }, + }) + ) + + const expectedResults = JSON.parse( + fs.readFileSync( + path.join( + __dirname, + '../../testdata/src/' + suiteName + '.' + methodName + '.results.json' + ), + { + encoding: 'utf-8', + } + ) + ) + const actualResults = JSON.parse(JSON.stringify(queries[methodName](query))) + assert.deepStrictEqual(actualResults, expectedResults) + }) + } + } +}) + +type Queries = { + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + [key: string]: (query: Query) => Object +} diff --git a/node_modules/@cucumber/query/src/helpers.ts b/node_modules/@cucumber/query/src/helpers.ts new file mode 100644 index 00000000..52c0f23c --- /dev/null +++ b/node_modules/@cucumber/query/src/helpers.ts @@ -0,0 +1,21 @@ +import { TestStepResultStatus } from '@cucumber/messages' + +export function statusOrdinal(status: TestStepResultStatus) { + return [ + TestStepResultStatus.UNKNOWN, + TestStepResultStatus.PASSED, + TestStepResultStatus.SKIPPED, + TestStepResultStatus.PENDING, + TestStepResultStatus.UNDEFINED, + TestStepResultStatus.AMBIGUOUS, + TestStepResultStatus.FAILED, + ].indexOf(status) +} + +export const assert = { + ok(target: unknown, message: string) { + if (!target) { + throw new Error(message) + } + }, +} diff --git a/node_modules/@cucumber/query/src/index.ts b/node_modules/@cucumber/query/src/index.ts new file mode 100644 index 00000000..20c403b7 --- /dev/null +++ b/node_modules/@cucumber/query/src/index.ts @@ -0,0 +1,4 @@ +import Query from './Query' +export * from './Lineage' + +export { Query } diff --git a/node_modules/@cucumber/query/tsconfig.base.json b/node_modules/@cucumber/query/tsconfig.base.json new file mode 100644 index 00000000..e7439e8d --- /dev/null +++ b/node_modules/@cucumber/query/tsconfig.base.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "declaration": true, + "target": "es2018", + "lib": ["es2019", "dom"], + "sourceMap": true, + "allowJs": false, + "jsx": "react", + "resolveJsonModule": true, + "module": "commonjs", + "esModuleInterop": true, + "noImplicitAny": true, + "moduleResolution": "node", + "outDir": "dist", + "downlevelIteration": true, + "skipLibCheck": true, + "strictNullChecks": false, + "experimentalDecorators": true + } +} diff --git a/node_modules/@cucumber/query/tsconfig.build.json b/node_modules/@cucumber/query/tsconfig.build.json new file mode 100644 index 00000000..bedb1374 --- /dev/null +++ b/node_modules/@cucumber/query/tsconfig.build.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "dist", + "composite": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "inlineSources": true, + "target": "es6", + "module": "commonjs" + }, + "include": [ + "src" + ], + "exclude": [ + "src/**/*.spec.*" + ] +} diff --git a/node_modules/@cucumber/query/tsconfig.json b/node_modules/@cucumber/query/tsconfig.json new file mode 100644 index 00000000..1af726cd --- /dev/null +++ b/node_modules/@cucumber/query/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "baseUrl": ".", + "noEmit": true + }, + "ts-node": { + "files": true + } +} diff --git a/node_modules/@cucumber/tag-expressions/LICENSE b/node_modules/@cucumber/tag-expressions/LICENSE new file mode 100644 index 00000000..a5e1512d --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Cucumber Ltd and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cucumber/tag-expressions/README.md b/node_modules/@cucumber/tag-expressions/README.md new file mode 100644 index 00000000..214e807f --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/README.md @@ -0,0 +1,14 @@ +# Cucumber Tag Expressions for JavaScript + +[The docs are here](https://cucumber.io/docs/cucumber/api/#tag-expressions). + +## Usage + +```typescript +import { type Node, parse } from '@cucumber/tag-expressions' + +const expressionNode: Node = parse('@tagA and @tagB') + +expressionNode.evaluate(['@tagA', '@tagB']) // => true +expressionNode.evaluate(['@tagA', '@tagC']) // => false +``` \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/package.json b/node_modules/@cucumber/tag-expressions/dist/cjs/package.json new file mode 100644 index 00000000..b731bd61 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/package.json @@ -0,0 +1 @@ +{"type": "commonjs"} diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.d.ts b/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.d.ts new file mode 100644 index 00000000..eac23c17 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.d.ts @@ -0,0 +1,15 @@ +/** + * Parses infix boolean expression (using Dijkstra's Shunting Yard algorithm) + * and builds a tree of expressions. The root node of the expression is returned. + * + * This expression can be evaluated by passing in an array of literals that resolve to true + */ +export declare function parse(infix: string): Node; +export interface Node { + evaluate(variables: string[]): boolean; +} +/** + * @deprecated Use the named export `parse` instead: `import { parse } from '@cucumber/tag-expressions'` + */ +export default parse; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.d.ts.map new file mode 100644 index 00000000..c5ea3cc9 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CA4FzC;AAqDD,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CACvC;AA4ED;;GAEG;AACH,eAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.js b/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.js new file mode 100644 index 00000000..bf9810ee --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.js @@ -0,0 +1,231 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parse = parse; +var OPERAND = 'operand'; +var OPERATOR = 'operator'; +var PREC = { + '(': -2, + ')': -1, + or: 0, + and: 1, + not: 2, +}; +var ASSOC = { + or: 'left', + and: 'left', + not: 'right', +}; +/** + * Parses infix boolean expression (using Dijkstra's Shunting Yard algorithm) + * and builds a tree of expressions. The root node of the expression is returned. + * + * This expression can be evaluated by passing in an array of literals that resolve to true + */ +function parse(infix) { + var tokens = tokenize(infix); + if (tokens.length === 0) { + return new True(); + } + var expressions = []; + var operators = []; + var expectedTokenType = OPERAND; + tokens.forEach(function (token) { + if (isUnary(token)) { + check(expectedTokenType, OPERAND); + operators.push(token); + expectedTokenType = OPERAND; + } + else if (isBinary(token)) { + check(expectedTokenType, OPERATOR); + while (operators.length > 0 && + isOp(peek(operators)) && + ((ASSOC[token] === 'left' && PREC[token] <= PREC[peek(operators)]) || + (ASSOC[token] === 'right' && PREC[token] < PREC[peek(operators)]))) { + pushExpr(operators.pop(), expressions); + } + operators.push(token); + expectedTokenType = OPERAND; + } + else if ('(' === token) { + check(expectedTokenType, OPERAND); + operators.push(token); + expectedTokenType = OPERAND; + } + else if (')' === token) { + check(expectedTokenType, OPERATOR); + while (operators.length > 0 && peek(operators) !== '(') { + pushExpr(operators.pop(), expressions); + } + if (operators.length === 0) { + throw new Error("Tag expression \"".concat(infix, "\" could not be parsed because of syntax error: Unmatched ).")); + } + if (peek(operators) === '(') { + operators.pop(); + } + expectedTokenType = OPERATOR; + } + else { + check(expectedTokenType, OPERAND); + pushExpr(token, expressions); + expectedTokenType = OPERATOR; + } + }); + while (operators.length > 0) { + if (peek(operators) === '(') { + throw new Error("Tag expression \"".concat(infix, "\" could not be parsed because of syntax error: Unmatched (.")); + } + pushExpr(operators.pop(), expressions); + } + return expressions.pop(); + function check(expectedTokenType, tokenType) { + if (expectedTokenType !== tokenType) { + throw new Error("Tag expression \"".concat(infix, "\" could not be parsed because of syntax error: Expected ").concat(expectedTokenType, ".")); + } + } + function pushExpr(token, stack) { + if (token === 'and') { + var rightAndExpr = popOperand(stack); + stack.push(new And(popOperand(stack), rightAndExpr)); + } + else if (token === 'or') { + var rightOrExpr = popOperand(stack); + stack.push(new Or(popOperand(stack), rightOrExpr)); + } + else if (token === 'not') { + stack.push(new Not(popOperand(stack))); + } + else { + stack.push(new Literal(token)); + } + } + function popOperand(stack) { + if (stack.length === 0) { + throw new Error("Tag expression \"".concat(infix, "\" could not be parsed because of syntax error: Expected operand.")); + } + return stack.pop(); + } +} +function tokenize(expr) { + var tokens = []; + var isEscaped = false; + var token = []; + for (var i = 0; i < expr.length; i++) { + var c = expr.charAt(i); + if (isEscaped) { + if (c === '(' || c === ')' || c === '\\' || /\s/.test(c)) { + token.push(c); + isEscaped = false; + } + else { + throw new Error("Tag expression \"".concat(expr, "\" could not be parsed because of syntax error: Illegal escape before \"").concat(c, "\".")); + } + } + else if (c === '\\') { + isEscaped = true; + } + else if (c === '(' || c === ')' || /\s/.test(c)) { + if (token.length > 0) { + tokens.push(token.join('')); + token = []; + } + if (!/\s/.test(c)) { + tokens.push(c); + } + } + else { + token.push(c); + } + } + if (token.length > 0) { + tokens.push(token.join('')); + } + return tokens; +} +function isUnary(token) { + return 'not' === token; +} +function isBinary(token) { + return 'or' === token || 'and' === token; +} +function isOp(token) { + return ASSOC[token] !== undefined; +} +function peek(stack) { + return stack[stack.length - 1]; +} +var Literal = /** @class */ (function () { + function Literal(value) { + this.value = value; + } + Literal.prototype.evaluate = function (variables) { + return variables.indexOf(this.value) !== -1; + }; + Literal.prototype.toString = function () { + return this.value + .replace(/\\/g, '\\\\') + .replace(/\(/g, '\\(') + .replace(/\)/g, '\\)') + .replace(/\s/g, '\\ '); + }; + return Literal; +}()); +var Or = /** @class */ (function () { + function Or(leftExpr, rightExpr) { + this.leftExpr = leftExpr; + this.rightExpr = rightExpr; + } + Or.prototype.evaluate = function (variables) { + return this.leftExpr.evaluate(variables) || this.rightExpr.evaluate(variables); + }; + Or.prototype.toString = function () { + return '( ' + this.leftExpr.toString() + ' or ' + this.rightExpr.toString() + ' )'; + }; + return Or; +}()); +var And = /** @class */ (function () { + function And(leftExpr, rightExpr) { + this.leftExpr = leftExpr; + this.rightExpr = rightExpr; + } + And.prototype.evaluate = function (variables) { + return this.leftExpr.evaluate(variables) && this.rightExpr.evaluate(variables); + }; + And.prototype.toString = function () { + return '( ' + this.leftExpr.toString() + ' and ' + this.rightExpr.toString() + ' )'; + }; + return And; +}()); +var Not = /** @class */ (function () { + function Not(expr) { + this.expr = expr; + } + Not.prototype.evaluate = function (variables) { + return !this.expr.evaluate(variables); + }; + Not.prototype.toString = function () { + if (this.expr instanceof And || this.expr instanceof Or) { + // -- HINT: Binary Operators already have already '( ... )'. + return 'not ' + this.expr.toString(); + } + // -- OTHERWISE: + return 'not ( ' + this.expr.toString() + ' )'; + }; + return Not; +}()); +var True = /** @class */ (function () { + function True() { + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + True.prototype.evaluate = function (variables) { + return true; + }; + True.prototype.toString = function () { + return ''; + }; + return True; +}()); +/** + * @deprecated Use the named export `parse` instead: `import { parse } from '@cucumber/tag-expressions'` + */ +exports.default = parse; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.js.map b/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.js.map new file mode 100644 index 00000000..cd95c0a6 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;AAqBA,sBA4FC;AAjHD,IAAM,OAAO,GAAG,SAAS,CAAA;AACzB,IAAM,QAAQ,GAAG,UAAU,CAAA;AAC3B,IAAM,IAAI,GAA8B;IACtC,GAAG,EAAE,CAAC,CAAC;IACP,GAAG,EAAE,CAAC,CAAC;IACP,EAAE,EAAE,CAAC;IACL,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;CACP,CAAA;AACD,IAAM,KAAK,GAA8B;IACvC,EAAE,EAAE,MAAM;IACV,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,OAAO;CACb,CAAA;AAED;;;;;GAKG;AACH,SAAgB,KAAK,CAAC,KAAa;IACjC,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC9B,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,IAAI,EAAE,CAAA;IACnB,CAAC;IACD,IAAM,WAAW,GAAW,EAAE,CAAA;IAC9B,IAAM,SAAS,GAAa,EAAE,CAAA;IAC9B,IAAI,iBAAiB,GAAG,OAAO,CAAA;IAE/B,MAAM,CAAC,OAAO,CAAC,UAAU,KAAK;QAC5B,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACnB,KAAK,CAAC,iBAAiB,EAAE,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S,CAAC,CAAA;IAChF,CAAC;IAEM,sBAAQ,GAAf;QACE,OAAO,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAA;IACrF,CAAC;IACH,UAAC;AAAD,CAAC,AAbD,IAaC;AAED;IACE,aAA6B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAEpC,sBAAQ,GAAf,UAAgB,SAAmB;QACjC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IACvC,CAAC;IAEM,sBAAQ,GAAf;QACE,IAAI,IAAI,CAAC,IAAI,YAAY,GAAG,IAAI,IAAI,CAAC,IAAI,YAAY,EAAE,EAAE,CAAC;YACxD,4DAA4D;YAC5D,OAAO,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAA;QACtC,CAAC;QACD,gBAAgB;QAChB,OAAO,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAA;IAC/C,CAAC;IACH,UAAC;AAAD,CAAC,AAfD,IAeC;AAED;IAAA;IASA,CAAC;IARC,6DAA6D;IACtD,uBAAQ,GAAf,UAAgB,SAAmB;QACjC,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,uBAAQ,GAAf;QACE,OAAO,EAAE,CAAA;IACX,CAAC;IACH,WAAC;AAAD,CAAC,AATD,IASC;AAED;;GAEG;AACH,kBAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.d.ts b/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.d.ts new file mode 100644 index 00000000..428c8ce1 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=errors.test.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.d.ts.map new file mode 100644 index 00000000..78798ef5 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.test.d.ts","sourceRoot":"","sources":["../../../test/errors.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.js b/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.js new file mode 100644 index 00000000..e992fd7e --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.js @@ -0,0 +1,44 @@ +"use strict"; +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var fs_1 = __importDefault(require("fs")); +var js_yaml_1 = __importDefault(require("js-yaml")); +var index_js_1 = __importDefault(require("../src/index.js")); +var testDataDir_js_1 = require("./testDataDir.js"); +var tests = js_yaml_1.default.load(fs_1.default.readFileSync("".concat(testDataDir_js_1.testDataDir, "/errors.yml"), 'utf-8')); +describe('Errors', function () { + var e_1, _a; + var _loop_1 = function (test_1) { + it("fails to parse \"".concat(test_1.expression, "\" with \"").concat(test_1.error, "\""), function () { + assert_1.default.throws(function () { return (0, index_js_1.default)(test_1.expression); }, { message: test_1.error }); + }); + }; + try { + for (var tests_1 = __values(tests), tests_1_1 = tests_1.next(); !tests_1_1.done; tests_1_1 = tests_1.next()) { + var test_1 = tests_1_1.value; + _loop_1(test_1); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (tests_1_1 && !tests_1_1.done && (_a = tests_1.return)) _a.call(tests_1); + } + finally { if (e_1) throw e_1.error; } + } +}); +//# sourceMappingURL=errors.test.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.js.map b/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.js.map new file mode 100644 index 00000000..c79fe9c7 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/errors.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.test.js","sourceRoot":"","sources":["../../../test/errors.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA2B;AAC3B,0CAAmB;AACnB,oDAA0B;AAE1B,6DAAmC;AACnC,mDAA8C;AAO9C,IAAM,KAAK,GAAG,iBAAI,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,UAAG,4BAAW,gBAAa,EAAE,OAAO,CAAC,CAAgB,CAAA;AAE7F,QAAQ,CAAC,QAAQ,EAAE;;4BACN,MAAI;QACb,EAAE,CAAC,2BAAmB,MAAI,CAAC,UAAU,uBAAW,MAAI,CAAC,KAAK,OAAG,EAAE;YAC7D,gBAAM,CAAC,MAAM,CAAC,cAAM,OAAA,IAAA,kBAAK,EAAC,MAAI,CAAC,UAAU,CAAC,EAAtB,CAAsB,EAAE,EAAE,OAAO,EAAE,MAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QACtE,CAAC,CAAC,CAAA;;;QAHJ,KAAmB,IAAA,UAAA,SAAA,KAAK,CAAA,4BAAA;YAAnB,IAAM,MAAI,kBAAA;oBAAJ,MAAI;SAId;;;;;;;;;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.d.ts b/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.d.ts new file mode 100644 index 00000000..82af13c6 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=evaluations.test.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.d.ts.map new file mode 100644 index 00000000..46129a21 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluations.test.d.ts","sourceRoot":"","sources":["../../../test/evaluations.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.js b/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.js new file mode 100644 index 00000000..03f0b6e0 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.js @@ -0,0 +1,63 @@ +"use strict"; +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var fs_1 = __importDefault(require("fs")); +var js_yaml_1 = __importDefault(require("js-yaml")); +var index_js_1 = __importDefault(require("../src/index.js")); +var testDataDir_js_1 = require("./testDataDir.js"); +var evaluationsTest = js_yaml_1.default.load(fs_1.default.readFileSync("".concat(testDataDir_js_1.testDataDir, "/evaluations.yml"), 'utf-8')); +describe('Evaluations', function () { + var e_1, _a; + var _loop_1 = function (evaluation) { + describe(evaluation.expression, function () { + var e_2, _a; + var _loop_2 = function (test_1) { + it("evaluates [".concat(test_1.variables.join(', '), "] to ").concat(test_1.result), function () { + var node = (0, index_js_1.default)(evaluation.expression); + assert_1.default.strictEqual(node.evaluate(test_1.variables), test_1.result); + }); + }; + try { + for (var _b = (e_2 = void 0, __values(evaluation.tests)), _c = _b.next(); !_c.done; _c = _b.next()) { + var test_1 = _c.value; + _loop_2(test_1); + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) _a.call(_b); + } + finally { if (e_2) throw e_2.error; } + } + }); + }; + try { + for (var evaluationsTest_1 = __values(evaluationsTest), evaluationsTest_1_1 = evaluationsTest_1.next(); !evaluationsTest_1_1.done; evaluationsTest_1_1 = evaluationsTest_1.next()) { + var evaluation = evaluationsTest_1_1.value; + _loop_1(evaluation); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (evaluationsTest_1_1 && !evaluationsTest_1_1.done && (_a = evaluationsTest_1.return)) _a.call(evaluationsTest_1); + } + finally { if (e_1) throw e_1.error; } + } +}); +//# sourceMappingURL=evaluations.test.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.js.map b/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.js.map new file mode 100644 index 00000000..d6563242 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/evaluations.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluations.test.js","sourceRoot":"","sources":["../../../test/evaluations.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA2B;AAC3B,0CAAmB;AACnB,oDAA0B;AAE1B,6DAAmC;AACnC,mDAA8C;AAU9C,IAAM,eAAe,GAAG,iBAAI,CAAC,IAAI,CAC/B,YAAE,CAAC,YAAY,CAAC,UAAG,4BAAW,qBAAkB,EAAE,OAAO,CAAC,CAC3C,CAAA;AAEjB,QAAQ,CAAC,aAAa,EAAE;;4BACX,UAAU;QACnB,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE;;oCACnB,MAAI;gBACb,EAAE,CAAC,qBAAc,MAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAQ,MAAI,CAAC,MAAM,CAAE,EAAE;oBAC/D,IAAM,IAAI,GAAG,IAAA,kBAAK,EAAC,UAAU,CAAC,UAAU,CAAC,CAAA;oBACzC,gBAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAI,CAAC,SAAS,CAAC,EAAE,MAAI,CAAC,MAAM,CAAC,CAAA;gBAChE,CAAC,CAAC,CAAA;;;gBAJJ,KAAmB,IAAA,oBAAA,SAAA,UAAU,CAAC,KAAK,CAAA,CAAA,gBAAA;oBAA9B,IAAM,MAAI,WAAA;4BAAJ,MAAI;iBAKd;;;;;;;;;QACH,CAAC,CAAC,CAAA;;;QARJ,KAAyB,IAAA,oBAAA,SAAA,eAAe,CAAA,gDAAA;YAAnC,IAAM,UAAU,4BAAA;oBAAV,UAAU;SASpB;;;;;;;;;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.d.ts b/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.d.ts new file mode 100644 index 00000000..c90cf427 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=parsing.test.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.d.ts.map new file mode 100644 index 00000000..4b54406f --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parsing.test.d.ts","sourceRoot":"","sources":["../../../test/parsing.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.js b/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.js new file mode 100644 index 00000000..6b63b0c2 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.js @@ -0,0 +1,47 @@ +"use strict"; +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var assert_1 = __importDefault(require("assert")); +var fs_1 = __importDefault(require("fs")); +var js_yaml_1 = __importDefault(require("js-yaml")); +var index_js_1 = __importDefault(require("../src/index.js")); +var testDataDir_js_1 = require("./testDataDir.js"); +var tests = js_yaml_1.default.load(fs_1.default.readFileSync("".concat(testDataDir_js_1.testDataDir, "/parsing.yml"), 'utf-8')); +describe('Parsing', function () { + var e_1, _a; + var _loop_1 = function (test_1) { + it("parses \"".concat(test_1.expression, "\" into \"").concat(test_1.formatted, "\""), function () { + var expression = (0, index_js_1.default)(test_1.expression); + assert_1.default.strictEqual(expression.toString(), test_1.formatted); + var expressionAgain = (0, index_js_1.default)(expression.toString()); + assert_1.default.strictEqual(expressionAgain.toString(), test_1.formatted); + }); + }; + try { + for (var tests_1 = __values(tests), tests_1_1 = tests_1.next(); !tests_1_1.done; tests_1_1 = tests_1.next()) { + var test_1 = tests_1_1.value; + _loop_1(test_1); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (tests_1_1 && !tests_1_1.done && (_a = tests_1.return)) _a.call(tests_1); + } + finally { if (e_1) throw e_1.error; } + } +}); +//# sourceMappingURL=parsing.test.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.js.map b/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.js.map new file mode 100644 index 00000000..3b3d989f --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/parsing.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parsing.test.js","sourceRoot":"","sources":["../../../test/parsing.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA2B;AAC3B,0CAAmB;AACnB,oDAA0B;AAE1B,6DAAmC;AACnC,mDAA8C;AAO9C,IAAM,KAAK,GAAG,iBAAI,CAAC,IAAI,CAAC,YAAE,CAAC,YAAY,CAAC,UAAG,4BAAW,iBAAc,EAAE,OAAO,CAAC,CAAkB,CAAA;AAEhG,QAAQ,CAAC,SAAS,EAAE;;4BACP,MAAI;QACb,EAAE,CAAC,mBAAW,MAAI,CAAC,UAAU,uBAAW,MAAI,CAAC,SAAS,OAAG,EAAE;YACzD,IAAM,UAAU,GAAG,IAAA,kBAAK,EAAC,MAAI,CAAC,UAAU,CAAC,CAAA;YACzC,gBAAM,CAAC,WAAW,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,MAAI,CAAC,SAAS,CAAC,CAAA;YAEzD,IAAM,eAAe,GAAG,IAAA,kBAAK,EAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;YACpD,gBAAM,CAAC,WAAW,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,MAAI,CAAC,SAAS,CAAC,CAAA;QAChE,CAAC,CAAC,CAAA;;;QAPJ,KAAmB,IAAA,UAAA,SAAA,KAAK,CAAA,4BAAA;YAAnB,IAAM,MAAI,kBAAA;oBAAJ,MAAI;SAQd;;;;;;;;;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.d.ts b/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.d.ts new file mode 100644 index 00000000..d1ff6beb --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.d.ts @@ -0,0 +1,2 @@ +export declare const testDataDir: string; +//# sourceMappingURL=testDataDir.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.d.ts.map new file mode 100644 index 00000000..07c67596 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"testDataDir.d.ts","sourceRoot":"","sources":["../../../test/testDataDir.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAA6D,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.js b/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.js new file mode 100644 index 00000000..295c2edf --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.testDataDir = void 0; +exports.testDataDir = process.env.TAG_EXPRESSIONS_TEST_DATA_DIR || '../testdata'; +//# sourceMappingURL=testDataDir.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.js.map b/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.js.map new file mode 100644 index 00000000..442960bf --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/test/testDataDir.js.map @@ -0,0 +1 @@ +{"version":3,"file":"testDataDir.js","sourceRoot":"","sources":["../../../test/testDataDir.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/cjs/tsconfig.build-cjs.tsbuildinfo b/node_modules/@cucumber/tag-expressions/dist/cjs/tsconfig.build-cjs.tsbuildinfo new file mode 100644 index 00000000..b33198ad --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/cjs/tsconfig.build-cjs.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/index.ts","../../node_modules/@types/js-yaml/index.d.ts","../../test/testDataDir.ts","../../test/errors.test.ts","../../test/evaluations.test.ts","../../test/parsing.test.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/json5/index.d.ts","../../node_modules/@types/mocha/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/@types/node/web-globals/events.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/inspector.generated.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/sqlite.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[62,110,127,128],[62,107,108,110,127,128],[62,109,110,127,128],[110,127,128],[62,110,115,127,128,145],[62,110,111,116,121,127,128,130,142,153],[62,110,111,112,121,127,128,130],[57,58,59,62,110,127,128],[62,110,113,127,128,154],[62,110,114,115,122,127,128,131],[62,110,115,127,128,142,150],[62,110,116,118,121,127,128,130],[62,109,110,117,127,128],[62,110,118,119,127,128],[62,110,120,121,127,128],[62,109,110,121,127,128],[62,110,121,122,123,127,128,142,153],[62,110,121,122,123,127,128,137,142,145],[62,103,110,118,121,124,127,128,130,142,153],[62,110,121,122,124,125,127,128,130,142,150,153],[62,110,124,126,127,128,142,150,153],[60,61,62,63,64,65,66,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],[62,110,121,127,128],[62,110,127,128,129,153],[62,110,118,121,127,128,130,142],[62,110,127,128,131],[62,110,127,128,132],[62,109,110,127,128,133],[62,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159],[62,110,127,128,135],[62,110,127,128,136],[62,110,121,127,128,137,138],[62,110,127,128,137,139,154,156],[62,110,122,127,128],[62,110,121,127,128,142,143,145],[62,110,127,128,144,145],[62,110,127,128,142,143],[62,110,127,128,145],[62,110,127,128,146],[62,107,110,127,128,142,147,153],[62,110,121,127,128,148,149],[62,110,127,128,148,149],[62,110,115,127,128,130,142,150],[62,110,127,128,151],[62,110,127,128,130,152],[62,110,124,127,128,136,153],[62,110,115,127,128,154],[62,110,127,128,142,155],[62,110,127,128,129,156],[62,110,127,128,157],[62,103,110,127,128],[62,103,110,121,123,127,128,133,142,145,153,155,156,158],[62,110,127,128,142,159],[62,75,79,110,127,128,153],[62,75,110,127,128,142,153],[62,70,110,127,128],[62,72,75,110,127,128,150,153],[62,110,127,128,130,150],[62,110,127,128,160],[62,70,110,127,128,160],[62,72,75,110,127,128,130,153],[62,67,68,71,74,110,121,127,128,142,153],[62,75,82,110,127,128],[62,67,73,110,127,128],[62,75,96,97,110,127,128],[62,71,75,110,127,128,145,153,160],[62,96,110,127,128,160],[62,69,70,110,127,128,160],[62,75,110,127,128],[62,69,70,71,72,73,74,75,76,77,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,97,98,99,100,101,102,110,127,128],[62,75,90,110,127,128],[62,75,82,83,110,127,128],[62,73,75,83,84,110,127,128],[62,74,110,127,128],[62,67,70,75,110,127,128],[62,75,79,83,84,110,127,128],[62,79,110,127,128],[62,73,75,78,110,127,128,153],[62,67,72,75,82,110,127,128],[62,110,127,128,142],[62,70,75,96,110,127,128,158,160],[47,48,49,62,107,110,122,127,128]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"f848f045ce0e49ffe9f383cd575ad14e56b6a1a41ac1610e97dd764061166869","signature":"ff7ffac8d9efc0c3c21083324e96d40aae6debeff7599af97ea19510391236bc"},{"version":"5b89c37ff5dfea00195f8ea5e6fc8e086be68613297fc8152c08900a1d1fdb83","impliedFormat":1},{"version":"457a5ffb6b3d7d2bce4ca038b56ff812e4b5a7b09c41cd7e8e59611025733e90","signature":"bd6640feffbb44ade7ce92bd1353f4ca41107af7bc1a05b290e1344854e60fcf"},{"version":"c747a6506f143144c533bc8fc04c1af5aaf2b8cd7d764d7683e2338586245010","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"25b7ee0f11180bf75f2f287aadb374930ac6ad86fe179019c0025f2571950e80","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"969102143aef0d525b5afd6f752f39f43ac138a338e320edcc75c2f28e983a78","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"f949f7f6c7802a338039cfc2156d1fe285cdd1e092c64437ebe15ae8edc854e0","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bc7425ef40526650d6db7e072c1ff4a51101c3ac2cc4b666623b19496a6e27","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"6b039f55681caaf111d5eb84d292b9bee9e0131d0db1ad0871eef0964f533c73","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c8d3e5a18ba35629954e48c4cc8f11dc88224650067a172685c736b27a34a4dc","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"0dba70b3fb0dcd713fda33c2df64fa6751fff6460e536971cee917260fb17882","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1}],"root":[47,[49,52]],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitAny":true,"outDir":"./","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":1},"referencedMap":[[53,1],[48,1],[54,1],[55,1],[56,1],[107,2],[108,2],[109,3],[62,4],[110,5],[111,6],[112,7],[57,1],[60,8],[58,1],[59,1],[113,9],[114,10],[115,11],[116,12],[117,13],[118,14],[119,14],[120,15],[121,16],[122,17],[123,18],[63,1],[61,1],[124,19],[125,20],[126,21],[160,22],[127,23],[128,1],[129,24],[130,25],[131,26],[132,27],[133,28],[134,29],[135,30],[136,31],[137,32],[138,32],[139,33],[140,1],[141,34],[142,35],[144,36],[143,37],[145,38],[146,39],[147,40],[148,41],[149,42],[150,43],[151,44],[152,45],[153,46],[154,47],[155,48],[156,49],[157,50],[64,1],[65,1],[66,1],[104,51],[105,1],[106,1],[158,52],[159,53],[45,1],[46,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[19,1],[20,1],[4,1],[21,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[82,54],[92,55],[81,54],[102,56],[73,57],[72,58],[101,59],[95,60],[100,61],[75,62],[89,63],[74,64],[98,65],[70,66],[69,59],[99,67],[71,68],[76,69],[77,1],[80,69],[67,1],[103,70],[93,71],[84,72],[85,73],[87,74],[83,75],[86,76],[96,59],[78,77],[79,78],[88,79],[68,80],[91,71],[90,69],[94,1],[97,81],[47,1],[50,82],[51,82],[52,82],[49,1]],"latestChangedDtsFile":"./test/parsing.test.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/src/index.d.ts b/node_modules/@cucumber/tag-expressions/dist/esm/src/index.d.ts new file mode 100644 index 00000000..eac23c17 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/src/index.d.ts @@ -0,0 +1,15 @@ +/** + * Parses infix boolean expression (using Dijkstra's Shunting Yard algorithm) + * and builds a tree of expressions. The root node of the expression is returned. + * + * This expression can be evaluated by passing in an array of literals that resolve to true + */ +export declare function parse(infix: string): Node; +export interface Node { + evaluate(variables: string[]): boolean; +} +/** + * @deprecated Use the named export `parse` instead: `import { parse } from '@cucumber/tag-expressions'` + */ +export default parse; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/src/index.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/esm/src/index.d.ts.map new file mode 100644 index 00000000..c5ea3cc9 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CA4FzC;AAqDD,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;CACvC;AA4ED;;GAEG;AACH,eAAe,KAAK,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/src/index.js b/node_modules/@cucumber/tag-expressions/dist/esm/src/index.js new file mode 100644 index 00000000..26f52bb2 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/src/index.js @@ -0,0 +1,221 @@ +const OPERAND = 'operand'; +const OPERATOR = 'operator'; +const PREC = { + '(': -2, + ')': -1, + or: 0, + and: 1, + not: 2, +}; +const ASSOC = { + or: 'left', + and: 'left', + not: 'right', +}; +/** + * Parses infix boolean expression (using Dijkstra's Shunting Yard algorithm) + * and builds a tree of expressions. The root node of the expression is returned. + * + * This expression can be evaluated by passing in an array of literals that resolve to true + */ +export function parse(infix) { + const tokens = tokenize(infix); + if (tokens.length === 0) { + return new True(); + } + const expressions = []; + const operators = []; + let expectedTokenType = OPERAND; + tokens.forEach(function (token) { + if (isUnary(token)) { + check(expectedTokenType, OPERAND); + operators.push(token); + expectedTokenType = OPERAND; + } + else if (isBinary(token)) { + check(expectedTokenType, OPERATOR); + while (operators.length > 0 && + isOp(peek(operators)) && + ((ASSOC[token] === 'left' && PREC[token] <= PREC[peek(operators)]) || + (ASSOC[token] === 'right' && PREC[token] < PREC[peek(operators)]))) { + pushExpr(operators.pop(), expressions); + } + operators.push(token); + expectedTokenType = OPERAND; + } + else if ('(' === token) { + check(expectedTokenType, OPERAND); + operators.push(token); + expectedTokenType = OPERAND; + } + else if (')' === token) { + check(expectedTokenType, OPERATOR); + while (operators.length > 0 && peek(operators) !== '(') { + pushExpr(operators.pop(), expressions); + } + if (operators.length === 0) { + throw new Error(`Tag expression "${infix}" could not be parsed because of syntax error: Unmatched ).`); + } + if (peek(operators) === '(') { + operators.pop(); + } + expectedTokenType = OPERATOR; + } + else { + check(expectedTokenType, OPERAND); + pushExpr(token, expressions); + expectedTokenType = OPERATOR; + } + }); + while (operators.length > 0) { + if (peek(operators) === '(') { + throw new Error(`Tag expression "${infix}" could not be parsed because of syntax error: Unmatched (.`); + } + pushExpr(operators.pop(), expressions); + } + return expressions.pop(); + function check(expectedTokenType, tokenType) { + if (expectedTokenType !== tokenType) { + throw new Error(`Tag expression "${infix}" could not be parsed because of syntax error: Expected ${expectedTokenType}.`); + } + } + function pushExpr(token, stack) { + if (token === 'and') { + const rightAndExpr = popOperand(stack); + stack.push(new And(popOperand(stack), rightAndExpr)); + } + else if (token === 'or') { + const rightOrExpr = popOperand(stack); + stack.push(new Or(popOperand(stack), rightOrExpr)); + } + else if (token === 'not') { + stack.push(new Not(popOperand(stack))); + } + else { + stack.push(new Literal(token)); + } + } + function popOperand(stack) { + if (stack.length === 0) { + throw new Error(`Tag expression "${infix}" could not be parsed because of syntax error: Expected operand.`); + } + return stack.pop(); + } +} +function tokenize(expr) { + const tokens = []; + let isEscaped = false; + let token = []; + for (let i = 0; i < expr.length; i++) { + const c = expr.charAt(i); + if (isEscaped) { + if (c === '(' || c === ')' || c === '\\' || /\s/.test(c)) { + token.push(c); + isEscaped = false; + } + else { + throw new Error(`Tag expression "${expr}" could not be parsed because of syntax error: Illegal escape before "${c}".`); + } + } + else if (c === '\\') { + isEscaped = true; + } + else if (c === '(' || c === ')' || /\s/.test(c)) { + if (token.length > 0) { + tokens.push(token.join('')); + token = []; + } + if (!/\s/.test(c)) { + tokens.push(c); + } + } + else { + token.push(c); + } + } + if (token.length > 0) { + tokens.push(token.join('')); + } + return tokens; +} +function isUnary(token) { + return 'not' === token; +} +function isBinary(token) { + return 'or' === token || 'and' === token; +} +function isOp(token) { + return ASSOC[token] !== undefined; +} +function peek(stack) { + return stack[stack.length - 1]; +} +class Literal { + constructor(value) { + this.value = value; + } + evaluate(variables) { + return variables.indexOf(this.value) !== -1; + } + toString() { + return this.value + .replace(/\\/g, '\\\\') + .replace(/\(/g, '\\(') + .replace(/\)/g, '\\)') + .replace(/\s/g, '\\ '); + } +} +class Or { + constructor(leftExpr, rightExpr) { + this.leftExpr = leftExpr; + this.rightExpr = rightExpr; + } + evaluate(variables) { + return this.leftExpr.evaluate(variables) || this.rightExpr.evaluate(variables); + } + toString() { + return '( ' + this.leftExpr.toString() + ' or ' + this.rightExpr.toString() + ' )'; + } +} +class And { + constructor(leftExpr, rightExpr) { + this.leftExpr = leftExpr; + this.rightExpr = rightExpr; + } + evaluate(variables) { + return this.leftExpr.evaluate(variables) && this.rightExpr.evaluate(variables); + } + toString() { + return '( ' + this.leftExpr.toString() + ' and ' + this.rightExpr.toString() + ' )'; + } +} +class Not { + constructor(expr) { + this.expr = expr; + } + evaluate(variables) { + return !this.expr.evaluate(variables); + } + toString() { + if (this.expr instanceof And || this.expr instanceof Or) { + // -- HINT: Binary Operators already have already '( ... )'. + return 'not ' + this.expr.toString(); + } + // -- OTHERWISE: + return 'not ( ' + this.expr.toString() + ' )'; + } +} +class True { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + evaluate(variables) { + return true; + } + toString() { + return ''; + } +} +/** + * @deprecated Use the named export `parse` instead: `import { parse } from '@cucumber/tag-expressions'` + */ +export default parse; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/src/index.js.map b/node_modules/@cucumber/tag-expressions/dist/esm/src/index.js.map new file mode 100644 index 00000000..c15e21a2 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,SAAS,CAAA;AACzB,MAAM,QAAQ,GAAG,UAAU,CAAA;AAC3B,MAAM,IAAI,GAA8B;IACtC,GAAG,EAAE,CAAC,CAAC;IACP,GAAG,EAAE,CAAC,CAAC;IACP,EAAE,EAAE,CAAC;IACL,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;CACP,CAAA;AACD,MAAM,KAAK,GAA8B;IACvC,EAAE,EAAE,MAAM;IACV,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,OAAO;CACb,CAAA;AAED;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,MAAM,MAAM,GAAG,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.d.ts b/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.d.ts new file mode 100644 index 00000000..428c8ce1 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=errors.test.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.d.ts.map new file mode 100644 index 00000000..78798ef5 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.test.d.ts","sourceRoot":"","sources":["../../../test/errors.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.js b/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.js new file mode 100644 index 00000000..a18ff955 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.js @@ -0,0 +1,14 @@ +import assert from 'assert'; +import fs from 'fs'; +import yaml from 'js-yaml'; +import parse from '../src/index.js'; +import { testDataDir } from './testDataDir.js'; +const tests = yaml.load(fs.readFileSync(`${testDataDir}/errors.yml`, 'utf-8')); +describe('Errors', () => { + for (const test of tests) { + it(`fails to parse "${test.expression}" with "${test.error}"`, () => { + assert.throws(() => parse(test.expression), { message: test.error }); + }); + } +}); +//# sourceMappingURL=errors.test.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.js.map b/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.js.map new file mode 100644 index 00000000..17297b44 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/errors.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.test.js","sourceRoot":"","sources":["../../../test/errors.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAO9C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,WAAW,aAAa,EAAE,OAAO,CAAC,CAAgB,CAAA;AAE7F,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,EAAE,CAAC,mBAAmB,IAAI,CAAC,UAAU,WAAW,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE;YAClE,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QACtE,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.d.ts b/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.d.ts new file mode 100644 index 00000000..82af13c6 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=evaluations.test.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.d.ts.map new file mode 100644 index 00000000..46129a21 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluations.test.d.ts","sourceRoot":"","sources":["../../../test/evaluations.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.js b/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.js new file mode 100644 index 00000000..e69fc037 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.js @@ -0,0 +1,19 @@ +import assert from 'assert'; +import fs from 'fs'; +import yaml from 'js-yaml'; +import parse from '../src/index.js'; +import { testDataDir } from './testDataDir.js'; +const evaluationsTest = yaml.load(fs.readFileSync(`${testDataDir}/evaluations.yml`, 'utf-8')); +describe('Evaluations', () => { + for (const evaluation of evaluationsTest) { + describe(evaluation.expression, () => { + for (const test of evaluation.tests) { + it(`evaluates [${test.variables.join(', ')}] to ${test.result}`, () => { + const node = parse(evaluation.expression); + assert.strictEqual(node.evaluate(test.variables), test.result); + }); + } + }); + } +}); +//# sourceMappingURL=evaluations.test.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.js.map b/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.js.map new file mode 100644 index 00000000..c35609ad --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/evaluations.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"evaluations.test.js","sourceRoot":"","sources":["../../../test/evaluations.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAU9C,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAC/B,EAAE,CAAC,YAAY,CAAC,GAAG,WAAW,kBAAkB,EAAE,OAAO,CAAC,CAC3C,CAAA;AAEjB,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,KAAK,MAAM,UAAU,IAAI,eAAe,EAAE,CAAC;QACzC,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE;YACnC,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;gBACpC,EAAE,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE;oBACpE,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;oBACzC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;gBAChE,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.d.ts b/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.d.ts new file mode 100644 index 00000000..c90cf427 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=parsing.test.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.d.ts.map new file mode 100644 index 00000000..4b54406f --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parsing.test.d.ts","sourceRoot":"","sources":["../../../test/parsing.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.js b/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.js new file mode 100644 index 00000000..97222a57 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.js @@ -0,0 +1,17 @@ +import assert from 'assert'; +import fs from 'fs'; +import yaml from 'js-yaml'; +import parse from '../src/index.js'; +import { testDataDir } from './testDataDir.js'; +const tests = yaml.load(fs.readFileSync(`${testDataDir}/parsing.yml`, 'utf-8')); +describe('Parsing', () => { + for (const test of tests) { + it(`parses "${test.expression}" into "${test.formatted}"`, () => { + const expression = parse(test.expression); + assert.strictEqual(expression.toString(), test.formatted); + const expressionAgain = parse(expression.toString()); + assert.strictEqual(expressionAgain.toString(), test.formatted); + }); + } +}); +//# sourceMappingURL=parsing.test.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.js.map b/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.js.map new file mode 100644 index 00000000..73e66167 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/parsing.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parsing.test.js","sourceRoot":"","sources":["../../../test/parsing.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAO9C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,WAAW,cAAc,EAAE,OAAO,CAAC,CAAkB,CAAA;AAEhG,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,EAAE,CAAC,WAAW,IAAI,CAAC,UAAU,WAAW,IAAI,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE;YAC9D,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;YACzC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;YAEzD,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;YACpD,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAChE,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.d.ts b/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.d.ts new file mode 100644 index 00000000..d1ff6beb --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.d.ts @@ -0,0 +1,2 @@ +export declare const testDataDir: string; +//# sourceMappingURL=testDataDir.d.ts.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.d.ts.map b/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.d.ts.map new file mode 100644 index 00000000..07c67596 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"testDataDir.d.ts","sourceRoot":"","sources":["../../../test/testDataDir.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAA6D,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.js b/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.js new file mode 100644 index 00000000..541bc820 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.js @@ -0,0 +1,2 @@ +export const testDataDir = process.env.TAG_EXPRESSIONS_TEST_DATA_DIR || '../testdata'; +//# sourceMappingURL=testDataDir.js.map \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.js.map b/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.js.map new file mode 100644 index 00000000..c6d72131 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/test/testDataDir.js.map @@ -0,0 +1 @@ +{"version":3,"file":"testDataDir.js","sourceRoot":"","sources":["../../../test/testDataDir.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,IAAI,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/dist/esm/tsconfig.build-esm.tsbuildinfo b/node_modules/@cucumber/tag-expressions/dist/esm/tsconfig.build-esm.tsbuildinfo new file mode 100644 index 00000000..184bb4e8 --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/dist/esm/tsconfig.build-esm.tsbuildinfo @@ -0,0 +1 @@ +{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/index.ts","../../node_modules/@types/js-yaml/index.d.ts","../../test/testDataDir.ts","../../test/errors.test.ts","../../test/evaluations.test.ts","../../test/parsing.test.ts","../../node_modules/@types/estree/index.d.ts","../../node_modules/@types/json-schema/index.d.ts","../../node_modules/@types/json5/index.d.ts","../../node_modules/@types/mocha/index.d.ts","../../node_modules/@types/node/compatibility/disposable.d.ts","../../node_modules/@types/node/compatibility/indexable.d.ts","../../node_modules/@types/node/compatibility/iterators.d.ts","../../node_modules/@types/node/compatibility/index.d.ts","../../node_modules/@types/node/globals.typedarray.d.ts","../../node_modules/@types/node/buffer.buffer.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../node_modules/@types/node/web-globals/domexception.d.ts","../../node_modules/@types/node/web-globals/events.d.ts","../../node_modules/undici-types/header.d.ts","../../node_modules/undici-types/readable.d.ts","../../node_modules/undici-types/file.d.ts","../../node_modules/undici-types/fetch.d.ts","../../node_modules/undici-types/formdata.d.ts","../../node_modules/undici-types/connector.d.ts","../../node_modules/undici-types/client.d.ts","../../node_modules/undici-types/errors.d.ts","../../node_modules/undici-types/dispatcher.d.ts","../../node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/undici-types/global-origin.d.ts","../../node_modules/undici-types/pool-stats.d.ts","../../node_modules/undici-types/pool.d.ts","../../node_modules/undici-types/handlers.d.ts","../../node_modules/undici-types/balanced-pool.d.ts","../../node_modules/undici-types/agent.d.ts","../../node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/undici-types/mock-agent.d.ts","../../node_modules/undici-types/mock-client.d.ts","../../node_modules/undici-types/mock-pool.d.ts","../../node_modules/undici-types/mock-errors.d.ts","../../node_modules/undici-types/proxy-agent.d.ts","../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../node_modules/undici-types/retry-handler.d.ts","../../node_modules/undici-types/retry-agent.d.ts","../../node_modules/undici-types/api.d.ts","../../node_modules/undici-types/interceptors.d.ts","../../node_modules/undici-types/util.d.ts","../../node_modules/undici-types/cookies.d.ts","../../node_modules/undici-types/patch.d.ts","../../node_modules/undici-types/websocket.d.ts","../../node_modules/undici-types/eventsource.d.ts","../../node_modules/undici-types/filereader.d.ts","../../node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/undici-types/content-type.d.ts","../../node_modules/undici-types/cache.d.ts","../../node_modules/undici-types/index.d.ts","../../node_modules/@types/node/web-globals/fetch.d.ts","../../node_modules/@types/node/web-globals/navigator.d.ts","../../node_modules/@types/node/web-globals/storage.d.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/inspector.generated.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/sea.d.ts","../../node_modules/@types/node/sqlite.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[61,109,126,127],[61,106,107,109,126,127],[61,108,109,126,127],[109,126,127],[61,109,114,126,127,144],[61,109,110,115,120,126,127,129,141,152],[61,109,110,111,120,126,127,129],[56,57,58,61,109,126,127],[61,109,112,126,127,153],[61,109,113,114,121,126,127,130],[61,109,114,126,127,141,149],[61,109,115,117,120,126,127,129],[61,108,109,116,126,127],[61,109,117,118,126,127],[61,109,119,120,126,127],[61,108,109,120,126,127],[61,109,120,121,122,126,127,141,152],[61,109,120,121,122,126,127,136,141,144],[61,102,109,117,120,123,126,127,129,141,152],[61,109,120,121,123,124,126,127,129,141,149,152],[61,109,123,125,126,127,141,149,152],[59,60,61,62,63,64,65,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158],[61,109,120,126,127],[61,109,126,127,128,152],[61,109,117,120,126,127,129,141],[61,109,126,127,130],[61,109,126,127,131],[61,108,109,126,127,132],[61,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158],[61,109,126,127,134],[61,109,126,127,135],[61,109,120,126,127,136,137],[61,109,126,127,136,138,153,155],[61,109,121,126,127],[61,109,120,126,127,141,142,144],[61,109,126,127,143,144],[61,109,126,127,141,142],[61,109,126,127,144],[61,109,126,127,145],[61,106,109,126,127,141,146,152],[61,109,120,126,127,147,148],[61,109,126,127,147,148],[61,109,114,126,127,129,141,149],[61,109,126,127,150],[61,109,126,127,129,151],[61,109,123,126,127,135,152],[61,109,114,126,127,153],[61,109,126,127,141,154],[61,109,126,127,128,155],[61,109,126,127,156],[61,102,109,126,127],[61,102,109,120,122,126,127,132,141,144,152,154,155,157],[61,109,126,127,141,158],[61,74,78,109,126,127,152],[61,74,109,126,127,141,152],[61,69,109,126,127],[61,71,74,109,126,127,149,152],[61,109,126,127,129,149],[61,109,126,127,159],[61,69,109,126,127,159],[61,71,74,109,126,127,129,152],[61,66,67,70,73,109,120,126,127,141,152],[61,74,81,109,126,127],[61,66,72,109,126,127],[61,74,95,96,109,126,127],[61,70,74,109,126,127,144,152,159],[61,95,109,126,127,159],[61,68,69,109,126,127,159],[61,74,109,126,127],[61,68,69,70,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,96,97,98,99,100,101,109,126,127],[61,74,89,109,126,127],[61,74,81,82,109,126,127],[61,72,74,82,83,109,126,127],[61,73,109,126,127],[61,66,69,74,109,126,127],[61,74,78,82,83,109,126,127],[61,78,109,126,127],[61,72,74,77,109,126,127,152],[61,66,71,74,81,109,126,127],[61,109,126,127,141],[61,69,74,95,109,126,127,157,159],[46,47,48,61,106,109,121,126,127]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"f848f045ce0e49ffe9f383cd575ad14e56b6a1a41ac1610e97dd764061166869","signature":"ff7ffac8d9efc0c3c21083324e96d40aae6debeff7599af97ea19510391236bc"},{"version":"5b89c37ff5dfea00195f8ea5e6fc8e086be68613297fc8152c08900a1d1fdb83","impliedFormat":1},{"version":"457a5ffb6b3d7d2bce4ca038b56ff812e4b5a7b09c41cd7e8e59611025733e90","signature":"bd6640feffbb44ade7ce92bd1353f4ca41107af7bc1a05b290e1344854e60fcf"},{"version":"c747a6506f143144c533bc8fc04c1af5aaf2b8cd7d764d7683e2338586245010","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"25b7ee0f11180bf75f2f287aadb374930ac6ad86fe179019c0025f2571950e80","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"969102143aef0d525b5afd6f752f39f43ac138a338e320edcc75c2f28e983a78","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","impliedFormat":1},{"version":"29f72ec1289ae3aeda78bf14b38086d3d803262ac13904b400422941a26a3636","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"b52476feb4a0cbcb25e5931b930fc73cb6643fb1a5060bf8a3dda0eeae5b4b68","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"f949f7f6c7802a338039cfc2156d1fe285cdd1e092c64437ebe15ae8edc854e0","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"d2bc7425ef40526650d6db7e072c1ff4a51101c3ac2cc4b666623b19496a6e27","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"6b039f55681caaf111d5eb84d292b9bee9e0131d0db1ad0871eef0964f533c73","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c8d3e5a18ba35629954e48c4cc8f11dc88224650067a172685c736b27a34a4dc","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"0dba70b3fb0dcd713fda33c2df64fa6751fff6460e536971cee917260fb17882","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1}],"root":[46,[48,51]],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":5,"noImplicitAny":true,"outDir":"./","rootDir":"../..","skipLibCheck":true,"sourceMap":true,"strictNullChecks":true,"target":2},"referencedMap":[[52,1],[47,1],[53,1],[54,1],[55,1],[106,2],[107,2],[108,3],[61,4],[109,5],[110,6],[111,7],[56,1],[59,8],[57,1],[58,1],[112,9],[113,10],[114,11],[115,12],[116,13],[117,14],[118,14],[119,15],[120,16],[121,17],[122,18],[62,1],[60,1],[123,19],[124,20],[125,21],[159,22],[126,23],[127,1],[128,24],[129,25],[130,26],[131,27],[132,28],[133,29],[134,30],[135,31],[136,32],[137,32],[138,33],[139,1],[140,34],[141,35],[143,36],[142,37],[144,38],[145,39],[146,40],[147,41],[148,42],[149,43],[150,44],[151,45],[152,46],[153,47],[154,48],[155,49],[156,50],[63,1],[64,1],[65,1],[103,51],[104,1],[105,1],[157,52],[158,53],[44,1],[45,1],[9,1],[8,1],[2,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[3,1],[18,1],[19,1],[4,1],[20,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[35,1],[32,1],[33,1],[34,1],[36,1],[7,1],[37,1],[42,1],[43,1],[38,1],[39,1],[40,1],[41,1],[1,1],[81,54],[91,55],[80,54],[101,56],[72,57],[71,58],[100,59],[94,60],[99,61],[74,62],[88,63],[73,64],[97,65],[69,66],[68,59],[98,67],[70,68],[75,69],[76,1],[79,69],[66,1],[102,70],[92,71],[83,72],[84,73],[86,74],[82,75],[85,76],[95,59],[77,77],[78,78],[87,79],[67,80],[90,71],[89,69],[93,1],[96,81],[46,1],[49,82],[50,82],[51,82],[48,1]],"latestChangedDtsFile":"./test/parsing.test.d.ts","version":"5.9.3"} \ No newline at end of file diff --git a/node_modules/@cucumber/tag-expressions/package.json b/node_modules/@cucumber/tag-expressions/package.json new file mode 100644 index 00000000..ff9b849a --- /dev/null +++ b/node_modules/@cucumber/tag-expressions/package.json @@ -0,0 +1,71 @@ +{ + "name": "@cucumber/tag-expressions", + "version": "9.1.0", + "description": "Cucumber Tag Expression parser", + "type": "module", + "main": "dist/cjs/src/index.js", + "types": "dist/cjs/src/index.d.ts", + "files": [ + "dist/cjs", + "dist/esm" + ], + "module": "dist/esm/src/index.js", + "jsnext:main": "dist/esm/src/index.js", + "exports": { + ".": { + "import": "./dist/esm/src/index.js", + "require": "./dist/cjs/src/index.js" + } + }, + "scripts": { + "build:cjs": "tsc --build tsconfig.build-cjs.json && cp package.cjs.json dist/cjs/package.json", + "build:esm": "tsc --build tsconfig.build-esm.json", + "build": "npm run build:cjs && npm run build:esm", + "test": "mocha && npm run test:cjs", + "test:cjs": "npm run build:cjs && mocha --no-config dist/cjs/test", + "stryker": "TAG_EXPRESSIONS_TEST_DATA_DIR=$(pwd)/../testdata stryker run", + "prepublishOnly": "npm run build", + "fix": "eslint --max-warnings 0 --fix src test && prettier --write src test", + "lint": "eslint --max-warnings 0 src test && prettier --check src test" + }, + "repository": { + "type": "git", + "url": "git://github.com/cucumber/tag-expressions.git" + }, + "keywords": [ + "cucumber" + ], + "author": "Cucumber Limited ", + "license": "MIT", + "bugs": { + "url": "https://github.com/cucumber/tag-expressions/issues" + }, + "homepage": "https://github.com/cucumber/tag-expressions", + "devDependencies": { + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "^9.21.0", + "@stryker-mutator/core": "9.5.1", + "@stryker-mutator/mocha-runner": "9.5.1", + "@stryker-mutator/typescript-checker": "9.5.1", + "@types/js-yaml": "^4.0.3", + "@types/mocha": "10.0.10", + "@types/node": "22.19.11", + "@typescript-eslint/eslint-plugin": "^8.46.0", + "@typescript-eslint/parser": "^8.46.0", + "eslint": "^9.21.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^17.15.1", + "eslint-plugin-simple-import-sort": "^12.1.1", + "globals": "^17.0.0", + "js-yaml": "^4.1.0", + "mocha": "11.7.5", + "prettier": "^3.5.2", + "pretty-quick": "4.2.2", + "ts-node": "10.9.2", + "typescript": "5.9.3" + }, + "directories": { + "test": "test" + } +} diff --git a/node_modules/@playwright/test/LICENSE b/node_modules/@playwright/test/LICENSE new file mode 100644 index 00000000..4ace03dd --- /dev/null +++ b/node_modules/@playwright/test/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Portions Copyright (c) Microsoft Corporation. + Portions Copyright 2017 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/@playwright/test/NOTICE b/node_modules/@playwright/test/NOTICE new file mode 100644 index 00000000..814ec169 --- /dev/null +++ b/node_modules/@playwright/test/NOTICE @@ -0,0 +1,5 @@ +Playwright +Copyright (c) Microsoft Corporation + +This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer), +available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE). diff --git a/node_modules/@playwright/test/README.md b/node_modules/@playwright/test/README.md new file mode 100644 index 00000000..d3abb8ff --- /dev/null +++ b/node_modules/@playwright/test/README.md @@ -0,0 +1,318 @@ +# 🎭 Playwright + +[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) [![Chromium version](https://img.shields.io/badge/chromium-149.0.7827.55-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-151.0-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-26.5-blue.svg?logo=safari)](https://webkit.org/) [![Join Discord](https://img.shields.io/badge/join-discord-informational)](https://aka.ms/playwright/discord) + +## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright) + +Playwright is a framework for web automation and testing. It drives Chromium, Firefox, and WebKit with a single API — in your tests, in your scripts, and as a tool for AI agents. + +## Get Started + +Choose the path that fits your workflow: + +| | Best for | Install | +|---|---|---| +| **[Playwright Test](#playwright-test)** | End-to-end testing | `npm init playwright@latest` | +| **[Playwright CLI](#playwright-cli)** | Coding agents (Claude Code, Copilot) | `npm i -g @playwright/cli@latest` | +| **[Playwright MCP](#playwright-mcp)** | AI agents and LLM-driven automation | `npx @playwright/mcp@latest` | +| **[Playwright Library](#playwright-library)** | Browser automation scripts | `npm i playwright` | +| **[VS Code Extension](#vs-code-extension)** | Test authoring and debugging in VS Code | [Install from Marketplace](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) | + +--- + +## Playwright Test + +Playwright Test is a full-featured test runner built for end-to-end testing. It runs tests across Chromium, Firefox, and WebKit with full browser isolation, auto-waiting, and web-first assertions. + +### Install + +```bash +npm init playwright@latest +``` + +Or add manually: + +```bash +npm i -D @playwright/test +npx playwright install +``` + +### Write a test + +```TypeScript +import { test, expect } from '@playwright/test'; + +test('has title', async ({ page }) => { + await page.goto('https://playwright.dev/'); + await expect(page).toHaveTitle(/Playwright/); +}); + +test('get started link', async ({ page }) => { + await page.goto('https://playwright.dev/'); + await page.getByRole('link', { name: 'Get started' }).click(); + await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); +}); +``` + +### Run tests + +```bash +npx playwright test +``` + +Tests run in parallel across all configured browsers, in headless mode by default. Each test gets a fresh browser context — full isolation with near-zero overhead. + +### Key capabilities + +**Auto-wait and web-first assertions.** No artificial timeouts. Playwright waits for elements to be actionable, and assertions automatically retry until conditions are met. + +**Locators.** Find elements with resilient locators that mirror how users see the page: + +```TypeScript +page.getByRole('button', { name: 'Submit' }) +page.getByLabel('Email') +page.getByPlaceholder('Search...') +page.getByTestId('login-form') +``` + +**Test isolation.** Each test runs in its own browser context — equivalent to a fresh browser profile. Save authentication state once and reuse it across tests: + +```TypeScript +// Save state after login +await page.context().storageState({ path: 'auth.json' }); + +// Reuse in other tests +test.use({ storageState: 'auth.json' }); +``` + +**Tracing.** Capture execution traces, screenshots, and videos on failure. Inspect every action, DOM snapshot, network request, and console message in the [Trace Viewer](https://playwright.dev/docs/trace-viewer): + +```TypeScript +// playwright.config.ts +export default defineConfig({ + use: { + trace: 'on-first-retry', + }, +}); +``` + +```bash +npx playwright show-trace trace.zip +``` + + + +**Parallelism.** Tests run in parallel by default across all configured browsers. + +[Full testing documentation](https://playwright.dev/docs/intro) + +--- + +## Playwright CLI + +[Playwright CLI](https://github.com/microsoft/playwright-cli) is a command-line interface for browser automation designed for coding agents. It's more token-efficient than MCP — commands avoid loading large tool schemas and accessibility trees into the model context. + +### Install + +```bash +npm install -g @playwright/cli@latest +``` + +Optionally install skills for richer agent integration: + +```bash +playwright-cli install --skills +``` + +### Usage + +Point your coding agent at a task: + +``` +Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli. +Take screenshots for all successful and failing scenarios. +``` + +Or run commands directly: + +```bash +playwright-cli open https://demo.playwright.dev/todomvc/ --headed +playwright-cli type "Buy groceries" +playwright-cli press Enter +playwright-cli screenshot +``` + +### Session monitoring + +Use `playwright-cli show` to open a visual dashboard with live screencast previews of all running browser sessions. Click any session to zoom in and take remote control. + +```bash +playwright-cli show +``` + + + +[Full CLI documentation](https://playwright.dev/agent-cli/introduction) | [GitHub](https://github.com/microsoft/playwright-cli) + +--- + +## Playwright MCP + +The [Playwright MCP server](https://github.com/microsoft/playwright-mcp) gives AI agents full browser control through the [Model Context Protocol](https://modelcontextprotocol.io). Agents interact with pages using structured accessibility snapshots — no vision models or screenshots required. + +### Setup + +Add to your MCP client (VS Code, Cursor, Claude Desktop, Windsurf, etc.): + +```json +{ + "mcpServers": { + "playwright": { + "command": "npx", + "args": ["@playwright/mcp@latest"] + } + } +} +``` + +**One-click install for VS Code:** + +[Install in VS Code](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) + +**For Claude Code:** + +```bash +claude mcp add playwright npx @playwright/mcp@latest +``` + +### How it works + +Ask your AI assistant to interact with any web page: + +``` +Navigate to https://demo.playwright.dev/todomvc and add a few todo items. +``` + +The agent sees the page as a structured accessibility tree: + +``` +- heading "todos" [level=1] +- textbox "What needs to be done?" [ref=e5] +- listitem: + - checkbox "Toggle Todo" [ref=e10] + - text: "Buy groceries" +``` + +It uses element refs like `e5` and `e10` to click, type, and interact — deterministically and without visual ambiguity. Tools cover navigation, form filling, screenshots, network mocking, storage management, and more. + +[Full MCP documentation](https://playwright.dev/mcp/introduction) | [GitHub](https://github.com/microsoft/playwright-mcp) + +--- + +## Playwright Library + +Use `playwright` as a library for browser automation scripts — web scraping, PDF generation, screenshot capture, and any workflow that needs programmatic browser control without a test runner. + +### Install + +```bash +npm i playwright +``` + +### Examples + +**Take a screenshot:** + +```TypeScript +import { chromium } from 'playwright'; + +const browser = await chromium.launch(); +const page = await browser.newPage(); +await page.goto('https://playwright.dev/'); +await page.screenshot({ path: 'screenshot.png' }); +await browser.close(); +``` + +**Generate a PDF:** + +```TypeScript +import { chromium } from 'playwright'; + +const browser = await chromium.launch(); +const page = await browser.newPage(); +await page.goto('https://playwright.dev/'); +await page.pdf({ path: 'page.pdf', format: 'A4' }); +await browser.close(); +``` + +**Emulate a mobile device:** + +```TypeScript +import { chromium, devices } from 'playwright'; + +const browser = await chromium.launch(); +const context = await browser.newContext(devices['iPhone 15']); +const page = await context.newPage(); +await page.goto('https://playwright.dev/'); +await page.screenshot({ path: 'mobile.png' }); +await browser.close(); +``` + +**Intercept network requests:** + +```TypeScript +import { chromium } from 'playwright'; + +const browser = await chromium.launch(); +const page = await browser.newPage(); +await page.route('**/*.{png,jpg,jpeg}', route => route.abort()); +await page.goto('https://playwright.dev/'); +await browser.close(); +``` + +[Library documentation](https://playwright.dev/docs/library) | [API reference](https://playwright.dev/docs/api/class-playwright) + +--- + +## VS Code Extension + +The [Playwright VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) brings test running, debugging, and code generation directly into your editor. + + + +**Run and debug tests** from the editor with a single click. Set breakpoints, inspect variables, and step through test execution with a live browser view. + +**Generate tests with CodeGen.** Click "Record new" to open a browser — navigate and interact with your app while Playwright writes the test code for you. + +**Pick locators.** Hover over any element in the browser to see the best available locator, then click to copy it to your clipboard. + +**Trace Viewer integration.** Enable "Show Trace Viewer" in the sidebar to get a full execution trace after each test run — DOM snapshots, network requests, console logs, and screenshots at every step. + +[Install the extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) | [VS Code guide](https://playwright.dev/docs/getting-started-vscode) + +--- + +## Cross-Browser Support + +| | Linux | macOS | Windows | +| :--- | :---: | :---: | :---: | +| Chromium1 149.0.7827.55 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| WebKit 26.5 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 151.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | + +Headless and headed execution on all platforms. 1 Uses [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing) by default. + +## Other Languages + +Playwright is also available for [Python](https://playwright.dev/python/docs/intro), [.NET](https://playwright.dev/dotnet/docs/intro), and [Java](https://playwright.dev/java/docs/intro). + +## Resources + +* [Documentation](https://playwright.dev) +* [API reference](https://playwright.dev/docs/api/class-playwright) +* [MCP server](https://github.com/microsoft/playwright-mcp) +* [CLI for coding agents](https://github.com/microsoft/playwright-cli) +* [VS Code extension](https://github.com/microsoft/playwright-vscode) +* [Contribution guide](CONTRIBUTING.md) +* [Changelog](https://github.com/microsoft/playwright/releases) +* [Discord](https://aka.ms/playwright/discord) diff --git a/node_modules/@playwright/test/cli.js b/node_modules/@playwright/test/cli.js new file mode 100644 index 00000000..e42facb0 --- /dev/null +++ b/node_modules/@playwright/test/cli.js @@ -0,0 +1,19 @@ +#!/usr/bin/env node +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { program } = require('playwright/lib/program'); +program.parse(process.argv); diff --git a/node_modules/@playwright/test/index.d.ts b/node_modules/@playwright/test/index.d.ts new file mode 100644 index 00000000..8d99c915 --- /dev/null +++ b/node_modules/@playwright/test/index.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from 'playwright/test'; +export { default } from 'playwright/test'; diff --git a/node_modules/@playwright/test/index.js b/node_modules/@playwright/test/index.js new file mode 100644 index 00000000..8536f063 --- /dev/null +++ b/node_modules/@playwright/test/index.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module.exports = require('playwright/test'); diff --git a/node_modules/@playwright/test/index.mjs b/node_modules/@playwright/test/index.mjs new file mode 100644 index 00000000..8d99c915 --- /dev/null +++ b/node_modules/@playwright/test/index.mjs @@ -0,0 +1,18 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from 'playwright/test'; +export { default } from 'playwright/test'; diff --git a/node_modules/@playwright/test/package.json b/node_modules/@playwright/test/package.json new file mode 100644 index 00000000..16ee688a --- /dev/null +++ b/node_modules/@playwright/test/package.json @@ -0,0 +1,35 @@ +{ + "name": "@playwright/test", + "version": "1.61.0", + "description": "A high-level API to automate web browsers", + "repository": { + "type": "git", + "url": "git+https://github.com/microsoft/playwright.git" + }, + "homepage": "https://playwright.dev", + "engines": { + "node": ">=18" + }, + "author": { + "name": "Microsoft Corporation" + }, + "license": "Apache-2.0", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./index.mjs", + "require": "./index.js", + "default": "./index.js" + }, + "./cli": "./cli.js", + "./package.json": "./package.json", + "./reporter": "./reporter.js" + }, + "bin": { + "playwright": "cli.js" + }, + "scripts": {}, + "dependencies": { + "playwright": "1.61.0" + } +} diff --git a/node_modules/@playwright/test/reporter.d.ts b/node_modules/@playwright/test/reporter.d.ts new file mode 100644 index 00000000..806d13fb --- /dev/null +++ b/node_modules/@playwright/test/reporter.d.ts @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from 'playwright/types/testReporter'; diff --git a/node_modules/@playwright/test/reporter.js b/node_modules/@playwright/test/reporter.js new file mode 100644 index 00000000..485e880a --- /dev/null +++ b/node_modules/@playwright/test/reporter.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// We only export types in reporter.d.ts. diff --git a/node_modules/@playwright/test/reporter.mjs b/node_modules/@playwright/test/reporter.mjs new file mode 100644 index 00000000..485e880a --- /dev/null +++ b/node_modules/@playwright/test/reporter.mjs @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// We only export types in reporter.d.ts. diff --git a/node_modules/@teppeis/multimaps/README.md b/node_modules/@teppeis/multimaps/README.md new file mode 100644 index 00000000..f1c8cca3 --- /dev/null +++ b/node_modules/@teppeis/multimaps/README.md @@ -0,0 +1,63 @@ +# @teppeis/multimaps + +Multi-Map classes for TypeScript and JavaScript + +[![npm version][npm-image]][npm-url] +![Node.js Version Support][node-version] +![TypeScript Version Support][ts-version] +[![build status][ci-image]][ci-url] +![dependency status][deps-count-image] +![monthly downloads][npm-downloads-image] +![License][license] + +## Install + +```console +$ npm i @teppeis/multimaps +``` + +## Usage + +### `ArrayMultimap` + +```js +import {ArrayMultimap} from '@teppeis/multimaps'; + +const map = new ArrayMultimap(); +map.put('foo', 'a'); +map.get('foo'); // ['a'] +map.put('foo', 'b'); +map.get('foo'); // ['a', 'b'] +map.put('foo', 'a'); +map.get('foo'); // ['a', 'b', 'a'] +``` + +### `SetMultimap` + +```js +import {SetMultimap} from '@teppeis/multimaps'; + +const map = new SetMultimap(); +map.put('foo', 'a'); +map.get('foo'); // a `Set` of ['a'] +map.put('foo', 'b'); +map.get('foo'); // a `Set` of ['a', 'b'] +map.put('foo', 'a'); +map.get('foo'); // a `Set` of ['a', 'b'] +``` + +## License + +MIT License: Teppei Sato <teppeis@gmail.com> + +[npm-image]: https://badgen.net/npm/v/@teppeis/multimaps?icon=npm&label= +[npm-url]: https://npmjs.org/package/@teppeis/multimaps +[npm-downloads-image]: https://badgen.net/npm/dm/@teppeis/multimaps +[deps-image]: https://badgen.net/david/dep/teppeis/multimaps.svg +[deps-url]: https://david-dm.org/teppeis/multimaps +[deps-count-image]: https://badgen.net/bundlephobia/dependency-count/@teppeis/multimaps +[node-version]: https://badgen.net/npm/node/@teppeis/multimaps +[ts-version]: https://badgen.net/badge/typescript/%3E=4.0?icon=typescript +[license]: https://img.shields.io/npm/l/@teppeis/multimaps.svg +[ci-image]: https://github.com/teppeis/multimaps/workflows/CI/badge.svg +[ci-url]: https://github.com/teppeis/multimaps/actions?query=workflow%3ACI diff --git a/node_modules/@teppeis/multimaps/dist/cjs/arraymultimap.d.ts b/node_modules/@teppeis/multimaps/dist/cjs/arraymultimap.d.ts new file mode 100644 index 00000000..7c7bbd7c --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/arraymultimap.d.ts @@ -0,0 +1,5 @@ +import { Multimap } from "./multimap.js"; +export declare class ArrayMultimap extends Multimap { + constructor(iterable?: Iterable<[K, V]>); + get [Symbol.toStringTag](): string; +} diff --git a/node_modules/@teppeis/multimaps/dist/cjs/arraymultimap.js b/node_modules/@teppeis/multimaps/dist/cjs/arraymultimap.js new file mode 100644 index 00000000..d24a312d --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/arraymultimap.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ArrayMultimap = void 0; +const multimap_js_1 = require("./multimap.js"); +class ArrayMultimap extends multimap_js_1.Multimap { + constructor(iterable) { + super(new ArrayOperator(), iterable); + } + get [Symbol.toStringTag]() { + return "ArrayMultimap"; + } +} +exports.ArrayMultimap = ArrayMultimap; +class ArrayOperator { + create() { + return []; + } + clone(collection) { + return collection.slice(); + } + add(value, collection) { + collection.push(value); + return true; + } + size(collection) { + return collection.length; + } + delete(value, collection) { + const index = collection.indexOf(value); + if (index > -1) { + collection.splice(index, 1); + return true; + } + return false; + } + has(value, collection) { + return collection.includes(value); + } +} diff --git a/node_modules/@teppeis/multimaps/dist/cjs/index.d.ts b/node_modules/@teppeis/multimaps/dist/cjs/index.d.ts new file mode 100644 index 00000000..17ca91be --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/index.d.ts @@ -0,0 +1,2 @@ +export { ArrayMultimap } from "./arraymultimap.js"; +export { SetMultimap } from "./setmultimap.js"; diff --git a/node_modules/@teppeis/multimaps/dist/cjs/index.js b/node_modules/@teppeis/multimaps/dist/cjs/index.js new file mode 100644 index 00000000..cf68b69b --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SetMultimap = exports.ArrayMultimap = void 0; +var arraymultimap_js_1 = require("./arraymultimap.js"); +Object.defineProperty(exports, "ArrayMultimap", { enumerable: true, get: function () { return arraymultimap_js_1.ArrayMultimap; } }); +var setmultimap_js_1 = require("./setmultimap.js"); +Object.defineProperty(exports, "SetMultimap", { enumerable: true, get: function () { return setmultimap_js_1.SetMultimap; } }); diff --git a/node_modules/@teppeis/multimaps/dist/cjs/multimap.d.ts b/node_modules/@teppeis/multimaps/dist/cjs/multimap.d.ts new file mode 100644 index 00000000..4f245ee7 --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/multimap.d.ts @@ -0,0 +1,31 @@ +export declare abstract class Multimap> implements Iterable<[K, V]> { + private size_; + private map; + private operator; + constructor(operator: CollectionOperator, iterable?: Iterable<[K, V]>); + abstract get [Symbol.toStringTag](): string; + get size(): number; + get(key: K): I; + put(key: K, value: V): boolean; + putAll(key: K, values: I): boolean; + putAll(multimap: Multimap): boolean; + has(key: K): boolean; + hasEntry(key: K, value: V): boolean; + delete(key: K): boolean; + deleteEntry(key: K, value: V): boolean; + clear(): void; + keys(): IterableIterator; + entries(): IterableIterator<[K, V]>; + values(): IterableIterator; + forEach(callback: (this: T | this, alue: V, key: K, map: this) => void, thisArg?: T): void; + [Symbol.iterator](): IterableIterator<[K, V]>; + asMap(): Map; +} +export interface CollectionOperator { + create(): I; + clone(collection: I): I; + add(value: V, collection: I): boolean; + size(collection: I): number; + delete(value: V, collection: I): boolean; + has(value: V, collection: I): boolean; +} diff --git a/node_modules/@teppeis/multimaps/dist/cjs/multimap.js b/node_modules/@teppeis/multimaps/dist/cjs/multimap.js new file mode 100644 index 00000000..47091bbc --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/multimap.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Multimap = void 0; +class Multimap { + constructor(operator, iterable) { + this.size_ = 0; + this.map = new Map(); + this.operator = operator; + if (iterable) { + for (const [key, value] of iterable) { + this.put(key, value); + } + } + return this; + } + get size() { + return this.size_; + } + get(key) { + const values = this.map.get(key); + if (values) { + return this.operator.clone(values); + } + else { + return this.operator.create(); + } + } + put(key, value) { + let values = this.map.get(key); + if (!values) { + values = this.operator.create(); + } + if (!this.operator.add(value, values)) { + return false; + } + this.map.set(key, values); + this.size_++; + return true; + } + putAll(arg1, arg2) { + let pushed = 0; + if (arg2) { + const key = arg1; + const values = arg2; + for (const value of values) { + this.put(key, value); + pushed++; + } + } + else if (arg1 instanceof Multimap) { + for (const [key, value] of arg1.entries()) { + this.put(key, value); + pushed++; + } + } + else { + throw new TypeError("unexpected arguments"); + } + return pushed > 0; + } + has(key) { + return this.map.has(key); + } + hasEntry(key, value) { + return this.operator.has(value, this.get(key)); + } + delete(key) { + this.size_ -= this.operator.size(this.get(key)); + return this.map.delete(key); + } + deleteEntry(key, value) { + const current = this.get(key); + if (!this.operator.delete(value, current)) { + return false; + } + this.map.set(key, current); + this.size_--; + return true; + } + clear() { + this.map.clear(); + this.size_ = 0; + } + keys() { + return this.map.keys(); + } + entries() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + function* gen() { + for (const [key, values] of self.map.entries()) { + for (const value of values) { + yield [key, value]; + } + } + } + return gen(); + } + values() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + function* gen() { + for (const [, value] of self.entries()) { + yield value; + } + } + return gen(); + } + forEach(callback, thisArg) { + for (const [key, value] of this.entries()) { + callback.call(thisArg === undefined ? this : thisArg, value, key, this); + } + } + [Symbol.iterator]() { + return this.entries(); + } + asMap() { + const ret = new Map(); + for (const key of this.keys()) { + ret.set(key, this.operator.clone(this.get(key))); + } + return ret; + } +} +exports.Multimap = Multimap; diff --git a/node_modules/@teppeis/multimaps/dist/cjs/package.json b/node_modules/@teppeis/multimaps/dist/cjs/package.json new file mode 100644 index 00000000..5bbefffb --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@teppeis/multimaps/dist/cjs/setmultimap.d.ts b/node_modules/@teppeis/multimaps/dist/cjs/setmultimap.d.ts new file mode 100644 index 00000000..d484fdc3 --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/setmultimap.d.ts @@ -0,0 +1,5 @@ +import { Multimap } from "./multimap.js"; +export declare class SetMultimap extends Multimap> { + constructor(iterable?: Iterable<[K, V]>); + get [Symbol.toStringTag](): string; +} diff --git a/node_modules/@teppeis/multimaps/dist/cjs/setmultimap.js b/node_modules/@teppeis/multimaps/dist/cjs/setmultimap.js new file mode 100644 index 00000000..1029a4b6 --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/cjs/setmultimap.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SetMultimap = void 0; +const multimap_js_1 = require("./multimap.js"); +class SetMultimap extends multimap_js_1.Multimap { + constructor(iterable) { + super(new SetOperator(), iterable); + } + get [Symbol.toStringTag]() { + return "SetMultimap"; + } +} +exports.SetMultimap = SetMultimap; +class SetOperator { + create() { + return new Set(); + } + clone(collection) { + return new Set(collection); + } + add(value, collection) { + const prev = collection.size; + collection.add(value); + return prev !== collection.size; + } + size(collection) { + return collection.size; + } + delete(value, collection) { + return collection.delete(value); + } + has(value, collection) { + return collection.has(value); + } +} diff --git a/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.d.ts b/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.d.ts new file mode 100644 index 00000000..7c7bbd7c --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.d.ts @@ -0,0 +1,5 @@ +import { Multimap } from "./multimap.js"; +export declare class ArrayMultimap extends Multimap { + constructor(iterable?: Iterable<[K, V]>); + get [Symbol.toStringTag](): string; +} diff --git a/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js b/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js new file mode 100644 index 00000000..a45b7481 --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js @@ -0,0 +1,35 @@ +import { Multimap } from "./multimap.js"; +export class ArrayMultimap extends Multimap { + constructor(iterable) { + super(new ArrayOperator(), iterable); + } + get [Symbol.toStringTag]() { + return "ArrayMultimap"; + } +} +class ArrayOperator { + create() { + return []; + } + clone(collection) { + return collection.slice(); + } + add(value, collection) { + collection.push(value); + return true; + } + size(collection) { + return collection.length; + } + delete(value, collection) { + const index = collection.indexOf(value); + if (index > -1) { + collection.splice(index, 1); + return true; + } + return false; + } + has(value, collection) { + return collection.includes(value); + } +} diff --git a/node_modules/@teppeis/multimaps/dist/esm/index.d.ts b/node_modules/@teppeis/multimaps/dist/esm/index.d.ts new file mode 100644 index 00000000..17ca91be --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/esm/index.d.ts @@ -0,0 +1,2 @@ +export { ArrayMultimap } from "./arraymultimap.js"; +export { SetMultimap } from "./setmultimap.js"; diff --git a/node_modules/@teppeis/multimaps/dist/esm/index.js b/node_modules/@teppeis/multimaps/dist/esm/index.js new file mode 100644 index 00000000..17ca91be --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/esm/index.js @@ -0,0 +1,2 @@ +export { ArrayMultimap } from "./arraymultimap.js"; +export { SetMultimap } from "./setmultimap.js"; diff --git a/node_modules/@teppeis/multimaps/dist/esm/multimap.d.ts b/node_modules/@teppeis/multimaps/dist/esm/multimap.d.ts new file mode 100644 index 00000000..4f245ee7 --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/esm/multimap.d.ts @@ -0,0 +1,31 @@ +export declare abstract class Multimap> implements Iterable<[K, V]> { + private size_; + private map; + private operator; + constructor(operator: CollectionOperator, iterable?: Iterable<[K, V]>); + abstract get [Symbol.toStringTag](): string; + get size(): number; + get(key: K): I; + put(key: K, value: V): boolean; + putAll(key: K, values: I): boolean; + putAll(multimap: Multimap): boolean; + has(key: K): boolean; + hasEntry(key: K, value: V): boolean; + delete(key: K): boolean; + deleteEntry(key: K, value: V): boolean; + clear(): void; + keys(): IterableIterator; + entries(): IterableIterator<[K, V]>; + values(): IterableIterator; + forEach(callback: (this: T | this, alue: V, key: K, map: this) => void, thisArg?: T): void; + [Symbol.iterator](): IterableIterator<[K, V]>; + asMap(): Map; +} +export interface CollectionOperator { + create(): I; + clone(collection: I): I; + add(value: V, collection: I): boolean; + size(collection: I): number; + delete(value: V, collection: I): boolean; + has(value: V, collection: I): boolean; +} diff --git a/node_modules/@teppeis/multimaps/dist/esm/multimap.js b/node_modules/@teppeis/multimaps/dist/esm/multimap.js new file mode 100644 index 00000000..c71afa68 --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/esm/multimap.js @@ -0,0 +1,121 @@ +export class Multimap { + constructor(operator, iterable) { + this.size_ = 0; + this.map = new Map(); + this.operator = operator; + if (iterable) { + for (const [key, value] of iterable) { + this.put(key, value); + } + } + return this; + } + get size() { + return this.size_; + } + get(key) { + const values = this.map.get(key); + if (values) { + return this.operator.clone(values); + } + else { + return this.operator.create(); + } + } + put(key, value) { + let values = this.map.get(key); + if (!values) { + values = this.operator.create(); + } + if (!this.operator.add(value, values)) { + return false; + } + this.map.set(key, values); + this.size_++; + return true; + } + putAll(arg1, arg2) { + let pushed = 0; + if (arg2) { + const key = arg1; + const values = arg2; + for (const value of values) { + this.put(key, value); + pushed++; + } + } + else if (arg1 instanceof Multimap) { + for (const [key, value] of arg1.entries()) { + this.put(key, value); + pushed++; + } + } + else { + throw new TypeError("unexpected arguments"); + } + return pushed > 0; + } + has(key) { + return this.map.has(key); + } + hasEntry(key, value) { + return this.operator.has(value, this.get(key)); + } + delete(key) { + this.size_ -= this.operator.size(this.get(key)); + return this.map.delete(key); + } + deleteEntry(key, value) { + const current = this.get(key); + if (!this.operator.delete(value, current)) { + return false; + } + this.map.set(key, current); + this.size_--; + return true; + } + clear() { + this.map.clear(); + this.size_ = 0; + } + keys() { + return this.map.keys(); + } + entries() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + function* gen() { + for (const [key, values] of self.map.entries()) { + for (const value of values) { + yield [key, value]; + } + } + } + return gen(); + } + values() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const self = this; + function* gen() { + for (const [, value] of self.entries()) { + yield value; + } + } + return gen(); + } + forEach(callback, thisArg) { + for (const [key, value] of this.entries()) { + callback.call(thisArg === undefined ? this : thisArg, value, key, this); + } + } + [Symbol.iterator]() { + return this.entries(); + } + asMap() { + const ret = new Map(); + for (const key of this.keys()) { + ret.set(key, this.operator.clone(this.get(key))); + } + return ret; + } +} diff --git a/node_modules/@teppeis/multimaps/dist/esm/setmultimap.d.ts b/node_modules/@teppeis/multimaps/dist/esm/setmultimap.d.ts new file mode 100644 index 00000000..d484fdc3 --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/esm/setmultimap.d.ts @@ -0,0 +1,5 @@ +import { Multimap } from "./multimap.js"; +export declare class SetMultimap extends Multimap> { + constructor(iterable?: Iterable<[K, V]>); + get [Symbol.toStringTag](): string; +} diff --git a/node_modules/@teppeis/multimaps/dist/esm/setmultimap.js b/node_modules/@teppeis/multimaps/dist/esm/setmultimap.js new file mode 100644 index 00000000..35269d90 --- /dev/null +++ b/node_modules/@teppeis/multimaps/dist/esm/setmultimap.js @@ -0,0 +1,31 @@ +import { Multimap } from "./multimap.js"; +export class SetMultimap extends Multimap { + constructor(iterable) { + super(new SetOperator(), iterable); + } + get [Symbol.toStringTag]() { + return "SetMultimap"; + } +} +class SetOperator { + create() { + return new Set(); + } + clone(collection) { + return new Set(collection); + } + add(value, collection) { + const prev = collection.size; + collection.add(value); + return prev !== collection.size; + } + size(collection) { + return collection.size; + } + delete(value, collection) { + return collection.delete(value); + } + has(value, collection) { + return collection.has(value); + } +} diff --git a/node_modules/@teppeis/multimaps/package.json b/node_modules/@teppeis/multimaps/package.json new file mode 100644 index 00000000..9c4fa1bc --- /dev/null +++ b/node_modules/@teppeis/multimaps/package.json @@ -0,0 +1,75 @@ +{ + "name": "@teppeis/multimaps", + "description": "Multimap classes for TypeScript and JavaScript", + "version": "3.0.0", + "author": "Teppei Sato ", + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=14" + }, + "type": "module", + "main": "./dist/cjs/index.js", + "types": "./dist/cjs/index.d.ts", + "module": "./dist/esm/index.js", + "exports": { + ".": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js", + "default": "./dist/esm/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "scripts": { + "build": "run-p build:*", + "build:cjs": "tsc -p tsconfig.cjs.json && ./gen-cjs-packagejson.sh", + "build:esm": "tsc", + "clean": "rimraf dist test/ts40/dist", + "lint:eslint": "eslint .", + "lint:prettier": "prettier --check .", + "fix": "run-s fix:prettier fix:eslint", + "fix:eslint": "npm run lint:eslint -- --fix", + "fix:prettier": "npm run lint:prettier -- --write", + "prepublishOnly": "run-s clean build", + "test": "run-p -cl --aggregate-output lint:* type unit test:nest", + "test:install": "cd test/exports && npm i && cd ../ts40 && npm i", + "test:nest": "run-s test-exports test-ts40", + "test-exports": "cd test/exports && npm t", + "test-ts40": "cd test/ts40 && npm t", + "type": "tsc -p tsconfig.test.json", + "unit": "vitest run --coverage" + }, + "devDependencies": { + "@tsconfig/node14": "^1.0.3", + "@types/node": "^14.18.38", + "@vitest/coverage-c8": "^0.29.3", + "c8": "^7.12.0", + "eslint": "^8.36.0", + "eslint-config-teppeis": "^16.0.0", + "npm-run-all": "^4.1.5", + "power-assert": "^1.6.1", + "prettier": "^2.8.4", + "rimraf": "^3.0.2", + "typescript": "^4.9.5", + "vitest": "^0.29.3" + }, + "homepage": "https://github.com/teppeis/multimaps#readme", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/teppeis/multimaps.git" + }, + "bugs": { + "url": "https://github.com/teppeis/multimaps/issues" + }, + "keywords": [ + "map", + "multi-map", + "multimap", + "typescript" + ], + "license": "MIT" +} diff --git a/node_modules/@types/normalize-package-data/LICENSE b/node_modules/@types/normalize-package-data/LICENSE new file mode 100644 index 00000000..9e841e7a --- /dev/null +++ b/node_modules/@types/normalize-package-data/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/normalize-package-data/README.md b/node_modules/@types/normalize-package-data/README.md new file mode 100644 index 00000000..7c909159 --- /dev/null +++ b/node_modules/@types/normalize-package-data/README.md @@ -0,0 +1,62 @@ +# Installation +> `npm install --save @types/normalize-package-data` + +# Summary +This package contains type definitions for normalize-package-data (https://github.com/npm/normalize-package-data#readme). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data. +## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data/index.d.ts) +````ts +export = normalize; + +declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void; +declare function normalize(data: normalize.Input, strict?: boolean): void; + +declare namespace normalize { + type WarnFn = (msg: string) => void; + interface Input { + [k: string]: any; + } + + interface Person { + name?: string | undefined; + email?: string | undefined; + url?: string | undefined; + } + + interface Package { + [k: string]: any; + name: string; + version: string; + files?: string[] | undefined; + bin?: { [k: string]: string } | undefined; + man?: string[] | undefined; + keywords?: string[] | undefined; + author?: Person | undefined; + maintainers?: Person[] | undefined; + contributors?: Person[] | undefined; + bundleDependencies?: { [name: string]: string } | undefined; + dependencies?: { [name: string]: string } | undefined; + devDependencies?: { [name: string]: string } | undefined; + optionalDependencies?: { [name: string]: string } | undefined; + description?: string | undefined; + engines?: { [type: string]: string } | undefined; + license?: string | undefined; + repository?: { type: string; url: string } | undefined; + bugs?: { url: string; email?: string | undefined } | { url?: string | undefined; email: string } | undefined; + homepage?: string | undefined; + scripts?: { [k: string]: string } | undefined; + readme: string; + _id: string; + } +} + +```` + +### Additional Details + * Last updated: Tue, 07 Nov 2023 09:09:39 GMT + * Dependencies: none + +# Credits +These definitions were written by [Jeff Dickey](https://github.com/jdxcode). diff --git a/node_modules/@types/normalize-package-data/index.d.ts b/node_modules/@types/normalize-package-data/index.d.ts new file mode 100644 index 00000000..7eea5807 --- /dev/null +++ b/node_modules/@types/normalize-package-data/index.d.ts @@ -0,0 +1,43 @@ +export = normalize; + +declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void; +declare function normalize(data: normalize.Input, strict?: boolean): void; + +declare namespace normalize { + type WarnFn = (msg: string) => void; + interface Input { + [k: string]: any; + } + + interface Person { + name?: string | undefined; + email?: string | undefined; + url?: string | undefined; + } + + interface Package { + [k: string]: any; + name: string; + version: string; + files?: string[] | undefined; + bin?: { [k: string]: string } | undefined; + man?: string[] | undefined; + keywords?: string[] | undefined; + author?: Person | undefined; + maintainers?: Person[] | undefined; + contributors?: Person[] | undefined; + bundleDependencies?: { [name: string]: string } | undefined; + dependencies?: { [name: string]: string } | undefined; + devDependencies?: { [name: string]: string } | undefined; + optionalDependencies?: { [name: string]: string } | undefined; + description?: string | undefined; + engines?: { [type: string]: string } | undefined; + license?: string | undefined; + repository?: { type: string; url: string } | undefined; + bugs?: { url: string; email?: string | undefined } | { url?: string | undefined; email: string } | undefined; + homepage?: string | undefined; + scripts?: { [k: string]: string } | undefined; + readme: string; + _id: string; + } +} diff --git a/node_modules/@types/normalize-package-data/package.json b/node_modules/@types/normalize-package-data/package.json new file mode 100644 index 00000000..5e8e11d3 --- /dev/null +++ b/node_modules/@types/normalize-package-data/package.json @@ -0,0 +1,25 @@ +{ + "name": "@types/normalize-package-data", + "version": "2.4.4", + "description": "TypeScript definitions for normalize-package-data", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data", + "license": "MIT", + "contributors": [ + { + "name": "Jeff Dickey", + "githubUsername": "jdxcode", + "url": "https://github.com/jdxcode" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/normalize-package-data" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "f0a1ad6fab1a44929aa98a3e4ac36a2c42c2ca36a7e49671db2109fb2acd57c9", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js new file mode 100644 index 00000000..9e37ec3d --- /dev/null +++ b/node_modules/ansi-regex/index.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = options => { + options = Object.assign({ + onlyFirst: false + }, options); + + const pattern = [ + '[\\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(pattern, options.onlyFirst ? undefined : 'g'); +}; diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/ansi-regex/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json new file mode 100644 index 00000000..66a43e1f --- /dev/null +++ b/node_modules/ansi-regex/package.json @@ -0,0 +1,53 @@ +{ + "name": "ansi-regex", + "version": "4.1.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^0.25.0", + "xo": "^0.23.0" + } +} diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000..d19c4466 --- /dev/null +++ b/node_modules/ansi-regex/readme.md @@ -0,0 +1,87 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex([options]) + +Returns a regex for matching ANSI escape codes. + +#### options + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/ansi-styles/index.d.ts b/node_modules/ansi-styles/index.d.ts new file mode 100644 index 00000000..e0170aa3 --- /dev/null +++ b/node_modules/ansi-styles/index.d.ts @@ -0,0 +1,167 @@ +declare namespace ansiStyles { + interface CSPair { + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; + } + + interface ColorBase { + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + + ansi256(code: number): string; + + ansi16m(red: number, green: number, blue: number): string; + } + + interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Make text overline. + + Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash. + */ + readonly overline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; + } + + interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; + } + + interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; + } + + interface ConvertColor { + /** + Convert from the RGB color space to the ANSI 256 color space. + + @param red - (`0...255`) + @param green - (`0...255`) + @param blue - (`0...255`) + */ + rgbToAnsi256(red: number, green: number, blue: number): number; + + /** + Convert from the RGB HEX color space to the RGB color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToRgb(hex: string): [red: number, green: number, blue: number]; + + /** + Convert from the RGB HEX color space to the ANSI 256 color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hexToAnsi256(hex: string): number; + } +} + +declare const ansiStyles: { + readonly modifier: ansiStyles.Modifier; + readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; + readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; + readonly codes: ReadonlyMap; +} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier & ansiStyles.ConvertColor; + +export = ansiStyles; diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js new file mode 100644 index 00000000..a9eac589 --- /dev/null +++ b/node_modules/ansi-styles/index.js @@ -0,0 +1,164 @@ +'use strict'; + +const ANSI_BACKGROUND_OFFSET = 10; + +const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`; + +const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + 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], + + // Bright color + 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], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + + // From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js + Object.defineProperties(styles, { + rgbToAnsi256: { + value: (red, green, blue) => { + // We use the extended greyscale palette here, with the exception of + // black and white. normal palette only has 4 greyscale shades. + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + + if (red > 248) { + return 231; + } + + return Math.round(((red - 8) / 247) * 24) + 232; + } + + return 16 + + (36 * Math.round(red / 255 * 5)) + + (6 * Math.round(green / 255 * 5)) + + Math.round(blue / 255 * 5); + }, + enumerable: false + }, + hexToRgb: { + value: hex => { + const matches = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + + let {colorString} = matches.groups; + + if (colorString.length === 3) { + colorString = colorString.split('').map(character => character + character).join(''); + } + + const integer = Number.parseInt(colorString, 16); + + return [ + (integer >> 16) & 0xFF, + (integer >> 8) & 0xFF, + integer & 0xFF + ]; + }, + enumerable: false + }, + hexToAnsi256: { + value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false + } + }); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json new file mode 100644 index 00000000..b3c89c90 --- /dev/null +++ b/node_modules/ansi-styles/package.json @@ -0,0 +1,52 @@ +{ + "name": "ansi-styles", + "version": "5.2.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "devDependencies": { + "ava": "^2.4.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.14.0", + "xo": "^0.37.1" + } +} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md new file mode 100644 index 00000000..7d124665 --- /dev/null +++ b/node_modules/ansi-styles/readme.md @@ -0,0 +1,144 @@ +# ansi-styles + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + +## Install + +``` +$ npm install ansi-styles +``` + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 256/truecolor +// NOTE: When converting from truecolor to 256 colors, the original color +// may be degraded to fit the new color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(`${style.color.ansi256(style.rgbToAnsi256(199, 20, 250))}Hello World${style.color.close}`) +console.log(`${style.color.ansi16m(...style.hexToRgb('#abcdef'))}Hello World${style.color.close}`) +``` + +## API + +Each style has an `open` and `close` property. + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `overline` *Supported on VTE-based terminals, the GNOME terminal, mintty, and Git Bash.* +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` allows converting between various color formats and ANSI escapes, with support for 256 and 16 million colors. + +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `ansi256` + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi256(style.rgbToAnsi256(100, 200, 15)); // RGB to 256 color ansi foreground code +style.bgColor.ansi256(style.hexToAnsi256('#C0FFEE')); // HEX to 256 color ansi foreground code + +style.color.ansi16m(100, 200, 15); // RGB to 16 million color foreground code +style.bgColor.ansi16m(...style.hexToRgb('#C0FFEE')); // Hex (RGB) to 16 million color foreground code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/any-promise/.jshintrc b/node_modules/any-promise/.jshintrc new file mode 100644 index 00000000..979105e9 --- /dev/null +++ b/node_modules/any-promise/.jshintrc @@ -0,0 +1,4 @@ +{ + "node":true, + "strict":true +} diff --git a/node_modules/any-promise/.npmignore b/node_modules/any-promise/.npmignore new file mode 100644 index 00000000..1354abc0 --- /dev/null +++ b/node_modules/any-promise/.npmignore @@ -0,0 +1,7 @@ +.git* +test/ +test-browser/ +build/ +.travis.yml +*.swp +Makefile diff --git a/node_modules/any-promise/LICENSE b/node_modules/any-promise/LICENSE new file mode 100644 index 00000000..9187fe5d --- /dev/null +++ b/node_modules/any-promise/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2014-2016 Kevin Beaty + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/any-promise/README.md b/node_modules/any-promise/README.md new file mode 100644 index 00000000..174bea4a --- /dev/null +++ b/node_modules/any-promise/README.md @@ -0,0 +1,161 @@ +## Any Promise + +[![Build Status](https://secure.travis-ci.org/kevinbeaty/any-promise.svg)](http://travis-ci.org/kevinbeaty/any-promise) + +Let your library support any ES 2015 (ES6) compatible `Promise` and leave the choice to application authors. The application can *optionally* register its preferred `Promise` implementation and it will be exported when requiring `any-promise` from library code. + +If no preference is registered, defaults to the global `Promise` for newer Node.js versions. The browser version defaults to the window `Promise`, so polyfill or register as necessary. + +### Usage with global Promise: + +Assuming the global `Promise` is the desired implementation: + +```bash +# Install any libraries depending on any-promise +$ npm install mz +``` + +The installed libraries will use global Promise by default. + +```js +// in library +var Promise = require('any-promise') // the global Promise + +function promiseReturningFunction(){ + return new Promise(function(resolve, reject){...}) +} +``` + +### Usage with registration: + +Assuming `bluebird` is the desired Promise implementation: + +```bash +# Install preferred promise library +$ npm install bluebird +# Install any-promise to allow registration +$ npm install any-promise +# Install any libraries you would like to use depending on any-promise +$ npm install mz +``` + +Register your preference in the application entry point before any other `require` of packages that load `any-promise`: + +```javascript +// top of application index.js or other entry point +require('any-promise/register/bluebird') + +// -or- Equivalent to above, but allows customization of Promise library +require('any-promise/register')('bluebird', {Promise: require('bluebird')}) +``` + +Now that the implementation is registered, you can use any package depending on `any-promise`: + + +```javascript +var fsp = require('mz/fs') // mz/fs will use registered bluebird promises +var Promise = require('any-promise') // the registered bluebird promise +``` + +It is safe to call `register` multiple times, but it must always be with the same implementation. + +Again, registration is *optional*. It should only be called by the application user if overriding the global `Promise` implementation is desired. + +### Optional Application Registration + +As an application author, you can *optionally* register a preferred `Promise` implementation on application startup (before any call to `require('any-promise')`: + +You must register your preference before any call to `require('any-promise')` (by you or required packages), and only one implementation can be registered. Typically, this registration would occur at the top of the application entry point. + + +#### Registration shortcuts + +If you are using a known `Promise` implementation, you can register your preference with a shortcut: + + +```js +require('any-promise/register/bluebird') +// -or- +import 'any-promise/register/q'; +``` + +Shortcut registration is the preferred registration method as it works in the browser and Node.js. It is also convenient for using with `import` and many test runners, that offer a `--require` flag: + +``` +$ ava --require=any-promise/register/bluebird test.js +``` + +Current known implementations include `bluebird`, `q`, `when`, `rsvp`, `es6-promise`, `promise`, `native-promise-only`, `pinkie`, `vow` and `lie`. If you are not using a known implementation, you can use another registration method described below. + + +#### Basic Registration + +As an alternative to registration shortcuts, you can call the `register` function with the preferred `Promise` implementation. The benefit of this approach is that a `Promise` library can be required by name without being a known implementation. This approach does NOT work in the browser. To use `any-promise` in the browser use either registration shortcuts or specify the `Promise` constructor using advanced registration (see below). + +```javascript +require('any-promise/register')('when') +// -or- require('any-promise/register')('any other ES6 compatible library (known or otherwise)') +``` + +This registration method will try to detect the `Promise` constructor from requiring the specified implementation. If you would like to specify your own constructor, see advanced registration. + + +#### Advanced Registration + +To use the browser version, you should either install a polyfill or explicitly register the `Promise` constructor: + +```javascript +require('any-promise/register')('bluebird', {Promise: require('bluebird')}) +``` + +This could also be used for registering a custom `Promise` implementation or subclass. + +Your preference will be registered globally, allowing a single registration even if multiple versions of `any-promise` are installed in the NPM dependency tree or are using multiple bundled JavaScript files in the browser. You can bypass this global registration in options: + + +```javascript +require('../register')('es6-promise', {Promise: require('es6-promise').Promise, global: false}) +``` + +### Library Usage + +To use any `Promise` constructor, simply require it: + +```javascript +var Promise = require('any-promise'); + +return Promise + .all([xf, f, init, coll]) + .then(fn); + + +return new Promise(function(resolve, reject){ + try { + resolve(item); + } catch(e){ + reject(e); + } +}); + +``` + +Except noted below, libraries using `any-promise` should only use [documented](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) functions as there is no guarantee which implementation will be chosen by the application author. Libraries should never call `register`, only the application user should call if desired. + + +#### Advanced Library Usage + +If your library needs to branch code based on the registered implementation, you can retrieve it using `var impl = require('any-promise/implementation')`, where `impl` will be the package name (`"bluebird"`, `"when"`, etc.) if registered, `"global.Promise"` if using the global version on Node.js, or `"window.Promise"` if using the browser version. You should always include a default case, as there is no guarantee what package may be registered. + + +### Support for old Node.js versions + +Node.js versions prior to `v0.12` may have contained buggy versions of the global `Promise`. For this reason, the global `Promise` is not loaded automatically for these old versions. If using `any-promise` in Node.js versions versions `<= v0.12`, the user should register a desired implementation. + +If an implementation is not registered, `any-promise` will attempt to discover an installed `Promise` implementation. If no implementation can be found, an error will be thrown on `require('any-promise')`. While the auto-discovery usually avoids errors, it is non-deterministic. It is recommended that the user always register a preferred implementation for older Node.js versions. + +This auto-discovery is only available for Node.jS versions prior to `v0.12`. Any newer versions will always default to the global `Promise` implementation. + +### Related + +- [any-observable](https://github.com/sindresorhus/any-observable) - `any-promise` for Observables. + diff --git a/node_modules/any-promise/implementation.d.ts b/node_modules/any-promise/implementation.d.ts new file mode 100644 index 00000000..c331a56a --- /dev/null +++ b/node_modules/any-promise/implementation.d.ts @@ -0,0 +1,3 @@ +declare var implementation: string; + +export = implementation; diff --git a/node_modules/any-promise/implementation.js b/node_modules/any-promise/implementation.js new file mode 100644 index 00000000..a45ae94d --- /dev/null +++ b/node_modules/any-promise/implementation.js @@ -0,0 +1 @@ +module.exports = require('./register')().implementation diff --git a/node_modules/any-promise/index.d.ts b/node_modules/any-promise/index.d.ts new file mode 100644 index 00000000..9f646c5d --- /dev/null +++ b/node_modules/any-promise/index.d.ts @@ -0,0 +1,73 @@ +declare class Promise implements Promise.Thenable { + /** + * If you call resolve in the body of the callback passed to the constructor, + * your promise is fulfilled with result object passed to resolve. + * If you call reject your promise is rejected with the object passed to resolve. + * For consistency and debugging (eg stack traces), obj should be an instanceof Error. + * Any errors thrown in the constructor callback will be implicitly passed to reject(). + */ + constructor (callback: (resolve : (value?: R | Promise.Thenable) => void, reject: (error?: any) => void) => void); + + /** + * onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. + * Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. + * Both callbacks have a single parameter , the fulfillment value or rejection reason. + * "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. + * If an error is thrown in the callback, the returned promise rejects with that error. + * + * @param onFulfilled called when/if "promise" resolves + * @param onRejected called when/if "promise" rejects + */ + then (onFulfilled?: (value: R) => U | Promise.Thenable, onRejected?: (error: any) => U | Promise.Thenable): Promise; + then (onFulfilled?: (value: R) => U | Promise.Thenable, onRejected?: (error: any) => void): Promise; + + /** + * Sugar for promise.then(undefined, onRejected) + * + * @param onRejected called when/if "promise" rejects + */ + catch (onRejected?: (error: any) => U | Promise.Thenable): Promise; + + /** + * Make a new promise from the thenable. + * A thenable is promise-like in as far as it has a "then" method. + */ + static resolve (): Promise; + static resolve (value: R | Promise.Thenable): Promise; + + /** + * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error + */ + static reject (error: any): Promise; + + /** + * Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects. + * the array passed to all can be a mixture of promise-like objects and other objects. + * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. + */ + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable, T9 | Promise.Thenable, T10 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable, T9 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable ]): Promise<[T1, T2, T3, T4]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable]): Promise<[T1, T2, T3]>; + static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable]): Promise<[T1, T2]>; + static all (values: [T1 | Promise.Thenable]): Promise<[T1]>; + static all (values: Array>): Promise; + + /** + * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. + */ + static race (promises: (R | Promise.Thenable)[]): Promise; +} + +declare namespace Promise { + export interface Thenable { + then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; + then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; + } +} + +export = Promise; diff --git a/node_modules/any-promise/index.js b/node_modules/any-promise/index.js new file mode 100644 index 00000000..74b85483 --- /dev/null +++ b/node_modules/any-promise/index.js @@ -0,0 +1 @@ +module.exports = require('./register')().Promise diff --git a/node_modules/any-promise/loader.js b/node_modules/any-promise/loader.js new file mode 100644 index 00000000..e1649142 --- /dev/null +++ b/node_modules/any-promise/loader.js @@ -0,0 +1,78 @@ +"use strict" + // global key for user preferred registration +var REGISTRATION_KEY = '@@any-promise/REGISTRATION', + // Prior registration (preferred or detected) + registered = null + +/** + * Registers the given implementation. An implementation must + * be registered prior to any call to `require("any-promise")`, + * typically on application load. + * + * If called with no arguments, will return registration in + * following priority: + * + * For Node.js: + * + * 1. Previous registration + * 2. global.Promise if node.js version >= 0.12 + * 3. Auto detected promise based on first sucessful require of + * known promise libraries. Note this is a last resort, as the + * loaded library is non-deterministic. node.js >= 0.12 will + * always use global.Promise over this priority list. + * 4. Throws error. + * + * For Browser: + * + * 1. Previous registration + * 2. window.Promise + * 3. Throws error. + * + * Options: + * + * Promise: Desired Promise constructor + * global: Boolean - Should the registration be cached in a global variable to + * allow cross dependency/bundle registration? (default true) + */ +module.exports = function(root, loadImplementation){ + return function register(implementation, opts){ + implementation = implementation || null + opts = opts || {} + // global registration unless explicitly {global: false} in options (default true) + var registerGlobal = opts.global !== false; + + // load any previous global registration + if(registered === null && registerGlobal){ + registered = root[REGISTRATION_KEY] || null + } + + if(registered !== null + && implementation !== null + && registered.implementation !== implementation){ + // Throw error if attempting to redefine implementation + throw new Error('any-promise already defined as "'+registered.implementation+ + '". You can only register an implementation before the first '+ + ' call to require("any-promise") and an implementation cannot be changed') + } + + if(registered === null){ + // use provided implementation + if(implementation !== null && typeof opts.Promise !== 'undefined'){ + registered = { + Promise: opts.Promise, + implementation: implementation + } + } else { + // require implementation if implementation is specified but not provided + registered = loadImplementation(implementation) + } + + if(registerGlobal){ + // register preference globally in case multiple installations + root[REGISTRATION_KEY] = registered + } + } + + return registered + } +} diff --git a/node_modules/any-promise/optional.js b/node_modules/any-promise/optional.js new file mode 100644 index 00000000..f3889420 --- /dev/null +++ b/node_modules/any-promise/optional.js @@ -0,0 +1,6 @@ +"use strict"; +try { + module.exports = require('./register')().Promise || null +} catch(e) { + module.exports = null +} diff --git a/node_modules/any-promise/package.json b/node_modules/any-promise/package.json new file mode 100644 index 00000000..5baf14cf --- /dev/null +++ b/node_modules/any-promise/package.json @@ -0,0 +1,45 @@ +{ + "name": "any-promise", + "version": "1.3.0", + "description": "Resolve any installed ES6 compatible promise", + "main": "index.js", + "typings": "index.d.ts", + "browser": { + "./register.js": "./register-shim.js" + }, + "scripts": { + "test": "ava" + }, + "repository": { + "type": "git", + "url": "https://github.com/kevinbeaty/any-promise" + }, + "keywords": [ + "promise", + "es6" + ], + "author": "Kevin Beaty", + "license": "MIT", + "bugs": { + "url": "https://github.com/kevinbeaty/any-promise/issues" + }, + "homepage": "http://github.com/kevinbeaty/any-promise", + "dependencies": {}, + "devDependencies": { + "ava": "^0.14.0", + "bluebird": "^3.0.0", + "es6-promise": "^3.0.0", + "is-promise": "^2.0.0", + "lie": "^3.0.0", + "mocha": "^2.0.0", + "native-promise-only": "^0.8.0", + "phantomjs-prebuilt": "^2.0.0", + "pinkie": "^2.0.0", + "promise": "^7.0.0", + "q": "^1.0.0", + "rsvp": "^3.0.0", + "vow": "^0.4.0", + "when": "^3.0.0", + "zuul": "^3.0.0" + } +} diff --git a/node_modules/any-promise/register-shim.js b/node_modules/any-promise/register-shim.js new file mode 100644 index 00000000..9049405c --- /dev/null +++ b/node_modules/any-promise/register-shim.js @@ -0,0 +1,18 @@ +"use strict"; +module.exports = require('./loader')(window, loadImplementation) + +/** + * Browser specific loadImplementation. Always uses `window.Promise` + * + * To register a custom implementation, must register with `Promise` option. + */ +function loadImplementation(){ + if(typeof window.Promise === 'undefined'){ + throw new Error("any-promise browser requires a polyfill or explicit registration"+ + " e.g: require('any-promise/register/bluebird')") + } + return { + Promise: window.Promise, + implementation: 'window.Promise' + } +} diff --git a/node_modules/any-promise/register.d.ts b/node_modules/any-promise/register.d.ts new file mode 100644 index 00000000..97f2fc05 --- /dev/null +++ b/node_modules/any-promise/register.d.ts @@ -0,0 +1,17 @@ +import Promise = require('./index'); + +declare function register (module?: string, options?: register.Options): register.Register; + +declare namespace register { + export interface Register { + Promise: typeof Promise; + implementation: string; + } + + export interface Options { + Promise?: typeof Promise; + global?: boolean + } +} + +export = register; diff --git a/node_modules/any-promise/register.js b/node_modules/any-promise/register.js new file mode 100644 index 00000000..255c6e2f --- /dev/null +++ b/node_modules/any-promise/register.js @@ -0,0 +1,94 @@ +"use strict" +module.exports = require('./loader')(global, loadImplementation); + +/** + * Node.js version of loadImplementation. + * + * Requires the given implementation and returns the registration + * containing {Promise, implementation} + * + * If implementation is undefined or global.Promise, loads it + * Otherwise uses require + */ +function loadImplementation(implementation){ + var impl = null + + if(shouldPreferGlobalPromise(implementation)){ + // if no implementation or env specified use global.Promise + impl = { + Promise: global.Promise, + implementation: 'global.Promise' + } + } else if(implementation){ + // if implementation specified, require it + var lib = require(implementation) + impl = { + Promise: lib.Promise || lib, + implementation: implementation + } + } else { + // try to auto detect implementation. This is non-deterministic + // and should prefer other branches, but this is our last chance + // to load something without throwing error + impl = tryAutoDetect() + } + + if(impl === null){ + throw new Error('Cannot find any-promise implementation nor'+ + ' global.Promise. You must install polyfill or call'+ + ' require("any-promise/register") with your preferred'+ + ' implementation, e.g. require("any-promise/register/bluebird")'+ + ' on application load prior to any require("any-promise").') + } + + return impl +} + +/** + * Determines if the global.Promise should be preferred if an implementation + * has not been registered. + */ +function shouldPreferGlobalPromise(implementation){ + if(implementation){ + return implementation === 'global.Promise' + } else if(typeof global.Promise !== 'undefined'){ + // Load global promise if implementation not specified + // Versions < 0.11 did not have global Promise + // Do not use for version < 0.12 as version 0.11 contained buggy versions + var version = (/v(\d+)\.(\d+)\.(\d+)/).exec(process.version) + return !(version && +version[1] == 0 && +version[2] < 12) + } + + // do not have global.Promise or another implementation was specified + return false +} + +/** + * Look for common libs as last resort there is no guarantee that + * this will return a desired implementation or even be deterministic. + * The priority is also nearly arbitrary. We are only doing this + * for older versions of Node.js <0.12 that do not have a reasonable + * global.Promise implementation and we the user has not registered + * the preference. This preserves the behavior of any-promise <= 0.1 + * and may be deprecated or removed in the future + */ +function tryAutoDetect(){ + var libs = [ + "es6-promise", + "promise", + "native-promise-only", + "bluebird", + "rsvp", + "when", + "q", + "pinkie", + "lie", + "vow"] + var i = 0, len = libs.length + for(; i < len; i++){ + try { + return loadImplementation(libs[i]) + } catch(e){} + } + return null +} diff --git a/node_modules/any-promise/register/bluebird.d.ts b/node_modules/any-promise/register/bluebird.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/bluebird.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/bluebird.js b/node_modules/any-promise/register/bluebird.js new file mode 100644 index 00000000..de0f87eb --- /dev/null +++ b/node_modules/any-promise/register/bluebird.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('bluebird', {Promise: require('bluebird')}) diff --git a/node_modules/any-promise/register/es6-promise.d.ts b/node_modules/any-promise/register/es6-promise.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/es6-promise.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/es6-promise.js b/node_modules/any-promise/register/es6-promise.js new file mode 100644 index 00000000..59bd55b7 --- /dev/null +++ b/node_modules/any-promise/register/es6-promise.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('es6-promise', {Promise: require('es6-promise').Promise}) diff --git a/node_modules/any-promise/register/lie.d.ts b/node_modules/any-promise/register/lie.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/lie.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/lie.js b/node_modules/any-promise/register/lie.js new file mode 100644 index 00000000..7d305ca4 --- /dev/null +++ b/node_modules/any-promise/register/lie.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('lie', {Promise: require('lie')}) diff --git a/node_modules/any-promise/register/native-promise-only.d.ts b/node_modules/any-promise/register/native-promise-only.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/native-promise-only.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/native-promise-only.js b/node_modules/any-promise/register/native-promise-only.js new file mode 100644 index 00000000..70a5a5e1 --- /dev/null +++ b/node_modules/any-promise/register/native-promise-only.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('native-promise-only', {Promise: require('native-promise-only')}) diff --git a/node_modules/any-promise/register/pinkie.d.ts b/node_modules/any-promise/register/pinkie.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/pinkie.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/pinkie.js b/node_modules/any-promise/register/pinkie.js new file mode 100644 index 00000000..caaf98a5 --- /dev/null +++ b/node_modules/any-promise/register/pinkie.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('pinkie', {Promise: require('pinkie')}) diff --git a/node_modules/any-promise/register/promise.d.ts b/node_modules/any-promise/register/promise.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/promise.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/promise.js b/node_modules/any-promise/register/promise.js new file mode 100644 index 00000000..746620d4 --- /dev/null +++ b/node_modules/any-promise/register/promise.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('promise', {Promise: require('promise')}) diff --git a/node_modules/any-promise/register/q.d.ts b/node_modules/any-promise/register/q.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/q.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/q.js b/node_modules/any-promise/register/q.js new file mode 100644 index 00000000..0fc633a9 --- /dev/null +++ b/node_modules/any-promise/register/q.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('q', {Promise: require('q').Promise}) diff --git a/node_modules/any-promise/register/rsvp.d.ts b/node_modules/any-promise/register/rsvp.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/rsvp.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/rsvp.js b/node_modules/any-promise/register/rsvp.js new file mode 100644 index 00000000..02b13180 --- /dev/null +++ b/node_modules/any-promise/register/rsvp.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('rsvp', {Promise: require('rsvp').Promise}) diff --git a/node_modules/any-promise/register/vow.d.ts b/node_modules/any-promise/register/vow.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/vow.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/vow.js b/node_modules/any-promise/register/vow.js new file mode 100644 index 00000000..5b6868c4 --- /dev/null +++ b/node_modules/any-promise/register/vow.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('vow', {Promise: require('vow').Promise}) diff --git a/node_modules/any-promise/register/when.d.ts b/node_modules/any-promise/register/when.d.ts new file mode 100644 index 00000000..336ce12b --- /dev/null +++ b/node_modules/any-promise/register/when.d.ts @@ -0,0 +1 @@ +export {} diff --git a/node_modules/any-promise/register/when.js b/node_modules/any-promise/register/when.js new file mode 100644 index 00000000..d91c13d3 --- /dev/null +++ b/node_modules/any-promise/register/when.js @@ -0,0 +1,2 @@ +'use strict'; +require('../register')('when', {Promise: require('when').Promise}) diff --git a/node_modules/assertion-error-formatter/CHANGELOG.md b/node_modules/assertion-error-formatter/CHANGELOG.md new file mode 100644 index 00000000..ed850090 --- /dev/null +++ b/node_modules/assertion-error-formatter/CHANGELOG.md @@ -0,0 +1,38 @@ +# 3.0.0 (2019-08-20) + +* drop support for Node 4, 6 +* support Node 10, 12 + +# 2.0.1 + +* support object errors without stack +* better formatting for errors where the stack does not include the message + +# 2.0.0 + +* support string errors +* update options structure + ```js + // Before + { + colorDiffAdded, + colorDiffRemoved, + colorErrorMessage, + inlineDiffs + } + + // After + { + colorFns: { + diffAdded, + diffRemoved, + errorMessage, + errorStack + }, + inlineDiffs + } + ``` + +# 1.0.1 + +* Initial release diff --git a/node_modules/assertion-error-formatter/LICENSE b/node_modules/assertion-error-formatter/LICENSE new file mode 100644 index 00000000..3e6bf323 --- /dev/null +++ b/node_modules/assertion-error-formatter/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Charlie Rudolph + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/assertion-error-formatter/README.md b/node_modules/assertion-error-formatter/README.md new file mode 100644 index 00000000..f2fc19a4 --- /dev/null +++ b/node_modules/assertion-error-formatter/README.md @@ -0,0 +1,22 @@ +# Node Assertion Error Formatter + +Format errors to display a diff between the actual and expected + +Originally extracted from [mocha](https://github.com/mochajs/mocha) + +## Usage +```js +import {format} from 'assertion-error-formatter' + +format(error) +``` + +## API Reference + +#### `format(error [, options])` + +* `error`: a javascript error +* `options`: An object with the following keys: + * `colorFns`: An object with the keys 'diffAdded', 'diffRemoved', 'errorMessage', 'errorStack'. The values are functions to colorize a string, each defaults to identity. + * `inlineDiff`: boolean (default: false) + * toggle between inline and unified diffs diff --git a/node_modules/assertion-error-formatter/lib/helpers/canonicalize.js b/node_modules/assertion-error-formatter/lib/helpers/canonicalize.js new file mode 100644 index 00000000..b05e9a97 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/canonicalize.js @@ -0,0 +1,52 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = canonicalize;var _has_property = _interopRequireDefault(require("./has_property")); +var _type = _interopRequireDefault(require("./type"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function canonicalize(value, stack) { + stack = stack || []; + + function withStack(fn) { + stack.push(value); + const result = fn(); + stack.pop(); + return result; + } + + if (stack.indexOf(value) !== -1) { + return '[Circular]'; + } + + switch ((0, _type.default)(value)) { + case 'array': + return withStack(function () { + return value.map(function (item) { + return canonicalize(item, stack); + }); + }); + case 'function': + if (!(0, _has_property.default)(value)) { + return '[Function]'; + } + /* falls through */ + case 'object': + return withStack(function () { + const canonicalizedObj = {}; + Object.keys(value). + sort(). + map(function (key) { + canonicalizedObj[key] = canonicalize(value[key], stack); + }); + return canonicalizedObj; + }); + case 'boolean': + case 'buffer': + case 'date': + case 'null': + case 'number': + case 'regexp': + case 'symbol': + case 'undefined': + return value; + default: + return value.toString();} + +} \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/canonicalize_test.js b/node_modules/assertion-error-formatter/lib/helpers/canonicalize_test.js new file mode 100644 index 00000000..d5116d41 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/canonicalize_test.js @@ -0,0 +1,69 @@ +"use strict";var _canonicalize = _interopRequireDefault(require("./canonicalize")); +var _mocha = require("mocha"); +var _chai = require("chai");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function functionWithProperties() {} +functionWithProperties.a = 1; + +const circularObject = {}; +circularObject.a = circularObject; + +const circularArray = []; +circularArray.push(circularArray); + +const nestedCircular = { a: [{}] }; +nestedCircular.a[0].a = nestedCircular; + +const examples = [ +{ + input: { b: 1, a: 2 }, + inputDescription: 'an object with unsorted keys', + output: { a: 2, b: 1 }, + outputDescription: 'the object with sorted keys' }, + +{ + input() {}, + inputDescription: 'function without properties', + output: '[Function]', + outputDescription: '[Function]' }, + +{ + input: functionWithProperties, + inputDescription: 'function with properties', + output: { a: 1 }, + outputDescription: 'the object' }, + +{ + input: circularObject, + inputDescription: 'circular object', + output: { a: '[Circular]' }, + outputDescription: 'the circular property as [Circular]' }, + +{ + input: circularArray, + inputDescription: 'circular array', + output: ['[Circular]'], + outputDescription: 'the circular property as [Circular]' }, + +{ + input: nestedCircular, + inputDescription: 'nested circular object', + output: { a: [{ a: '[Circular]' }] }, + outputDescription: 'the circular property as [Circular]' }]; + + + +(0, _mocha.describe)('canonicalize', function () { + examples.forEach(function ({ + input, + inputDescription, + output, + outputDescription }) + { + (0, _mocha.describe)('input is ' + inputDescription, function () { + (0, _mocha.it)('returns ' + outputDescription, function () { + (0, _chai.expect)((0, _canonicalize.default)(input)).to.eql(output); + }); + }); + }); +}); \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/has_property.js b/node_modules/assertion-error-formatter/lib/helpers/has_property.js new file mode 100644 index 00000000..f3ad3750 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/has_property.js @@ -0,0 +1,8 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = hasProperty;function hasProperty(obj) { + for (const prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + return true; + } + } + return false; +} \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/inline_diff.js b/node_modules/assertion-error-formatter/lib/helpers/inline_diff.js new file mode 100644 index 00000000..324ff7f0 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/inline_diff.js @@ -0,0 +1,43 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = inlineDiff;var _diff = require("diff"); +var _padRight = _interopRequireDefault(require("pad-right"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function inlineDiff(actual, expected, colorFns) { + let msg = errorDiff(actual, expected, colorFns); + + // linenos + const lines = msg.split('\n'); + if (lines.length > 4) { + const width = String(lines.length).length; + msg = lines. + map(function (str, i) { + return (0, _padRight.default)(i + 1, width, ' ') + '|' + ' ' + str; + }). + join('\n'); + } + + // legend + msg = + '\n ' + + colorFns.diffRemoved('actual') + + ' ' + + colorFns.diffAdded('expected') + + '\n\n' + + msg.replace(/^/gm, ' ') + + '\n'; + + return msg; +} + +function errorDiff(actual, expected, colorFns) { + return (0, _diff.diffWordsWithSpace)(actual, expected). + map(function (str) { + if (str.added) { + return colorFns.diffAdded(str.value); + } + if (str.removed) { + return colorFns.diffRemoved(str.value); + } + return str.value; + }). + join(''); +} \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/json_stringify.js b/node_modules/assertion-error-formatter/lib/helpers/json_stringify.js new file mode 100644 index 00000000..c69b58b6 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/json_stringify.js @@ -0,0 +1,80 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = jsonStringify;var _repeatString = _interopRequireDefault(require("repeat-string")); +var _type = _interopRequireDefault(require("./type"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function jsonStringify(object, depth) { + depth = depth || 1; + + switch ((0, _type.default)(object)) { + case 'boolean': + case 'regexp': + case 'symbol': + return object.toString(); + case 'null': + case 'undefined': + return '[' + object + ']'; + case 'array': + case 'object': + return jsonStringifyProperties(object, depth); + case 'number': + if (object === 0 && 1 / object === -Infinity) { + return '-0'; + } else { + return object.toString(); + } + case 'date': + return jsonStringifyDate(object); + case 'buffer': + return jsonStringifyBuffer(object, depth); + default: + if (object === '[Function]' || object === '[Circular]') { + return object; + } else { + return JSON.stringify(object); // string + }} + +} + +function jsonStringifyBuffer(object, depth) { + const { data } = object.toJSON(); + return '[Buffer: ' + jsonStringify(data, depth) + ']'; +} + +function jsonStringifyDate(object) { + let str; + if (isNaN(object.getTime())) { + str = object.toString(); + } else { + str = object.toISOString(); + } + return '[Date: ' + str + ']'; +} + +function jsonStringifyProperties(object, depth) { + const space = 2 * depth; + const start = (0, _type.default)(object) === 'array' ? '[' : '{'; + const end = (0, _type.default)(object) === 'array' ? ']' : '}'; + const length = + typeof object.length === 'number' ? + object.length : + Object.keys(object).length; + let addedProperties = 0; + let str = start; + + for (const prop in object) { + if (Object.prototype.hasOwnProperty.call(object, prop)) { + addedProperties += 1; + str += + '\n' + + (0, _repeatString.default)(' ', space) + ( + (0, _type.default)(object) === 'array' ? '' : '"' + prop + '": ') + + jsonStringify(object[prop], depth + 1) + ( + addedProperties === length ? '' : ','); + } + } + + if (str.length !== 1) { + str += '\n' + (0, _repeatString.default)(' ', space - 2); + } + + return str + end; +} \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/stringify.js b/node_modules/assertion-error-formatter/lib/helpers/stringify.js new file mode 100644 index 00000000..ef927128 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/stringify.js @@ -0,0 +1,6 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = stringify;var _canonicalize = _interopRequireDefault(require("./canonicalize")); +var _json_stringify = _interopRequireDefault(require("./json_stringify"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function stringify(value) { + return (0, _json_stringify.default)((0, _canonicalize.default)(value)).replace(/,(\n|$)/g, '$1'); +} \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/stringify_test.js b/node_modules/assertion-error-formatter/lib/helpers/stringify_test.js new file mode 100644 index 00000000..0573b7bf --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/stringify_test.js @@ -0,0 +1,112 @@ +"use strict";var _stringify = _interopRequireDefault(require("./stringify")); +var _mocha = require("mocha"); +var _chai = require("chai");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function functionWithProperties() {} +functionWithProperties.a = 1; + +const circularObject = {}; +circularObject.a = circularObject; + +const circularArray = []; +circularArray.push(circularArray); + +const nestedCircular = { a: [{}] }; +nestedCircular.a[0].a = nestedCircular; + +const examples = [ +{ + input: { b: 1, a: 2 }, + inputDescription: 'an object with unsorted keys', + output: '{\n' + ' "a": 2\n' + ' "b": 1\n' + '}', + outputDescription: 'the object with sorted keys' }, + +{ + input() {}, + inputDescription: 'function with not properties', + output: '[Function]', + outputDescription: '[Function]' }, + +{ + input: functionWithProperties, + inputDescription: 'function with properties', + output: '{\n' + ' "a": 1\n' + '}', + outputDescription: 'the object' }, + +{ + input: circularObject, + inputDescription: 'circular object', + output: '{\n' + ' "a": [Circular]\n' + '}', + outputDescription: 'the circular property as [Circular]' }, + +{ + input: circularArray, + inputDescription: 'circular array', + output: '[\n' + ' [Circular]\n' + ']', + outputDescription: 'the circular property as [Circular]' }, + +{ + input: nestedCircular, + inputDescription: 'nested circular object', + output: + '{\n' + + ' "a": [\n' + + ' {\n' + + ' "a": [Circular]\n' + + ' }\n' + + ' ]\n' + + '}', + outputDescription: 'the circular property as [Circular]' }, + +{ + input: null, + inputDescription: 'null', + output: '[null]', + outputDescription: '[null]' }, + +{ + input: undefined, + inputDescription: 'undefined', + output: '[undefined]', + outputDescription: '[undefined]' }, + +{ + input: -0, + inputDescription: '-0', + output: '-0', + outputDescription: '-0' }, + +{ + input: new Date(0), + inputDescription: 'valid date', + output: '[Date: 1970-01-01T00:00:00.000Z]', + outputDescription: '[Date ]' }, + +{ + input: new Date(NaN), + inputDescription: 'invalid date', + output: '[Date: Invalid Date]', + outputDescription: '[Date Invalid Date]' }, + +{ + input: Buffer.from([1, 2, 3]), + inputDescription: 'buffer', + output: '[Buffer: [\n' + ' 1\n' + ' 2\n' + ' 3\n' + ']]', + outputDescription: '[Buffer ]' }]; + + + +(0, _mocha.describe)('stringify', function () { + examples.forEach(function ({ + input, + inputDescription, + output, + outputDescription }) + { + (0, _mocha.describe)('input is ' + inputDescription, function () { + (0, _mocha.it)('returns ' + outputDescription, function () { + (0, _chai.expect)((0, _stringify.default)(input)).to.eql(output); + }); + }); + }); +}); \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/type.js b/node_modules/assertion-error-formatter/lib/helpers/type.js new file mode 100644 index 00000000..0497cfb5 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/type.js @@ -0,0 +1,13 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = type;function type(value) { + if (value === undefined) { + return 'undefined'; + } else if (value === null) { + return 'null'; + } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) { + return 'buffer'; + } + return Object.prototype.toString. + call(value). + replace(/^\[.+\s(.+?)\]$/, '$1'). + toLowerCase(); +} \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/type_test.js b/node_modules/assertion-error-formatter/lib/helpers/type_test.js new file mode 100644 index 00000000..cab7c377 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/type_test.js @@ -0,0 +1,71 @@ +"use strict";var _type = _interopRequireDefault(require("./type")); +var _mocha = require("mocha"); +var _chai = require("chai");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +const examples = [ +{ + description: 'an object', + input: {}, + output: 'object' }, + +{ + description: 'an array', + input: [], + output: 'array' }, + +{ + description: 'a number', + input: 1, + output: 'number' }, + +{ + description: 'a boolean', + input: false, + output: 'boolean' }, + +{ + description: 'string', + input: 'a', + output: 'string' }, + +{ + description: 'Infinity', + input: Infinity, + output: 'number' }, + +{ + description: 'null', + input: null, + output: 'null' }, + +{ + description: 'undefined', + input: undefined, + output: 'undefined' }, + +{ + description: 'Date', + input: new Date(), + output: 'date' }, + +{ + description: 'regular expression', + input: /foo/, + output: 'regexp' }, + +{ + description: 'global', + input: global, + output: 'global' }]; + + + +(0, _mocha.describe)('type', function () { + examples.forEach(function ({ description, input, output }) { + (0, _mocha.describe)('input is ' + description, function () { + (0, _mocha.it)('returns ' + output, function () { + (0, _chai.expect)((0, _type.default)(input)).to.eql(output); + }); + }); + }); +}); \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/helpers/unified_diff.js b/node_modules/assertion-error-formatter/lib/helpers/unified_diff.js new file mode 100644 index 00000000..1efb137d --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/helpers/unified_diff.js @@ -0,0 +1,40 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = unifiedDiff;var _diff = require("diff"); + +function unifiedDiff(actual, expected, colorFns) { + const indent = ' '; + function cleanUp(line) { + if (line.length === 0) { + return ''; + } + if (line[0] === '+') { + return indent + colorFns.diffAdded(line); + } + if (line[0] === '-') { + return indent + colorFns.diffRemoved(line); + } + if (line.match(/@@/)) { + return null; + } + if (line.match(/\\ No newline/)) { + return null; + } + return indent + line; + } + function notBlank(line) { + return typeof line !== 'undefined' && line !== null; + } + const msg = (0, _diff.createPatch)('string', actual, expected); + const lines = msg.split('\n').splice(4); + return ( + '\n' + + indent + + colorFns.diffAdded('+ expected') + + ' ' + + colorFns.diffRemoved('- actual') + + '\n\n' + + lines. + map(cleanUp). + filter(notBlank). + join('\n')); + +} \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/index.js b/node_modules/assertion-error-formatter/lib/index.js new file mode 100644 index 00000000..38d30495 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/index.js @@ -0,0 +1,80 @@ +"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.format = format;var _inline_diff = _interopRequireDefault(require("./helpers/inline_diff")); +var _stringify = _interopRequireDefault(require("./helpers/stringify")); +var _type = _interopRequireDefault(require("./helpers/type")); +var _unified_diff = _interopRequireDefault(require("./helpers/unified_diff"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} + +function identity(x) { + return x; +} + +function format(err, options) { + if (!options) { + options = {}; + } + if (!options.colorFns) { + options.colorFns = {}; + } + ['diffAdded', 'diffRemoved', 'errorMessage', 'errorStack'].forEach(function ( + key) + { + if (!options.colorFns[key]) { + options.colorFns[key] = identity; + } + }); + + let message; + if (err.message && typeof err.message.toString === 'function') { + message = err.message + ''; + } else if (typeof err.inspect === 'function') { + message = err.inspect() + ''; + } else if (typeof err === 'string') { + message = err; + } else { + message = JSON.stringify(err); + } + + let stack = err.stack || message; + const startOfMessageIndex = stack.indexOf(message); + if (startOfMessageIndex === -1) { + stack = '\n' + stack; + } else { + const endOfMessageIndex = startOfMessageIndex + message.length; + message = stack.slice(0, endOfMessageIndex); + stack = stack.slice(endOfMessageIndex); // remove message from stack + } + + if (err.uncaught) { + message = 'Uncaught ' + message; + } + + let actual = err.actual; + let expected = err.expected; + + if ( + err.showDiff !== false && + (0, _type.default)(actual) === (0, _type.default)(expected) && + expected !== undefined) + { + if (!((0, _type.default)(actual) === 'string' && (0, _type.default)(expected) === 'string')) { + actual = (0, _stringify.default)(actual); + expected = (0, _stringify.default)(expected); + } + + const match = message.match(/^([^:]+): expected/); + message = options.colorFns.errorMessage(match ? match[1] : message); + + if (options.inlineDiff) { + message += (0, _inline_diff.default)(actual, expected, options.colorFns); + } else { + message += (0, _unified_diff.default)(actual, expected, options.colorFns); + } + } else { + message = options.colorFns.errorMessage(message); + } + + if (stack) { + stack = options.colorFns.errorStack(stack); + } + + return message + stack; +} \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/lib/index_test.js b/node_modules/assertion-error-formatter/lib/index_test.js new file mode 100644 index 00000000..c0620ee3 --- /dev/null +++ b/node_modules/assertion-error-formatter/lib/index_test.js @@ -0,0 +1,165 @@ +"use strict";var _ = require("./"); +var _mocha = require("mocha"); +var _chai = require("chai"); + +(0, _mocha.describe)('AssertionErrorFormatter', function () { + (0, _mocha.describe)('format', function () { + (0, _mocha.beforeEach)(function () { + this.options = { + colorFns: { + diffAdded(x) { + return '' + x + ''; + }, + diffRemoved(x) { + return '' + x + ''; + }, + errorMessage(x) { + return '' + x + ''; + }, + errorStack(x) { + return '' + x + ''; + } } }; + + + }); + + (0, _mocha.describe)('with assertion error', function () { + (0, _mocha.describe)('unified diffs', function () { + (0, _mocha.it)('should show string diffs', function () { + const error = { + actual: 'foo', + expected: 'bar', + message: "'foo' to equal 'bar'", + stack: "'foo' to equal 'bar'\n line1\n line2\n line3" }; + + (0, _chai.expect)((0, _.format)(error, this.options)).to.eql( + "'foo' to equal 'bar'\n" + + ' + expected - actual\n' + + '\n' + + ' -foo\n' + + ' +bar\n' + + '\n' + + ' line1\n' + + ' line2\n' + + ' line3'); + + }); + + (0, _mocha.it)('should show object diffs', function () { + const error = { + actual: { x: 1, y: 2 }, + expected: { x: 1, y: 3 }, + message: '{ x: 1, y: 2 } to equal { x: 1, y: 3 }', + stack: + '{ x: 1, y: 2 } to equal { x: 1, y: 3 }\n line1\n line2\n line3' }; + + (0, _chai.expect)((0, _.format)(error, this.options)).to.eql( + '{ x: 1, y: 2 } to equal { x: 1, y: 3 }\n' + + ' + expected - actual\n' + + '\n' + + ' {\n' + + ' "x": 1\n' + + ' - "y": 2\n' + + ' + "y": 3\n' + + ' }\n' + + '\n' + + ' line1\n' + + ' line2\n' + + ' line3'); + + }); + }); + + (0, _mocha.describe)('inline diffs', function () { + (0, _mocha.beforeEach)(function () { + this.options.inlineDiff = true; + }); + + (0, _mocha.it)('should show string diffs', function () { + const error = { + actual: 'foo', + expected: 'bar', + message: "'foo' to equal 'bar'", + stack: "'foo' to equal 'bar'\n line1\n line2\n line3" }; + + (0, _chai.expect)((0, _.format)(error, this.options)).to.eql( + "'foo' to equal 'bar'\n" + + ' actual expected\n' + + '\n' + + ' foobar\n' + + '\n' + + ' line1\n' + + ' line2\n' + + ' line3'); + + }); + + (0, _mocha.it)('should show object diffs', function () { + const error = { + actual: { x: 1, y: 2 }, + expected: { x: 1, y: 3 }, + message: '{ x: 1, y: 2 } to equal { x: 1, y: 3 }', + stack: + '{ x: 1, y: 2 } to equal { x: 1, y: 3 }\n line1\n line2\n line3' }; + + (0, _chai.expect)((0, _.format)(error, this.options)).to.eql( + '{ x: 1, y: 2 } to equal { x: 1, y: 3 }\n' + + ' actual expected\n' + + '\n' + + ' {\n' + + ' "x": 1\n' + + ' "y": 23\n' + + ' }\n' + + '\n' + + ' line1\n' + + ' line2\n' + + ' line3'); + + }); + }); + }); + + (0, _mocha.describe)('with other error', function () { + (0, _mocha.describe)('message is in the stack', function () { + (0, _mocha.it)('returns the stack only', function () { + const error = { + message: 'abc', + stack: 'abc\n line1\n line2\n line3' }; + + (0, _chai.expect)((0, _.format)(error, this.options)).to.eql( + 'abc\n' + + ' line1\n' + + ' line2\n' + + ' line3'); + + }); + }); + + (0, _mocha.describe)('message is not in the stack', function () { + (0, _mocha.it)('returns the message and the stack', function () { + const error = { + message: 'abc', + stack: 'line1\nline2\nline3' }; + + (0, _chai.expect)((0, _.format)(error, this.options)).to.eql( + 'abc\n' + 'line1\n' + 'line2\n' + 'line3'); + + }); + }); + }); + + (0, _mocha.describe)('with string', function () { + (0, _mocha.it)('outputs the string', function () { + (0, _chai.expect)((0, _.format)('abc', this.options)).to.eql('abc'); + }); + }); + + (0, _mocha.describe)('with object', function () { + (0, _mocha.it)('outputs the json stringified object', function () { + (0, _chai.expect)((0, _.format)({ x: 1, y: 2 }, this.options)).to.eql( + '{"x":1,"y":2}'); + + }); + }); + }); +}); \ No newline at end of file diff --git a/node_modules/assertion-error-formatter/package.json b/node_modules/assertion-error-formatter/package.json new file mode 100644 index 00000000..bec51f09 --- /dev/null +++ b/node_modules/assertion-error-formatter/package.json @@ -0,0 +1,57 @@ +{ + "name": "assertion-error-formatter", + "version": "3.0.0", + "main": "lib/index.js", + "scripts": { + "build": "babel src -d lib --ignore '**/*_test.js' --retain-lines", + "lint": "yarn run lint-js && yarn run lint-dependencies", + "lint-dependencies": "dependency-lint", + "lint-js": "eslint src/** test/test_helper.js", + "prepublish": "yarn run build", + "test": "yarn run lint && yarn run unit-test", + "unit-test": "mocha src" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/charlierudolph/node-assertion-error-formatter.git" + }, + "author": { + "name": "Charlie Rudolph", + "email": "charles.w.rudolph@gmail.com" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/charlierudolph/node-assertion-error-formatter/issues" + }, + "homepage": "https://github.com/charlierudolph/node-assertion-error-formatter", + "devDependencies": { + "@babel/cli": "^7.5.5", + "@babel/core": "^7.5.5", + "@babel/preset-env": "^7.5.5", + "@babel/register": "^7.5.5", + "babel-eslint": "^10.0.2", + "chai": "^4.2.0", + "dependency-lint": "^6.0.0", + "eslint": "~6.1.0", + "eslint-config-prettier": "^6.1.0", + "eslint-config-standard": "^14.0.0", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-node": "^9.1.0", + "eslint-plugin-prettier": "^3.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", + "mocha": "^6.2.0", + "prettier": "^1.18.2", + "sinon": "^7.4.1", + "sinon-chai": "^3.3.0" + }, + "dependencies": { + "diff": "^4.0.1", + "pad-right": "^0.2.2", + "repeat-string": "^1.6.1" + }, + "files": [ + "lib" + ] +} diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000..61ece8cc --- /dev/null +++ b/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,23 @@ +(MIT) + +Original code Copyright Julian Gruber + +Port to TypeScript Copyright Isaac Z. Schlueter + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/balanced-match/README.md b/node_modules/balanced-match/README.md new file mode 100644 index 00000000..f3bb3773 --- /dev/null +++ b/node_modules/balanced-match/README.md @@ -0,0 +1,57 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and +``. Supports regular expressions as well! + +## Example + +Get the first matching pair of braces: + +```js +import { balanced } from 'balanced-match' + +console.log(balanced('{', '}', 'pre{in{nested}}post')) +console.log(balanced('{', '}', 'pre{first}between{second}post')) +console.log( + balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'), +) +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### const m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +- **start** the index of the first match of `a` +- **end** the index of the matching `b` +- **pre** the preamble, `a` and `b` not included +- **body** the match, `a` and `b` not included +- **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### const r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. diff --git a/node_modules/balanced-match/dist/commonjs/index.d.ts b/node_modules/balanced-match/dist/commonjs/index.d.ts new file mode 100644 index 00000000..f819cfd0 --- /dev/null +++ b/node_modules/balanced-match/dist/commonjs/index.d.ts @@ -0,0 +1,9 @@ +export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | { + start: number; + end: number; + pre: string; + body: string; + post: string; +} | undefined; +export declare const range: (a: string, b: string, str: string) => undefined | [number, number]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/balanced-match/dist/commonjs/index.d.ts.map b/node_modules/balanced-match/dist/commonjs/index.d.ts.map new file mode 100644 index 00000000..6306762c --- /dev/null +++ b/node_modules/balanced-match/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"} \ No newline at end of file diff --git a/node_modules/balanced-match/dist/commonjs/index.js b/node_modules/balanced-match/dist/commonjs/index.js new file mode 100644 index 00000000..0c9014ba --- /dev/null +++ b/node_modules/balanced-match/dist/commonjs/index.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.range = exports.balanced = void 0; +const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +exports.balanced = balanced; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +const range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +exports.range = range; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/balanced-match/dist/commonjs/index.js.map b/node_modules/balanced-match/dist/commonjs/index.js.map new file mode 100644 index 00000000..83f547ca --- /dev/null +++ b/node_modules/balanced-match/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,IAAA,aAAK,EAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;KAClC,CACF,CAAA;AACH,CAAC,CAAA;AAnBY,Q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SAAS;oBAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,KAAK,SA+CjB","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/node_modules/balanced-match/dist/commonjs/package.json b/node_modules/balanced-match/dist/commonjs/package.json new file mode 100644 index 00000000..5bbefffb --- /dev/null +++ b/node_modules/balanced-match/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/balanced-match/dist/esm/index.d.ts b/node_modules/balanced-match/dist/esm/index.d.ts new file mode 100644 index 00000000..f819cfd0 --- /dev/null +++ b/node_modules/balanced-match/dist/esm/index.d.ts @@ -0,0 +1,9 @@ +export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | { + start: number; + end: number; + pre: string; + body: string; + post: string; +} | undefined; +export declare const range: (a: string, b: string, str: string) => undefined | [number, number]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/balanced-match/dist/esm/index.d.ts.map b/node_modules/balanced-match/dist/esm/index.d.ts.map new file mode 100644 index 00000000..6306762c --- /dev/null +++ b/node_modules/balanced-match/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"} \ No newline at end of file diff --git a/node_modules/balanced-match/dist/esm/index.js b/node_modules/balanced-match/dist/esm/index.js new file mode 100644 index 00000000..fe81200f --- /dev/null +++ b/node_modules/balanced-match/dist/esm/index.js @@ -0,0 +1,54 @@ +export const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && range(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +export const range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/balanced-match/dist/esm/index.js.map b/node_modules/balanced-match/dist/esm/index.js.map new file mode 100644 index 00000000..b476cae2 --- /dev/null +++ b/node_modules/balanced-match/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EAC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EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/node_modules/balanced-match/dist/esm/package.json b/node_modules/balanced-match/dist/esm/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/node_modules/balanced-match/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json new file mode 100644 index 00000000..48f1a638 --- /dev/null +++ b/node_modules/balanced-match/package.json @@ -0,0 +1,68 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "4.0.4", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^25.2.1", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.6.2", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/node_modules/brace-expansion/LICENSE b/node_modules/brace-expansion/LICENSE new file mode 100644 index 00000000..46e7b75c --- /dev/null +++ b/node_modules/brace-expansion/LICENSE @@ -0,0 +1,23 @@ +MIT License + +Copyright Julian Gruber + +TypeScript port Copyright Isaac Z. Schlueter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/brace-expansion/README.md b/node_modules/brace-expansion/README.md new file mode 100644 index 00000000..d00b24d5 --- /dev/null +++ b/node_modules/brace-expansion/README.md @@ -0,0 +1,94 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![CI](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +## Example + +```js +import { expand } from 'brace-expansion' + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +import { expand } from 'brace-expansion' +``` + +### const expanded = expand(str, [options]) + +Return an array of all possible and valid expansions of `str`. If +none are found, `[str]` is returned. + +The `options` object can provide a `max` value to cap the number +of expansions allowed. This is limited to `100_000` by default, +to prevent DoS attacks. + +```js +const expansions = expand('{1..100}'.repeat(5), { + max: 100, +}) +// expansions.length will be 100, not 100^5 +``` + +Valid expansions are: + +```js +;/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. diff --git a/node_modules/brace-expansion/dist/commonjs/index.d.ts b/node_modules/brace-expansion/dist/commonjs/index.d.ts new file mode 100644 index 00000000..92b7a7f0 --- /dev/null +++ b/node_modules/brace-expansion/dist/commonjs/index.d.ts @@ -0,0 +1,6 @@ +export declare const EXPANSION_MAX = 100000; +export type BraceExpansionOptions = { + max?: number; +}; +export declare function expand(str: string, options?: BraceExpansionOptions): string[]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/brace-expansion/dist/commonjs/index.d.ts.map b/node_modules/brace-expansion/dist/commonjs/index.d.ts.map new file mode 100644 index 00000000..a4f36aed --- /dev/null +++ b/node_modules/brace-expansion/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAwDpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"} \ No newline at end of file diff --git a/node_modules/brace-expansion/dist/commonjs/index.js b/node_modules/brace-expansion/dist/commonjs/index.js new file mode 100644 index 00000000..33063dd3 --- /dev/null +++ b/node_modules/brace-expansion/dist/commonjs/index.js @@ -0,0 +1,201 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EXPANSION_MAX = void 0; +exports.expand = expand; +const balanced_match_1 = require("balanced-match"); +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\\./g; +exports.EXPANSION_MAX = 100_000; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = (0, balanced_match_1.balanced)('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +function expand(str, options = {}) { + if (!str) { + return []; + } + const { max = exports.EXPANSION_MAX } = options; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), max, true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +function expand_(str, max, isTop) { + /** @type {string[]} */ + const expansions = []; + const m = (0, balanced_match_1.balanced)('{', '}', str); + if (!m) + return [str]; + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + const post = m.post.length ? expand_(m.post, max, false) : ['']; + if (/\$$/.test(m.pre)) { + for (let k = 0; k < post.length && k < max; k++) { + const expansion = pre + '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } + else { + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand_(str, max, true); + } + return [str]; + } + let n; + if (isSequence) { + n = m.body.split(/\.\./); + } + else { + n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], max, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + return post.map(p => m.pre + n[0] + p); + } + /* c8 ignore stop */ + } + } + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + let N; + if (isSequence && n[0] !== undefined && n[1] !== undefined) { + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + N = []; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + N.push(c); + } + } + else { + N = []; + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], max, false)); + } + } + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length && expansions.length < max; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { + expansions.push(expansion); + } + } + } + } + return expansions; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/brace-expansion/dist/commonjs/index.js.map b/node_modules/brace-expansion/dist/commonjs/index.js.map new file mode 100644 index 00000000..77dd0803 --- /dev/null +++ b/node_modules/brace-expansion/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA8EA,wBAkBC;AAhGD,mDAAyC;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;AACnD,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,aAAa,GAAG,OAAO,CAAA;AAEhB,QAAA,aAAa,GAA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AC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChE,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;oBACtC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n const post: string[] = m.post.length ? expand_(m.post, max, false) : ['']\n\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n } else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n return expand_(str, max, true)\n }\n return [str]\n }\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n }\n\n return expansions\n}\n"]} \ No newline at end of file diff --git a/node_modules/brace-expansion/dist/commonjs/package.json b/node_modules/brace-expansion/dist/commonjs/package.json new file mode 100644 index 00000000..5bbefffb --- /dev/null +++ b/node_modules/brace-expansion/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/brace-expansion/dist/esm/index.d.ts b/node_modules/brace-expansion/dist/esm/index.d.ts new file mode 100644 index 00000000..92b7a7f0 --- /dev/null +++ b/node_modules/brace-expansion/dist/esm/index.d.ts @@ -0,0 +1,6 @@ +export declare const EXPANSION_MAX = 100000; +export type BraceExpansionOptions = { + max?: number; +}; +export declare function expand(str: string, options?: BraceExpansionOptions): string[]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/brace-expansion/dist/esm/index.d.ts.map b/node_modules/brace-expansion/dist/esm/index.d.ts.map new file mode 100644 index 00000000..a4f36aed --- /dev/null +++ b/node_modules/brace-expansion/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAwDpC,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"} \ No newline at end of file diff --git a/node_modules/brace-expansion/dist/esm/index.js b/node_modules/brace-expansion/dist/esm/index.js new file mode 100644 index 00000000..32399e7b --- /dev/null +++ b/node_modules/brace-expansion/dist/esm/index.js @@ -0,0 +1,197 @@ +import { balanced } from 'balanced-match'; +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\\./g; +export const EXPANSION_MAX = 100_000; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = balanced('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +export function expand(str, options = {}) { + if (!str) { + return []; + } + const { max = EXPANSION_MAX } = options; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), max, true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +function expand_(str, max, isTop) { + /** @type {string[]} */ + const expansions = []; + const m = balanced('{', '}', str); + if (!m) + return [str]; + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + const post = m.post.length ? expand_(m.post, max, false) : ['']; + if (/\$$/.test(m.pre)) { + for (let k = 0; k < post.length && k < max; k++) { + const expansion = pre + '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } + else { + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand_(str, max, true); + } + return [str]; + } + let n; + if (isSequence) { + n = m.body.split(/\.\./); + } + else { + n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], max, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + return post.map(p => m.pre + n[0] + p); + } + /* c8 ignore stop */ + } + } + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + let N; + if (isSequence && n[0] !== undefined && n[1] !== undefined) { + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + N = []; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + N.push(c); + } + } + else { + N = []; + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], max, false)); + } + } + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length && expansions.length < max; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { + expansions.push(expansion); + } + } + } + } + return expansions; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/brace-expansion/dist/esm/index.js.map b/node_modules/brace-expansion/dist/esm/index.js.map new file mode 100644 index 00000000..63a6a2a9 --- /dev/null +++ b/node_modules/brace-expansion/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eA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CAAC,GAAG,EAAE,CAAA;YAEN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAW,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;YACtD,CAAC;QACH,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChE,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;gBACtC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;oBACtC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAC5B,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\nfunction expand_(str: string, max: number, isTop: boolean): string[] {\n /** @type {string[]} */\n const expansions: string[] = []\n\n const m = balanced('{', '}', str)\n if (!m) return [str]\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n const post: string[] = m.post.length ? expand_(m.post, max, false) : ['']\n\n if (/\\$$/.test(m.pre)) {\n for (let k = 0; k < post.length && k < max; k++) {\n const expansion = pre + '{' + m.body + '}' + post[k]\n expansions.push(expansion)\n }\n } else {\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n return expand_(str, max, true)\n }\n return [str]\n }\n\n let n: string[]\n if (isSequence) {\n n = m.body.split(/\\.\\./)\n } else {\n n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n return post.map(p => m.pre + n[0] + p)\n }\n /* c8 ignore stop */\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n let N: string[]\n\n if (isSequence && n[0] !== undefined && n[1] !== undefined) {\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n N = []\n\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n N.push(c)\n }\n } else {\n N = []\n\n for (let j = 0; j < n.length; j++) {\n N.push.apply(N, expand_(n[j] as string, max, false))\n }\n }\n\n for (let j = 0; j < N.length; j++) {\n for (let k = 0; k < post.length && expansions.length < max; k++) {\n const expansion = pre + N[j] + post[k]\n if (!isTop || isSequence || expansion) {\n expansions.push(expansion)\n }\n }\n }\n }\n\n return expansions\n}\n"]} \ No newline at end of file diff --git a/node_modules/brace-expansion/dist/esm/package.json b/node_modules/brace-expansion/dist/esm/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/node_modules/brace-expansion/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json new file mode 100644 index 00000000..81524809 --- /dev/null +++ b/node_modules/brace-expansion/package.json @@ -0,0 +1,64 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "5.0.6", + "files": [ + "dist" + ], + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^25.2.1", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.6.2", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "dependencies": { + "balanced-match": "^4.0.2" + }, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/juliangruber/brace-expansion.git" + } +} diff --git a/node_modules/buffer-from/LICENSE b/node_modules/buffer-from/LICENSE new file mode 100644 index 00000000..e4bf1d69 --- /dev/null +++ b/node_modules/buffer-from/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016, 2018 Linus Unnebäck + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/buffer-from/index.js b/node_modules/buffer-from/index.js new file mode 100644 index 00000000..e1a58b5e --- /dev/null +++ b/node_modules/buffer-from/index.js @@ -0,0 +1,72 @@ +/* eslint-disable node/no-deprecated-api */ + +var toString = Object.prototype.toString + +var isModern = ( + typeof Buffer !== 'undefined' && + typeof Buffer.alloc === 'function' && + typeof Buffer.allocUnsafe === 'function' && + typeof Buffer.from === 'function' +) + +function isArrayBuffer (input) { + return toString.call(input).slice(8, -1) === 'ArrayBuffer' +} + +function fromArrayBuffer (obj, byteOffset, length) { + byteOffset >>>= 0 + + var maxLength = obj.byteLength - byteOffset + + if (maxLength < 0) { + throw new RangeError("'offset' is out of bounds") + } + + if (length === undefined) { + length = maxLength + } else { + length >>>= 0 + + if (length > maxLength) { + throw new RangeError("'length' is out of bounds") + } + } + + return isModern + ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) + : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length))) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + return isModern + ? Buffer.from(string, encoding) + : new Buffer(string, encoding) +} + +function bufferFrom (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (isArrayBuffer(value)) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + return isModern + ? Buffer.from(value) + : new Buffer(value) +} + +module.exports = bufferFrom diff --git a/node_modules/buffer-from/package.json b/node_modules/buffer-from/package.json new file mode 100644 index 00000000..6ac5327b --- /dev/null +++ b/node_modules/buffer-from/package.json @@ -0,0 +1,19 @@ +{ + "name": "buffer-from", + "version": "1.1.2", + "license": "MIT", + "repository": "LinusU/buffer-from", + "files": [ + "index.js" + ], + "scripts": { + "test": "standard && node test" + }, + "devDependencies": { + "standard": "^12.0.1" + }, + "keywords": [ + "buffer", + "buffer from" + ] +} diff --git a/node_modules/buffer-from/readme.md b/node_modules/buffer-from/readme.md new file mode 100644 index 00000000..9880a558 --- /dev/null +++ b/node_modules/buffer-from/readme.md @@ -0,0 +1,69 @@ +# Buffer From + +A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available. + +## Installation + +```sh +npm install --save buffer-from +``` + +## Usage + +```js +const bufferFrom = require('buffer-from') + +console.log(bufferFrom([1, 2, 3, 4])) +//=> + +const arr = new Uint8Array([1, 2, 3, 4]) +console.log(bufferFrom(arr.buffer, 1, 2)) +//=> + +console.log(bufferFrom('test', 'utf8')) +//=> + +const buf = bufferFrom('test') +console.log(bufferFrom(buf)) +//=> +``` + +## API + +### bufferFrom(array) + +- `array` <Array> + +Allocates a new `Buffer` using an `array` of octets. + +### bufferFrom(arrayBuffer[, byteOffset[, length]]) + +- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer +- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0` +- `length` <Integer> How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a TypedArray instance, the +newly created `Buffer` will share the same allocated memory as the TypedArray. + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +### bufferFrom(buffer) + +- `buffer` <Buffer> An existing `Buffer` to copy data from + +Copies the passed `buffer` data onto a new `Buffer` instance. + +### bufferFrom(string[, encoding]) + +- `string` <String> A string to encode. +- `encoding` <String> The encoding of `string`. **Default:** `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `string`. If +provided, the `encoding` parameter identifies the character encoding of +`string`. + +## See also + +- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` +- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` diff --git a/node_modules/capital-case/LICENSE b/node_modules/capital-case/LICENSE new file mode 100644 index 00000000..983fbe8a --- /dev/null +++ b/node_modules/capital-case/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/capital-case/README.md b/node_modules/capital-case/README.md new file mode 100644 index 00000000..06ce1584 --- /dev/null +++ b/node_modules/capital-case/README.md @@ -0,0 +1,37 @@ +# Capital Case + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Bundle size][bundlephobia-image]][bundlephobia-url] + +> Transform into a space separated string with each word capitalized. + +## Installation + +``` +npm install capital-case --save +``` + +## Usage + +```js +import { capitalCase } from "capital-case"; + +capitalCase("string"); //=> "String" +capitalCase("dot.case"); //=> "Dot Case" +capitalCase("PascalCase"); //=> "Pascal Case" +capitalCase("version 1.2.10"); //=> "Version 1 2 10" +``` + +The function also accepts [`options`](https://github.com/blakeembrey/change-case#options). + +## License + +MIT + +[npm-image]: https://img.shields.io/npm/v/capital-case.svg?style=flat +[npm-url]: https://npmjs.org/package/capital-case +[downloads-image]: https://img.shields.io/npm/dm/capital-case.svg?style=flat +[downloads-url]: https://npmjs.org/package/capital-case +[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/capital-case.svg +[bundlephobia-url]: https://bundlephobia.com/result?p=capital-case diff --git a/node_modules/capital-case/dist.es2015/index.d.ts b/node_modules/capital-case/dist.es2015/index.d.ts new file mode 100644 index 00000000..b11b8001 --- /dev/null +++ b/node_modules/capital-case/dist.es2015/index.d.ts @@ -0,0 +1,4 @@ +import { Options } from "no-case"; +export { Options }; +export declare function capitalCaseTransform(input: string): string; +export declare function capitalCase(input: string, options?: Options): string; diff --git a/node_modules/capital-case/dist.es2015/index.js b/node_modules/capital-case/dist.es2015/index.js new file mode 100644 index 00000000..10ecc5ed --- /dev/null +++ b/node_modules/capital-case/dist.es2015/index.js @@ -0,0 +1,11 @@ +import { __assign } from "tslib"; +import { noCase } from "no-case"; +import { upperCaseFirst } from "upper-case-first"; +export function capitalCaseTransform(input) { + return upperCaseFirst(input.toLowerCase()); +} +export function capitalCase(input, options) { + if (options === void 0) { options = {}; } + return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options)); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/capital-case/dist.es2015/index.js.map b/node_modules/capital-case/dist.es2015/index.js.map new file mode 100644 index 00000000..8d9adf0c --- /dev/null +++ b/node_modules/capital-case/dist.es2015/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,OAAqB;IAArB,wBAAA,EAAA,YAAqB;IAC9D,OAAO,MAAM,CAAC,KAAK,aACjB,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,oBAAoB,IAC5B,OAAO,EACV,CAAC;AACL,CAAC","sourcesContent":["import { noCase, Options } from \"no-case\";\nimport { upperCaseFirst } from \"upper-case-first\";\n\nexport { Options };\n\nexport function capitalCaseTransform(input: string) {\n return upperCaseFirst(input.toLowerCase());\n}\n\nexport function capitalCase(input: string, options: Options = {}) {\n return noCase(input, {\n delimiter: \" \",\n transform: capitalCaseTransform,\n ...options,\n });\n}\n"]} \ No newline at end of file diff --git a/node_modules/capital-case/dist.es2015/index.spec.d.ts b/node_modules/capital-case/dist.es2015/index.spec.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/capital-case/dist.es2015/index.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/capital-case/dist.es2015/index.spec.js b/node_modules/capital-case/dist.es2015/index.spec.js new file mode 100644 index 00000000..41835f91 --- /dev/null +++ b/node_modules/capital-case/dist.es2015/index.spec.js @@ -0,0 +1,22 @@ +import { capitalCase } from "."; +var TEST_CASES = [ + ["", ""], + ["test", "Test"], + ["test string", "Test String"], + ["Test String", "Test String"], + ["TestV2", "Test V2"], + ["version 1.2.10", "Version 1 2 10"], + ["version 1.21.0", "Version 1 21 0"], +]; +describe("capital case", function () { + var _loop_1 = function (input, result) { + it(input + " -> " + result, function () { + expect(capitalCase(input)).toEqual(result); + }); + }; + for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) { + var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1]; + _loop_1(input, result); + } +}); +//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/node_modules/capital-case/dist.es2015/index.spec.js.map b/node_modules/capital-case/dist.es2015/index.spec.js.map new file mode 100644 index 00000000..321a84de --- /dev/null +++ b/node_modules/capital-case/dist.es2015/index.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAEhC,IAAM,UAAU,GAAuB;IACrC,CAAC,EAAE,EAAE,EAAE,CAAC;IACR,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,QAAQ,EAAE,SAAS,CAAC;IACrB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,QAAQ,CAAC,cAAc,EAAE;4BACX,KAAK,EAAE,MAAM;QACvB,EAAE,CAAI,KAAK,YAAO,MAAQ,EAAE;YAC1B,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;;IAHL,KAA8B,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU;QAA7B,IAAA,qBAAe,EAAd,KAAK,QAAA,EAAE,MAAM,QAAA;gBAAb,KAAK,EAAE,MAAM;KAIxB;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { capitalCase } from \".\";\n\nconst TEST_CASES: [string, string][] = [\n [\"\", \"\"],\n [\"test\", \"Test\"],\n [\"test string\", \"Test String\"],\n [\"Test String\", \"Test String\"],\n [\"TestV2\", \"Test V2\"],\n [\"version 1.2.10\", \"Version 1 2 10\"],\n [\"version 1.21.0\", \"Version 1 21 0\"],\n];\n\ndescribe(\"capital case\", () => {\n for (const [input, result] of TEST_CASES) {\n it(`${input} -> ${result}`, () => {\n expect(capitalCase(input)).toEqual(result);\n });\n }\n});\n"]} \ No newline at end of file diff --git a/node_modules/capital-case/dist/index.d.ts b/node_modules/capital-case/dist/index.d.ts new file mode 100644 index 00000000..b11b8001 --- /dev/null +++ b/node_modules/capital-case/dist/index.d.ts @@ -0,0 +1,4 @@ +import { Options } from "no-case"; +export { Options }; +export declare function capitalCaseTransform(input: string): string; +export declare function capitalCase(input: string, options?: Options): string; diff --git a/node_modules/capital-case/dist/index.js b/node_modules/capital-case/dist/index.js new file mode 100644 index 00000000..a12cc1c4 --- /dev/null +++ b/node_modules/capital-case/dist/index.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.capitalCase = exports.capitalCaseTransform = void 0; +var tslib_1 = require("tslib"); +var no_case_1 = require("no-case"); +var upper_case_first_1 = require("upper-case-first"); +function capitalCaseTransform(input) { + return upper_case_first_1.upperCaseFirst(input.toLowerCase()); +} +exports.capitalCaseTransform = capitalCaseTransform; +function capitalCase(input, options) { + if (options === void 0) { options = {}; } + return no_case_1.noCase(input, tslib_1.__assign({ delimiter: " ", transform: capitalCaseTransform }, options)); +} +exports.capitalCase = capitalCase; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/capital-case/dist/index.js.map b/node_modules/capital-case/dist/index.js.map new file mode 100644 index 00000000..18c57cc2 --- /dev/null +++ b/node_modules/capital-case/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,mCAA0C;AAC1C,qDAAkD;AAIlD,SAAgB,oBAAoB,CAAC,KAAa;IAChD,OAAO,iCAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AAC7C,CAAC;AAFD,oDAEC;AAED,SAAgB,WAAW,CAAC,KAAa,EAAE,OAAqB;IAArB,wBAAA,EAAA,YAAqB;IAC9D,OAAO,gBAAM,CAAC,KAAK,qBACjB,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,oBAAoB,IAC5B,OAAO,EACV,CAAC;AACL,CAAC;AAND,kCAMC","sourcesContent":["import { noCase, Options } from \"no-case\";\nimport { upperCaseFirst } from \"upper-case-first\";\n\nexport { Options };\n\nexport function capitalCaseTransform(input: string) {\n return upperCaseFirst(input.toLowerCase());\n}\n\nexport function capitalCase(input: string, options: Options = {}) {\n return noCase(input, {\n delimiter: \" \",\n transform: capitalCaseTransform,\n ...options,\n });\n}\n"]} \ No newline at end of file diff --git a/node_modules/capital-case/dist/index.spec.d.ts b/node_modules/capital-case/dist/index.spec.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/capital-case/dist/index.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/capital-case/dist/index.spec.js b/node_modules/capital-case/dist/index.spec.js new file mode 100644 index 00000000..0a3af9c6 --- /dev/null +++ b/node_modules/capital-case/dist/index.spec.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var _1 = require("."); +var TEST_CASES = [ + ["", ""], + ["test", "Test"], + ["test string", "Test String"], + ["Test String", "Test String"], + ["TestV2", "Test V2"], + ["version 1.2.10", "Version 1 2 10"], + ["version 1.21.0", "Version 1 21 0"], +]; +describe("capital case", function () { + var _loop_1 = function (input, result) { + it(input + " -> " + result, function () { + expect(_1.capitalCase(input)).toEqual(result); + }); + }; + for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) { + var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1]; + _loop_1(input, result); + } +}); +//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/node_modules/capital-case/dist/index.spec.js.map b/node_modules/capital-case/dist/index.spec.js.map new file mode 100644 index 00000000..2565e285 --- /dev/null +++ b/node_modules/capital-case/dist/index.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;AAAA,sBAAgC;AAEhC,IAAM,UAAU,GAAuB;IACrC,CAAC,EAAE,EAAE,EAAE,CAAC;IACR,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,QAAQ,EAAE,SAAS,CAAC;IACrB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,QAAQ,CAAC,cAAc,EAAE;4BACX,KAAK,EAAE,MAAM;QACvB,EAAE,CAAI,KAAK,YAAO,MAAQ,EAAE;YAC1B,MAAM,CAAC,cAAW,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;;IAHL,KAA8B,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU;QAA7B,IAAA,qBAAe,EAAd,KAAK,QAAA,EAAE,MAAM,QAAA;gBAAb,KAAK,EAAE,MAAM;KAIxB;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { capitalCase } from \".\";\n\nconst TEST_CASES: [string, string][] = [\n [\"\", \"\"],\n [\"test\", \"Test\"],\n [\"test string\", \"Test String\"],\n [\"Test String\", \"Test String\"],\n [\"TestV2\", \"Test V2\"],\n [\"version 1.2.10\", \"Version 1 2 10\"],\n [\"version 1.21.0\", \"Version 1 21 0\"],\n];\n\ndescribe(\"capital case\", () => {\n for (const [input, result] of TEST_CASES) {\n it(`${input} -> ${result}`, () => {\n expect(capitalCase(input)).toEqual(result);\n });\n }\n});\n"]} \ No newline at end of file diff --git a/node_modules/capital-case/package.json b/node_modules/capital-case/package.json new file mode 100644 index 00000000..40a3fb83 --- /dev/null +++ b/node_modules/capital-case/package.json @@ -0,0 +1,90 @@ +{ + "name": "capital-case", + "version": "1.0.4", + "description": "Transform into a space separated string with each word capitalized", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "module": "dist.es2015/index.js", + "sideEffects": false, + "jsnext:main": "dist.es2015/index.js", + "files": [ + "dist/", + "dist.es2015/", + "LICENSE" + ], + "scripts": { + "lint": "tslint \"src/**/*\" --project tsconfig.json", + "build": "rimraf dist/ dist.es2015/ && tsc && tsc -P tsconfig.es2015.json", + "specs": "jest --coverage", + "test": "npm run build && npm run lint && npm run specs", + "size": "size-limit", + "prepare": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/blakeembrey/change-case.git" + }, + "keywords": [ + "capital", + "case", + "title", + "capital-case", + "convert", + "transform", + "capitalize" + ], + "author": { + "name": "Blake Embrey", + "email": "hello@blakeembrey.com", + "url": "http://blakeembrey.me" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/blakeembrey/change-case/issues" + }, + "homepage": "https://github.com/blakeembrey/change-case/tree/master/packages/capital-case#readme", + "size-limit": [ + { + "path": "dist/index.js", + "limit": "500 B" + } + ], + "jest": { + "roots": [ + "/src/" + ], + "transform": { + "\\.tsx?$": "ts-jest" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "jsx", + "json", + "node" + ] + }, + "publishConfig": { + "access": "public" + }, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + }, + "devDependencies": { + "@size-limit/preset-small-lib": "^2.2.1", + "@types/jest": "^24.0.23", + "@types/node": "^12.12.14", + "jest": "^24.9.0", + "rimraf": "^3.0.0", + "ts-jest": "^24.2.0", + "tslint": "^5.20.1", + "tslint-config-prettier": "^1.18.0", + "tslint-config-standard": "^9.0.0", + "typescript": "^4.1.2" + }, + "gitHead": "76a21a7f6f2a226521ef6abd345ff309cbd01fb0" +} diff --git a/node_modules/chalk/index.d.ts b/node_modules/chalk/index.d.ts new file mode 100644 index 00000000..9cd88f38 --- /dev/null +++ b/node_modules/chalk/index.d.ts @@ -0,0 +1,415 @@ +/** +Basic foreground colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type ForegroundColor = + | 'black' + | 'red' + | 'green' + | 'yellow' + | 'blue' + | 'magenta' + | 'cyan' + | 'white' + | 'gray' + | 'grey' + | 'blackBright' + | 'redBright' + | 'greenBright' + | 'yellowBright' + | 'blueBright' + | 'magentaBright' + | 'cyanBright' + | 'whiteBright'; + +/** +Basic background colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type BackgroundColor = + | 'bgBlack' + | 'bgRed' + | 'bgGreen' + | 'bgYellow' + | 'bgBlue' + | 'bgMagenta' + | 'bgCyan' + | 'bgWhite' + | 'bgGray' + | 'bgGrey' + | 'bgBlackBright' + | 'bgRedBright' + | 'bgGreenBright' + | 'bgYellowBright' + | 'bgBlueBright' + | 'bgMagentaBright' + | 'bgCyanBright' + | 'bgWhiteBright'; + +/** +Basic colors. + +[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) +*/ +declare type Color = ForegroundColor | BackgroundColor; + +declare type Modifiers = + | 'reset' + | 'bold' + | 'dim' + | 'italic' + | 'underline' + | 'inverse' + | 'hidden' + | 'strikethrough' + | 'visible'; + +declare namespace chalk { + /** + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + type Level = 0 | 1 | 2 | 3; + + interface Options { + /** + Specify the color support for Chalk. + + By default, color support is automatically detected based on the environment. + + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + level?: Level; + } + + /** + Return a new Chalk instance. + */ + type Instance = new (options?: Options) => Chalk; + + /** + Detect whether the terminal supports color. + */ + interface ColorSupport { + /** + The color level used by Chalk. + */ + level: Level; + + /** + Return whether Chalk supports basic 16 colors. + */ + hasBasic: boolean; + + /** + Return whether Chalk supports ANSI 256 colors. + */ + has256: boolean; + + /** + Return whether Chalk supports Truecolor 16 million colors. + */ + has16m: boolean; + } + + interface ChalkFunction { + /** + Use a template string. + + @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) + + @example + ``` + import chalk = require('chalk'); + + log(chalk` + CPU: {red ${cpu.totalPercent}%} + RAM: {green ${ram.used / ram.total * 100}%} + DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} + `); + ``` + + @example + ``` + import chalk = require('chalk'); + + log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) + ``` + */ + (text: TemplateStringsArray, ...placeholders: unknown[]): string; + + (...text: unknown[]): string; + } + + interface Chalk extends ChalkFunction { + /** + Return a new Chalk instance. + */ + Instance: Instance; + + /** + The color support for Chalk. + + By default, color support is automatically detected based on the environment. + + Levels: + - `0` - All colors disabled. + - `1` - Basic 16 colors support. + - `2` - ANSI 256 colors support. + - `3` - Truecolor 16 million colors support. + */ + level: Level; + + /** + Use HEX value to set text color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.hex('#DEADED'); + ``` + */ + hex(color: string): Chalk; + + /** + Use keyword color value to set text color. + + @param color - Keyword value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.keyword('orange'); + ``` + */ + keyword(color: string): Chalk; + + /** + Use RGB values to set text color. + */ + rgb(red: number, green: number, blue: number): Chalk; + + /** + Use HSL values to set text color. + */ + hsl(hue: number, saturation: number, lightness: number): Chalk; + + /** + Use HSV values to set text color. + */ + hsv(hue: number, saturation: number, value: number): Chalk; + + /** + Use HWB values to set text color. + */ + hwb(hue: number, whiteness: number, blackness: number): Chalk; + + /** + Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. + + 30 <= code && code < 38 || 90 <= code && code < 98 + For example, 31 for red, 91 for redBright. + */ + ansi(code: number): Chalk; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(index: number): Chalk; + + /** + Use HEX value to set background color. + + @param color - Hexadecimal value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.bgHex('#DEADED'); + ``` + */ + bgHex(color: string): Chalk; + + /** + Use keyword color value to set background color. + + @param color - Keyword value representing the desired color. + + @example + ``` + import chalk = require('chalk'); + + chalk.bgKeyword('orange'); + ``` + */ + bgKeyword(color: string): Chalk; + + /** + Use RGB values to set background color. + */ + bgRgb(red: number, green: number, blue: number): Chalk; + + /** + Use HSL values to set background color. + */ + bgHsl(hue: number, saturation: number, lightness: number): Chalk; + + /** + Use HSV values to set background color. + */ + bgHsv(hue: number, saturation: number, value: number): Chalk; + + /** + Use HWB values to set background color. + */ + bgHwb(hue: number, whiteness: number, blackness: number): Chalk; + + /** + Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. + + 30 <= code && code < 38 || 90 <= code && code < 98 + For example, 31 for red, 91 for redBright. + Use the foreground code, not the background code (for example, not 41, nor 101). + */ + bgAnsi(code: number): Chalk; + + /** + Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. + */ + bgAnsi256(index: number): Chalk; + + /** + Modifier: Resets the current color chain. + */ + readonly reset: Chalk; + + /** + Modifier: Make text bold. + */ + readonly bold: Chalk; + + /** + Modifier: Emitting only a small amount of light. + */ + readonly dim: Chalk; + + /** + Modifier: Make text italic. (Not widely supported) + */ + readonly italic: Chalk; + + /** + Modifier: Make text underline. (Not widely supported) + */ + readonly underline: Chalk; + + /** + Modifier: Inverse background and foreground colors. + */ + readonly inverse: Chalk; + + /** + Modifier: Prints the text, but makes it invisible. + */ + readonly hidden: Chalk; + + /** + Modifier: Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: Chalk; + + /** + Modifier: Prints the text only when Chalk has a color support level > 0. + Can be useful for things that are purely cosmetic. + */ + readonly visible: Chalk; + + readonly black: Chalk; + readonly red: Chalk; + readonly green: Chalk; + readonly yellow: Chalk; + readonly blue: Chalk; + readonly magenta: Chalk; + readonly cyan: Chalk; + readonly white: Chalk; + + /* + Alias for `blackBright`. + */ + readonly gray: Chalk; + + /* + Alias for `blackBright`. + */ + readonly grey: Chalk; + + readonly blackBright: Chalk; + readonly redBright: Chalk; + readonly greenBright: Chalk; + readonly yellowBright: Chalk; + readonly blueBright: Chalk; + readonly magentaBright: Chalk; + readonly cyanBright: Chalk; + readonly whiteBright: Chalk; + + readonly bgBlack: Chalk; + readonly bgRed: Chalk; + readonly bgGreen: Chalk; + readonly bgYellow: Chalk; + readonly bgBlue: Chalk; + readonly bgMagenta: Chalk; + readonly bgCyan: Chalk; + readonly bgWhite: Chalk; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGray: Chalk; + + /* + Alias for `bgBlackBright`. + */ + readonly bgGrey: Chalk; + + readonly bgBlackBright: Chalk; + readonly bgRedBright: Chalk; + readonly bgGreenBright: Chalk; + readonly bgYellowBright: Chalk; + readonly bgBlueBright: Chalk; + readonly bgMagentaBright: Chalk; + readonly bgCyanBright: Chalk; + readonly bgWhiteBright: Chalk; + } +} + +/** +Main Chalk object that allows to chain styles together. +Call the last one as a method with a string argument. +Order doesn't matter, and later styles take precedent in case of a conflict. +This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. +*/ +declare const chalk: chalk.Chalk & chalk.ChalkFunction & { + supportsColor: chalk.ColorSupport | false; + Level: chalk.Level; + Color: Color; + ForegroundColor: ForegroundColor; + BackgroundColor: BackgroundColor; + Modifiers: Modifiers; + stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; +}; + +export = chalk; diff --git a/node_modules/chalk/license b/node_modules/chalk/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/chalk/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/chalk/node_modules/ansi-styles/index.d.ts b/node_modules/chalk/node_modules/ansi-styles/index.d.ts new file mode 100644 index 00000000..44a907e5 --- /dev/null +++ b/node_modules/chalk/node_modules/ansi-styles/index.d.ts @@ -0,0 +1,345 @@ +declare type CSSColor = + | 'aliceblue' + | 'antiquewhite' + | 'aqua' + | 'aquamarine' + | 'azure' + | 'beige' + | 'bisque' + | 'black' + | 'blanchedalmond' + | 'blue' + | 'blueviolet' + | 'brown' + | 'burlywood' + | 'cadetblue' + | 'chartreuse' + | 'chocolate' + | 'coral' + | 'cornflowerblue' + | 'cornsilk' + | 'crimson' + | 'cyan' + | 'darkblue' + | 'darkcyan' + | 'darkgoldenrod' + | 'darkgray' + | 'darkgreen' + | 'darkgrey' + | 'darkkhaki' + | 'darkmagenta' + | 'darkolivegreen' + | 'darkorange' + | 'darkorchid' + | 'darkred' + | 'darksalmon' + | 'darkseagreen' + | 'darkslateblue' + | 'darkslategray' + | 'darkslategrey' + | 'darkturquoise' + | 'darkviolet' + | 'deeppink' + | 'deepskyblue' + | 'dimgray' + | 'dimgrey' + | 'dodgerblue' + | 'firebrick' + | 'floralwhite' + | 'forestgreen' + | 'fuchsia' + | 'gainsboro' + | 'ghostwhite' + | 'gold' + | 'goldenrod' + | 'gray' + | 'green' + | 'greenyellow' + | 'grey' + | 'honeydew' + | 'hotpink' + | 'indianred' + | 'indigo' + | 'ivory' + | 'khaki' + | 'lavender' + | 'lavenderblush' + | 'lawngreen' + | 'lemonchiffon' + | 'lightblue' + | 'lightcoral' + | 'lightcyan' + | 'lightgoldenrodyellow' + | 'lightgray' + | 'lightgreen' + | 'lightgrey' + | 'lightpink' + | 'lightsalmon' + | 'lightseagreen' + | 'lightskyblue' + | 'lightslategray' + | 'lightslategrey' + | 'lightsteelblue' + | 'lightyellow' + | 'lime' + | 'limegreen' + | 'linen' + | 'magenta' + | 'maroon' + | 'mediumaquamarine' + | 'mediumblue' + | 'mediumorchid' + | 'mediumpurple' + | 'mediumseagreen' + | 'mediumslateblue' + | 'mediumspringgreen' + | 'mediumturquoise' + | 'mediumvioletred' + | 'midnightblue' + | 'mintcream' + | 'mistyrose' + | 'moccasin' + | 'navajowhite' + | 'navy' + | 'oldlace' + | 'olive' + | 'olivedrab' + | 'orange' + | 'orangered' + | 'orchid' + | 'palegoldenrod' + | 'palegreen' + | 'paleturquoise' + | 'palevioletred' + | 'papayawhip' + | 'peachpuff' + | 'peru' + | 'pink' + | 'plum' + | 'powderblue' + | 'purple' + | 'rebeccapurple' + | 'red' + | 'rosybrown' + | 'royalblue' + | 'saddlebrown' + | 'salmon' + | 'sandybrown' + | 'seagreen' + | 'seashell' + | 'sienna' + | 'silver' + | 'skyblue' + | 'slateblue' + | 'slategray' + | 'slategrey' + | 'snow' + | 'springgreen' + | 'steelblue' + | 'tan' + | 'teal' + | 'thistle' + | 'tomato' + | 'turquoise' + | 'violet' + | 'wheat' + | 'white' + | 'whitesmoke' + | 'yellow' + | 'yellowgreen'; + +declare namespace ansiStyles { + interface ColorConvert { + /** + The RGB color space. + + @param red - (`0`-`255`) + @param green - (`0`-`255`) + @param blue - (`0`-`255`) + */ + rgb(red: number, green: number, blue: number): string; + + /** + The RGB HEX color space. + + @param hex - A hexadecimal string containing RGB data. + */ + hex(hex: string): string; + + /** + @param keyword - A CSS color name. + */ + keyword(keyword: CSSColor): string; + + /** + The HSL color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param lightness - (`0`-`100`) + */ + hsl(hue: number, saturation: number, lightness: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param saturation - (`0`-`100`) + @param value - (`0`-`100`) + */ + hsv(hue: number, saturation: number, value: number): string; + + /** + The HSV color space. + + @param hue - (`0`-`360`) + @param whiteness - (`0`-`100`) + @param blackness - (`0`-`100`) + */ + hwb(hue: number, whiteness: number, blackness: number): string; + + /** + Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. + */ + ansi(ansi: number): string; + + /** + Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. + */ + ansi256(ansi: number): string; + } + + interface CSPair { + /** + The ANSI terminal control sequence for starting this style. + */ + readonly open: string; + + /** + The ANSI terminal control sequence for ending this style. + */ + readonly close: string; + } + + interface ColorBase { + readonly ansi: ColorConvert; + readonly ansi256: ColorConvert; + readonly ansi16m: ColorConvert; + + /** + The ANSI terminal control sequence for ending this color. + */ + readonly close: string; + } + + interface Modifier { + /** + Resets the current color chain. + */ + readonly reset: CSPair; + + /** + Make text bold. + */ + readonly bold: CSPair; + + /** + Emitting only a small amount of light. + */ + readonly dim: CSPair; + + /** + Make text italic. (Not widely supported) + */ + readonly italic: CSPair; + + /** + Make text underline. (Not widely supported) + */ + readonly underline: CSPair; + + /** + Inverse background and foreground colors. + */ + readonly inverse: CSPair; + + /** + Prints the text, but makes it invisible. + */ + readonly hidden: CSPair; + + /** + Puts a horizontal line through the center of the text. (Not widely supported) + */ + readonly strikethrough: CSPair; + } + + interface ForegroundColor { + readonly black: CSPair; + readonly red: CSPair; + readonly green: CSPair; + readonly yellow: CSPair; + readonly blue: CSPair; + readonly cyan: CSPair; + readonly magenta: CSPair; + readonly white: CSPair; + + /** + Alias for `blackBright`. + */ + readonly gray: CSPair; + + /** + Alias for `blackBright`. + */ + readonly grey: CSPair; + + readonly blackBright: CSPair; + readonly redBright: CSPair; + readonly greenBright: CSPair; + readonly yellowBright: CSPair; + readonly blueBright: CSPair; + readonly cyanBright: CSPair; + readonly magentaBright: CSPair; + readonly whiteBright: CSPair; + } + + interface BackgroundColor { + readonly bgBlack: CSPair; + readonly bgRed: CSPair; + readonly bgGreen: CSPair; + readonly bgYellow: CSPair; + readonly bgBlue: CSPair; + readonly bgCyan: CSPair; + readonly bgMagenta: CSPair; + readonly bgWhite: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGray: CSPair; + + /** + Alias for `bgBlackBright`. + */ + readonly bgGrey: CSPair; + + readonly bgBlackBright: CSPair; + readonly bgRedBright: CSPair; + readonly bgGreenBright: CSPair; + readonly bgYellowBright: CSPair; + readonly bgBlueBright: CSPair; + readonly bgCyanBright: CSPair; + readonly bgMagentaBright: CSPair; + readonly bgWhiteBright: CSPair; + } +} + +declare const ansiStyles: { + readonly modifier: ansiStyles.Modifier; + readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; + readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; + readonly codes: ReadonlyMap; +} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; + +export = ansiStyles; diff --git a/node_modules/chalk/node_modules/ansi-styles/index.js b/node_modules/chalk/node_modules/ansi-styles/index.js new file mode 100644 index 00000000..5d82581a --- /dev/null +++ b/node_modules/chalk/node_modules/ansi-styles/index.js @@ -0,0 +1,163 @@ +'use strict'; + +const wrapAnsi16 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => (...args) => { + const code = fn(...args); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => (...args) => { + const rgb = fn(...args); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +const ansi2ansi = n => n; +const rgb2rgb = (r, g, b) => [r, g, b]; + +const setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + + return value; + }, + enumerable: true, + configurable: true + }); +}; + +/** @type {typeof import('color-convert')} */ +let colorConvert; +const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { + if (colorConvert === undefined) { + colorConvert = require('color-convert'); + } + + const offset = isBackground ? 10 : 0; + const styles = {}; + + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap(identity, offset); + } else if (typeof suite === 'object') { + styles[name] = wrap(suite[targetSpace], offset); + } + } + + return styles; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + 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], + + // Bright color + 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], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Alias bright black as gray (and grey) + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); + setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); + setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); + setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/chalk/node_modules/ansi-styles/license b/node_modules/chalk/node_modules/ansi-styles/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/chalk/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/chalk/node_modules/ansi-styles/package.json new file mode 100644 index 00000000..75393284 --- /dev/null +++ b/node_modules/chalk/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "4.3.0", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "funding": "https://github.com/chalk/ansi-styles?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^2.0.1" + }, + "devDependencies": { + "@types/color-convert": "^1.9.0", + "ava": "^2.3.0", + "svg-term-cli": "^2.1.1", + "tsd": "^0.11.0", + "xo": "^0.25.3" + } +} diff --git a/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/chalk/node_modules/ansi-styles/readme.md new file mode 100644 index 00000000..24883de8 --- /dev/null +++ b/node_modules/chalk/node_modules/ansi-styles/readme.md @@ -0,0 +1,152 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + +## Install + +``` +$ npm install ansi-styles +``` + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `blackBright` (alias: `gray`, `grey`) +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` (alias: `bgGray`, `bgGrey`) +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +The following color spaces from `color-convert` are supported: + +- `rgb` +- `hex` +- `keyword` +- `hsl` +- `hsv` +- `hwb` +- `ansi` +- `ansi256` + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/chalk/node_modules/supports-color/browser.js b/node_modules/chalk/node_modules/supports-color/browser.js new file mode 100644 index 00000000..62afa3a7 --- /dev/null +++ b/node_modules/chalk/node_modules/supports-color/browser.js @@ -0,0 +1,5 @@ +'use strict'; +module.exports = { + stdout: false, + stderr: false +}; diff --git a/node_modules/chalk/node_modules/supports-color/index.js b/node_modules/chalk/node_modules/supports-color/index.js new file mode 100644 index 00000000..6fada390 --- /dev/null +++ b/node_modules/chalk/node_modules/supports-color/index.js @@ -0,0 +1,135 @@ +'use strict'; +const os = require('os'); +const tty = require('tty'); +const hasFlag = require('has-flag'); + +const {env} = process; + +let forceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false') || + hasFlag('color=never')) { + forceColor = 0; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + forceColor = 1; +} + +if ('FORCE_COLOR' in env) { + if (env.FORCE_COLOR === 'true') { + forceColor = 1; + } else if (env.FORCE_COLOR === 'false') { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; + } + + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) +}; diff --git a/node_modules/chalk/node_modules/supports-color/license b/node_modules/chalk/node_modules/supports-color/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/chalk/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/chalk/node_modules/supports-color/package.json b/node_modules/chalk/node_modules/supports-color/package.json new file mode 100644 index 00000000..f7182edc --- /dev/null +++ b/node_modules/chalk/node_modules/supports-color/package.json @@ -0,0 +1,53 @@ +{ + "name": "supports-color", + "version": "7.2.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^4.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "import-fresh": "^3.0.0", + "xo": "^0.24.0" + }, + "browser": "browser.js" +} diff --git a/node_modules/chalk/node_modules/supports-color/readme.md b/node_modules/chalk/node_modules/supports-color/readme.md new file mode 100644 index 00000000..36542285 --- /dev/null +++ b/node_modules/chalk/node_modules/supports-color/readme.md @@ -0,0 +1,76 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install supports-color +``` + + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +--- + + + +--- diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json new file mode 100644 index 00000000..47c23f29 --- /dev/null +++ b/node_modules/chalk/package.json @@ -0,0 +1,68 @@ +{ + "name": "chalk", + "version": "4.1.2", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "funding": "https://github.com/chalk/chalk?sponsor=1", + "main": "source", + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && nyc ava && tsd", + "bench": "matcha benchmark.js" + }, + "files": [ + "source", + "index.d.ts" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "coveralls": "^3.0.7", + "execa": "^4.0.0", + "import-fresh": "^3.1.0", + "matcha": "^0.7.0", + "nyc": "^15.0.0", + "resolve-from": "^5.0.0", + "tsd": "^0.7.4", + "xo": "^0.28.2" + }, + "xo": { + "rules": { + "unicorn/prefer-string-slice": "off", + "unicorn/prefer-includes": "off", + "@typescript-eslint/member-ordering": "off", + "no-redeclare": "off", + "unicorn/string-content": "off", + "unicorn/better-regex": "off" + } + } +} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md new file mode 100644 index 00000000..a055d21c --- /dev/null +++ b/node_modules/chalk/readme.md @@ -0,0 +1,341 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) + + + +
+ +--- + + + +--- + +
+ +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020 + +## Install + +```console +$ npm install chalk +``` + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + +## API + +### chalk.` + + + + + + +
+

+ Fisher-Yates Shuffle Demo +

+

+ This is a demo of knuth-shuffle-seeded. Enjoy! +

+
+
+ + +
+
+
+
+ + +
+
+ +
+

+      
+
+
+

+ Made with ❤ by @TimothyGu. Copyright 2015. Apache License Version 2.0. +

+
+ + + + + + diff --git a/node_modules/knuth-shuffle-seeded/index.js b/node_modules/knuth-shuffle-seeded/index.js new file mode 100644 index 00000000..5dbc6ae8 --- /dev/null +++ b/node_modules/knuth-shuffle-seeded/index.js @@ -0,0 +1,69 @@ +/* + * Copyright 2013 AJ O'Neal + * Copyright 2015 Tiancheng "Timothy" Gu + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict' + +/** + * @file + * + * Implementation of the Fisher-Yates shuffle algorithm in JavaScript, with + * the possibility of using a seed to ensure reproducibility. + * + * @module knuth-shuffle-seeded + */ + +var randGen = require('seed-random') + +/** + * Shuffle an array using the Fisher-Yates shuffle algorithm, aka Knuth + * shuffle. + * + * Note that this function overwrites the initial array. As a result if you + * would like to keep the original array intact, you have to copy the initial + * array to a new array. + * + * Implementation derived from http://stackoverflow.com/questions/2450954/. + * + * @param {Array} array An array that is to be shuffled. + * @param [seed=Math.random()] Seed for the shuffling operation. If + * unspecified then a random value is used. + * @return {Array} The resulting array. + */ +module.exports = function shuffle(array, seed) { + var currentIndex + , temporaryValue + , randomIndex + , rand + if (seed == null) rand = randGen() + else rand = randGen(seed) + + if (array.constructor !== Array) throw new Error('Input is not an array') + currentIndex = array.length + + // While there remain elements to shuffle... + while (0 !== currentIndex) { + // Pick a remaining element... + randomIndex = Math.floor(rand() * (currentIndex --)) + + // And swap it with the current element. + temporaryValue = array[currentIndex] + array[currentIndex] = array[randomIndex] + array[randomIndex] = temporaryValue + } + + return array +} diff --git a/node_modules/knuth-shuffle-seeded/package.json b/node_modules/knuth-shuffle-seeded/package.json new file mode 100644 index 00000000..e87e4b2a --- /dev/null +++ b/node_modules/knuth-shuffle-seeded/package.json @@ -0,0 +1,50 @@ +{ + "name": "knuth-shuffle-seeded", + "version": "1.0.6", + "description": "The Fisher-Yates (aka Knuth) shuffle for Node.js, with seeding support", + "main": "index.js", + "scripts": { + "test": "mocha", + "browserify": "browserify -s shuffle -g uglifyify -o browser.js index.js", + "prepublish": "npm run browserify", + "coverage": "istanbul cover node_modules/mocha/bin/_mocha", + "codecov": "npm run coverage && cat ./coverage/lcov.info | codecov" + }, + "homepage": "https://github.com/TimothyGu/knuth-shuffle-seeded", + "repository": { + "type": "git", + "url": "git://github.com/TimothyGu/knuth-shuffle-seeded.git" + }, + "keywords": [ + "ronald", + "fisher", + "frank", + "yates", + "fisher-yates", + "donald", + "knuth", + "shuffle", + "random", + "randomize", + "unbiased", + "algorithm" + ], + "author": "AJ O'Neal (http://coolaj86.info/)", + "contributors": [ + "Timothy Gu (https://timothygu.github.io/)" + ], + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/TimothyGu/knuth-shuffle-seeded/issues" + }, + "dependencies": { + "seed-random": "~2.2.0" + }, + "devDependencies": { + "browserify": "~8.1.1", + "codecov.io": "~0.0.8", + "istanbul": "~0.3.5", + "mocha": "~2.1.0", + "uglifyify": "~3.0.1" + } +} diff --git a/node_modules/knuth-shuffle-seeded/test/test.js b/node_modules/knuth-shuffle-seeded/test/test.js new file mode 100644 index 00000000..903b031a --- /dev/null +++ b/node_modules/knuth-shuffle-seeded/test/test.js @@ -0,0 +1,119 @@ +// Licensed under the Apache License, version 2.0 + +'use strict' + +var shuffle = require('..') + , assert = require('assert') + , test = [ 2, 11, 37, 42, 'adsf', 'blah', { heeeheee: true } ] + +it('changes input array', function () { + var input = test.slice(0) + , a = shuffle(input) + assert.deepEqual(a, input) +}) + +describe('random shuffling', function () { + it('works', function () { + var a = shuffle(test.slice(0)) + , b = shuffle(test.slice(0)) + , c = shuffle(test.slice(0)) + // Try three times. + // The possibility of this test being a false positive is: + // + // / 1 \ 3 -12 + // |----| ≈ 7.81 × 10 ≈ 0.0000000078% + // \ 7! / + // + // That's good enough IMO. + try { + assert.notDeepEqual(test, a) + } catch (e) { + if (!(e instanceof AssertionError)) throw e + try { + assert.notDeepEqual(test, b) + } catch (e) { + if (!(e instanceof AssertionError)) throw e + assert.notDeepEqual(test, c) + } + } + }) +}) + +describe('seeding with a number', function () { + var a, b + + it('does not crash', function () { + a = shuffle(test.slice(0), 2) + b = shuffle(test.slice(0), 2) + }) + + it('output is the same for the same seed', function () { + assert.deepEqual(a, b) + assert.deepEqual(a, [ 'blah', { heeeheee: true }, 2, 'adsf', 11, 42, 37 ]) + }) +}) + +describe('seeding with a object', function () { + var obj1 = { blah: 'ad', bla: 4 } + , obj2 = new Date() + , a + , b + + it('does not crash', function () { + a = shuffle(test.slice(0), obj1) + b = shuffle(test.slice(0), obj2) + }) +}) + +describe('seeding with a string', function () { + var str = 'Lorem ipsum' + , a + , b + + it('does not crash', function () { + a = shuffle(test.slice(0), str) + b = shuffle(test.slice(0), str) + }) + + it('output is the same for the same seed', function () { + assert.deepEqual(a, b) + assert.deepEqual(a, [ { heeeheee: true }, 2, 'blah', 11, 'adsf', 42, 37 ]) + }) +}) + +describe('errors', function () { + it('on String input', function () { + assert.throws(function () { + shuffle('adf') + }) + }) + it('on Boolean input', function () { + assert.throws(function () { + shuffle(true) + }) + }) + it('on Object input', function () { + assert.throws(function () { + shuffle({ a: true }) + }) + }) + it('on Number input', function () { + assert.throws(function () { + shuffle(40) + }) + }) + it('on null input', function () { + assert.throws(function () { + shuffle(null) + }) + }) + it('on undefined input', function () { + assert.throws(function () { + shuffle(undefined) + }) + }) + it('not on empty array', function () { + var a = shuffle([]) + assert.deepEqual(a, []) + }) +}) diff --git a/node_modules/lodash.merge/LICENSE b/node_modules/lodash.merge/LICENSE new file mode 100644 index 00000000..77c42f14 --- /dev/null +++ b/node_modules/lodash.merge/LICENSE @@ -0,0 +1,47 @@ +Copyright OpenJS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.merge/README.md b/node_modules/lodash.merge/README.md new file mode 100644 index 00000000..91b75386 --- /dev/null +++ b/node_modules/lodash.merge/README.md @@ -0,0 +1,18 @@ +# lodash.merge v4.6.2 + +The [Lodash](https://lodash.com/) method `_.merge` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.merge +``` + +In Node.js: +```js +var merge = require('lodash.merge'); +``` + +See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/4.6.2-npm-packages/lodash.merge) for more details. diff --git a/node_modules/lodash.merge/index.js b/node_modules/lodash.merge/index.js new file mode 100644 index 00000000..8e75d955 --- /dev/null +++ b/node_modules/lodash.merge/index.js @@ -0,0 +1,1977 @@ +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeMax = Math.max, + nativeNow = Date.now; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ +function toPlainObject(value) { + return copyObject(value, keysIn(value)); +} + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +/** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ +var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); +}); + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = merge; diff --git a/node_modules/lodash.merge/package.json b/node_modules/lodash.merge/package.json new file mode 100644 index 00000000..3130fc8f --- /dev/null +++ b/node_modules/lodash.merge/package.json @@ -0,0 +1,16 @@ +{ + "name": "lodash.merge", + "version": "4.6.2", + "description": "The Lodash method `_.merge` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, merge", + "author": "John-David Dalton ", + "contributors": [ + "John-David Dalton ", + "Mathias Bynens " + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lodash.mergewith/LICENSE b/node_modules/lodash.mergewith/LICENSE new file mode 100644 index 00000000..77c42f14 --- /dev/null +++ b/node_modules/lodash.mergewith/LICENSE @@ -0,0 +1,47 @@ +Copyright OpenJS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.mergewith/README.md b/node_modules/lodash.mergewith/README.md new file mode 100644 index 00000000..011e9e65 --- /dev/null +++ b/node_modules/lodash.mergewith/README.md @@ -0,0 +1,18 @@ +# lodash.mergewith v4.6.2 + +The [Lodash](https://lodash.com/) method `_.mergeWith` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.mergewith +``` + +In Node.js: +```js +var mergeWith = require('lodash.mergewith'); +``` + +See the [documentation](https://lodash.com/docs#mergeWith) or [package source](https://github.com/lodash/lodash/blob/4.6.2-npm-packages/lodash.mergewith) for more details. diff --git a/node_modules/lodash.mergewith/index.js b/node_modules/lodash.mergewith/index.js new file mode 100644 index 00000000..45b0a1fe --- /dev/null +++ b/node_modules/lodash.mergewith/index.js @@ -0,0 +1,1977 @@ +/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeMax = Math.max, + nativeNow = Date.now; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ +function toPlainObject(value) { + return copyObject(value, keysIn(value)); +} + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +/** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ +var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); +}); + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = mergeWith; diff --git a/node_modules/lodash.mergewith/package.json b/node_modules/lodash.mergewith/package.json new file mode 100644 index 00000000..d37acd03 --- /dev/null +++ b/node_modules/lodash.mergewith/package.json @@ -0,0 +1,16 @@ +{ + "name": "lodash.mergewith", + "version": "4.6.2", + "description": "The Lodash method `_.mergeWith` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, mergewith", + "author": "John-David Dalton ", + "contributors": [ + "John-David Dalton ", + "Mathias Bynens " + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lodash.sortby/LICENSE b/node_modules/lodash.sortby/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/node_modules/lodash.sortby/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash.sortby/README.md b/node_modules/lodash.sortby/README.md new file mode 100644 index 00000000..266738eb --- /dev/null +++ b/node_modules/lodash.sortby/README.md @@ -0,0 +1,18 @@ +# lodash.sortby v4.7.0 + +The [lodash](https://lodash.com/) method `_.sortBy` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.sortby +``` + +In Node.js: +```js +var sortBy = require('lodash.sortby'); +``` + +See the [documentation](https://lodash.com/docs#sortBy) or [package source](https://github.com/lodash/lodash/blob/4.7.0-npm-packages/lodash.sortby) for more details. diff --git a/node_modules/lodash.sortby/index.js b/node_modules/lodash.sortby/index.js new file mode 100644 index 00000000..85dddb46 --- /dev/null +++ b/node_modules/lodash.sortby/index.js @@ -0,0 +1,2630 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!seen.has(othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + string = toString(string); + + var result = []; + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ +var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); +}); + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Assign cache to `_.memoize`. +memoize.Cache = MapCache; + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the value at `path` of a given object. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + * @example + * + * var objects = [ + * { 'a': { 'b': 2 } }, + * { 'a': { 'b': 1 } } + * ]; + * + * _.map(objects, _.property('a.b')); + * // => [2, 1] + * + * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); +} + +module.exports = sortBy; diff --git a/node_modules/lodash.sortby/package.json b/node_modules/lodash.sortby/package.json new file mode 100644 index 00000000..bfe6985e --- /dev/null +++ b/node_modules/lodash.sortby/package.json @@ -0,0 +1,17 @@ +{ + "name": "lodash.sortby", + "version": "4.7.0", + "description": "The lodash method `_.sortBy` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": "lodash-modularized, sortby", + "author": "John-David Dalton (http://allyoucanleet.com/)", + "contributors": [ + "John-David Dalton (http://allyoucanleet.com/)", + "Blaine Bublitz (https://github.com/phated)", + "Mathias Bynens (https://mathiasbynens.be/)" + ], + "repository": "lodash/lodash", + "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } +} diff --git a/node_modules/lower-case/LICENSE b/node_modules/lower-case/LICENSE new file mode 100644 index 00000000..983fbe8a --- /dev/null +++ b/node_modules/lower-case/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/lower-case/README.md b/node_modules/lower-case/README.md new file mode 100644 index 00000000..18bf9002 --- /dev/null +++ b/node_modules/lower-case/README.md @@ -0,0 +1,35 @@ +# Lower Case + +[![NPM version][npm-image]][npm-url] +[![NPM downloads][downloads-image]][downloads-url] +[![Bundle size][bundlephobia-image]][bundlephobia-url] + +> Transforms the string to lower case. + +## Installation + +``` +npm install lower-case --save +``` + +## Usage + +```js +import { lowerCase, localeLowerCase } from "lower-case"; + +lowerCase("string"); //=> "string" +lowerCase("PascalCase"); //=> "pascalcase" + +localeLowerCase("STRING", "tr"); //=> "strıng" +``` + +## License + +MIT + +[npm-image]: https://img.shields.io/npm/v/lower-case.svg?style=flat +[npm-url]: https://npmjs.org/package/lower-case +[downloads-image]: https://img.shields.io/npm/dm/lower-case.svg?style=flat +[downloads-url]: https://npmjs.org/package/lower-case +[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/lower-case.svg +[bundlephobia-url]: https://bundlephobia.com/result?p=lower-case diff --git a/node_modules/lower-case/dist.es2015/index.d.ts b/node_modules/lower-case/dist.es2015/index.d.ts new file mode 100644 index 00000000..d563e2f9 --- /dev/null +++ b/node_modules/lower-case/dist.es2015/index.d.ts @@ -0,0 +1,8 @@ +/** + * Localized lower case. + */ +export declare function localeLowerCase(str: string, locale: string): string; +/** + * Lower case as a function. + */ +export declare function lowerCase(str: string): string; diff --git a/node_modules/lower-case/dist.es2015/index.js b/node_modules/lower-case/dist.es2015/index.js new file mode 100644 index 00000000..2be99779 --- /dev/null +++ b/node_modules/lower-case/dist.es2015/index.js @@ -0,0 +1,48 @@ +/** + * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt + */ +var SUPPORTED_LOCALE = { + tr: { + regexp: /\u0130|\u0049|\u0049\u0307/g, + map: { + İ: "\u0069", + I: "\u0131", + İ: "\u0069", + }, + }, + az: { + regexp: /\u0130/g, + map: { + İ: "\u0069", + I: "\u0131", + İ: "\u0069", + }, + }, + lt: { + regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, + map: { + I: "\u0069\u0307", + J: "\u006A\u0307", + Į: "\u012F\u0307", + Ì: "\u0069\u0307\u0300", + Í: "\u0069\u0307\u0301", + Ĩ: "\u0069\u0307\u0303", + }, + }, +}; +/** + * Localized lower case. + */ +export function localeLowerCase(str, locale) { + var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; + if (lang) + return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); + return lowerCase(str); +} +/** + * Lower case as a function. + */ +export function lowerCase(str) { + return str.toLowerCase(); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lower-case/dist.es2015/index.js.map b/node_modules/lower-case/dist.es2015/index.js.map new file mode 100644 index 00000000..73fb240c --- /dev/null +++ b/node_modules/lower-case/dist.es2015/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,IAAM,gBAAgB,GAA2B;IAC/C,EAAE,EAAE;QACF,MAAM,EAAE,6BAA6B;QACrC,GAAG,EAAE;YACH,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,EAAE,EAAE,QAAQ;SACb;KACF;IACD,EAAE,EAAE;QACF,MAAM,EAAE,SAAS;QACjB,GAAG,EAAE;YACH,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,EAAE,EAAE,QAAQ;SACb;KACF;IACD,EAAE,EAAE;QACF,MAAM,EAAE,4CAA4C;QACpD,GAAG,EAAE;YACH,CAAC,EAAE,cAAc;YACjB,CAAC,EAAE,cAAc;YACjB,CAAC,EAAE,cAAc;YACjB,CAAC,EAAE,oBAAoB;YACvB,CAAC,EAAE,oBAAoB;YACvB,CAAC,EAAE,oBAAoB;SACxB;KACF;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,MAAc;IACzD,IAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IACpD,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAC,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAX,CAAW,CAAC,CAAC,CAAC;IACzE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["/**\n * Locale character mapping rules.\n */\ninterface Locale {\n regexp: RegExp;\n map: Record;\n}\n\n/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nconst SUPPORTED_LOCALE: Record = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str: string, locale: string) {\n const lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang) return lowerCase(str.replace(lang.regexp, (m) => lang.map[m]));\n return lowerCase(str);\n}\n\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str: string) {\n return str.toLowerCase();\n}\n"]} \ No newline at end of file diff --git a/node_modules/lower-case/dist.es2015/index.spec.d.ts b/node_modules/lower-case/dist.es2015/index.spec.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/lower-case/dist.es2015/index.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/lower-case/dist.es2015/index.spec.js b/node_modules/lower-case/dist.es2015/index.spec.js new file mode 100644 index 00000000..1211f742 --- /dev/null +++ b/node_modules/lower-case/dist.es2015/index.spec.js @@ -0,0 +1,34 @@ +import { lowerCase, localeLowerCase } from "."; +var TEST_CASES = [ + ["", ""], + ["test", "test"], + ["TEST", "test"], + ["test string", "test string"], + ["TEST STRING", "test string"], +]; +var LOCALE_TEST_CASES = [ + ["STRING", "strıng", "tr"], +]; +describe("lower case", function () { + var _loop_1 = function (input, result) { + it(input + " -> " + result, function () { + expect(lowerCase(input)).toEqual(result); + }); + }; + for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) { + var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1]; + _loop_1(input, result); + } +}); +describe("locale lower case", function () { + var _loop_2 = function (input, result, locale) { + it(locale + ": " + input + " -> " + result, function () { + expect(localeLowerCase(input, locale)).toEqual(result); + }); + }; + for (var _i = 0, LOCALE_TEST_CASES_1 = LOCALE_TEST_CASES; _i < LOCALE_TEST_CASES_1.length; _i++) { + var _a = LOCALE_TEST_CASES_1[_i], input = _a[0], result = _a[1], locale = _a[2]; + _loop_2(input, result, locale); + } +}); +//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/node_modules/lower-case/dist.es2015/index.spec.js.map b/node_modules/lower-case/dist.es2015/index.spec.js.map new file mode 100644 index 00000000..0639121e --- /dev/null +++ b/node_modules/lower-case/dist.es2015/index.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAE/C,IAAM,UAAU,GAAuB;IACrC,CAAC,EAAE,EAAE,EAAE,CAAC;IACR,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,aAAa,EAAE,aAAa,CAAC;CAC/B,CAAC;AAEF,IAAM,iBAAiB,GAA+B;IACpD,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC;CAC3B,CAAC;AAEF,QAAQ,CAAC,YAAY,EAAE;4BACT,KAAK,EAAE,MAAM;QACvB,EAAE,CAAI,KAAK,YAAO,MAAQ,EAAE;YAC1B,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;;IAHL,KAA8B,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU;QAA7B,IAAA,qBAAe,EAAd,KAAK,QAAA,EAAE,MAAM,QAAA;gBAAb,KAAK,EAAE,MAAM;KAIxB;AACH,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,mBAAmB,EAAE;4BAChB,KAAK,EAAE,MAAM,EAAE,MAAM;QAC/B,EAAE,CAAI,MAAM,UAAK,KAAK,YAAO,MAAQ,EAAE;YACrC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;;IAHL,KAAsC,UAAiB,EAAjB,uCAAiB,EAAjB,+BAAiB,EAAjB,IAAiB;QAA5C,IAAA,4BAAuB,EAAtB,KAAK,QAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA;gBAArB,KAAK,EAAE,MAAM,EAAE,MAAM;KAIhC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { lowerCase, localeLowerCase } from \".\";\n\nconst TEST_CASES: [string, string][] = [\n [\"\", \"\"],\n [\"test\", \"test\"],\n [\"TEST\", \"test\"],\n [\"test string\", \"test string\"],\n [\"TEST STRING\", \"test string\"],\n];\n\nconst LOCALE_TEST_CASES: [string, string, string][] = [\n [\"STRING\", \"strıng\", \"tr\"],\n];\n\ndescribe(\"lower case\", () => {\n for (const [input, result] of TEST_CASES) {\n it(`${input} -> ${result}`, () => {\n expect(lowerCase(input)).toEqual(result);\n });\n }\n});\n\ndescribe(\"locale lower case\", () => {\n for (const [input, result, locale] of LOCALE_TEST_CASES) {\n it(`${locale}: ${input} -> ${result}`, () => {\n expect(localeLowerCase(input, locale)).toEqual(result);\n });\n }\n});\n"]} \ No newline at end of file diff --git a/node_modules/lower-case/dist/index.d.ts b/node_modules/lower-case/dist/index.d.ts new file mode 100644 index 00000000..d563e2f9 --- /dev/null +++ b/node_modules/lower-case/dist/index.d.ts @@ -0,0 +1,8 @@ +/** + * Localized lower case. + */ +export declare function localeLowerCase(str: string, locale: string): string; +/** + * Lower case as a function. + */ +export declare function lowerCase(str: string): string; diff --git a/node_modules/lower-case/dist/index.js b/node_modules/lower-case/dist/index.js new file mode 100644 index 00000000..8494b1c6 --- /dev/null +++ b/node_modules/lower-case/dist/index.js @@ -0,0 +1,53 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lowerCase = exports.localeLowerCase = void 0; +/** + * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt + */ +var SUPPORTED_LOCALE = { + tr: { + regexp: /\u0130|\u0049|\u0049\u0307/g, + map: { + İ: "\u0069", + I: "\u0131", + İ: "\u0069", + }, + }, + az: { + regexp: /\u0130/g, + map: { + İ: "\u0069", + I: "\u0131", + İ: "\u0069", + }, + }, + lt: { + regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, + map: { + I: "\u0069\u0307", + J: "\u006A\u0307", + Į: "\u012F\u0307", + Ì: "\u0069\u0307\u0300", + Í: "\u0069\u0307\u0301", + Ĩ: "\u0069\u0307\u0303", + }, + }, +}; +/** + * Localized lower case. + */ +function localeLowerCase(str, locale) { + var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; + if (lang) + return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); + return lowerCase(str); +} +exports.localeLowerCase = localeLowerCase; +/** + * Lower case as a function. + */ +function lowerCase(str) { + return str.toLowerCase(); +} +exports.lowerCase = lowerCase; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lower-case/dist/index.js.map b/node_modules/lower-case/dist/index.js.map new file mode 100644 index 00000000..974aeecd --- /dev/null +++ b/node_modules/lower-case/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAQA;;GAEG;AACH,IAAM,gBAAgB,GAA2B;IAC/C,EAAE,EAAE;QACF,MAAM,EAAE,6BAA6B;QACrC,GAAG,EAAE;YACH,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,EAAE,EAAE,QAAQ;SACb;KACF;IACD,EAAE,EAAE;QACF,MAAM,EAAE,SAAS;QACjB,GAAG,EAAE;YACH,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,EAAE,EAAE,QAAQ;SACb;KACF;IACD,EAAE,EAAE;QACF,MAAM,EAAE,4CAA4C;QACpD,GAAG,EAAE;YACH,CAAC,EAAE,cAAc;YACjB,CAAC,EAAE,cAAc;YACjB,CAAC,EAAE,cAAc;YACjB,CAAC,EAAE,oBAAoB;YACvB,CAAC,EAAE,oBAAoB;YACvB,CAAC,EAAE,oBAAoB;SACxB;KACF;CACF,CAAC;AAEF;;GAEG;AACH,SAAgB,eAAe,CAAC,GAAW,EAAE,MAAc;IACzD,IAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IACpD,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,UAAC,CAAC,IAAK,OAAA,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAX,CAAW,CAAC,CAAC,CAAC;IACzE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAJD,0CAIC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;AAC3B,CAAC;AAFD,8BAEC","sourcesContent":["/**\n * Locale character mapping rules.\n */\ninterface Locale {\n regexp: RegExp;\n map: Record;\n}\n\n/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nconst SUPPORTED_LOCALE: Record = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str: string, locale: string) {\n const lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang) return lowerCase(str.replace(lang.regexp, (m) => lang.map[m]));\n return lowerCase(str);\n}\n\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str: string) {\n return str.toLowerCase();\n}\n"]} \ No newline at end of file diff --git a/node_modules/lower-case/dist/index.spec.d.ts b/node_modules/lower-case/dist/index.spec.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/lower-case/dist/index.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/lower-case/dist/index.spec.js b/node_modules/lower-case/dist/index.spec.js new file mode 100644 index 00000000..254b080f --- /dev/null +++ b/node_modules/lower-case/dist/index.spec.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var _1 = require("."); +var TEST_CASES = [ + ["", ""], + ["test", "test"], + ["TEST", "test"], + ["test string", "test string"], + ["TEST STRING", "test string"], +]; +var LOCALE_TEST_CASES = [ + ["STRING", "strıng", "tr"], +]; +describe("lower case", function () { + var _loop_1 = function (input, result) { + it(input + " -> " + result, function () { + expect(_1.lowerCase(input)).toEqual(result); + }); + }; + for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) { + var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1]; + _loop_1(input, result); + } +}); +describe("locale lower case", function () { + var _loop_2 = function (input, result, locale) { + it(locale + ": " + input + " -> " + result, function () { + expect(_1.localeLowerCase(input, locale)).toEqual(result); + }); + }; + for (var _i = 0, LOCALE_TEST_CASES_1 = LOCALE_TEST_CASES; _i < LOCALE_TEST_CASES_1.length; _i++) { + var _a = LOCALE_TEST_CASES_1[_i], input = _a[0], result = _a[1], locale = _a[2]; + _loop_2(input, result, locale); + } +}); +//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/node_modules/lower-case/dist/index.spec.js.map b/node_modules/lower-case/dist/index.spec.js.map new file mode 100644 index 00000000..25bb7f11 --- /dev/null +++ b/node_modules/lower-case/dist/index.spec.js.map @@ -0,0 +1 @@ +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sourcesContent":["import { lowerCase, localeLowerCase } from \".\";\n\nconst TEST_CASES: [string, string][] = [\n [\"\", \"\"],\n [\"test\", \"test\"],\n [\"TEST\", \"test\"],\n [\"test string\", \"test string\"],\n [\"TEST STRING\", \"test string\"],\n];\n\nconst LOCALE_TEST_CASES: [string, string, string][] = [\n [\"STRING\", \"strıng\", \"tr\"],\n];\n\ndescribe(\"lower case\", () => {\n for (const [input, result] of TEST_CASES) {\n it(`${input} -> ${result}`, () => {\n expect(lowerCase(input)).toEqual(result);\n });\n }\n});\n\ndescribe(\"locale lower case\", () => {\n for (const [input, result, locale] of LOCALE_TEST_CASES) {\n it(`${locale}: ${input} -> ${result}`, () => {\n expect(localeLowerCase(input, locale)).toEqual(result);\n });\n }\n});\n"]} \ No newline at end of file diff --git a/node_modules/lower-case/package.json b/node_modules/lower-case/package.json new file mode 100644 index 00000000..23e1c644 --- /dev/null +++ b/node_modules/lower-case/package.json @@ -0,0 +1,87 @@ +{ + "name": "lower-case", + "version": "2.0.2", + "description": "Transforms the string to lower case", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "module": "dist.es2015/index.js", + "sideEffects": false, + "jsnext:main": "dist.es2015/index.js", + "files": [ + "dist/", + "dist.es2015/", + "LICENSE" + ], + "scripts": { + "lint": "tslint \"src/**/*\" --project tsconfig.json", + "build": "rimraf dist/ dist.es2015/ && tsc && tsc -P tsconfig.es2015.json", + "specs": "jest --coverage", + "test": "npm run build && npm run lint && npm run specs", + "size": "size-limit", + "prepare": "npm run build" + }, + "repository": { + "type": "git", + "url": "git://github.com/blakeembrey/change-case.git" + }, + "keywords": [ + "lower", + "case", + "downcase", + "locale", + "convert", + "transform" + ], + "author": { + "name": "Blake Embrey", + "email": "hello@blakeembrey.com", + "url": "http://blakeembrey.me" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/blakeembrey/change-case/issues" + }, + "homepage": "https://github.com/blakeembrey/change-case/tree/master/packages/lower-case#readme", + "size-limit": [ + { + "path": "dist/index.js", + "limit": "250 B" + } + ], + "jest": { + "roots": [ + "/src/" + ], + "transform": { + "\\.tsx?$": "ts-jest" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "jsx", + "json", + "node" + ] + }, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@size-limit/preset-small-lib": "^2.2.1", + "@types/jest": "^24.0.23", + "@types/node": "^12.12.14", + "jest": "^24.9.0", + "rimraf": "^3.0.0", + "ts-jest": "^24.2.0", + "tslint": "^5.20.1", + "tslint-config-prettier": "^1.18.0", + "tslint-config-standard": "^9.0.0", + "typescript": "^4.1.2" + }, + "dependencies": { + "tslib": "^2.0.3" + }, + "gitHead": "76a21a7f6f2a226521ef6abd345ff309cbd01fb0" +} diff --git a/node_modules/lru-cache/LICENSE.md b/node_modules/lru-cache/LICENSE.md new file mode 100644 index 00000000..c5402b95 --- /dev/null +++ b/node_modules/lru-cache/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +***As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim.*** diff --git a/node_modules/lru-cache/README.md b/node_modules/lru-cache/README.md new file mode 100644 index 00000000..b990a379 --- /dev/null +++ b/node_modules/lru-cache/README.md @@ -0,0 +1,469 @@ +# lru-cache + +A cache object that deletes the least-recently-used items. + +Specify a max number of the most recently used items that you +want to keep, and this cache will keep that many of the most +recently accessed items. + +This is not primarily a TTL cache, and does not make strong TTL +guarantees. There is no preemptive pruning of expired items by +default, but you _may_ set a TTL on the cache or on a single +`set`. If you do so, it will treat expired items as missing, and +delete them when fetched. If you are more interested in TTL +caching than LRU caching, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +As of version 7, this is one of the most performant LRU +implementations available in JavaScript, and supports a wide +diversity of use cases. However, note that using some of the +features will necessarily impact performance, by causing the +cache to have to do more work. See the "Performance" section +below. + +## Installation + +```bash +npm install lru-cache --save +``` + +## Usage + +```js +// hybrid module, either works +import { LRUCache } from 'lru-cache' +// or: +const { LRUCache } = require('lru-cache') +// or in minified form for web browsers: +import { LRUCache } from 'http://unpkg.com/lru-cache@9/dist/mjs/index.min.mjs' + +// At least one of 'max', 'ttl', or 'maxSize' is required, to prevent +// unsafe unbounded storage. +// +// In most cases, it's best to specify a max for performance, so all +// the required memory allocation is done up-front. +// +// All the other options are optional, see the sections below for +// documentation on what each one does. Most of them can be +// overridden for specific items in get()/set() +const options = { + max: 500, + + // for use with tracking overall storage size + maxSize: 5000, + sizeCalculation: (value, key) => { + return 1 + }, + + // for use when you need to clean up something when objects + // are evicted from the cache + dispose: (value, key, reason) => { + freeFromMemoryOrWhatever(value) + }, + + // for use when you need to know that an item is being inserted + // note that this does NOT allow you to prevent the insertion, + // it just allows you to know about it. + onInsert: (value, key, reason) => { + logInsertionOrWhatever(key, value) + }, + + // how long to live in ms + ttl: 1000 * 60 * 5, + + // return stale items before removing from cache? + allowStale: false, + + updateAgeOnGet: false, + updateAgeOnHas: false, + + // async method to use for cache.fetch(), for + // stale-while-revalidate type of behavior + fetchMethod: async (key, staleValue, { options, signal, context }) => {}, +} + +const cache = new LRUCache(options) + +cache.set('key', 'value') +cache.get('key') // "value" + +// non-string keys ARE fully supported +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } +cache.set(someObject, 'a value') +// Object keys are not toString()-ed +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) + +cache.clear() // empty the cache +``` + +If you put more stuff in the cache, then less recently used items +will fall out. That's what an LRU cache is. + +For full description of the API and all options, please see [the +LRUCache typedocs](https://isaacs.github.io/node-lru-cache/) + +## Storage Bounds Safety + +This implementation aims to be as flexible as possible, within +the limits of safe memory consumption and optimal performance. + +At initial object creation, storage is allocated for `max` items. +If `max` is set to zero, then some performance is lost, and item +count is unbounded. Either `maxSize` or `ttl` _must_ be set if +`max` is not specified. + +If `maxSize` is set, then this creates a safe limit on the +maximum storage consumed, but without the performance benefits of +pre-allocation. When `maxSize` is set, every item _must_ provide +a size, either via the `sizeCalculation` method provided to the +constructor, or via a `size` or `sizeCalculation` option provided +to `cache.set()`. The size of every item _must_ be a positive +integer. + +If neither `max` nor `maxSize` are set, then `ttl` tracking must +be enabled. Note that, even when tracking item `ttl`, items are +_not_ preemptively deleted when they become stale, unless +`ttlAutopurge` is enabled. Instead, they are only purged the +next time the key is requested. Thus, if `ttlAutopurge`, `max`, +and `maxSize` are all not set, then the cache will potentially +grow unbounded. + +In this case, a warning is printed to standard error. Future +versions may require the use of `ttlAutopurge` if `max` and +`maxSize` are not specified. + +If you truly wish to use a cache that is bound _only_ by TTL +expiration, consider using a `Map` object, and calling +`setTimeout` to delete entries when they expire. It will perform +much better than an LRU cache. + +Here is an implementation you may use, under the same +[license](./LICENSE) as this package: + +```js +// a storage-unbounded ttl cache that is not an lru-cache +const cache = { + data: new Map(), + timers: new Map(), + set: (k, v, ttl) => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.set( + k, + setTimeout(() => cache.delete(k), ttl), + ) + cache.data.set(k, v) + }, + get: k => cache.data.get(k), + has: k => cache.data.has(k), + delete: k => { + if (cache.timers.has(k)) { + clearTimeout(cache.timers.get(k)) + } + cache.timers.delete(k) + return cache.data.delete(k) + }, + clear: () => { + cache.data.clear() + for (const v of cache.timers.values()) { + clearTimeout(v) + } + cache.timers.clear() + }, +} +``` + +If that isn't to your liking, check out +[@isaacs/ttlcache](http://npm.im/@isaacs/ttlcache). + +## Storing Undefined Values + +This cache never stores undefined values, as `undefined` is used +internally in a few places to indicate that a key is not in the +cache. + +You may call `cache.set(key, undefined)`, but this is just +an alias for `cache.delete(key)`. Note that this has the effect +that `cache.has(key)` will return _false_ after setting it to +undefined. + +```js +cache.set(myKey, undefined) +cache.has(myKey) // false! +``` + +If you need to track `undefined` values, and still note that the +key is in the cache, an easy workaround is to use a sigil object +of your own. + +```js +import { LRUCache } from 'lru-cache' +const undefinedValue = Symbol('undefined') +const cache = new LRUCache(...) +const mySet = (key, value) => + cache.set(key, value === undefined ? undefinedValue : value) +const myGet = (key, value) => { + const v = cache.get(key) + return v === undefinedValue ? undefined : v +} +``` + +## Tracing and Observability + +Most methods can accept a `status` option, which is an +[`LRUCache.Status`](https://isaacs.github.io/node-lru-cache/interfaces/LRUCache.LRUCache.Status.html) +object that will be decorated along the operation with +indications about what was done and why. + +Additionally, this library is instrumented using the +[`node:diagnostics_channel`](https://nodejs.org/api/diagnostics_channel.html) +module on Node and other platforms that support it. In order to +get diagnostics metrics, listen on the +`channel('lru-cache:metrics')`. To get Tracing Channel traces, +subscribe to the `tracingChannel('lru-cache')`. The +[`LRUCache.Status`](https://isaacs.github.io/node-lru-cache/interfaces/LRUCache.LRUCache.Status.html) +objects will be provided as the message context to those channel +listeners. + +For example, you could do the following to get comprehensive +information about every LRUCache instance in your application: + +```ts +import { tracingChannel, subscribe } from 'node:diagnostics_channel' + +subscribe('lru-cache:metrics', (message, name) => { + // name will always be 'lru-cache:metrics' + // message will be the LRUCache.Status object for whatever + // synchronous operation was performed. + console.error('LRUCache Metrics', message) +}) + +tracingChannel('lru-cache').subscribe({ + start: status => { + // a traced operation is starting + }, + asyncStart: status => { + // an async traced operation is starting + }, + asyncEnd: status => { + // an async traced operation is ending + } + error: status => { + // a traced operation failed + }, + end: status => { + // a traced operation is complete + }, +}) +``` + +The async `cache.fetch()` and `cache.forceFetch` methods are +covered by `tracingChannels`. All the other operations are +covered by the `lru-cache:metrics` channel, because they are +strictly synchronous, and thus don't have an asynchronous +lifecycle to track. + +Note that using `status` objects or using +`node:diagnostics_channel` listeners _will_ impose a modest +performance penalty. Creating data objects is not ever free; do +not believe anyone who tells you otherwise. But it is as small as +possible. + +### Platform Compatibility Caveat + +Not all platforms support the `node:diagnostics_channel` module. +Currently, this is only available in Node, Bun, and Deno, and +some edge computing platforms that provide a Node compatibility +layer. + +To work around this, if you are loading in a non-Node +environment, the package.json exports will direct your module +loader to pull in a version that starts out with a dummy +implementation, then does a conditional dynamic `import` of the +`node:diagnostics_channel` module, and then swaps out those +dummy objects with the real thing if it succeeds. This means that +cache metrics and tracing channels started in the first load-time +tick of your application will _not_ be covered, except in +environments that load using the `require` import +condition, or both the `node` and `esm` import conditions +together. + +Top-level await _could_ be used to remove this caveat, but that +feature is dead on arrival, unfortunately. See +[#397](https://github.com/isaacs/node-lru-cache/issues/397) and +[#398](https://github.com/isaacs/node-lru-cache/issues/398) for +more details. + +## Performance + +As of April 2026, version 11 of this library is one of the most +performant LRU cache implementations in JavaScript. + +Benchmarks can be extremely difficult to get right. In +particular, the performance of set/get/delete operations on +objects will vary _wildly_ depending on the type of key used. V8 +is highly optimized for objects with keys that are short strings, +especially integer numeric strings. Thus any benchmark which +tests _solely_ using numbers as keys will tend to find that an +object-based approach performs the best. + +Note that coercing _anything_ to strings to use as object keys is +unsafe, unless you can be 100% certain that no other type of +value will be used. For example: + +```js +const myCache = {} +const set = (k, v) => (myCache[k] = v) +const get = k => myCache[k] + +set({}, 'please hang onto this for me') +set('[object Object]', 'oopsie') +``` + +Also beware of "Just So" stories regarding performance. Garbage +collection of large (especially: deep) object graphs can be +incredibly costly, with several "tipping points" where it +increases exponentially. As a result, putting that off until +later can make it much worse, and less predictable. If a library +performs well, but only in a scenario where the object graph is +kept shallow, then that won't help you if you are using large +objects as keys. + +In general, when attempting to use a library to improve +performance (such as a cache like this one), it's best to choose +an option that will perform well in the sorts of scenarios where +you'll actually use it. + +This library is optimized for repeated gets and minimizing +eviction time, since that is the expected need of a LRU. Set +operations are somewhat slower on average than a few other +options, in part because of that optimization. It is assumed +that you'll be caching some costly operation, ideally as rarely +as possible, so optimizing set over get would be unwise. + +If performance matters to you: + +1. If it's at all possible to use small integer values as keys, + and you can guarantee that no other types of values will be + used as keys, then do that, and use a cache such as + [lru-fast](https://npmjs.com/package/lru-fast), or + [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache) + which uses an Object as its data store. + +2. Failing that, if you can use short non-numeric strings (ie, + less than 256 characters) as your keys, and you do not need + any of the other features of this library, use [mnemonist's + LRUCache](https://yomguithereal.github.io/mnemonist/lru-cache). + +3. If the types of your keys will be anything else, especially + long strings, strings that look like floats, objects, or some + mix of types, or if you aren't sure, then this library will + work well for you. + + If you do not need the features that this library provides + (like asynchronous fetching, a variety of TTL staleness + options, and so on), then [mnemonist's + LRUMap](https://yomguithereal.github.io/mnemonist/lru-map) is + also a very good option, and just slightly faster than this + module (since it does considerably less). + +4. Do not use a `dispose` function, size tracking, or especially + ttl behavior or observability features, unless absolutely + needed. These features are convenient, and necessary in some + use cases, and every attempt has been made to make the + performance impact minimal, but it isn't nothing. + +## Testing + +When writing tests that involve TTL-related functionality, note +that this module creates an internal reference to the global +`performance` or `Date` objects at import time. If you import it +statically at the top level, those references cannot be mocked or +overridden in your test environment. + +To avoid this, dynamically import the package within your tests +so that the references are captured after your mocks are applied. +For example: + +```ts +// ❌ Not recommended +import { LRUCache } from 'lru-cache' +// mocking timers, e.g. jest.useFakeTimers() + +// ✅ Recommended for TTL tests +// mocking timers, e.g. jest.useFakeTimers() +const { LRUCache } = await import('lru-cache') +``` + +This ensures that your mocked timers or time sources are +respected when testing TTL behavior. + +Additionally, you can pass in a `perf` option when creating your +LRUCache instance. This option accepts any object with a `now` +method that returns a number. + +For example, this would be a very bare-bones time-mocking system +you could use in your tests, without any particular test +framework: + +```ts +import { LRUCache } from 'lru-cache' + +let myClockTime = 0 + +const cache = new LRUCache({ + max: 10, + ttl: 1000, + perf: { + now: () => myClockTime, + }, +}) + +// run tests, updating myClockTime as needed +``` + +## Breaking Changes in Version 7 + +This library changed to a different algorithm and internal data +structure in version 7, yielding significantly better +performance, albeit with some subtle changes as a result. + +If you were relying on the internals of LRUCache in version 6 or +before, it probably will not work in version 7 and above. + +## Breaking Changes in Version 8 + +- The `fetchContext` option was renamed to `context`, and may no + longer be set on the cache instance itself. +- Rewritten in TypeScript, so pretty much all the types moved + around a lot. +- The AbortController/AbortSignal polyfill was removed. For this + reason, **Node version 16.14.0 or higher is now required**. +- Internal properties were moved to actual private class + properties. +- Keys and values must not be `null` or `undefined`. +- Minified export available at `'lru-cache/min'`, for both CJS + and MJS builds. + +## Breaking Changes in Version 9 + +- Named export only, no default export. +- AbortController polyfill returned, albeit with a warning when + used. + +## Breaking Changes in Version 10 + +- `cache.fetch()` return type is now `Promise` + instead of `Promise`. This is an irrelevant change + practically speaking, but can require changes for TypeScript + users. + +For more info, see the [change log](CHANGELOG.md). diff --git a/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map b/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map new file mode 100644 index 00000000..a457786d --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map b/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map new file mode 100644 index 00000000..bb682313 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":";;;AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AAC1B,QAAA,OAAO,GAAG,KAAyB,CAAA;AACnC,QAAA,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts b/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts new file mode 100644 index 00000000..5360898f --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-browser.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js b/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js new file mode 100644 index 00000000..8f6a8f12 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +const dummy = { hasSubscribers: false }; +exports.metrics = dummy; +exports.tracing = dummy; +//# sourceMappingURL=diagnostics-channel-browser.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/index.d.ts b/node_modules/lru-cache/dist/commonjs/browser/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map b/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map new file mode 100644 index 00000000..fa98a0f5 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../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AAC,EAAE,CAAC,EACJ,WAAW,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC9D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/index.js b/node_modules/lru-cache/dist/commonjs/browser/index.js new file mode 100644 index 00000000..179694b1 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/index.js @@ -0,0 +1,1726 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/index.js.map b/node_modules/lru-cache/dist/commonjs/browser/index.js.map new file mode 100644 index 00000000..c1652fa0 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,qCAAq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D,4BAk9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/index.min.js b/node_modules/lru-cache/dist/commonjs/browser/index.min.js new file mode 100644 index 00000000..8e424610 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(c,t)=>()=>(t||c((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U={hasSubscribers:!1};O.metrics=U;O.tracing=U});var P=j(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.defaultPerf=void 0;D.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),x=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(c,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`)},B=c=>!k.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),H=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},C=class c{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];c.#o=!0;let i=new c(t,e);return c.#o=!1,i}constructor(t,e){if(!c.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},L=class c{#o;#c;#m;#W;#S;#M;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#_,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#L(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:u,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:M=1,perf:v}=t;if(this.backgroundFetchSize=M,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#y=C.create(e),this.#n=0,this.#b=0,typeof o=="function"&&(this.#m=o),typeof d=="function"&&(this.#W=d),typeof y=="function"?(this.#S=y,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#D=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let R="LRU_CACHE_UNBOUNDED";B(R)&&(k.add(R),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,c))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#w.now())=>{e[h]=a!==0?o:0,t[h]=a,s(h,a)},this.#R=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#v(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#E=(h,a)=>{if(t[a]){let o=t[a],d=e[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=t[a],d=e[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=e[h],o=t[h];return!!o&&!!a&&(n||r())-a>o}}#R=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#_=t,this.#x=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#x=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#C(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[e],h=this.#F[e];if(r&&h){let a=r-(this.#w.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[e];let h=this.#w.now()-this.#F[e];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(e);if(e===void 0)return o&&(o.set="deleted"),this.delete(t),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=e);let _=this.#N(t,e,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#v(t,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(t);if(u===void 0)u=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#I(u,_,o),o&&(o.set="add"),y=!1,this.#D&&!d&&this.#W?.(e,t,"add");else{this.#L(u);let p=this.#t[u];if(e!==p){if(!h)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#x(u),this.#I(u,_,o),this.#t[u]=e,!d){let f=p&&this.#e(p)?p.__staleWhileFetching:p,b=f===void 0?"add":e!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#D&&this.onInsert?.(e,t,b)}}else d||(o&&(o.set="update"),this.#D&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(u,n,r),o&&this.#E(o,u)),!h&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#m?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#x(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=x()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!S&&!b)return y(r.signal.reason,F);let w=u,m=this.#t[e];return(m===u||m===void 0&&S&&b)&&(f===void 0?w.__staleWhileFetching!==void 0?this.#t[e]=w.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,a.options,w))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,S=l&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,w=F||i.noDeleteOnFetchRejection,m=u;if(this.#t[e]===u&&(!w||!b&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},_=(f,b)=>{let l=this.#M?.(t,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>o(S,!0)))}),l&&l instanceof Promise?l.then(S=>f(S===void 0?void 0:S),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(_).then(o,d),p=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=x()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#B(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#B(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:S}=e;if(l&&(l.op="fetch",l.key=t,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:p,ignoreFetchAbort:u,status:l,signal:S},w=this.#s.get(t);if(w===void 0){l&&(l.fetch="miss");let m=this.#G(t,w,F,f);return m.__returned=m}else{let m=this.#t[w];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",E&&(l.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(w);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(w),s&&this.#R(w),l&&this.#E(l,w),m;let z=this.#G(t,w,F,f),v=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",v&&A&&(l.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=x()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#B(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=e;n&&r&&(n.forceRefresh=!0);let a=this.#C(t,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(t,a,{options:h,context:s});return n&&(n.value=d),this.#O(t,d,h),d}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#C(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#C(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,h=this.#s.get(t);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#E(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#R(h),o?a.__staleWhileFetching:a)}#q(t,e){this.#u[e]=t,this.#l[t]=e}#L(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#q(this.#u[t],this.#l[t]),this.#q(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=L; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map b/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map new file mode 100644 index 00000000..80b762ed --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-browser.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "gLAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxBC,EAAA,QAAUD,EACVC,EAAA,QAAUD,mGCFVE,EAAA,YAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,sFCZzB,IAAAC,EAAA,IACAC,EAAA,IAIMC,EAAiB,IACrBF,EAAA,QAAQ,gBAAkBA,EAAA,QAAQ,eAE9BG,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAYC,GAChB,CAAC,CAACA,GAAKA,IAAM,KAAK,MAAMA,CAAW,GAAKA,EAAI,GAAK,SAASA,CAAC,EAcvDC,EAAgBC,GACnBH,EAASG,CAAG,EACXA,GAAO,KAAK,IAAI,EAAG,CAAC,EAAI,WACxBA,GAAO,KAAK,IAAI,EAAG,EAAE,EAAI,YACzBA,GAAO,KAAK,IAAI,EAAG,EAAE,EAAI,YACzBA,GAAO,OAAO,iBAAmBC,EACjC,KALe,KAQbA,EAAN,cAAwB,KAAa,CACnC,YAAYC,EAAY,CACtB,MAAMA,CAAI,EACV,KAAK,KAAK,CAAC,CACb,GAMIC,EAAN,MAAMC,CAAK,CAET,KAEA,OAEA,MAAOC,GAAyB,GAChC,OAAO,OAAOL,E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,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF,GAj9DF,QAAA,SAAAvH", + "names": ["dummy", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts b/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map b/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/perf.js b/node_modules/lru-cache/dist/commonjs/browser/perf.js new file mode 100644 index 00000000..bd4c80f4 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/browser/perf.js.map b/node_modules/lru-cache/dist/commonjs/browser/perf.js.map new file mode 100644 index 00000000..a193c90f --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/browser/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map b/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map new file mode 100644 index 00000000..abdcb32e --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-cjs.cjs","sourceRoot":"","sources":["../../src/diagnostics-channel-cjs.cts"],"names":[],"mappings":";;;AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AAC1B,QAAA,OAAO,GAAG,KAAyB,CAAA;AACnC,QAAA,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in CJS environments that do NOT follow the 'node' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map b/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map new file mode 100644 index 00000000..7cfc73f1 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-cjs.d.cts","sourceRoot":"","sources":["../../src/diagnostics-channel-cjs.cts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts b/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts new file mode 100644 index 00000000..6cf41c4f --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-cjs.d.cts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js b/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js new file mode 100644 index 00000000..bdd4f41f --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +const dummy = { hasSubscribers: false }; +exports.metrics = dummy; +exports.tracing = dummy; +//# sourceMappingURL=diagnostics-channel-cjs.cjs.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.d.ts b/node_modules/lru-cache/dist/commonjs/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.d.ts.map b/node_modules/lru-cache/dist/commonjs/index.d.ts.map new file mode 100644 index 00000000..3ab3f752 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,G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,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.js b/node_modules/lru-cache/dist/commonjs/index.js new file mode 100644 index 00000000..179694b1 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.js @@ -0,0 +1,1726 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.js.map b/node_modules/lru-cache/dist/commonjs/index.js.map new file mode 100644 index 00000000..81f10335 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO;IACT,CAAC,CAAC,EAAE,CAA6B,CAAA;AACnC,oBAAoB;AAEpB,MAAM,WAAW,GAAG,CAClB,GAAW,EACX,IAAY,EACZ,IAAY,EACZ,EAAQ,EACR,EAAE;IACF,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE,CAAC;QAC9C,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,qCAAqC;QACrC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,IAAI,KAAK,GAAG,EAAE,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AACD,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAEtD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;AAI3B,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAe,EAAE,CAC3C,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAW,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,CA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AK,SAAS;oBAAE,YAAY,CAAC,CAAC,CAAC,CAAA;YACtC,CAAC;YACD,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACxC,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAl9DD,4BAk9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/index.min.js b/node_modules/lru-cache/dist/commonjs/index.min.js new file mode 100644 index 00000000..8e424610 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(c,t)=>()=>(t||c((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U={hasSubscribers:!1};O.metrics=U;O.tracing=U});var P=j(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.defaultPerf=void 0;D.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),x=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(c,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`)},B=c=>!k.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),H=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},C=class c{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];c.#o=!0;let i=new c(t,e);return c.#o=!1,i}constructor(t,e){if(!c.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},L=class c{#o;#c;#m;#W;#S;#M;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#_,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#L(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:u,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:M=1,perf:v}=t;if(this.backgroundFetchSize=M,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#y=C.create(e),this.#n=0,this.#b=0,typeof o=="function"&&(this.#m=o),typeof d=="function"&&(this.#W=d),typeof y=="function"?(this.#S=y,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#D=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let R="LRU_CACHE_UNBOUNDED";B(R)&&(k.add(R),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,c))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#w.now())=>{e[h]=a!==0?o:0,t[h]=a,s(h,a)},this.#R=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#v(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#E=(h,a)=>{if(t[a]){let o=t[a],d=e[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=t[a],d=e[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=e[h],o=t[h];return!!o&&!!a&&(n||r())-a>o}}#R=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#_=t,this.#x=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#x=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#C(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[e],h=this.#F[e];if(r&&h){let a=r-(this.#w.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[e];let h=this.#w.now()-this.#F[e];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(e);if(e===void 0)return o&&(o.set="deleted"),this.delete(t),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=e);let _=this.#N(t,e,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#v(t,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(t);if(u===void 0)u=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#I(u,_,o),o&&(o.set="add"),y=!1,this.#D&&!d&&this.#W?.(e,t,"add");else{this.#L(u);let p=this.#t[u];if(e!==p){if(!h)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#x(u),this.#I(u,_,o),this.#t[u]=e,!d){let f=p&&this.#e(p)?p.__staleWhileFetching:p,b=f===void 0?"add":e!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#D&&this.onInsert?.(e,t,b)}}else d||(o&&(o.set="update"),this.#D&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(u,n,r),o&&this.#E(o,u)),!h&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#m?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#x(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=x()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!S&&!b)return y(r.signal.reason,F);let w=u,m=this.#t[e];return(m===u||m===void 0&&S&&b)&&(f===void 0?w.__staleWhileFetching!==void 0?this.#t[e]=w.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,a.options,w))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,S=l&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,w=F||i.noDeleteOnFetchRejection,m=u;if(this.#t[e]===u&&(!w||!b&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},_=(f,b)=>{let l=this.#M?.(t,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>o(S,!0)))}),l&&l instanceof Promise?l.then(S=>f(S===void 0?void 0:S),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(_).then(o,d),p=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=x()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#B(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#B(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:S}=e;if(l&&(l.op="fetch",l.key=t,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:p,ignoreFetchAbort:u,status:l,signal:S},w=this.#s.get(t);if(w===void 0){l&&(l.fetch="miss");let m=this.#G(t,w,F,f);return m.__returned=m}else{let m=this.#t[w];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",E&&(l.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(w);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(w),s&&this.#R(w),l&&this.#E(l,w),m;let z=this.#G(t,w,F,f),v=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",v&&A&&(l.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=x()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#B(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=e;n&&r&&(n.forceRefresh=!0);let a=this.#C(t,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(t,a,{options:h,context:s});return n&&(n.value=d),this.#O(t,d,h),d}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#C(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#C(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,h=this.#s.get(t);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#E(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#R(h),o?a.__staleWhileFetching:a)}#q(t,e){this.#u[e]=t,this.#l[t]=e}#L(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#q(this.#u[t],this.#l[t]),this.#q(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=L; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/lru-cache/dist/commonjs/index.min.js.map b/node_modules/lru-cache/dist/commonjs/index.min.js.map new file mode 100644 index 00000000..171cf936 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/diagnostics-channel-cjs.cts", "../../src/perf.ts", "../../src/index.ts"], + "sourcesContent": ["// this is used in CJS environments that do NOT follow the 'node' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "gLAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxBC,EAAA,QAAUD,EACVC,EAAA,QAAUD,mGCFVE,EAAA,YAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,sFCZzB,IAAAC,EAAA,IACAC,EAAA,IAIMC,EAAiB,IACrBF,EAAA,QAAQ,gBAAkBA,EAAA,QAAQ,eAE9BG,EAAS,I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I,KAAKF,GAAmB2D,CAAC,EAC3BA,EAAE,kBAAkB,MAAM,IAAI,MAAM,SAAS,CAAC,MACzC,CACL,IAAM1D,EAAI,KAAKnB,GAASoB,CAAK,EACzB,KAAKR,IACP,KAAKrB,KAAWsF,EAAQ1D,EAAQiI,CAAM,EAEpC,KAAKtI,IACP,KAAKP,IAAW,KAAK,CAACsE,EAAQ1D,EAAQiI,CAAM,CAAC,CAEjD,CACF,CAKA,GAHA,KAAKrJ,GAAQ,MAAK,EACb,KAAKE,GAAS,KAAK,MAAS,EACjC,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW0D,KAAK,KAAKxD,IAAoB,CAAA,EACnCwD,IAAM,QAAW,aAAaA,CAAC,EAErC,KAAKxD,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF,GAj9DF,QAAA,SAAAvH", + "names": ["dummy", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map b/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map new file mode 100644 index 00000000..2c0f7d51 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AACvC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO,CAAgC,CAAA;AACrE,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,CAA+B,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map b/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map new file mode 100644 index 00000000..47bd2c0d --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,mEAAmE;AACnE,uEAAkE;AAGrD,QAAA,OAAO,GAAqB,IAAA,kCAAO,EAAC,mBAAmB,CAAC,CAAA;AACxD,QAAA,OAAO,GAA4B,IAAA,yCAAc,EAAC,WAAW,CAAC,CAAA","sourcesContent":["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts b/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts new file mode 100644 index 00000000..3e9e25d0 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import type { TracingChannel, Channel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-node.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js b/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js new file mode 100644 index 00000000..30f39a05 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tracing = exports.metrics = void 0; +// simple node version that imports from node builtin +// this is built to both ESM and CommonJS on the 'node' import path +const node_diagnostics_channel_1 = require("node:diagnostics_channel"); +exports.metrics = (0, node_diagnostics_channel_1.channel)('lru-cache:metrics'); +exports.tracing = (0, node_diagnostics_channel_1.tracingChannel)('lru-cache'); +//# sourceMappingURL=diagnostics-channel-node.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/index.d.ts b/node_modules/lru-cache/dist/commonjs/node/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map b/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map new file mode 100644 index 00000000..fa98a0f5 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAAA;AAoB9C,cAAM,SAAU,SAAQ,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,MAAM;CAIzB;AACD,YAAY,EAAE,SAAS,EAAE,CAAA;AACzB,YAAY,EAAE,KAAK,EAAE,CAAA;AAErB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;AACvC,cAAM,KAAK;;IAET,IAAI,EAAE,WAAW,CAAA;IAEjB,MAAM,EAAE,MAAM,CAAA;IAGd,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,S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AiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/index.js b/node_modules/lru-cache/dist/commonjs/node/index.js new file mode 100644 index 00000000..179694b1 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/index.js @@ -0,0 +1,1726 @@ +"use strict"; +/** + * @module LRUCache + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LRUCache = void 0; +const diagnostics_channel_js_1 = require("./diagnostics-channel.js"); +const perf_js_1 = require("./perf.js"); +const hasSubscribers = () => diagnostics_channel_js_1.metrics.hasSubscribers || diagnostics_channel_js_1.tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? perf_js_1.defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = diagnostics_channel_js_1.tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + diagnostics_channel_js_1.tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = diagnostics_channel_js_1.metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (diagnostics_channel_js_1.metrics.hasSubscribers) + diagnostics_channel_js_1.metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (diagnostics_channel_js_1.metrics.hasSubscribers) { + diagnostics_channel_js_1.metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +exports.LRUCache = LRUCache; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/index.js.map b/node_modules/lru-cache/dist/commonjs/node/index.js.map new file mode 100644 index 00000000..c1652fa0 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qEAA2D;AAC3D,uCAAuC;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,gCAAO,CAAC,cAAc,IAAI,gCAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OAAO,KAAK,QAA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A;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAl9DD,4BAk9DC","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/index.min.js b/node_modules/lru-cache/dist/commonjs/node/index.min.js new file mode 100644 index 00000000..a03fc771 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/index.min.js @@ -0,0 +1,2 @@ +"use strict";var j=(c,t)=>()=>(t||c((t={exports:{}}).exports,t),t.exports);var I=j(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.tracing=O.metrics=void 0;var U=require("node:diagnostics_channel");O.metrics=(0,U.channel)("lru-cache:metrics");O.tracing=(0,U.tracingChannel)("lru-cache")});var P=j(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.defaultPerf=void 0;D.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(exports,"__esModule",{value:!0});exports.LRUCache=void 0;var g=I(),N=P(),C=()=>g.metrics.hasSubscribers||g.tracing.hasSubscribers,k=new Set,G=typeof process=="object"&&process?process:{},V=(c,t,e,i)=>{typeof G.emitWarning=="function"?G.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`)},q=c=>!k.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),H=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?W:null:null,W=class extends Array{constructor(t){super(t),this.fill(0)}},x=class c{heap;length;static#o=!1;static create(t){let e=H(t);if(!e)return[];c.#o=!0;let i=new c(t,e);return c.#o=!1,i}constructor(t,e){if(!c.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},L=class c{#o;#c;#m;#W;#S;#M;#j;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#_;#r;#y;#F;#d;#g;#T;#U;#f;#D;static unsafeExposeInternals(t){return{starts:t.#F,ttls:t.#d,autopurgeTimers:t.#g,sizes:t.#y,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#h},free:t.#_,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#G(e,i,s,n),moveToTail:e=>t.#L(e),indexes:e=>t.#A(e),rindexes:e=>t.#z(e),isStale:e=>t.#p(e)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#j}get dispose(){return this.#m}get onInsert(){return this.#W}get disposeAfter(){return this.#S}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:_,noDisposeOnSet:y,noUpdateTTL:u,maxSize:p=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:S,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:M=1,perf:v}=t;if(this.backgroundFetchSize=M,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=v??N.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let E=e?H(e):Array;if(!E)throw new Error("invalid max value: "+e);if(this.#o=e,this.#c=p,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#j=S,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:e}).fill(void 0),this.#t=Array.from({length:e}).fill(void 0),this.#l=new E(e),this.#u=new E(e),this.#a=0,this.#h=0,this.#_=x.create(e),this.#n=0,this.#b=0,typeof o=="function"&&(this.#m=o),typeof d=="function"&&(this.#W=d),typeof _=="function"?(this.#S=_,this.#r=[]):(this.#S=void 0,this.#r=void 0),this.#T=!!this.#m,this.#D=!!this.#W,this.#f=!!this.#S,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let R="LRU_CACHE_UNBOUNDED";q(R)&&(k.add(R),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,c))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new W(this.#o),e=new W(this.#o);this.#d=t,this.#F=e;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#w.now())=>{e[h]=a!==0?o:0,t[h]=a,s(h,a)},this.#R=h=>{e[h]=t[h]!==0?this.#w.now():0,s(h,t[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#v(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#E=(h,a)=>{if(t[a]){let o=t[a],d=e[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let _=h.now-d;h.remainingTTL=o-_}};let n=0,r=()=>{let h=this.#w.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=t[a],d=e[a];if(!o||!d)return 1/0;let _=(n||r())-d;return o-_},this.#p=h=>{let a=e[h],o=t[h];return!!o&&!!a&&(n||r())-a>o}}#R=()=>{};#E=()=>{};#H=()=>{};#p=()=>!1;#X(){let t=new W(this.#o);this.#b=0,this.#y=t,this.#C=e=>{this.#b-=t[e],t[e]=0},this.#N=(e,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#I=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#b>n;)this.#P(!0)}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#C=t=>{};#I=(t,e,i)=>{};#N=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#h;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#a);)e=this.#u[e]}*#z({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;this.#V(e)&&((t||!this.#p(e))&&(yield e),e!==this.#h);)e=this.#l[e]}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(let t of this.#z())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(let t of this.#z()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(let t of this.#z())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.#x(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}rforEach(t,e=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this)}}purgeStale(){let t=!1;for(let e of this.#z({allowStale:!0}))this.#p(e)&&(this.#v(this.#i[e],"expire"),t=!0);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[e],h=this.#F[e];if(r&&h){let a=r-(this.#w.now()-h);n.ttl=a,n.start=Date.now()}}return this.#y&&(n.size=this.#y[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[e];let h=this.#w.now()-this.#F[e];r.start=Math.floor(Date.now()-h)}this.#y&&(r.size=this.#y[e]),t.unshift([i,r])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#w.now()-s}this.#O(e,i.value,i)}}set(t,e,i={}){let{status:s=g.metrics.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=t,e!==void 0&&(s.value=e),s.cache=this);let n=this.#O(t,e,i);return s&&g.metrics.hasSubscribers&&g.metrics.publish(s),n}#O(t,e,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(e);if(e===void 0)return o&&(o.set="deleted"),this.delete(t),this;let{noUpdateTTL:_=this.noUpdateTTL}=i;o&&!d&&(o.value=e);let y=this.#N(t,e,i.size||0,a,o);if(this.maxEntrySize&&y>this.maxEntrySize)return this.#v(t,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(t);if(u===void 0)u=this.#n===0?this.#h:this.#_.length!==0?this.#_.pop():this.#n===this.#o?this.#P(!1):this.#n,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#I(u,y,o),o&&(o.set="add"),_=!1,this.#D&&!d&&this.#W?.(e,t,"add");else{this.#L(u);let p=this.#t[u];if(e!==p){if(!h)if(this.#e(p)){p!==s&&p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&f!==e&&(this.#T&&this.#m?.(f,t,"set"),this.#f&&this.#r?.push([f,t,"set"]))}else this.#T&&this.#m?.(p,t,"set"),this.#f&&this.#r?.push([p,t,"set"]);if(this.#C(u),this.#I(u,y,o),this.#t[u]=e,!d){let f=p&&this.#e(p)?p.__staleWhileFetching:p,b=f===void 0?"add":e!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#D&&this.onInsert?.(e,t,b)}}else d||(o&&(o.set="update"),this.#D&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(_||this.#H(u,n,r),o&&this.#E(o,u)),!h&&this.#f&&this.#r){let p=this.#r,f;for(;f=p?.shift();)this.#S?.(...f)}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#r){let t=this.#r,e;for(;e=t?.shift();)this.#S?.(...e)}}}#P(t){let e=this.#a,i=this.#i[e],s=this.#t[e],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#m?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#C(e),this.#g?.[e]&&(clearTimeout(this.#g[e]),this.#g[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#_.push(e)),this.#n===1?(this.#a=this.#h=0,this.#_.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="has",i.key=t,i.cache=this);let s=this.#Y(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Y(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#E(s,n));else return i&&this.#R(n),s&&(s.has="hit",this.#E(s,n)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{status:i=C()?{}:void 0}=e;i&&(i.op="peek",i.key=t,i.cache=this),e.status=i;let s=this.#J(t,e);return g.metrics.hasSubscribers&&g.metrics.publish(i),s}#J(t,e){let{status:i,allowStale:s=this.allowStale}=e,n=this.#s.get(t);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#G(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,S=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!S&&!b)return _(r.signal.reason,F);let w=u,m=this.#t[e];return(m===u||m===void 0&&S&&b)&&(f===void 0?w.__staleWhileFetching!==void 0?this.#t[e]=w.__staleWhileFetching:this.#v(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#O(t,f,a.options,w))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),_(f,!1)),_=(f,b)=>{let{aborted:l}=r.signal,S=l&&i.allowStaleOnFetchAbort,F=S||i.allowStaleOnFetchRejection,w=F||i.noDeleteOnFetchRejection,m=u;if(this.#t[e]===u&&(!w||!b&&m.__staleWhileFetching===void 0?this.#v(t,"fetch"):S||(this.#t[e]=m.__staleWhileFetching)),F)return i.status&&m.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),m.__staleWhileFetching;if(m.__returned===m)throw f},y=(f,b)=>{let l=this.#M?.(t,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=S=>o(S,!0)))}),l&&l instanceof Promise?l.then(S=>f(S===void 0?void 0:S),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(y).then(o,d),p=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#O(t,p,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=p,p}#e(t){if(!this.#U)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#q(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#q(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:S}=e;if(l&&(l.op="fetch",l.key=t,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#x(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:p,ignoreFetchAbort:u,status:l,signal:S},w=this.#s.get(t);if(w===void 0){l&&(l.fetch="miss");let m=this.#G(t,w,F,f);return m.__returned=m}else{let m=this.#t[w];if(this.#e(m)){let E=i&&m.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",E&&(l.returnedStale=!0)),E?m.__staleWhileFetching:m.__returned=m}let A=this.#p(w);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(w),s&&this.#R(w),l&&this.#E(l,w),m;let z=this.#G(t,w,F,f),v=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",v&&A&&(l.returnedStale=!0)),v?z.__staleWhileFetching:z.__returned=z}}forceFetch(t,e={}){let i=g.tracing.hasSubscribers,{status:s=C()?{}:void 0}=e;e.status=s,s&&e.context&&(s.context=e.context);let n=this.#K(t,e);return s&&i&&(s.trace=!0,g.tracing.tracePromise(()=>n,s).catch(()=>{})),n}async#K(t,e={}){let i=await this.#q(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="memo",i.key=t,e.context&&(i.context=e.context),i.cache=this);let s=this.#Q(t,e);return i&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i),s}#Q(t,e={}){let i=this.#j;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=e;n&&r&&(n.forceRefresh=!0);let a=this.#x(t,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(t,a,{options:h,context:s});return n&&(n.value=d),this.#O(t,d,h),d}get(t,e={}){let{status:i=g.metrics.hasSubscribers?{}:void 0}=e;e.status=i,i&&(i.op="get",i.key=t,i.cache=this);let s=this.#x(t,e);return i&&(s!==void 0&&(i.value=s),g.metrics.hasSubscribers&&g.metrics.publish(i)),s}#x(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,h=this.#s.get(t);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#E(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#v(t,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#R(h),o?a.__staleWhileFetching:a)}#B(t,e){this.#u[e]=t,this.#l[t]=e}#L(t){t!==this.#h&&(t===this.#a?this.#a=this.#l[t]:this.#B(this.#u[t],this.#l[t]),this.#B(this.#h,t),this.#h=t)}delete(t){return this.#v(t,"delete")}#v(t,e){g.metrics.hasSubscribers&&g.metrics.publish({op:"delete",delete:e,key:t,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#$(e);else{this.#C(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#m?.(n,t,e),this.#f&&this.#r?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#_.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#S?.(...n)}return i}clear(){return this.#$("delete")}#$(t){for(let e of this.#z({allowStale:!0})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[e];this.#T&&this.#m?.(i,s,t),this.#f&&this.#r?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let e of this.#g??[])e!==void 0&&clearTimeout(e);this.#g?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#a=0,this.#h=0,this.#_.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let e=this.#r,i;for(;i=e?.shift();)this.#S?.(...i)}}};exports.LRUCache=L; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/lru-cache/dist/commonjs/node/index.min.js.map b/node_modules/lru-cache/dist/commonjs/node/index.min.js.map new file mode 100644 index 00000000..b2b45305 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-node.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "gLAEA,IAAAA,EAAA,QAAA,0BAAA,EAGaC,EAAA,WAA4BD,EAAA,SAAQ,mBAAmB,EACvDC,EAAA,WAAmCD,EAAA,gBAAe,WAAW,mGCE7DE,EAAA,YAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,sFCZzB,IAAAC,EAAA,IACAC,EAAA,IAIMC,EAAiB,IACrBF,EAAA,QAAQ,gBAAkBA,EAAA,QAAQ,eAE9BG,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAY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ACb,KAAKE,GAAS,KAAK,MAAS,EACjC,KAAKD,GAAS,KAAK,MAAS,EACxB,KAAKU,IAAS,KAAKD,GAAS,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW0D,KAAK,KAAKxD,IAAoB,CAAA,EACnCwD,IAAM,QAAW,aAAaA,CAAC,EAErC,KAAKxD,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF,GAj9DF,QAAA,SAAAvH", + "names": ["node_diagnostics_channel_1", "exports", "exports", "diagnostics_channel_js_1", "perf_js_1", "hasSubscribers", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "perf_js_1", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "diagnostics_channel_js_1", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/node_modules/lru-cache/dist/commonjs/node/perf.d.ts b/node_modules/lru-cache/dist/commonjs/node/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map b/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/perf.js b/node_modules/lru-cache/dist/commonjs/node/perf.js new file mode 100644 index 00000000..bd4c80f4 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/node/perf.js.map b/node_modules/lru-cache/dist/commonjs/node/perf.js.map new file mode 100644 index 00000000..a193c90f --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/node/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/package.json b/node_modules/lru-cache/dist/commonjs/package.json new file mode 100644 index 00000000..5bbefffb --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/lru-cache/dist/commonjs/perf.d.ts b/node_modules/lru-cache/dist/commonjs/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/perf.d.ts.map b/node_modules/lru-cache/dist/commonjs/perf.d.ts.map new file mode 100644 index 00000000..fd6eeeed --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/perf.js b/node_modules/lru-cache/dist/commonjs/perf.js new file mode 100644 index 00000000..bd4c80f4 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/perf.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultPerf = void 0; +exports.defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/commonjs/perf.js.map b/node_modules/lru-cache/dist/commonjs/perf.js.map new file mode 100644 index 00000000..59bb4678 --- /dev/null +++ b/node_modules/lru-cache/dist/commonjs/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":";;;AAQa,QAAA,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map b/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map new file mode 100644 index 00000000..a457786d --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAGvC,eAAO,MAAM,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAChD,eAAO,MAAM,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map b/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map new file mode 100644 index 00000000..2595c398 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-browser.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-browser.ts"],"names":[],"mappings":"AAQA,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AACvC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAyB,CAAA;AAChD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAgC,CAAA","sourcesContent":["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts b/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts new file mode 100644 index 00000000..5360898f --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-browser.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js b/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js new file mode 100644 index 00000000..37524f35 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js @@ -0,0 +1,4 @@ +const dummy = { hasSubscribers: false }; +export const metrics = dummy; +export const tracing = dummy; +//# sourceMappingURL=diagnostics-channel-browser.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/index.d.ts b/node_modules/lru-cache/dist/esm/browser/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/index.d.ts.map b/node_modules/lru-cache/dist/esm/browser/index.d.ts.map new file mode 100644 index 00000000..fa98a0f5 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,G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AE,CAAC,GACrE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/index.js b/node_modules/lru-cache/dist/esm/browser/index.js new file mode 100644 index 00000000..2dd10cf8 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/index.js @@ -0,0 +1,1722 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/index.js.map b/node_modules/lru-cache/dist/esm/browser/index.js.map new file mode 100644 index 00000000..ab79a6c1 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EA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EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/index.min.js b/node_modules/lru-cache/dist/esm/browser/index.min.js new file mode 100644 index 00000000..86618ad2 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/index.min.js @@ -0,0 +1,2 @@ +var L={hasSubscribers:!1},S=L,W=L;var M=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var D=()=>S.hasSubscribers||W.hasSubscribers,j=new Set,I=typeof process=="object"&&process?process:{},P=(u,e,t,i)=>{typeof I.emitWarning=="function"?I.emitWarning(u,e,t,i):console.error(`[${t}] ${e}: ${u}`)},k=u=>!j.has(u);var T=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),G=u=>T(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},R=class u{heap;length;static#o=!1;static create(e){let t=G(e);if(!t)return[];u.#o=!0;let i=new u(e,t);return u.#o=!1,i}constructor(e,t){if(!u.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},U=class u{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#x;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:c,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:C=1,perf:E}=e;if(this.backgroundFetchSize=C,E!==void 0&&typeof E?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=E??M,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let v=t?G(t):Array;if(!v)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new v(t),this.#u=new v(t),this.#a=0,this.#h=0,this.#y=R.create(t),this.#n=0,this.#b=0,typeof o=="function"&&(this.#S=o),typeof d=="function"&&(this.#O=d),typeof y=="function"?(this.#w=y,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#x=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!c,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!m,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let x="LRU_CACHE_UNBOUNDED";k(x)&&(j.add(x),P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,u))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#m.now())=>{t[h]=a!==0?o:0,e[h]=a,s(h,a)},this.#D=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#E(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#v=(h,a)=>{if(e[a]){let o=e[a],d=t[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=e[a],d=t[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=t[h],o=e[h];return!!o&&!!a&&(n||r())-a>o}}#D=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#R=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#R=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[t],h=this.#F[t];if(r&&h){let a=r-(this.#m.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[t];let h=this.#m.now()-this.#F[t];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[t]),e.unshift([i,r])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(t);if(t===void 0)return o&&(o.set="deleted"),this.delete(e),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=t);let _=this.#N(e,t,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let c=this.#n===0?void 0:this.#s.get(e);if(c===void 0)c=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[c]=e,this.#t[c]=t,this.#s.set(e,c),this.#l[this.#h]=c,this.#u[c]=this.#h,this.#h=c,this.#n++,this.#j(c,_,o),o&&(o.set="add"),y=!1,this.#x&&!d&&this.#O?.(t,e,"add");else{this.#L(c);let g=this.#t[c];if(t!==g){if(!h)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#R(c),this.#j(c,_,o),this.#t[c]=t,!d){let f=g&&this.#e(g)?g.__staleWhileFetching:g,b=f===void 0?"add":t!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#x&&this.onInsert?.(t,e,b)}}else d||(o&&(o.set="update"),this.#x&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(c,n,r),o&&this.#v(o,c)),!h&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#S?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#R(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=D()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!w&&!b)return y(r.signal.reason,F);let m=c,p=this.#t[t];return(p===c||p===void 0&&w&&b)&&(f===void 0?m.__staleWhileFetching!==void 0?this.#t[t]=m.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,a.options,m))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,w=l&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,m=F||i.noDeleteOnFetchRejection,p=c;if(this.#t[t]===c&&(!m||!b&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,b)=>{let l=this.#M?.(e,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>o(w,!0)))}),l&&l instanceof Promise?l.then(w=>f(w===void 0?void 0:w),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(_).then(o,d),g=Object.assign(c,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...a.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=W.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:w}=t;if(l&&(l.op="fetch",l.key=e,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:c,status:l,signal:w},m=this.#s.get(e);if(m===void 0){l&&(l.fetch="miss");let p=this.#P(e,m,F,f);return p.__returned=p}else{let p=this.#t[m];if(this.#e(p)){let v=i&&p.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",v&&(l.returnedStale=!0)),v?p.__staleWhileFetching:p.__returned=p}let A=this.#p(m);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(m),s&&this.#D(m),l&&this.#v(l,m),p;let z=this.#P(e,m,F,f),E=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",E&&A&&(l.returnedStale=!0)),E?z.__staleWhileFetching:z.__returned=z}}forceFetch(e,t={}){let i=W.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=t;n&&r&&(n.forceRefresh=!0);let a=this.#C(e,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(e,a,{options:h,context:s});return n&&(n.value=d),this.#W(e,d,h),d}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=t,h=this.#s.get(e);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#v(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#D(h),o?a.__staleWhileFetching:a)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#R(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{U as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/lru-cache/dist/esm/browser/index.min.js.map b/node_modules/lru-cache/dist/esm/browser/index.min.js.map new file mode 100644 index 00000000..4c76924e --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-browser.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// this is used in ESM environments that follow the 'browser' import\n// condition, to avoid even trying to load node:diagnostics_channel\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\nconst dummy = { hasSubscribers: false }\nexport const metrics = dummy as Channel\nexport const tracing = dummy as TracingChannel\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAQA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EACxBC,EAAUD,EACVE,EAAUF,ECFhB,IAAMG,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAYC,GAChB,CAAC,CAACA,GAAKA,IAAM,KAAK,MAAMA,CAAW,GAAKA,EAAI,GAAK,SAASA,CAAC,EAcvDC,EAAgBC,GACnBH,EAASG,CAAG,EACXA,GAAO,KAAK,IAAI,EAAG,CAAC,EAAI,WACxBA,GAAO,KAAK,IAAI,EAAG,EAAE,EAAI,YACzBA,GAAO,KAAK,IAAI,EAAG,EAAE,EAAI,YACzBA,GAAO,OAAO,iBAAmBC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KD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF", + "names": ["dummy", "metrics", "tracing", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/node_modules/lru-cache/dist/esm/browser/perf.d.ts b/node_modules/lru-cache/dist/esm/browser/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map b/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/perf.js b/node_modules/lru-cache/dist/esm/browser/perf.js new file mode 100644 index 00000000..f21cd88c --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/browser/perf.js.map b/node_modules/lru-cache/dist/esm/browser/perf.js.map new file mode 100644 index 00000000..5dc82212 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/browser/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map b/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map new file mode 100644 index 00000000..180a381b --- /dev/null +++ b/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-esm.d.mts","sourceRoot":"","sources":["../../src/diagnostics-channel-esm.mts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,cAAc,EACpB,MAAM,0BAA0B,CAAA;AACjC,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AAavC,eAAO,IAAI,OAAO,EAAY,OAAO,CAAC,OAAO,CAAC,CAAA;AAC9C,eAAO,IAAI,OAAO,EAAY,cAAc,CAAC,OAAO,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map b/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map new file mode 100644 index 00000000..97b4b3fd --- /dev/null +++ b/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-esm.mjs","sourceRoot":"","sources":["../../src/diagnostics-channel-esm.mts"],"names":[],"mappings":"AAUA;;;;;GAKG;AAEH,uEAAuE;AACvE,4EAA4E;AAC5E,oBAAoB;AACpB,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,CAAA;AACvC,MAAM,CAAC,IAAI,OAAO,GAAG,KAAyB,CAAA;AAC9C,MAAM,CAAC,IAAI,OAAO,GAAG,KAAgC,CAAA;AACrD,MAAM,CAAC,0BAA0B,CAAC;KAC/B,IAAI,CAAC,EAAE,CAAC,EAAE;IACT,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;IACzC,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;AAC1C,CAAC,CAAC;KACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA","sourcesContent":["// This is used in ESM environments that do NOT follow the 'node' or 'browser'\n// import conditions. So, `node:diagnostics_channel` MAY be present.\n// Note that this is overridden in 'browser' conditional branch, because the\n// dynamic import can confound bundlers and cause CSP violations in browsers.\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\n/**\n * no-op polyfills for non-node environments. tries to load the actual\n * diagnostics_channel module on platforms that support it, but fails\n * gracefully if not found. This means that the first tick of metrics\n * and tracing will be missed, but that probably doesn't matter much.\n */\n\n// conditionally import from diagnostic_channel, fall back to dummyfill\n// all we actually have to mock is the hasSubscribers, since we always check\n/* v8 ignore next */\nconst dummy = { hasSubscribers: false }\nexport let metrics = dummy as Channel\nexport let tracing = dummy as TracingChannel\nimport('node:diagnostics_channel')\n .then(dc => {\n metrics = dc.channel('lru-cache:metrics')\n tracing = dc.tracingChannel('lru-cache')\n })\n .catch(() => {})\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts b/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts new file mode 100644 index 00000000..1580158b --- /dev/null +++ b/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import { type Channel, type TracingChannel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare let metrics: Channel; +export declare let tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-esm.d.mts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/diagnostics-channel.js b/node_modules/lru-cache/dist/esm/diagnostics-channel.js new file mode 100644 index 00000000..76d86f81 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/diagnostics-channel.js @@ -0,0 +1,19 @@ +/** + * no-op polyfills for non-node environments. tries to load the actual + * diagnostics_channel module on platforms that support it, but fails + * gracefully if not found. This means that the first tick of metrics + * and tracing will be missed, but that probably doesn't matter much. + */ +// conditionally import from diagnostic_channel, fall back to dummyfill +// all we actually have to mock is the hasSubscribers, since we always check +/* v8 ignore next */ +const dummy = { hasSubscribers: false }; +export let metrics = dummy; +export let tracing = dummy; +import('node:diagnostics_channel') + .then(dc => { + metrics = dc.channel('lru-cache:metrics'); + tracing = dc.tracingChannel('lru-cache'); +}) + .catch(() => { }); +//# sourceMappingURL=diagnostics-channel-esm.mjs.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.d.ts b/node_modules/lru-cache/dist/esm/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.d.ts.map b/node_modules/lru-cache/dist/esm/index.d.ts.map new file mode 100644 index 00000000..3ab3f752 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MAAM,IAAI,eAAiB,CAAA;AAC3B,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAC5D,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAKzD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAC9D,MAAM,MA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AAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.js b/node_modules/lru-cache/dist/esm/index.js new file mode 100644 index 00000000..2dd10cf8 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.js @@ -0,0 +1,1722 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.js.map b/node_modules/lru-cache/dist/esm/index.js.map new file mode 100644 index 00000000..e0a2fa92 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIvC,MAAM,cAAc,GAAG,GAAG,EAAE,CAC1B,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc,CAAA;AAElD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAMhC,qBAAqB;AACrB,MAAM,OAAO,GAAG,CACd,OAAO,OA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B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/index.min.js b/node_modules/lru-cache/dist/esm/index.min.js new file mode 100644 index 00000000..5715ef55 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.min.js @@ -0,0 +1,2 @@ +var L={hasSubscribers:!1},S=L,A=L;import("node:diagnostics_channel").then(c=>{S=c.channel("lru-cache:metrics"),A=c.tracingChannel("lru-cache")}).catch(()=>{});var M=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var D=()=>S.hasSubscribers||A.hasSubscribers,j=new Set,I=typeof process=="object"&&process?process:{},P=(c,e,t,i)=>{typeof I.emitWarning=="function"?I.emitWarning(c,e,t,i):console.error(`[${t}] ${e}: ${c}`)},k=c=>!j.has(c);var T=c=>!!c&&c===Math.floor(c)&&c>0&&isFinite(c),G=c=>T(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},R=class c{heap;length;static#o=!1;static create(e){let t=G(e);if(!t)return[];c.#o=!0;let i=new c(e,t);return c.#o=!1,i}constructor(e,t){if(!c.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},U=class c{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#x;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:u,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:z,ignoreFetchAbort:E,backgroundFetchSize:C=1,perf:v}=e;if(this.backgroundFetchSize=C,v!==void 0&&typeof v?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=v??M,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let W=t?G(t):Array;if(!W)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new W(t),this.#u=new W(t),this.#a=0,this.#h=0,this.#y=R.create(t),this.#n=0,this.#b=0,typeof o=="function"&&(this.#S=o),typeof d=="function"&&(this.#O=d),typeof y=="function"?(this.#w=y,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#x=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!z,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!m,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let x="LRU_CACHE_UNBOUNDED";k(x)&&(j.add(x),P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,c))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#m.now())=>{t[h]=a!==0?o:0,e[h]=a,s(h,a)},this.#D=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#E(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#v=(h,a)=>{if(e[a]){let o=e[a],d=t[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=e[a],d=t[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=t[h],o=e[h];return!!o&&!!a&&(n||r())-a>o}}#D=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#R=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#R=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[t],h=this.#F[t];if(r&&h){let a=r-(this.#m.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[t];let h=this.#m.now()-this.#F[t];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[t]),e.unshift([i,r])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(t);if(t===void 0)return o&&(o.set="deleted"),this.delete(e),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=t);let _=this.#N(e,t,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let u=this.#n===0?void 0:this.#s.get(e);if(u===void 0)u=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[u]=e,this.#t[u]=t,this.#s.set(e,u),this.#l[this.#h]=u,this.#u[u]=this.#h,this.#h=u,this.#n++,this.#j(u,_,o),o&&(o.set="add"),y=!1,this.#x&&!d&&this.#O?.(t,e,"add");else{this.#L(u);let g=this.#t[u];if(t!==g){if(!h)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#R(u),this.#j(u,_,o),this.#t[u]=t,!d){let f=g&&this.#e(g)?g.__staleWhileFetching:g,b=f===void 0?"add":t!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#x&&this.onInsert?.(t,e,b)}}else d||(o&&(o.set="update"),this.#x&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(u,n,r),o&&this.#v(o,u)),!h&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#S?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#R(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=D()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!w&&!b)return y(r.signal.reason,F);let m=u,p=this.#t[t];return(p===u||p===void 0&&w&&b)&&(f===void 0?m.__staleWhileFetching!==void 0?this.#t[t]=m.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,a.options,m))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,w=l&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,m=F||i.noDeleteOnFetchRejection,p=u;if(this.#t[t]===u&&(!m||!b&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,b)=>{let l=this.#M?.(e,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>o(w,!0)))}),l&&l instanceof Promise?l.then(w=>f(w===void 0?void 0:w),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let u=new Promise(_).then(o,d),g=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...a.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=A.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,A.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:w}=t;if(l&&(l.op="fetch",l.key=e,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:u,status:l,signal:w},m=this.#s.get(e);if(m===void 0){l&&(l.fetch="miss");let p=this.#P(e,m,F,f);return p.__returned=p}else{let p=this.#t[m];if(this.#e(p)){let W=i&&p.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",W&&(l.returnedStale=!0)),W?p.__staleWhileFetching:p.__returned=p}let z=this.#p(m);if(!b&&!z)return l&&(l.fetch="hit"),this.#L(m),s&&this.#D(m),l&&this.#v(l,m),p;let E=this.#P(e,m,F,f),v=E.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=z?"stale":"refresh",v&&z&&(l.returnedStale=!0)),v?E.__staleWhileFetching:E.__returned=E}}forceFetch(e,t={}){let i=A.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,A.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=t;n&&r&&(n.forceRefresh=!0);let a=this.#C(e,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(e,a,{options:h,context:s});return n&&(n.value=d),this.#W(e,d,h),d}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=t,h=this.#s.get(e);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#v(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#D(h),o?a.__staleWhileFetching:a)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#R(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{U as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/lru-cache/dist/esm/index.min.js.map b/node_modules/lru-cache/dist/esm/index.min.js.map new file mode 100644 index 00000000..e8b4b9e9 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../src/diagnostics-channel-esm.mts", "../../src/perf.ts", "../../src/index.ts"], + "sourcesContent": ["// This is used in ESM environments that do NOT follow the 'node' or 'browser'\n// import conditions. So, `node:diagnostics_channel` MAY be present.\n// Note that this is overridden in 'browser' conditional branch, because the\n// dynamic import can confound bundlers and cause CSP violations in browsers.\nimport {\n type Channel,\n type TracingChannel,\n} from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\n\n/**\n * no-op polyfills for non-node environments. tries to load the actual\n * diagnostics_channel module on platforms that support it, but fails\n * gracefully if not found. This means that the first tick of metrics\n * and tracing will be missed, but that probably doesn't matter much.\n */\n\n// conditionally import from diagnostic_channel, fall back to dummyfill\n// all we actually have to mock is the hasSubscribers, since we always check\n/* v8 ignore next */\nconst dummy = { hasSubscribers: false }\nexport let metrics = dummy as Channel\nexport let tracing = dummy as TracingChannel\nimport('node:diagnostics_channel')\n .then(dc => {\n metrics = dc.channel('lru-cache:metrics')\n tracing = dc.tracingChannel('lru-cache')\n })\n .catch(() => {})\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAoBA,IAAMA,EAAQ,CAAE,eAAgB,EAAK,EAC1BC,EAAUD,EACVE,EAAUF,EACrB,OAAO,0BAA0B,EAC9B,KAAKG,GAAK,CACTF,EAAUE,EAAG,QAAQ,mBAAmB,EACxCD,EAAUC,EAAG,eAAe,WAAW,CACzC,CAAC,EACA,MAAM,IAAK,CAAE,CAAC,ECpBV,IAAMC,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL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,CAC9B,KAAKC,GAAM,KAAK,CAAC,EACjB,KAAKD,GAAQ,KAAK,CAAC,EACnB,QAAW,KAAK,KAAKE,IAAoB,CAAA,EACnC,IAAM,QAAW,aAAa,CAAC,EAErC,KAAKA,IAAkB,KAAK,MAAS,CACvC,CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF", + "names": ["dummy", "metrics", "tracing", "dc", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map b/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map new file mode 100644 index 00000000..2c0f7d51 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.d.ts","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvE,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AACvC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,OAAO,CAAgC,CAAA;AACrE,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,OAAO,CAA+B,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map b/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map new file mode 100644 index 00000000..83ee50aa --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map @@ -0,0 +1 @@ +{"version":3,"file":"diagnostics-channel-node.js","sourceRoot":"","sources":["../../../src/diagnostics-channel-node.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,mEAAmE;AACnE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAGlE,MAAM,CAAC,MAAM,OAAO,GAAqB,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACrE,MAAM,CAAC,MAAM,OAAO,GAA4B,cAAc,CAAC,WAAW,CAAC,CAAA","sourcesContent":["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts b/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts new file mode 100644 index 00000000..3e9e25d0 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts @@ -0,0 +1,5 @@ +import type { TracingChannel, Channel } from 'node:diagnostics_channel'; +export type { TracingChannel, Channel }; +export declare const metrics: Channel; +export declare const tracing: TracingChannel; +//# sourceMappingURL=diagnostics-channel-node.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js b/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js new file mode 100644 index 00000000..f37e0baa --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js @@ -0,0 +1,6 @@ +// simple node version that imports from node builtin +// this is built to both ESM and CommonJS on the 'node' import path +import { tracingChannel, channel } from 'node:diagnostics_channel'; +export const metrics = channel('lru-cache:metrics'); +export const tracing = tracingChannel('lru-cache'); +//# sourceMappingURL=diagnostics-channel-node.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/index.d.ts b/node_modules/lru-cache/dist/esm/node/index.d.ts new file mode 100644 index 00000000..b0e4b964 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/index.d.ts @@ -0,0 +1,1400 @@ +/** + * @module LRUCache + */ +import type { Perf } from './perf.js'; +export type { Perf } from './perf.js'; +declare const TYPE: unique symbol; +export type PosInt = number & { + [TYPE]: 'Positive Integer'; +}; +export type Index = number & { + [TYPE]: 'LRUCache Index'; +}; +export type UintArray = Uint8Array | Uint16Array | Uint32Array; +export type NumberArray = UintArray | number[]; +declare class ZeroArray extends Array { + constructor(size: number); +} +export type { ZeroArray }; +export type { Stack }; +export type StackLike = Stack | Index[]; +declare class Stack { + #private; + heap: NumberArray; + length: number; + static create(max: number): StackLike; + constructor(max: number, HeapCls: { + new (n: number): NumberArray; + }); + push(n: Index): void; + pop(): Index; +} +/** + * Promise representing an in-progress {@link LRUCache#fetch} call + */ +export type BackgroundFetch = Promise & { + __returned: BackgroundFetch | undefined; + __abortController: AbortController; + __staleWhileFetching: V | undefined; +}; +export type DisposeTask = [ + value: V, + key: K, + reason: LRUCache.DisposeReason +]; +export declare namespace LRUCache { + /** + * An integer greater than 0, reflecting the calculated size of items + */ + type Size = number; + /** + * Integer greater than 0, representing some number of milliseconds, or the + * time at which a TTL started counting from. + */ + type Milliseconds = number; + /** + * An integer greater than 0, reflecting a number of items + */ + type Count = number; + /** + * The reason why an item was removed from the cache, passed + * to the {@link Disposer} methods. + * + * - `evict`: The item was evicted because it is the least recently used, + * and the cache is full. + * - `set`: A new value was set, overwriting the old value being disposed. + * - `delete`: The item was explicitly deleted, either by calling + * {@link LRUCache#delete}, {@link LRUCache#clear}, or + * {@link LRUCache#set} with an undefined value. + * - `expire`: The item was removed due to exceeding its TTL. + * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned + * `undefined` or was aborted, causing the item to be deleted. + */ + type DisposeReason = 'evict' | 'set' | 'delete' | 'expire' | 'fetch'; + /** + * A method called upon item removal, passed as the + * {@link OptionsBase.dispose} and/or + * {@link OptionsBase.disposeAfter} options. + */ + type Disposer = (value: V, key: K, reason: DisposeReason) => void; + /** + * The reason why an item was added to the cache, passed + * to the {@link Inserter} methods. + * + * - `add`: the item was not found in the cache, and was added + * - `update`: the item was in the cache, with the same value provided + * - `replace`: the item was in the cache, and replaced + */ + type InsertReason = 'add' | 'update' | 'replace'; + /** + * A method called upon item insertion, passed as the + * {@link OptionsBase.insert} + */ + type Inserter = (value: V, key: K, reason: InsertReason) => void; + /** + * A function that returns the effective calculated size + * of an entry in the cache. + */ + type SizeCalculator = (value: V, key: K) => Size; + /** + * Options provided to the + * {@link OptionsBase.fetchMethod} function. + */ + interface FetcherOptions { + signal: AbortSignal; + options: FetcherFetchOptions; + /** + * Object provided in the {@link FetchOptions.context} option to + * {@link LRUCache#fetch} + */ + context: FC; + } + /** + * Occasionally, it may be useful to track the internal behavior of the + * cache, particularly for logging, debugging, or for behavior within the + * `fetchMethod`. To do this, you can pass a `status` object to the + * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set}, + * {@link LRUCache#memo}, and {@link LRUCache#has} methods. + * + * The `status` option should be a plain JavaScript object. The following + * fields will be set on it appropriately, depending on the situation. + * + * These objects are also the context objects passed to listeners on the + * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing + * channels, in platforms that support them. + */ + interface Status { + /** + * The operation being performed + */ + op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'; + /** + * The status of a set() operation. + * + * - add: the item was not found in the cache, and was added + * - update: the item was in the cache, with the same value provided + * - replace: the item was in the cache, and replaced + * - miss: the item was not added to the cache for some reason + */ + set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'; + /** + * The status of a delete() operation. + */ + delete?: LRUCache.DisposeReason; + /** + * The result of a peek() operation + * + * - hit: the item was found and returned + * - stale: the item is in the cache, but past its ttl and not returned + * - miss: item not in the cache + */ + peek?: 'hit' | 'miss' | 'stale'; + /** + * The status of a memo() operation. + * + * - 'hit': the item was found in the cache and returned + * - 'miss': the `memoMethod` function was called + */ + memo?: 'hit' | 'miss'; + /** + * The `context` option provided to a memo or fetch operation + * + * In practice, of course, this will be the same type as the `FC` + * fetch context param used to instantiate the LRUCache, but the + * convolutions of threading that through would get quite complicated, + * and preclude forcing/forbidding the passing of a `context` param + * where it is/isn't expected, which is more valuable for error + * prevention. + */ + context?: unknown; + /** + * the ttl stored for the item, or undefined if ttls are not used. + */ + ttl?: Milliseconds; + /** + * the start time for the item, or undefined if ttls are not used. + */ + start?: Milliseconds; + /** + * The timestamp used for TTL calculation + */ + now?: Milliseconds; + /** + * the remaining ttl for the item, or undefined if ttls are not used. + */ + remainingTTL?: Milliseconds; + /** + * The calculated size for the item, if sizes are used. + */ + entrySize?: Size; + /** + * The total calculated size of the cache, if sizes are used. + */ + totalCalculatedSize?: Size; + /** + * A flag indicating that the item was not stored, due to exceeding the + * {@link OptionsBase.maxEntrySize} + */ + maxEntrySizeExceeded?: true; + /** + * The key that was set or retrieved + */ + key?: K; + /** + * The value that was set + */ + value?: V; + /** + * The old value, specified in the case of `set:'replace'` + */ + oldValue?: V; + /** + * The results of a {@link LRUCache#has} operation + * + * - hit: the item was found in the cache + * - stale: the item was found in the cache, but is stale + * - miss: the item was not found in the cache + */ + has?: 'hit' | 'stale' | 'miss'; + /** + * The status of a {@link LRUCache#fetch} operation. + * Note that this can change as the underlying fetch() moves through + * various states. + * + * - inflight: there is another fetch() for this key which is in process + * - get: there is no {@link OptionsBase.fetchMethod}, so + * {@link LRUCache#get} was called. + * - miss: the item is not in cache, and will be fetched. + * - hit: the item is in the cache, and was resolved immediately. + * - stale: the item is in the cache, but stale. + * - refresh: the item is in the cache, and not stale, but + * {@link FetchOptions.forceRefresh} was specified. + */ + fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'; + /** + * `forceRefresh` option was used for either a fetch or memo operation + */ + forceRefresh?: boolean; + /** + * The {@link OptionsBase.fetchMethod} was called + */ + fetchDispatched?: true; + /** + * The cached value was updated after a successful call to + * {@link OptionsBase.fetchMethod} + */ + fetchUpdated?: true; + /** + * The reason for a fetch() rejection. Either the error raised by the + * {@link OptionsBase.fetchMethod}, or the reason for an + * AbortSignal. + */ + fetchError?: Error; + /** + * The fetch received an abort signal + */ + fetchAborted?: true; + /** + * The abort signal received was ignored, and the fetch was allowed to + * continue in the background. + */ + fetchAbortIgnored?: true; + /** + * The fetchMethod promise resolved successfully + */ + fetchResolved?: true; + /** + * The fetchMethod promise was rejected + */ + fetchRejected?: true; + /** + * The status of a {@link LRUCache#get} operation. + * + * - fetching: The item is currently being fetched. If a previous value + * is present and allowed, that will be returned. + * - stale: The item is in the cache, and is stale. If it was returned, + * then the `returnedStale` flag will be set. + * - stale-fetching: The value is being fetched in the background, but is + * currently stale. If the stale value was returned, then the + * `returnedStale` flag will be set. + * - hit: the item is in the cache + * - miss: the item is not in the cache + */ + get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'; + /** + * A fetch or get operation returned a stale value. + */ + returnedStale?: true; + /** + * A tracingChannel trace was started for this operation + */ + trace?: boolean; + /** + * A reference to the cache instance associated with this operation + */ + cache?: LRUCache; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#fetch}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link OptionsBase.noDeleteOnFetchRejection}, + * {@link OptionsBase.allowStaleOnFetchRejection}, + * {@link FetchOptions.forceRefresh}, and + * {@link FetcherOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.fetchMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the fetchMethod is called. + */ + interface FetcherFetchOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + status?: Status; + size?: Size; + } + /** + * Options that may be passed to the {@link LRUCache#fetch} method. + */ + interface FetchOptions extends FetcherFetchOptions { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.fetchMethod} as + * the {@link FetcherOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + signal?: AbortSignal; + status?: Status; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface FetchOptionsWithContext extends FetchOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#fetch} when the FC type is + * `undefined` or `void` + */ + interface FetchOptionsNoContext extends FetchOptions { + context?: FC; + } + interface MemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL' | 'noDeleteOnFetchRejection' | 'allowStaleOnFetchRejection' | 'ignoreFetchAbort' | 'allowStaleOnFetchAbort'> { + /** + * Set to true to force a re-load of the existing data, even if it + * is not yet stale. + */ + forceRefresh?: boolean; + /** + * Context provided to the {@link OptionsBase.memoMethod} as + * the {@link MemoizerOptions.context} param. + * + * If the FC type is specified as unknown (the default), + * undefined or void, then this is optional. Otherwise, it will + * be required. + */ + context?: FC; + status?: Status; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is something + * other than `unknown`, `undefined`, or `void` + */ + interface MemoOptionsWithContext extends MemoOptions { + context: FC; + } + /** + * Options provided to {@link LRUCache#memo} when the FC type is + * `undefined` or `void` + */ + interface MemoOptionsNoContext extends MemoOptions { + context?: FC; + } + /** + * Options provided to the + * {@link OptionsBase.memoMethod} function. + */ + interface MemoizerOptions { + options: MemoizerMemoOptions; + /** + * Object provided in the {@link MemoOptions.context} option to + * {@link LRUCache#memo} + */ + context: FC; + } + /** + * options which override the options set in the LRUCache constructor + * when calling {@link LRUCache#memo}. + * + * This is the union of {@link GetOptions} and {@link SetOptions}, plus + * {@link MemoOptions.forceRefresh}, and + * {@link MemoOptions.context} + * + * Any of these may be modified in the {@link OptionsBase.memoMethod} + * function, but the {@link GetOptions} fields will of course have no + * effect, as the {@link LRUCache#get} call already happened by the time + * the memoMethod is called. + */ + interface MemoizerMemoOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet' | 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + status?: Status; + size?: Size; + start?: Milliseconds; + } + /** + * Options that may be passed to the {@link LRUCache#has} method. + */ + interface HasOptions extends Pick, 'updateAgeOnHas'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#get} method. + */ + interface GetOptions extends Pick, 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#peek} method. + */ + interface PeekOptions extends Pick, 'allowStale'> { + status?: Status; + } + /** + * Options that may be passed to the {@link LRUCache#set} method. + */ + interface SetOptions extends Pick, 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'> { + /** + * If size tracking is enabled, then setting an explicit size + * in the {@link LRUCache#set} call will prevent calling the + * {@link OptionsBase.sizeCalculation} function. + */ + size?: Size; + /** + * If TTL tracking is enabled, then setting an explicit start + * time in the {@link LRUCache#set} call will override the + * default time from `performance.now()` or `Date.now()`. + * + * Note that it must be a valid value for whichever time-tracking + * method is in use. + */ + start?: Milliseconds; + status?: Status; + } + /** + * The type signature for the {@link OptionsBase.fetchMethod} option. + */ + type Fetcher = (key: K, staleValue: V | undefined, options: FetcherOptions) => Promise | V | undefined | void; + /** + * the type signature for the {@link OptionsBase.memoMethod} option. + */ + type Memoizer = (key: K, staleValue: V | undefined, options: MemoizerOptions) => V; + /** + * Options which may be passed to the {@link LRUCache} constructor. + * + * Most of these may be overridden in the various options that use + * them. + * + * Despite all being technically optional, the constructor requires that + * a cache is at minimum limited by one or more of {@link OptionsBase.max}, + * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}. + * + * If {@link OptionsBase.ttl} is used alone, then it is strongly advised + * (and in fact required by the type definitions here) that the cache + * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially + * unbounded storage. + * + * All options are also available on the {@link LRUCache} instance, making + * it safe to pass an LRUCache instance as the options argumemnt to + * make another empty cache of the same type. + * + * Some options are marked as read-only, because changing them after + * instantiation is not safe. Changing any of the other options will of + * course only have an effect on subsequent method calls. + */ + interface OptionsBase { + /** + * The maximum number of items to store in the cache before evicting + * old entries. This is read-only on the {@link LRUCache} instance, + * and may not be overridden. + * + * If set, then storage space will be pre-allocated at construction + * time, and the cache will perform significantly faster. + * + * Note that significantly fewer items may be stored, if + * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also + * set. + * + * **It is strongly recommended to set a `max` to prevent unbounded growth + * of the cache.** + */ + max?: Count; + /** + * Max time in milliseconds for items to live in cache before they are + * considered stale. Note that stale items are NOT preemptively removed by + * default, and MAY live in the cache, contributing to its LRU max, long + * after they have expired, unless {@link OptionsBase.ttlAutopurge} is + * set. + * + * If set to `0` (the default value), then that means "do not track + * TTL", not "expire immediately". + * + * Also, as this cache is optimized for LRU/MRU operations, some of + * the staleness/TTL checks will reduce performance, as they will incur + * overhead by deleting items. + * + * This is not primarily a TTL cache, and does not make strong TTL + * guarantees. There is no pre-emptive pruning of expired items, but you + * _may_ set a TTL on the cache, and it will treat expired items as missing + * when they are fetched, and delete them. + * + * Optional, but must be a non-negative integer in ms if specified. + * + * This may be overridden by passing an options object to `cache.set()`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if ttl tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * If ttl tracking is enabled, and `max` and `maxSize` are not set, + * and `ttlAutopurge` is not set, then a warning will be emitted + * cautioning about the potential for unbounded memory consumption. + * (The TypeScript definitions will also discourage this.) + */ + ttl?: Milliseconds; + /** + * Minimum amount of time in ms in which to check for staleness. + * Defaults to 1, which means that the current time is checked + * at most once per millisecond. + * + * Set to 0 to check the current time every time staleness is tested. + * (This reduces performance, and is theoretically unnecessary.) + * + * Setting this to a higher value will improve performance somewhat + * while using ttl tracking, albeit at the expense of keeping stale + * items around a bit longer than their TTLs would indicate. + * + * @default 1 + */ + ttlResolution?: Milliseconds; + /** + * Preemptively remove stale items from the cache. + * + * Note that this may *significantly* degrade performance, especially if + * the cache is storing a large number of items. It is almost always best + * to just leave the stale items in the cache, and let them fall out as new + * items are added. + * + * Note that this means that {@link OptionsBase.allowStale} is a bit + * pointless, as stale items will be deleted almost as soon as they + * expire. + * + * Use with caution! + */ + ttlAutopurge?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever it is retrieved from cache with + * {@link LRUCache#get}, causing it to not expire. (It can still fall out + * of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + * + * This may be overridden by passing an options object to `cache.get()`. + */ + updateAgeOnGet?: boolean; + /** + * When using time-expiring entries with `ttl`, setting this to `true` will + * make each item's age reset to 0 whenever its presence in the cache is + * checked with {@link LRUCache#has}, causing it to not expire. (It can + * still fall out of cache based on recency of use, of course.) + * + * Has no effect if {@link OptionsBase.ttl} is not set. + */ + updateAgeOnHas?: boolean; + /** + * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return + * stale data, if available. + * + * By default, if you set `ttl`, stale items will only be deleted from the + * cache when you `get(key)`. That is, it's not preemptively pruning items, + * unless {@link OptionsBase.ttlAutopurge} is set. + * + * If you set `allowStale:true`, it'll return the stale value *as well as* + * deleting it. If you don't set this, then it'll return `undefined` when + * you try to get a stale entry. + * + * Note that when a stale entry is fetched, _even if it is returned due to + * `allowStale` being set_, it is removed from the cache immediately. You + * can suppress this behavior by setting + * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in + * the options provided to {@link LRUCache#get}. + * + * This may be overridden by passing an options object to `cache.get()`. + * The `cache.has()` method will always return `false` for stale items. + * + * Only relevant if a ttl is set. + */ + allowStale?: boolean; + /** + * Function that is called on items when they are dropped from the + * cache, as `dispose(value, key, reason)`. + * + * This can be handy if you want to close file descriptors or do + * other cleanup tasks when items are no longer stored in the cache. + * + * **NOTE**: It is called _before_ the item has been fully removed + * from the cache, so if you want to put it right back in, you need + * to wait until the next tick. If you try to add it back in during + * the `dispose()` function call, it will break things in subtle and + * weird ways. + * + * Unlike several other options, this may _not_ be overridden by + * passing an option to `set()`, for performance reasons. + * + * The `reason` will be one of the following strings, corresponding + * to the reason for the item's deletion: + * + * - `evict` Item was evicted to make space for a new addition + * - `set` Item was overwritten by a new value + * - `expire` Item expired its TTL + * - `fetch` Item was deleted due to a failed or aborted fetch, or a + * fetchMethod returning `undefined. + * - `delete` Item was removed by explicit `cache.delete(key)`, + * `cache.clear()`, or `cache.set(key, undefined)`. + */ + dispose?: Disposer; + /** + * Function that is called when new items are inserted into the cache, + * as `onInsert(value, key, reason)`. + * + * This can be useful if you need to perform actions when an item is + * added, such as logging or tracking insertions. + * + * Unlike some other options, this may _not_ be overridden by passing + * an option to `set()`, for performance and consistency reasons. + */ + onInsert?: Inserter; + /** + * The same as {@link OptionsBase.dispose}, but called *after* the entry + * is completely removed and the cache is once again in a clean state. + * + * It is safe to add an item right back into the cache at this point. + * However, note that it is *very* easy to inadvertently create infinite + * recursion this way. + */ + disposeAfter?: Disposer; + /** + * Set to true to suppress calling the + * {@link OptionsBase.dispose} function if the entry key is + * still accessible within the cache. + * + * This may be overridden by passing an options object to + * {@link LRUCache#set}. + * + * Only relevant if `dispose` or `disposeAfter` are set. + */ + noDisposeOnSet?: boolean; + /** + * Boolean flag to tell the cache to not update the TTL when setting a new + * value for an existing key (ie, when updating a value rather than + * inserting a new value). Note that the TTL value is _always_ set (if + * provided) when adding a new entry into the cache. + * + * Has no effect if a {@link OptionsBase.ttl} is not set. + * + * May be passed as an option to {@link LRUCache#set}. + */ + noUpdateTTL?: boolean; + /** + * Set to a positive integer to track the sizes of items added to the + * cache, and automatically evict items in order to stay below this size. + * Note that this may result in fewer than `max` items being stored. + * + * Attempting to add an item to the cache whose calculated size is greater + * that this amount will be a no-op. The item will not be cached, and no + * other items will be evicted. + * + * Optional, must be a positive integer if provided. + * + * Sets `maxEntrySize` to the same value, unless a different value is + * provided for `maxEntrySize`. + * + * At least one of `max`, `maxSize`, or `TTL` is required. This must be a + * positive integer if set. + * + * Even if size tracking is enabled, **it is strongly recommended to set a + * `max` to prevent unbounded growth of the cache.** + * + * Note also that size tracking can negatively impact performance, + * though for most cases, only minimally. + */ + maxSize?: Size; + /** + * The effective size for background fetch promises. + * + * This has no effect unless `maxSize` and `sizeCalculation` are used, + * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to + * support {@link LRUCache#fetch}. + * + * If a stale value is present in the cache, then the effective size of + * the background fetch is the size of the stale item it will eventually + * replace. If not, then this value is used as its effective size. + * + * @default 1 + */ + backgroundFetchSize?: number; + /** + * The maximum allowed size for any single item in the cache. + * + * If a larger item is passed to {@link LRUCache#set} or returned by a + * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then + * it will not be stored in the cache. + * + * Attempting to add an item whose calculated size is greater than + * this amount will not cache the item or evict any old items, but + * WILL delete an existing value if one is already present. + * + * Optional, must be a positive integer if provided. Defaults to + * the value of `maxSize` if provided. + */ + maxEntrySize?: Size; + /** + * A function that returns a number indicating the item's size. + * + * Requires {@link OptionsBase.maxSize} to be set. + * + * If not provided, and {@link OptionsBase.maxSize} or + * {@link OptionsBase.maxEntrySize} are set, then all + * {@link LRUCache#set} calls **must** provide an explicit + * {@link SetOptions.size} or sizeCalculation param. + */ + sizeCalculation?: SizeCalculator; + /** + * Method that provides the implementation for {@link LRUCache#fetch} + * + * ```ts + * fetchMethod(key, staleValue, { signal, options, context }) + * ``` + * + * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent + * to `Promise.resolve(cache.get(key))`. + * + * If at any time, `signal.aborted` is set to `true`, or if the + * `signal.onabort` method is called, or if it emits an `'abort'` event + * which you can listen to with `addEventListener`, then that means that + * the fetch should be abandoned. This may be passed along to async + * functions aware of AbortController/AbortSignal behavior. + * + * The `fetchMethod` should **only** return `undefined` or a Promise + * resolving to `undefined` if the AbortController signaled an `abort` + * event. In all other cases, it should return or resolve to a value + * suitable for adding to the cache. + * + * The `options` object is a union of the options that may be provided to + * `set()` and `get()`. If they are modified, then that will result in + * modifying the settings to `cache.set()` when the value is resolved, and + * in the case of + * {@link OptionsBase.noDeleteOnFetchRejection} and + * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of + * `fetchMethod` failures. + * + * For example, a DNS cache may update the TTL based on the value returned + * from a remote DNS server by changing `options.ttl` in the `fetchMethod`. + */ + fetchMethod?: Fetcher; + /** + * Method that provides the implementation for {@link LRUCache#memo} + */ + memoMethod?: Memoizer; + /** + * Set to true to suppress the deletion of stale data when a + * {@link OptionsBase.fetchMethod} returns a rejected promise. + */ + noDeleteOnFetchRejection?: boolean; + /** + * Do not delete stale items when they are retrieved with + * {@link LRUCache#get}. + * + * Note that the `get` return value will still be `undefined` + * unless {@link OptionsBase.allowStale} is true. + * + * When using time-expiring entries with `ttl`, by default stale + * items will be removed from the cache when the key is accessed + * with `cache.get()`. + * + * Setting this option will cause stale items to remain in the cache, until + * they are explicitly deleted with `cache.delete(key)`, or retrieved with + * `noDeleteOnStaleGet` set to `false`. + * + * This may be overridden by passing an options object to `cache.get()`. + * + * Only relevant if a ttl is used. + */ + noDeleteOnStaleGet?: boolean; + /** + * Set to true to allow returning stale data when a + * {@link OptionsBase.fetchMethod} throws an error or returns a rejected + * promise. + * + * This differs from using {@link OptionsBase.allowStale} in that stale + * data will ONLY be returned in the case that the {@link LRUCache#fetch} + * fails, not any other times. + * + * If a `fetchMethod` fails, and there is no stale value available, the + * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are + * suppressed. + * + * Implies `noDeleteOnFetchRejection`. + * + * This may be set in calls to `fetch()`, or defaulted on the constructor, + * or overridden by modifying the options object in the `fetchMethod`. + */ + allowStaleOnFetchRejection?: boolean; + /** + * Set to true to return a stale value from the cache when the + * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches + * an `'abort'` event, whether user-triggered, or due to internal cache + * behavior. + * + * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying + * {@link OptionsBase.fetchMethod} will still be considered canceled, and + * any value it returns will be ignored and not cached. + * + * Caveat: since fetches are aborted when a new value is explicitly + * set in the cache, this can lead to fetch returning a stale value, + * since that was the fallback value _at the moment the `fetch()` was + * initiated_, even though the new updated value is now present in + * the cache. + * + * For example: + * + * ```ts + * const cache = new LRUCache({ + * ttl: 100, + * fetchMethod: async (url, oldValue, { signal }) => { + * const res = await fetch(url, { signal }) + * return await res.json() + * } + * }) + * cache.set('https://example.com/', { some: 'data' }) + * // 100ms go by... + * const result = cache.fetch('https://example.com/') + * cache.set('https://example.com/', { other: 'thing' }) + * console.log(await result) // { some: 'data' } + * console.log(cache.get('https://example.com/')) // { other: 'thing' } + * ``` + */ + allowStaleOnFetchAbort?: boolean; + /** + * Set to true to ignore the `abort` event emitted by the `AbortSignal` + * object passed to {@link OptionsBase.fetchMethod}, and still cache the + * resulting resolution value, as long as it is not `undefined`. + * + * When used on its own, this means aborted {@link LRUCache#fetch} calls + * are not immediately resolved or rejected when they are aborted, and + * instead take the full time to await. + * + * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted + * {@link LRUCache#fetch} calls will resolve immediately to their stale + * cached value or `undefined`, and will continue to process and eventually + * update the cache when they resolve, as long as the resulting value is + * not `undefined`, thus supporting a "return stale on timeout while + * refreshing" mechanism by passing `AbortSignal.timeout(n)` as the signal. + * + * For example: + * + * ```ts + * const c = new LRUCache({ + * ttl: 100, + * ignoreFetchAbort: true, + * allowStaleOnFetchAbort: true, + * fetchMethod: async (key, oldValue, { signal }) => { + * // note: do NOT pass the signal to fetch()! + * // let's say this fetch can take a long time. + * const res = await fetch(`https://slow-backend-server/${key}`) + * return await res.json() + * }, + * }) + * + * // this will return the stale value after 100ms, while still + * // updating in the background for next time. + * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) }) + * ``` + * + * **Note**: regardless of this setting, an `abort` event _is still + * emitted on the `AbortSignal` object_, so may result in invalid results + * when passed to other underlying APIs that use AbortSignals. + * + * This may be overridden in the {@link OptionsBase.fetchMethod} or the + * call to {@link LRUCache#fetch}. + */ + ignoreFetchAbort?: boolean; + /** + * In some cases, you may want to swap out the performance/Date object + * used for TTL tracking. This should almost certainly NOT be done in + * production environments! + * + * This value defaults to `global.performance` if it has a `now()` method, + * or the `global.Date` object otherwise. + */ + perf?: Perf; + } + interface OptionsMaxLimit extends OptionsBase { + max: Count; + } + interface OptionsTTLLimit extends OptionsBase { + ttl: Milliseconds; + ttlAutopurge: boolean; + } + interface OptionsSizeLimit extends OptionsBase { + maxSize: Size; + } + /** + * The valid safe options for the {@link LRUCache} constructor + */ + type Options = OptionsMaxLimit | OptionsSizeLimit | OptionsTTLLimit; + /** + * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump}, + * and returned by {@link LRUCache#info}. + */ + interface Entry { + value: V; + ttl?: Milliseconds; + size?: Size; + start?: Milliseconds; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export declare class LRUCache { + #private; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf(): Perf; + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution: LRUCache.Milliseconds; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet: boolean; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas: boolean; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale: boolean; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet: boolean; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL: boolean; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize: LRUCache.Size; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation?: LRUCache.SizeCalculator; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort: boolean; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection: boolean; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort: boolean; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize: number; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c: LRUCache): { + starts: ZeroArray | undefined; + ttls: ZeroArray | undefined; + autopurgeTimers: (NodeJS.Timeout | undefined)[] | undefined; + sizes: ZeroArray | undefined; + keyMap: Map; + keyList: (K | undefined)[]; + valList: (V | BackgroundFetch | undefined)[]; + next: NumberArray; + prev: NumberArray; + readonly head: Index; + readonly tail: Index; + free: StackLike; + isBackgroundFetch: (p: unknown) => p is BackgroundFetch; + backgroundFetch: (k: K, index: number | undefined, options: LRUCache.FetchOptions, context: unknown) => BackgroundFetch; + moveToTail: (index: number) => void; + indexes: (options?: { + allowStale: boolean; + }) => Generator; + rindexes: (options?: { + allowStale: boolean; + }) => Generator; + isStale: (index: number | undefined) => boolean; + }; + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize(): LRUCache.Count; + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize(): LRUCache.Size; + /** + * The number of items stored in the cache (read-only) + */ + get size(): LRUCache.Count; + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod(): LRUCache.Fetcher | undefined; + get memoMethod(): LRUCache.Memoizer | undefined; + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose(): LRUCache.Disposer | undefined; + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert(): LRUCache.Inserter | undefined; + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter(): LRUCache.Disposer | undefined; + constructor(options: LRUCache.Options | LRUCache); + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key: K): number; + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + entries(): Generator<[K, V], void, unknown>; + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + rentries(): Generator<(K | V)[], void, unknown>; + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + keys(): Generator; + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + rkeys(): Generator; + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + values(): Generator; + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + rvalues(): Generator; + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator](): Generator<[K, V], void, unknown>; + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag]: string; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn: (v: V, k: K, self: LRUCache) => boolean, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn: (v: V, k: K, self: LRUCache) => unknown, thisp?: unknown): void; + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale(): boolean; + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key: K): LRUCache.Entry | undefined; + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump(): [K, LRUCache.Entry][]; + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr: [K, LRUCache.Entry][]): void; + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k: K, v: V | undefined, setOptions?: LRUCache.SetOptions): this; + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop(): V | undefined; + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k: K, hasOptions?: LRUCache.HasOptions): boolean; + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k: K, peekOptions?: LRUCache.PeekOptions): V | undefined; + /** + * Make an asynchronous cached fetch using the + * {@link LRUCache.OptionsBase.fetchMethod} function. + * + * If the value is in the cache and not stale, then the returned + * Promise resolves to the value. + * + * If not in the cache, or beyond its TTL staleness, then + * `fetchMethod(key, staleValue, { options, signal, context })` is + * called, and the value returned will be added to the cache once + * resolved. + * + * If called with `allowStale`, and an asynchronous fetch is + * currently in progress to reload a stale value, then the former + * stale value will be returned. + * + * If called with `forceRefresh`, then the cached item will be + * re-fetched, even if it is not stale. However, if `allowStale` is also + * set, then the old value will still be returned. This is useful + * in cases where you want to force a reload of a cached value. If + * a background fetch is already in progress, then `forceRefresh` + * has no effect. + * + * If multiple fetches for the same key are issued, then they will all be + * coalesced into a single call to fetchMethod. + * + * Note that this means that handling options such as + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}, + * {@link LRUCache.FetchOptions.signal}, + * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be + * determined by the FIRST fetch() call for a given key. + * + * This is a known (fixable) shortcoming which will be addresed on when + * someone complains about it, as the fix would involve added complexity and + * may not be worth the costs for this edge case. + * + * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is + * effectively an alias for `Promise.resolve(cache.get(key))`. + * + * When the fetch method resolves to a value, if the fetch has not + * been aborted due to deletion, eviction, or being overwritten, + * then it is added to the cache using the options provided. + * + * If the key is evicted or deleted before the `fetchMethod` + * resolves, then the AbortSignal passed to the `fetchMethod` will + * receive an `abort` event, and the promise returned by `fetch()` + * will reject with the reason for the abort. + * + * If a `signal` is passed to the `fetch()` call, then aborting the + * signal will abort the fetch and cause the `fetch()` promise to + * reject with the reason provided. + * + * **Setting `context`** + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the {@link LRUCache} constructor, then all + * calls to `cache.fetch()` _must_ provide a `context` option. If + * set to `undefined` or `void`, then calls to fetch _must not_ + * provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that + * might be relevant in the course of fetching the data. It is only + * relevant for the course of a single `fetch()` operation, and + * discarded afterwards. + * + * **Note: `fetch()` calls are inflight-unique** + * + * If you call `fetch()` multiple times with the same key value, + * then every call after the first will resolve on the same + * promise1, + * _even if they have different settings that would otherwise change + * the behavior of the fetch_, such as `noDeleteOnFetchRejection` + * or `ignoreFetchAbort`. + * + * In most cases, this is not a problem (in fact, only fetching + * something once is what you probably want, if you're caching in + * the first place). If you are changing the fetch() options + * dramatically between runs, there's a good chance that you might + * be trying to fit divergent semantics into a single object, and + * would be better off with multiple cache instances. + * + * **1**: Ie, they're not the "same Promise", but they resolve at + * the same time, because they're both waiting on the same + * underlying fetchMethod response. + */ + fetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + fetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * In some cases, `cache.fetch()` may resolve to `undefined`, either because + * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning + * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or + * because `ignoreFetchAbort` was specified (either to the constructor or + * in the {@link LRUCache.FetchOptions}). Also, the + * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making + * the test even more complicated. + * + * Because inferring the cases where `undefined` might be returned are so + * cumbersome, but testing for `undefined` can also be annoying, this method + * can be used, which will reject if `this.fetch()` resolves to undefined. + */ + forceFetch(k: K, fetchOptions: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : LRUCache.FetchOptionsWithContext): Promise; + forceFetch(k: unknown extends FC ? K : FC extends undefined | void ? K : never, fetchOptions?: unknown extends FC ? LRUCache.FetchOptions : FC extends undefined | void ? LRUCache.FetchOptionsNoContext : never): Promise; + /** + * If the key is found in the cache, then this is equivalent to + * {@link LRUCache#get}. If not, in the cache, then calculate the value using + * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache. + * + * If an `FC` type is set to a type other than `unknown`, `void`, or + * `undefined` in the LRUCache constructor, then all calls to `cache.memo()` + * _must_ provide a `context` option. If set to `undefined` or `void`, then + * calls to memo _must not_ provide a `context` option. + * + * The `context` param allows you to provide arbitrary data that might be + * relevant in the course of fetching the data. It is only relevant for the + * course of a single `memo()` operation, and discarded afterwards. + */ + memo(k: K, memoOptions: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : LRUCache.MemoOptionsWithContext): V; + memo(k: unknown extends FC ? K : FC extends undefined | void ? K : never, memoOptions?: unknown extends FC ? LRUCache.MemoOptions : FC extends undefined | void ? LRUCache.MemoOptionsNoContext : never): V; + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k: K, getOptions?: LRUCache.GetOptions): V | undefined; + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k: K): boolean; + /** + * Clear the cache entirely, throwing away all values. + */ + clear(): void; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/index.d.ts.map b/node_modules/lru-cache/dist/esm/node/index.d.ts.map new file mode 100644 index 00000000..fa98a0f5 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAiCrC,QAAA,MA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,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,CAAC;IAEJ,IAAI,CACF,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,CAAC,GACvB,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,CAAC,GAC/B,KAAK,EACP,WAAW,CAAC,EAAE,OAAO,SAAS,EAAE,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC/D,EAAE,SAAS,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACrE,KAAK,GACN,CAAC;IAyCJ;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,GAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAM;IA6FxD;;;;OAIG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC;IAiEX;;OAEG;IACH,KAAK;CA8CN"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/index.js b/node_modules/lru-cache/dist/esm/node/index.js new file mode 100644 index 00000000..2dd10cf8 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/index.js @@ -0,0 +1,1722 @@ +/** + * @module LRUCache + */ +import { metrics, tracing } from './diagnostics-channel.js'; +import { defaultPerf } from './perf.js'; +const hasSubscribers = () => metrics.hasSubscribers || tracing.hasSubscribers; +const warned = new Set(); +/* c8 ignore start */ +const PROCESS = (typeof process === 'object' && !!process ? + process + : {}); +/* c8 ignore stop */ +const emitWarning = (msg, type, code, fn) => { + if (typeof PROCESS.emitWarning === 'function') { + PROCESS.emitWarning(msg, type, code, fn); + } + else { + //oxlint-disable-next-line no-console + console.error(`[${code}] ${type}: ${msg}`); + } +}; +const shouldWarn = (code) => !warned.has(code); +const TYPE = Symbol('type'); +const isPosInt = (n) => !!n && n === Math.floor(n) && n > 0 && isFinite(n); +// This is a little bit ridiculous, tbh. +// The maximum array length is 2^32-1 or thereabouts on most JS impls. +// And well before that point, you're caching the entire world, I mean, +// that's ~32GB of just integers for the next/prev links, plus whatever +// else to hold that many keys and values. Just filling the memory with +// zeroes at init time is brutal when you get that big. +// But why not be complete? +// Maybe in the future, these limits will have expanded. +/* c8 ignore start */ +const getUintArray = (max) => !isPosInt(max) ? null + : max <= Math.pow(2, 8) ? Uint8Array + : max <= Math.pow(2, 16) ? Uint16Array + : max <= Math.pow(2, 32) ? Uint32Array + : max <= Number.MAX_SAFE_INTEGER ? ZeroArray + : null; +/* c8 ignore stop */ +class ZeroArray extends Array { + constructor(size) { + super(size); + this.fill(0); + } +} +class Stack { + /* c8 ignore start - not sure why this is showing up uncovered?? */ + heap; + /* c8 ignore stop */ + length; + // private constructor + static #constructing = false; + static create(max) { + const HeapCls = getUintArray(max); + if (!HeapCls) + return []; + Stack.#constructing = true; + const s = new Stack(max, HeapCls); + Stack.#constructing = false; + return s; + } + constructor(max, HeapCls) { + /* c8 ignore start */ + if (!Stack.#constructing) { + throw new TypeError('instantiate Stack using Stack.create(n)'); + } + /* c8 ignore stop */ + this.heap = new HeapCls(max); + this.length = 0; + } + push(n) { + this.heap[this.length++] = n; + } + pop() { + return this.heap[--this.length]; + } +} +/** + * Default export, the thing you're using this module to get. + * + * The `K` and `V` types define the key and value types, respectively. The + * optional `FC` type defines the type of the `context` object passed to + * `cache.fetch()` and `cache.memo()`. + * + * Keys and values **must not** be `null` or `undefined`. + * + * All properties from the options object (with the exception of `max`, + * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are + * added as normal public members. (The listed options are read-only getters.) + * + * Changing any of these will alter the defaults for subsequent method calls. + */ +export class LRUCache { + // options that cannot be changed without disaster + #max; + #maxSize; + #dispose; + #onInsert; + #disposeAfter; + #fetchMethod; + #memoMethod; + #perf; + /** + * {@link LRUCache.OptionsBase.perf} + */ + get perf() { + return this.#perf; + } + /** + * {@link LRUCache.OptionsBase.ttl} + */ + ttl; + /** + * {@link LRUCache.OptionsBase.ttlResolution} + */ + ttlResolution; + /** + * {@link LRUCache.OptionsBase.ttlAutopurge} + */ + ttlAutopurge; + /** + * {@link LRUCache.OptionsBase.updateAgeOnGet} + */ + updateAgeOnGet; + /** + * {@link LRUCache.OptionsBase.updateAgeOnHas} + */ + updateAgeOnHas; + /** + * {@link LRUCache.OptionsBase.allowStale} + */ + allowStale; + /** + * {@link LRUCache.OptionsBase.noDisposeOnSet} + */ + noDisposeOnSet; + /** + * {@link LRUCache.OptionsBase.noUpdateTTL} + */ + noUpdateTTL; + /** + * {@link LRUCache.OptionsBase.maxEntrySize} + */ + maxEntrySize; + /** + * {@link LRUCache.OptionsBase.sizeCalculation} + */ + sizeCalculation; + /** + * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection} + */ + noDeleteOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.noDeleteOnStaleGet} + */ + noDeleteOnStaleGet; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort} + */ + allowStaleOnFetchAbort; + /** + * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} + */ + allowStaleOnFetchRejection; + /** + * {@link LRUCache.OptionsBase.ignoreFetchAbort} + */ + ignoreFetchAbort; + /** {@link LRUCache.OptionsBase.backgroundFetchSize} */ + backgroundFetchSize; + // computed properties + #size; + #calculatedSize; + #keyMap; + #keyList; + #valList; + #next; + #prev; + #head; + #tail; + #free; + #disposed; + #sizes; + #starts; + #ttls; + #autopurgeTimers; + #hasDispose; + #hasFetchMethod; + #hasDisposeAfter; + #hasOnInsert; + /** + * Do not call this method unless you need to inspect the + * inner workings of the cache. If anything returned by this + * object is modified in any way, strange breakage may occur. + * + * These fields are private for a reason! + * + * @internal + */ + static unsafeExposeInternals(c) { + return { + // properties + starts: c.#starts, + ttls: c.#ttls, + autopurgeTimers: c.#autopurgeTimers, + sizes: c.#sizes, + keyMap: c.#keyMap, + keyList: c.#keyList, + valList: c.#valList, + next: c.#next, + prev: c.#prev, + get head() { + return c.#head; + }, + get tail() { + return c.#tail; + }, + free: c.#free, + // methods + isBackgroundFetch: (p) => c.#isBackgroundFetch(p), + backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context), + moveToTail: (index) => c.#moveToTail(index), + indexes: (options) => c.#indexes(options), + rindexes: (options) => c.#rindexes(options), + isStale: (index) => c.#isStale(index), + }; + } + // Protected read-only members + /** + * {@link LRUCache.OptionsBase.max} (read-only) + */ + get max() { + return this.#max; + } + /** + * {@link LRUCache.OptionsBase.maxSize} (read-only) + */ + get maxSize() { + return this.#maxSize; + } + /** + * The total computed size of items in the cache (read-only) + */ + get calculatedSize() { + return this.#calculatedSize; + } + /** + * The number of items stored in the cache (read-only) + */ + get size() { + return this.#size; + } + /** + * {@link LRUCache.OptionsBase.fetchMethod} (read-only) + */ + get fetchMethod() { + return this.#fetchMethod; + } + get memoMethod() { + return this.#memoMethod; + } + /** + * {@link LRUCache.OptionsBase.dispose} (read-only) + */ + get dispose() { + return this.#dispose; + } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } + /** + * {@link LRUCache.OptionsBase.disposeAfter} (read-only) + */ + get disposeAfter() { + return this.#disposeAfter; + } + constructor(options) { + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, backgroundFetchSize = 1, perf, } = options; + this.backgroundFetchSize = backgroundFetchSize; + if (perf !== undefined) { + if (typeof perf?.now !== 'function') { + throw new TypeError('perf option must have a now() method if specified'); + } + } + this.#perf = perf ?? defaultPerf; + if (max !== 0 && !isPosInt(max)) { + throw new TypeError('max option must be a nonnegative integer'); + } + const UintArray = max ? getUintArray(max) : Array; + if (!UintArray) { + throw new Error('invalid max value: ' + max); + } + this.#max = max; + this.#maxSize = maxSize; + this.maxEntrySize = maxEntrySize || this.#maxSize; + this.sizeCalculation = sizeCalculation; + if (this.sizeCalculation) { + if (!this.#maxSize && !this.maxEntrySize) { + throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize'); + } + if (typeof this.sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation set to non-function'); + } + } + if (memoMethod !== undefined && typeof memoMethod !== 'function') { + throw new TypeError('memoMethod must be a function if defined'); + } + this.#memoMethod = memoMethod; + if (fetchMethod !== undefined && typeof fetchMethod !== 'function') { + throw new TypeError('fetchMethod must be a function if specified'); + } + this.#fetchMethod = fetchMethod; + this.#hasFetchMethod = !!fetchMethod; + this.#keyMap = new Map(); + this.#keyList = Array.from({ length: max }).fill(undefined); + this.#valList = Array.from({ length: max }).fill(undefined); + this.#next = new UintArray(max); + this.#prev = new UintArray(max); + this.#head = 0; + this.#tail = 0; + this.#free = Stack.create(max); + this.#size = 0; + this.#calculatedSize = 0; + if (typeof dispose === 'function') { + this.#dispose = dispose; + } + if (typeof onInsert === 'function') { + this.#onInsert = onInsert; + } + if (typeof disposeAfter === 'function') { + this.#disposeAfter = disposeAfter; + this.#disposed = []; + } + else { + this.#disposeAfter = undefined; + this.#disposed = undefined; + } + this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; + this.#hasDisposeAfter = !!this.#disposeAfter; + this.noDisposeOnSet = !!noDisposeOnSet; + this.noUpdateTTL = !!noUpdateTTL; + this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection; + this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection; + this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort; + this.ignoreFetchAbort = !!ignoreFetchAbort; + // NB: maxEntrySize is set to maxSize if it's set + if (this.maxEntrySize !== 0) { + if (this.#maxSize !== 0) { + if (!isPosInt(this.#maxSize)) { + throw new TypeError('maxSize must be a positive integer if specified'); + } + } + if (!isPosInt(this.maxEntrySize)) { + throw new TypeError('maxEntrySize must be a positive integer if specified'); + } + this.#initializeSizeTracking(); + } + this.allowStale = !!allowStale; + this.noDeleteOnStaleGet = !!noDeleteOnStaleGet; + this.updateAgeOnGet = !!updateAgeOnGet; + this.updateAgeOnHas = !!updateAgeOnHas; + this.ttlResolution = + isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1; + this.ttlAutopurge = !!ttlAutopurge; + this.ttl = ttl || 0; + if (this.ttl) { + if (!isPosInt(this.ttl)) { + throw new TypeError('ttl must be a positive integer if specified'); + } + this.#initializeTTLTracking(); + } + // do not allow completely unbounded caches + if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) { + throw new TypeError('At least one of max, maxSize, or ttl is required'); + } + if (!this.ttlAutopurge && !this.#max && !this.#maxSize) { + const code = 'LRU_CACHE_UNBOUNDED'; + if (shouldWarn(code)) { + warned.add(code); + const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' + + 'result in unbounded memory consumption.'; + emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache); + } + } + } + /** + * Return the number of ms left in the item's TTL. If item is not in cache, + * returns `0`. Returns `Infinity` if item is in cache without a defined TTL. + */ + getRemainingTTL(key) { + return this.#keyMap.has(key) ? Infinity : 0; + } + #initializeTTLTracking() { + const ttls = new ZeroArray(this.#max); + const starts = new ZeroArray(this.#max); + this.#ttls = ttls; + this.#starts = starts; + const purgeTimers = this.ttlAutopurge ? + Array.from({ + length: this.#max, + }) + : undefined; + this.#autopurgeTimers = purgeTimers; + this.#setItemTTL = (index, ttl, start = this.#perf.now()) => { + starts[index] = ttl !== 0 ? start : 0; + ttls[index] = ttl; + setPurgetTimer(index, ttl); + }; + this.#updateItemAge = index => { + starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0; + setPurgetTimer(index, ttls[index]); + }; + // clear out the purge timer if we're setting TTL to 0, and + // previously had a ttl purge timer running, so it doesn't + // fire unnecessarily. Don't need to do this if we're not doing + // autopurge. + const setPurgetTimer = !this.ttlAutopurge ? + () => { } + : (index, ttl) => { + if (purgeTimers?.[index]) { + clearTimeout(purgeTimers[index]); + purgeTimers[index] = undefined; + } + if (ttl && ttl !== 0 && purgeTimers) { + const t = setTimeout(() => { + if (this.#isStale(index)) { + this.#delete(this.#keyList[index], 'expire'); + } + }, ttl + 1); + // unref() not supported on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + purgeTimers[index] = t; + } + }; + this.#statusTTL = (status, index) => { + if (ttls[index]) { + const ttl = ttls[index]; + const start = starts[index]; + /* c8 ignore start */ + if (!ttl || !start) { + return; + } + /* c8 ignore stop */ + status.ttl = ttl; + status.start = start; + status.now = cachedNow || getNow(); + const age = status.now - start; + status.remainingTTL = ttl - age; + } + }; + // debounce calls to perf.now() to 1s so we're not hitting + // that costly call repeatedly. + let cachedNow = 0; + const getNow = () => { + const n = this.#perf.now(); + if (this.ttlResolution > 0) { + cachedNow = n; + const t = setTimeout(() => (cachedNow = 0), this.ttlResolution); + // not available on all platforms + /* c8 ignore start */ + if (t.unref) { + t.unref(); + } + /* c8 ignore stop */ + } + return n; + }; + this.getRemainingTTL = key => { + const index = this.#keyMap.get(key); + if (index === undefined) { + return 0; + } + const ttl = ttls[index]; + const start = starts[index]; + if (!ttl || !start) { + return Infinity; + } + const age = (cachedNow || getNow()) - start; + return ttl - age; + }; + this.#isStale = index => { + const s = starts[index]; + const t = ttls[index]; + return !!t && !!s && (cachedNow || getNow()) - s > t; + }; + } + // conditionally set private methods related to TTL + #updateItemAge = () => { }; + #statusTTL = () => { }; + #setItemTTL = () => { }; + /* c8 ignore stop */ + #isStale = () => false; + #initializeSizeTracking() { + const sizes = new ZeroArray(this.#max); + this.#calculatedSize = 0; + this.#sizes = sizes; + this.#removeItemSize = index => { + this.#calculatedSize -= sizes[index]; + sizes[index] = 0; + }; + this.#requireSize = (k, v, size, sizeCalculation) => { + if (!isPosInt(size)) { + // provisionally accept background fetches. + // actual value size will be checked when they return. + if (this.#isBackgroundFetch(v)) { + // NB: this cannot occur if v.__staleWhileFetching is set, + // because in that case, it would take on the size of the + // existing entry that it temporarily replaces. + return this.backgroundFetchSize; + } + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function'); + } + size = sizeCalculation(v, k); + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)'); + } + } + else { + throw new TypeError('invalid size value (must be positive integer). ' + + 'When maxSize or maxEntrySize is used, sizeCalculation ' + + 'or size must be set.'); + } + } + return size; + }; + this.#addItemSize = (index, size, status) => { + sizes[index] = size; + if (this.#maxSize) { + const maxSize = this.#maxSize - sizes[index]; + while (this.#calculatedSize > maxSize) { + this.#evict(true); + } + } + this.#calculatedSize += sizes[index]; + if (status) { + status.entrySize = size; + status.totalCalculatedSize = this.#calculatedSize; + } + }; + } + #removeItemSize = _i => { }; + #addItemSize = (_i, _s, _st) => { }; + #requireSize = (_k, _v, size, sizeCalculation) => { + if (size || sizeCalculation) { + throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache'); + } + return 0; + }; + *#indexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#tail; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#head) { + break; + } + else { + i = this.#prev[i]; + } + } + } + } + *#rindexes({ allowStale = this.allowStale } = {}) { + if (this.#size) { + for (let i = this.#head; this.#isValidIndex(i);) { + if (allowStale || !this.#isStale(i)) { + yield i; + } + if (i === this.#tail) { + break; + } + else { + i = this.#next[i]; + } + } + } + } + #isValidIndex(index) { + return (index !== undefined && + this.#keyMap.get(this.#keyList[index]) === index); + } + /** + * Return a generator yielding `[key, value]` pairs, + * in order from most recently used to least recently used. + */ + *entries() { + for (const i of this.#indexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Inverse order version of {@link LRUCache.entries} + * + * Return a generator yielding `[key, value]` pairs, + * in order from least recently used to most recently used. + */ + *rentries() { + for (const i of this.#rindexes()) { + if (this.#valList[i] !== undefined && + this.#keyList[i] !== undefined && + !this.#isBackgroundFetch(this.#valList[i])) { + yield [this.#keyList[i], this.#valList[i]]; + } + } + } + /** + * Return a generator yielding the keys in the cache, + * in order from most recently used to least recently used. + */ + *keys() { + for (const i of this.#indexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Inverse order version of {@link LRUCache.keys} + * + * Return a generator yielding the keys in the cache, + * in order from least recently used to most recently used. + */ + *rkeys() { + for (const i of this.#rindexes()) { + const k = this.#keyList[i]; + if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield k; + } + } + } + /** + * Return a generator yielding the values in the cache, + * in order from most recently used to least recently used. + */ + *values() { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Inverse order version of {@link LRUCache.values} + * + * Return a generator yielding the values in the cache, + * in order from least recently used to most recently used. + */ + *rvalues() { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) { + yield this.#valList[i]; + } + } + } + /** + * Iterating over the cache itself yields the same results as + * {@link LRUCache.entries} + */ + [Symbol.iterator]() { + return this.entries(); + } + /** + * A String value that is used in the creation of the default string + * description of an object. Called by the built-in method + * `Object.prototype.toString`. + */ + [Symbol.toStringTag] = 'LRUCache'; + /** + * Find a value for which the supplied fn method returns a truthy value, + * similar to `Array.find()`. fn is called as `fn(value, key, cache)`. + */ + find(fn, getOptions = {}) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + if (fn(value, this.#keyList[i], this)) { + return this.#get(this.#keyList[i], getOptions); + } + } + } + /** + * Call the supplied function on each item in the cache, in order from most + * recently used to least recently used. + * + * `fn` is called as `fn(value, key, cache)`. + * + * If `thisp` is provided, function will be called in the `this`-context of + * the provided object, or the cache if no `thisp` object is provided. + * + * Does not update age or recenty of use, or iterate over stale values. + */ + forEach(fn, thisp = this) { + for (const i of this.#indexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * The same as {@link LRUCache.forEach} but items are iterated over in + * reverse order. (ie, less recently used items are iterated over first.) + */ + rforEach(fn, thisp = this) { + for (const i of this.#rindexes()) { + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + continue; + fn.call(thisp, value, this.#keyList[i], this); + } + } + /** + * Delete any stale entries. Returns true if anything was removed, + * false otherwise. + */ + purgeStale() { + let deleted = false; + for (const i of this.#rindexes({ allowStale: true })) { + if (this.#isStale(i)) { + this.#delete(this.#keyList[i], 'expire'); + deleted = true; + } + } + return deleted; + } + /** + * Get the extended info about a given entry, to get its value, size, and + * TTL info simultaneously. Returns `undefined` if the key is not present. + * + * Unlike {@link LRUCache#dump}, which is designed to be portable and survive + * serialization, the `start` value is always the current timestamp, and the + * `ttl` is a calculated remaining time to live (negative if expired). + * + * Always returns stale values, if their info is found in the cache, so be + * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl}) + * if relevant. + */ + info(key) { + const i = this.#keyMap.get(key); + if (i === undefined) + return undefined; + const v = this.#valList[i]; + /* c8 ignore start - this isn't tested for the info function, + * but it's the same logic as found in other places. */ + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined) + return undefined; + /* c8 ignore stop */ + const entry = { value }; + if (this.#ttls && this.#starts) { + const ttl = this.#ttls[i]; + const start = this.#starts[i]; + if (ttl && start) { + const remain = ttl - (this.#perf.now() - start); + entry.ttl = remain; + entry.start = Date.now(); + } + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + return entry; + } + /** + * Return an array of [key, {@link LRUCache.Entry}] tuples which can be + * passed to {@link LRUCache#load}. + * + * The `start` fields are calculated relative to a portable `Date.now()` + * timestamp, even if `performance.now()` is available. + * + * Stale entries are always included in the `dump`, even if + * {@link LRUCache.OptionsBase.allowStale} is false. + * + * Note: this returns an actual array, not a generator, so it can be more + * easily passed around. + */ + dump() { + const arr = []; + for (const i of this.#indexes({ allowStale: true })) { + const key = this.#keyList[i]; + const v = this.#valList[i]; + const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (value === undefined || key === undefined) + continue; + const entry = { value }; + if (this.#ttls && this.#starts) { + entry.ttl = this.#ttls[i]; + // always dump the start relative to a portable timestamp + // it's ok for this to be a bit slow, it's a rare operation. + const age = this.#perf.now() - this.#starts[i]; + entry.start = Math.floor(Date.now() - age); + } + if (this.#sizes) { + entry.size = this.#sizes[i]; + } + arr.unshift([key, entry]); + } + return arr; + } + /** + * Reset the cache and load in the items in entries in the order listed. + * + * The shape of the resulting cache may be different if the same options are + * not used in both caches. + * + * The `start` fields are assumed to be calculated relative to a portable + * `Date.now()` timestamp, even if `performance.now()` is available. + */ + load(arr) { + this.clear(); + for (const [key, entry] of arr) { + if (entry.start) { + // entry.start is a portable timestamp, but we may be using + // node's performance.now(), so calculate the offset, so that + // we get the intended remaining TTL, no matter how long it's + // been on ice. + // + // it's ok for this to be a bit slow, it's a rare operation. + const age = Date.now() - entry.start; + entry.start = this.#perf.now() - age; + } + this.#set(key, entry.value, entry); + } + } + /** + * Add a value to the cache. + * + * Note: if `undefined` is specified as a value, this is an alias for + * {@link LRUCache#delete} + * + * Fields on the {@link LRUCache.SetOptions} options param will override + * their corresponding values in the constructor options for the scope + * of this single `set()` operation. + * + * If `start` is provided, then that will set the effective start + * time for the TTL calculation. Note that this must be a previous + * value of `performance.now()` if supported, or a previous value of + * `Date.now()` if not. + * + * Options object may also include `size`, which will prevent + * calling the `sizeCalculation` function and just use the specified + * number if it is a positive integer, and `noDisposeOnSet` which + * will prevent calling a `dispose` function in the case of + * overwrites. + * + * If the `size` (or return value of `sizeCalculation`) for a given + * entry is greater than `maxEntrySize`, then the item will not be + * added to the cache. + * + * Will update the recency of the entry. + * + * If the value is `undefined`, then this is an alias for + * `cache.delete(key)`. `undefined` is never stored in the cache. + */ + set(k, v, setOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = setOptions; + setOptions.status = status; + if (status) { + status.op = 'set'; + status.key = k; + if (v !== undefined) + status.value = v; + status.cache = this; + } + const result = this.#set(k, v, setOptions); + if (status && metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #set(k, v, setOptions, bf) { + const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions; + const isBF = this.#isBackgroundFetch(v); + if (v === undefined) { + if (status) + status.set = 'deleted'; + this.delete(k); + return this; + } + let { noUpdateTTL = this.noUpdateTTL } = setOptions; + if (status && !isBF) + status.value = v; + const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation, status); + // if the item doesn't fit, don't do anything + // NB: maxEntrySize set to maxSize by default + if (this.maxEntrySize && size > this.maxEntrySize) { + // have to delete, in case something is there already. + this.#delete(k, 'set'); + if (status) { + status.set = 'miss'; + status.maxEntrySizeExceeded = true; + } + return this; + } + let index = this.#size === 0 ? undefined : this.#keyMap.get(k); + if (index === undefined) { + // addition + index = (this.#size === 0 ? this.#tail + : this.#free.length !== 0 ? this.#free.pop() + : this.#size === this.#max ? this.#evict(false) + : this.#size); + this.#keyList[index] = k; + this.#valList[index] = v; + this.#keyMap.set(k, index); + this.#next[this.#tail] = index; + this.#prev[index] = this.#tail; + this.#tail = index; + this.#size++; + this.#addItemSize(index, size, status); + if (status) + status.set = 'add'; + noUpdateTTL = false; + if (this.#hasOnInsert && !isBF) { + this.#onInsert?.(v, k, 'add'); + } + } + else { + // update + // might be updating a background fetch! + this.#moveToTail(index); + const oldVal = this.#valList[index]; + if (v !== oldVal) { + if (!noDisposeOnSet) { + if (this.#isBackgroundFetch(oldVal)) { + if (oldVal !== bf) { + // setting over a background fetch, not merely resolving it. + oldVal.__abortController.abort(new Error('replaced')); + } + const { __staleWhileFetching: s } = oldVal; + if (s !== undefined && s !== v) { + if (this.#hasDispose) { + this.#dispose?.(s, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([s, k, 'set']); + } + } + } + else { + if (this.#hasDispose) { + this.#dispose?.(oldVal, k, 'set'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldVal, k, 'set']); + } + } + } + this.#removeItemSize(index); + this.#addItemSize(index, size, status); + this.#valList[index] = v; + if (!isBF) { + const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? + oldVal.__staleWhileFetching + : oldVal; + const setType = oldValue === undefined ? 'add' + : v !== oldValue ? 'replace' + : 'update'; + if (status) { + status.set = setType; + if (oldValue !== undefined) + status.oldValue = oldValue; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, setType); + } + } + } + else if (!isBF) { + if (status) { + status.set = 'update'; + } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, 'update'); + } + } + } + if (ttl !== 0 && !this.#ttls) { + this.#initializeTTLTracking(); + } + if (this.#ttls) { + if (!noUpdateTTL) { + this.#setItemTTL(index, ttl, start); + } + if (status) + this.#statusTTL(status, index); + } + if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return this; + } + /** + * Evict the least recently used item, returning its value or + * `undefined` if cache is empty. + */ + pop() { + try { + while (this.#size) { + const val = this.#valList[this.#head]; + this.#evict(true); + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; + } + } + else if (val !== undefined) { + return val; + } + } + } + finally { + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } + } + #evict(free) { + const head = this.#head; + const k = this.#keyList[head]; + const v = this.#valList[head]; + const isBF = this.#isBackgroundFetch(v); + if (isBF) { + v.__abortController.abort(new Error('evicted')); + } + const oldValue = isBF ? v.__staleWhileFetching : v; + if ((this.#hasDispose || this.#hasDisposeAfter) && + oldValue !== undefined) { + if (this.#hasDispose) { + this.#dispose?.(oldValue, k, 'evict'); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([oldValue, k, 'evict']); + } + } + this.#removeItemSize(head); + if (this.#autopurgeTimers?.[head]) { + clearTimeout(this.#autopurgeTimers[head]); + this.#autopurgeTimers[head] = undefined; + } + // if we aren't about to use the index, then null these out + if (free) { + this.#keyList[head] = undefined; + this.#valList[head] = undefined; + this.#free.push(head); + } + if (this.#size === 1) { + this.#head = this.#tail = 0; + this.#free.length = 0; + } + else { + this.#head = this.#next[head]; + } + this.#keyMap.delete(k); + this.#size--; + return head; + } + /** + * Check if a key is in the cache, without updating the recency of use. + * Will return false if the item is stale, even though it is technically + * in the cache. + * + * Check if a key is in the cache, without updating the recency of + * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set + * to `true` in either the options or the constructor. + * + * Will return `false` if the item is stale, even though it is technically in + * the cache. The difference can be determined (if it matters) by using a + * `status` argument, and inspecting the `has` field. + * + * Will not update item age unless + * {@link LRUCache.OptionsBase.updateAgeOnHas} is set. + */ + has(k, hasOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions; + hasOptions.status = status; + if (status) { + status.op = 'has'; + status.key = k; + status.cache = this; + } + const result = this.#has(k, hasOptions); + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #has(k, hasOptions = {}) { + const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions; + const index = this.#keyMap.get(k); + if (index !== undefined) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v) && + v.__staleWhileFetching === undefined) { + return false; + } + if (!this.#isStale(index)) { + if (updateAgeOnHas) { + this.#updateItemAge(index); + } + if (status) { + status.has = 'hit'; + this.#statusTTL(status, index); + } + return true; + } + else if (status) { + status.has = 'stale'; + this.#statusTTL(status, index); + } + } + else if (status) { + status.has = 'miss'; + } + return false; + } + /** + * Like {@link LRUCache#get} but doesn't update recency or delete stale + * items. + * + * Returns `undefined` if the item is stale, unless + * {@link LRUCache.OptionsBase.allowStale} is set. + */ + peek(k, peekOptions = {}) { + const { status = hasSubscribers() ? {} : undefined } = peekOptions; + if (status) { + status.op = 'peek'; + status.key = k; + status.cache = this; + } + peekOptions.status = status; + const result = this.#peek(k, peekOptions); + if (metrics.hasSubscribers) { + metrics.publish(status); + } + return result; + } + #peek(k, peekOptions) { + const { status, allowStale = this.allowStale } = peekOptions; + const index = this.#keyMap.get(k); + if (index === undefined || (!allowStale && this.#isStale(index))) { + if (status) + status.peek = index === undefined ? 'miss' : 'stale'; + return undefined; + } + const v = this.#valList[index]; + const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; + if (status) { + if (val !== undefined) { + status.peek = 'hit'; + status.value = val; + } + else { + status.peek = 'miss'; + } + } + return val; + } + #backgroundFetch(k, index, options, context) { + const v = index === undefined ? undefined : this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + return v; + } + const ac = new AbortController(); + const { signal } = options; + // when/if our AC signals, then stop listening to theirs. + signal?.addEventListener('abort', () => ac.abort(signal.reason), { + signal: ac.signal, + }); + const fetchOpts = { + signal: ac.signal, + options, + context, + }; + const cb = (v, updateCache = false) => { + const { aborted } = ac.signal; + const ignoreAbort = options.ignoreFetchAbort && v !== undefined; + const proceed = options.ignoreFetchAbort || + !!(options.allowStaleOnFetchAbort && v !== undefined); + if (options.status) { + if (aborted && !updateCache) { + options.status.fetchAborted = true; + options.status.fetchError = ac.signal.reason; + if (ignoreAbort) + options.status.fetchAbortIgnored = true; + } + else { + options.status.fetchResolved = true; + } + } + if (aborted && !ignoreAbort && !updateCache) { + return fetchFail(ac.signal.reason, proceed); + } + // either we didn't abort, and are still here, or we did, and ignored + const bf = p; + // if nothing else has been written there but we're set to update the + // cache and ignore the abort, or if it's still pending on this specific + // background request, then write it to the cache. + const vl = this.#valList[index]; + if (vl === p || (vl === undefined && ignoreAbort && updateCache)) { + if (v === undefined) { + if (bf.__staleWhileFetching !== undefined) { + this.#valList[index] = bf.__staleWhileFetching; + } + else { + this.#delete(k, 'fetch'); + } + } + else { + if (options.status) + options.status.fetchUpdated = true; + this.#set(k, v, fetchOpts.options, bf); + } + } + return v; + }; + const eb = (er) => { + if (options.status) { + options.status.fetchRejected = true; + options.status.fetchError = er; + } + // do not pass go, do not collect $200 + return fetchFail(er, false); + }; + const fetchFail = (er, proceed) => { + const { aborted } = ac.signal; + const allowStaleAborted = aborted && options.allowStaleOnFetchAbort; + const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection; + const noDelete = allowStale || options.noDeleteOnFetchRejection; + const bf = p; + if (this.#valList[index] === p) { + // if we allow stale on fetch rejections, then we need to ensure that + // the stale value is not removed from the cache when the fetch fails. + const del = !noDelete || (!proceed && bf.__staleWhileFetching === undefined); + if (del) { + this.#delete(k, 'fetch'); + } + else if (!allowStaleAborted) { + // still replace the *promise* with the stale value, + // since we are done with the promise at this point. + // leave it untouched if we're still waiting for an + // aborted background fetch that hasn't yet returned. + this.#valList[index] = bf.__staleWhileFetching; + } + } + if (allowStale) { + if (options.status && bf.__staleWhileFetching !== undefined) { + options.status.returnedStale = true; + } + return bf.__staleWhileFetching; + } + else if (bf.__returned === bf) { + throw er; + } + }; + const pcall = (res, rej) => { + const fmp = this.#fetchMethod?.(k, v, fetchOpts); + // ignored, we go until we finish, regardless. + // defer check until we are actually aborting, + // so fetchMethod can override. + ac.signal.addEventListener('abort', () => { + if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) { + res(undefined); + // when it eventually resolves, update the cache. + if (options.allowStaleOnFetchAbort) { + res = v => cb(v, true); + } + } + }); + if (fmp && fmp instanceof Promise) { + fmp.then(v => res(v === undefined ? undefined : v), rej); + } + else if (fmp !== undefined) { + res(fmp); + } + }; + if (options.status) + options.status.fetchDispatched = true; + const p = new Promise(pcall).then(cb, eb); + const bf = Object.assign(p, { + __abortController: ac, + __staleWhileFetching: v, + __returned: undefined, + }); + if (index === undefined) { + // internal, don't expose status. + this.#set(k, bf, { ...fetchOpts.options, status: undefined }); + index = this.#keyMap.get(k); + } + else { + // do not call #set, because we do not want to adjust its place + // in the lru queue, as it has not yet been "used". Also, we don't + // need to worry about evicting for size, because a background fetch + // over a stale value is treated as the same size as its stale value. + this.#valList[index] = bf; + } + return bf; + } + #isBackgroundFetch(p) { + if (!this.#hasFetchMethod) + return false; + const b = p; + return (!!b && + b instanceof Promise && + b.hasOwnProperty('__staleWhileFetching') && + b.__abortController instanceof AbortController); + } + fetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#fetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #fetch(k, fetchOptions = {}) { + const { + // get options + allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, + // set options + ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, + // fetch exclusive options + noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions; + if (status) { + status.op = 'fetch'; + status.key = k; + if (forceRefresh) + status.forceRefresh = true; + status.cache = this; + } + if (!this.#hasFetchMethod) { + if (status) + status.fetch = 'get'; + return this.#get(k, { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + status, + }); + } + const options = { + allowStale, + updateAgeOnGet, + noDeleteOnStaleGet, + ttl, + noDisposeOnSet, + size, + sizeCalculation, + noUpdateTTL, + noDeleteOnFetchRejection, + allowStaleOnFetchRejection, + allowStaleOnFetchAbort, + ignoreFetchAbort, + status, + signal, + }; + let index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.fetch = 'miss'; + const p = this.#backgroundFetch(k, index, options, context); + return (p.__returned = p); + } + else { + // in cache, maybe already fetching + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + const stale = allowStale && v.__staleWhileFetching !== undefined; + if (status) { + status.fetch = 'inflight'; + if (stale) + status.returnedStale = true; + } + return stale ? v.__staleWhileFetching : (v.__returned = v); + } + // if we force a refresh, that means do NOT serve the cached value, + // unless we are already in the process of refreshing the cache. + const isStale = this.#isStale(index); + if (!forceRefresh && !isStale) { + if (status) + status.fetch = 'hit'; + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + if (status) + this.#statusTTL(status, index); + return v; + } + // ok, it is stale or a forced refresh, and not already fetching. + // refresh the cache. + const p = this.#backgroundFetch(k, index, options, context); + const hasStale = p.__staleWhileFetching !== undefined; + const staleVal = hasStale && allowStale; + if (status) { + status.fetch = isStale ? 'stale' : 'refresh'; + if (staleVal && isStale) + status.returnedStale = true; + } + return staleVal ? p.__staleWhileFetching : (p.__returned = p); + } + } + forceFetch(k, fetchOptions = {}) { + const ths = tracing.hasSubscribers; + const { status = hasSubscribers() ? {} : undefined } = fetchOptions; + fetchOptions.status = status; + if (status && fetchOptions.context) { + status.context = fetchOptions.context; + } + const p = this.#forceFetch(k, fetchOptions); + if (status && ths) { + status.trace = true; + tracing.tracePromise(() => p, status).catch(() => { }); + } + return p; + } + async #forceFetch(k, fetchOptions = {}) { + const v = await this.#fetch(k, fetchOptions); + if (v === undefined) + throw new Error('fetch() returned undefined'); + return v; + } + memo(k, memoOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = memoOptions; + memoOptions.status = status; + if (status) { + status.op = 'memo'; + status.key = k; + if (memoOptions.context) { + status.context = memoOptions.context; + } + status.cache = this; + } + const result = this.#memo(k, memoOptions); + if (status) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + return result; + } + #memo(k, memoOptions = {}) { + const memoMethod = this.#memoMethod; + if (!memoMethod) { + throw new Error('no memoMethod provided to constructor'); + } + const { context, status, forceRefresh, ...options } = memoOptions; + if (status && forceRefresh) + status.forceRefresh = true; + const v = this.#get(k, options); + const refresh = forceRefresh || v === undefined; + if (status) { + status.memo = refresh ? 'miss' : 'hit'; + if (!refresh) + status.value = v; + } + if (!refresh) + return v; + const vv = memoMethod(k, v, { + options, + context, + }); + if (status) + status.value = vv; + this.#set(k, vv, options); + return vv; + } + /** + * Return a value from the cache. Will update the recency of the cache + * entry found. + * + * If the key is not found, get() will return `undefined`. + */ + get(k, getOptions = {}) { + const { status = metrics.hasSubscribers ? {} : undefined } = getOptions; + getOptions.status = status; + if (status) { + status.op = 'get'; + status.key = k; + status.cache = this; + } + const result = this.#get(k, getOptions); + if (status) { + if (result !== undefined) + status.value = result; + if (metrics.hasSubscribers) + metrics.publish(status); + } + return result; + } + #get(k, getOptions = {}) { + const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions; + const index = this.#keyMap.get(k); + if (index === undefined) { + if (status) + status.get = 'miss'; + return undefined; + } + const value = this.#valList[index]; + const fetching = this.#isBackgroundFetch(value); + if (status) + this.#statusTTL(status, index); + if (this.#isStale(index)) { + // delete only if not an in-flight background fetch + if (!fetching) { + if (!noDeleteOnStaleGet) { + this.#delete(k, 'expire'); + } + if (status) + status.get = 'stale'; + if (allowStale) { + if (status) + status.returnedStale = true; + return value; + } + return undefined; + } + if (status) + status.get = 'stale-fetching'; + if (allowStale && value.__staleWhileFetching !== undefined) { + if (status) + status.returnedStale = true; + return value.__staleWhileFetching; + } + return undefined; + } + // not stale + if (status) + status.get = fetching ? 'fetching' : 'hit'; + // if we're currently fetching it, we don't actually have it yet + // it's not stale, which means this isn't a staleWhileRefetching. + // If it's not stale, and fetching, AND has a __staleWhileFetching + // value, then that means the user fetched with {forceRefresh:true}, + // so it's safe to return that value. + this.#moveToTail(index); + if (updateAgeOnGet) { + this.#updateItemAge(index); + } + return fetching ? value.__staleWhileFetching : value; + } + #connect(p, n) { + this.#prev[n] = p; + this.#next[p] = n; + } + #moveToTail(index) { + // if tail already, nothing to do + // if head, move head to next[index] + // else + // move next[prev[index]] to next[index] (head has no prev) + // move prev[next[index]] to prev[index] + // prev[index] = tail + // next[tail] = index + // tail = index + if (index !== this.#tail) { + if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + this.#connect(this.#prev[index], this.#next[index]); + } + this.#connect(this.#tail, index); + this.#tail = index; + } + } + /** + * Deletes a key out of the cache. + * + * Returns true if the key was deleted, false otherwise. + */ + delete(k) { + return this.#delete(k, 'delete'); + } + #delete(k, reason) { + if (metrics.hasSubscribers) { + metrics.publish({ + op: 'delete', + delete: reason, + key: k, + cache: this, + }); + } + let deleted = false; + if (this.#size !== 0) { + const index = this.#keyMap.get(k); + if (index !== undefined) { + if (this.#autopurgeTimers?.[index]) { + clearTimeout(this.#autopurgeTimers?.[index]); + this.#autopurgeTimers[index] = undefined; + } + deleted = true; + if (this.#size === 1) { + this.#clear(reason); + } + else { + this.#removeItemSize(index); + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else if (this.#hasDispose || this.#hasDisposeAfter) { + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + this.#keyMap.delete(k); + this.#keyList[index] = undefined; + this.#valList[index] = undefined; + if (index === this.#tail) { + this.#tail = this.#prev[index]; + } + else if (index === this.#head) { + this.#head = this.#next[index]; + } + else { + const pi = this.#prev[index]; + this.#next[pi] = this.#next[index]; + const ni = this.#next[index]; + this.#prev[ni] = this.#prev[index]; + } + this.#size--; + this.#free.push(index); + } + } + } + if (this.#hasDisposeAfter && this.#disposed?.length) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + return deleted; + } + /** + * Clear the cache entirely, throwing away all values. + */ + clear() { + return this.#clear('delete'); + } + #clear(reason) { + for (const index of this.#rindexes({ allowStale: true })) { + const v = this.#valList[index]; + if (this.#isBackgroundFetch(v)) { + v.__abortController.abort(new Error('deleted')); + } + else { + const k = this.#keyList[index]; + if (this.#hasDispose) { + this.#dispose?.(v, k, reason); + } + if (this.#hasDisposeAfter) { + this.#disposed?.push([v, k, reason]); + } + } + } + this.#keyMap.clear(); + void this.#valList.fill(undefined); + this.#keyList.fill(undefined); + if (this.#ttls && this.#starts) { + this.#ttls.fill(0); + this.#starts.fill(0); + for (const t of this.#autopurgeTimers ?? []) { + if (t !== undefined) + clearTimeout(t); + } + this.#autopurgeTimers?.fill(undefined); + } + if (this.#sizes) { + this.#sizes.fill(0); + } + this.#head = 0; + this.#tail = 0; + this.#free.length = 0; + this.#calculatedSize = 0; + this.#size = 0; + if (this.#hasDisposeAfter && this.#disposed) { + const dt = this.#disposed; + let task; + while ((task = dt?.shift())) { + this.#disposeAfter?.(...task); + } + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/index.js.map b/node_modules/lru-cache/dist/esm/node/index.js.map new file mode 100644 index 00000000..ab79a6c1 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings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,CAAC,CAAA;QACxC,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACrB,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,CAAU,CAAA;QACvB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;QACd,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAA;YACzB,IAAI,IAAmC,CAAA;YACvC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/index.min.js b/node_modules/lru-cache/dist/esm/node/index.min.js new file mode 100644 index 00000000..84c4c3ec --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/index.min.js @@ -0,0 +1,2 @@ +import{tracingChannel as G,channel as P}from"node:diagnostics_channel";var S=P("lru-cache:metrics"),W=G("lru-cache");var L=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date;var D=()=>S.hasSubscribers||W.hasSubscribers,U=new Set,M=typeof process=="object"&&process?process:{},k=(u,e,t,i)=>{typeof M.emitWarning=="function"?M.emitWarning(u,e,t,i):console.error(`[${t}] ${e}: ${u}`)},H=u=>!U.has(u);var T=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),j=u=>T(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(e){super(e),this.fill(0)}},R=class u{heap;length;static#o=!1;static create(e){let t=j(e);if(!t)return[];u.#o=!0;let i=new u(e,t);return u.#o=!1,i}constructor(e,t){if(!u.#o)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},I=class u{#o;#c;#S;#O;#w;#M;#I;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#n;#b;#s;#i;#t;#l;#u;#a;#h;#y;#r;#_;#F;#d;#g;#T;#U;#f;#x;static unsafeExposeInternals(e){return{starts:e.#F,ttls:e.#d,autopurgeTimers:e.#g,sizes:e.#_,keyMap:e.#s,keyList:e.#i,valList:e.#t,next:e.#l,prev:e.#u,get head(){return e.#a},get tail(){return e.#h},free:e.#y,isBackgroundFetch:t=>e.#e(t),backgroundFetch:(t,i,s,n)=>e.#P(t,i,s,n),moveToTail:t=>e.#L(t),indexes:t=>e.#A(t),rindexes:t=>e.#z(t),isStale:t=>e.#p(t)}}get max(){return this.#o}get maxSize(){return this.#c}get calculatedSize(){return this.#b}get size(){return this.#n}get fetchMethod(){return this.#M}get memoMethod(){return this.#I}get dispose(){return this.#S}get onInsert(){return this.#O}get disposeAfter(){return this.#w}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:h,allowStale:a,dispose:o,onInsert:d,disposeAfter:y,noDisposeOnSet:_,noUpdateTTL:c,maxSize:g=0,maxEntrySize:f=0,sizeCalculation:b,fetchMethod:l,memoMethod:w,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:m,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:A,ignoreFetchAbort:z,backgroundFetchSize:C=1,perf:E}=e;if(this.backgroundFetchSize=C,E!==void 0&&typeof E?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=E??L,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let v=t?j(t):Array;if(!v)throw new Error("invalid max value: "+t);if(this.#o=t,this.#c=g,this.maxEntrySize=f||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=w,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#M=l,this.#U=!!l,this.#s=new Map,this.#i=Array.from({length:t}).fill(void 0),this.#t=Array.from({length:t}).fill(void 0),this.#l=new v(t),this.#u=new v(t),this.#a=0,this.#h=0,this.#y=R.create(t),this.#n=0,this.#b=0,typeof o=="function"&&(this.#S=o),typeof d=="function"&&(this.#O=d),typeof y=="function"?(this.#w=y,this.#r=[]):(this.#w=void 0,this.#r=void 0),this.#T=!!this.#S,this.#x=!!this.#O,this.#f=!!this.#w,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!c,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!z,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#X()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!m,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!h,this.ttlResolution=T(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#o===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#o&&!this.#c){let x="LRU_CACHE_UNBOUNDED";H(x)&&(U.add(x),k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,u))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#k(){let e=new O(this.#o),t=new O(this.#o);this.#d=e,this.#F=t;let i=this.ttlAutopurge?Array.from({length:this.#o}):void 0;this.#g=i,this.#H=(h,a,o=this.#m.now())=>{t[h]=a!==0?o:0,e[h]=a,s(h,a)},this.#D=h=>{t[h]=e[h]!==0?this.#m.now():0,s(h,e[h])};let s=this.ttlAutopurge?(h,a)=>{if(i?.[h]&&(clearTimeout(i[h]),i[h]=void 0),a&&a!==0&&i){let o=setTimeout(()=>{this.#p(h)&&this.#E(this.#i[h],"expire")},a+1);o.unref&&o.unref(),i[h]=o}}:()=>{};this.#v=(h,a)=>{if(e[a]){let o=e[a],d=t[a];if(!o||!d)return;h.ttl=o,h.start=d,h.now=n||r();let y=h.now-d;h.remainingTTL=o-y}};let n=0,r=()=>{let h=this.#m.now();if(this.ttlResolution>0){n=h;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return h};this.getRemainingTTL=h=>{let a=this.#s.get(h);if(a===void 0)return 0;let o=e[a],d=t[a];if(!o||!d)return 1/0;let y=(n||r())-d;return o-y},this.#p=h=>{let a=t[h],o=e[h];return!!o&&!!a&&(n||r())-a>o}}#D=()=>{};#v=()=>{};#H=()=>{};#p=()=>!1;#X(){let e=new O(this.#o);this.#b=0,this.#_=e,this.#R=t=>{this.#b-=e[t],e[t]=0},this.#N=(t,i,s,n)=>{if(!T(s)){if(this.#e(i))return this.backgroundFetchSize;if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#j=(t,i,s)=>{if(e[t]=i,this.#c){let n=this.#c-e[t];for(;this.#b>n;)this.#G(!0)}this.#b+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b)}}#R=e=>{};#j=(e,t,i)=>{};#N=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#h;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#a);)t=this.#u[t]}*#z({allowStale:e=this.allowStale}={}){if(this.#n)for(let t=this.#a;this.#V(t)&&((e||!this.#p(t))&&(yield t),t!==this.#h);)t=this.#l[t]}#V(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#A())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*rentries(){for(let e of this.#z())this.#t[e]!==void 0&&this.#i[e]!==void 0&&!this.#e(this.#t[e])&&(yield[this.#i[e],this.#t[e]])}*keys(){for(let e of this.#A()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*rkeys(){for(let e of this.#z()){let t=this.#i[e];t!==void 0&&!this.#e(this.#t[e])&&(yield t)}}*values(){for(let e of this.#A())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}*rvalues(){for(let e of this.#z())this.#t[e]!==void 0&&!this.#e(this.#t[e])&&(yield this.#t[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#i[i],this))return this.#C(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#z()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#z({allowStale:!0}))this.#p(t)&&(this.#E(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#t[t],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#d&&this.#F){let r=this.#d[t],h=this.#F[t];if(r&&h){let a=r-(this.#m.now()-h);n.ttl=a,n.start=Date.now()}}return this.#_&&(n.size=this.#_[t]),n}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let i=this.#i[t],s=this.#t[t],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#F){r.ttl=this.#d[t];let h=this.#m.now()-this.#F[t];r.start=Math.floor(Date.now()-h)}this.#_&&(r.size=this.#_[t]),e.unshift([i,r])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=this.#m.now()-s}this.#W(t,i.value,i)}}set(e,t,i={}){let{status:s=S.hasSubscribers?{}:void 0}=i;i.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let n=this.#W(e,t,i);return s&&S.hasSubscribers&&S.publish(s),n}#W(e,t,i,s){let{ttl:n=this.ttl,start:r,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,d=this.#e(t);if(t===void 0)return o&&(o.set="deleted"),this.delete(e),this;let{noUpdateTTL:y=this.noUpdateTTL}=i;o&&!d&&(o.value=t);let _=this.#N(e,t,i.size||0,a,o);if(this.maxEntrySize&&_>this.maxEntrySize)return this.#E(e,"set"),o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this;let c=this.#n===0?void 0:this.#s.get(e);if(c===void 0)c=this.#n===0?this.#h:this.#y.length!==0?this.#y.pop():this.#n===this.#o?this.#G(!1):this.#n,this.#i[c]=e,this.#t[c]=t,this.#s.set(e,c),this.#l[this.#h]=c,this.#u[c]=this.#h,this.#h=c,this.#n++,this.#j(c,_,o),o&&(o.set="add"),y=!1,this.#x&&!d&&this.#O?.(t,e,"add");else{this.#L(c);let g=this.#t[c];if(t!==g){if(!h)if(this.#e(g)){g!==s&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&f!==t&&(this.#T&&this.#S?.(f,e,"set"),this.#f&&this.#r?.push([f,e,"set"]))}else this.#T&&this.#S?.(g,e,"set"),this.#f&&this.#r?.push([g,e,"set"]);if(this.#R(c),this.#j(c,_,o),this.#t[c]=t,!d){let f=g&&this.#e(g)?g.__staleWhileFetching:g,b=f===void 0?"add":t!==f?"replace":"update";o&&(o.set=b,f!==void 0&&(o.oldValue=f)),this.#x&&this.onInsert?.(t,e,b)}}else d||(o&&(o.set="update"),this.#x&&this.onInsert?.(t,e,"update"))}if(n!==0&&!this.#d&&this.#k(),this.#d&&(y||this.#H(c,n,r),o&&this.#v(o,c)),!h&&this.#f&&this.#r){let g=this.#r,f;for(;f=g?.shift();)this.#w?.(...f)}return this}pop(){try{for(;this.#n;){let e=this.#t[this.#a];if(this.#G(!0),this.#e(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#f&&this.#r){let e=this.#r,t;for(;t=e?.shift();)this.#w?.(...t)}}}#G(e){let t=this.#a,i=this.#i[t],s=this.#t[t],n=this.#e(s);n&&s.__abortController.abort(new Error("evicted"));let r=n?s.__staleWhileFetching:s;return(this.#T||this.#f)&&r!==void 0&&(this.#T&&this.#S?.(r,i,"evict"),this.#f&&this.#r?.push([r,i,"evict"])),this.#R(t),this.#g?.[t]&&(clearTimeout(this.#g[t]),this.#g[t]=void 0),e&&(this.#i[t]=void 0,this.#t[t]=void 0,this.#y.push(t)),this.#n===1?(this.#a=this.#h=0,this.#y.length=0):this.#a=this.#l[t],this.#s.delete(i),this.#n--,t}has(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let s=this.#Y(e,t);return S.hasSubscribers&&S.publish(i),s}#Y(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=this.#s.get(e);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return!1;if(this.#p(n))s&&(s.has="stale",this.#v(s,n));else return i&&this.#D(n),s&&(s.has="hit",this.#v(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:i=D()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let s=this.#J(e,t);return S.hasSubscribers&&S.publish(i),s}#J(e,t){let{status:i,allowStale:s=this.allowStale}=t,n=this.#s.get(e);if(n===void 0||!s&&this.#p(n)){i&&(i.peek=n===void 0?"miss":"stale");return}let r=this.#t[n],h=this.#e(r)?r.__staleWhileFetching:r;return i&&(h!==void 0?(i.peek="hit",i.value=h):i.peek="miss"),h}#P(e,t,i,s){let n=t===void 0?void 0:this.#t[t];if(this.#e(n))return n;let r=new AbortController,{signal:h}=i;h?.addEventListener("abort",()=>r.abort(h.reason),{signal:r.signal});let a={signal:r.signal,options:i,context:s},o=(f,b=!1)=>{let{aborted:l}=r.signal,w=i.ignoreFetchAbort&&f!==void 0,F=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&f!==void 0);if(i.status&&(l&&!b?(i.status.fetchAborted=!0,i.status.fetchError=r.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!w&&!b)return y(r.signal.reason,F);let m=c,p=this.#t[t];return(p===c||p===void 0&&w&&b)&&(f===void 0?m.__staleWhileFetching!==void 0?this.#t[t]=m.__staleWhileFetching:this.#E(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#W(e,f,a.options,m))),f},d=f=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=f),y(f,!1)),y=(f,b)=>{let{aborted:l}=r.signal,w=l&&i.allowStaleOnFetchAbort,F=w||i.allowStaleOnFetchRejection,m=F||i.noDeleteOnFetchRejection,p=c;if(this.#t[t]===c&&(!m||!b&&p.__staleWhileFetching===void 0?this.#E(e,"fetch"):w||(this.#t[t]=p.__staleWhileFetching)),F)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw f},_=(f,b)=>{let l=this.#M?.(e,n,a);r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(f(void 0),i.allowStaleOnFetchAbort&&(f=w=>o(w,!0)))}),l&&l instanceof Promise?l.then(w=>f(w===void 0?void 0:w),b):l!==void 0&&f(l)};i.status&&(i.status.fetchDispatched=!0);let c=new Promise(_).then(o,d),g=Object.assign(c,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.#W(e,g,{...a.options,status:void 0}),t=this.#s.get(e)):this.#t[t]=g,g}#e(e){if(!this.#U)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=W.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#B(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#B(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:y=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:_=this.allowStaleOnFetchRejection,ignoreFetchAbort:c=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:f,forceRefresh:b=!1,status:l,signal:w}=t;if(l&&(l.op="fetch",l.key=e,b&&(l.forceRefresh=!0),l.cache=this),!this.#U)return l&&(l.fetch="get"),this.#C(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let F={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:h,size:a,sizeCalculation:o,noUpdateTTL:d,noDeleteOnFetchRejection:y,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:g,ignoreFetchAbort:c,status:l,signal:w},m=this.#s.get(e);if(m===void 0){l&&(l.fetch="miss");let p=this.#P(e,m,F,f);return p.__returned=p}else{let p=this.#t[m];if(this.#e(p)){let v=i&&p.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",v&&(l.returnedStale=!0)),v?p.__staleWhileFetching:p.__returned=p}let A=this.#p(m);if(!b&&!A)return l&&(l.fetch="hit"),this.#L(m),s&&this.#D(m),l&&this.#v(l,m),p;let z=this.#P(e,m,F,f),E=z.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=A?"stale":"refresh",E&&A&&(l.returnedStale=!0)),E?z.__staleWhileFetching:z.__returned=z}}forceFetch(e,t={}){let i=W.hasSubscribers,{status:s=D()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let n=this.#K(e,t);return s&&i&&(s.trace=!0,W.tracePromise(()=>n,s).catch(()=>{})),n}async#K(e,t={}){let i=await this.#B(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let s=this.#Q(e,t);return i&&(i.value=s),S.hasSubscribers&&S.publish(i),s}#Q(e,t={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,status:n,forceRefresh:r,...h}=t;n&&r&&(n.forceRefresh=!0);let a=this.#C(e,h),o=r||a===void 0;if(n&&(n.memo=o?"miss":"hit",o||(n.value=a)),!o)return a;let d=i(e,a,{options:h,context:s});return n&&(n.value=d),this.#W(e,d,h),d}get(e,t={}){let{status:i=S.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let s=this.#C(e,t);return i&&(s!==void 0&&(i.value=s),S.hasSubscribers&&S.publish(i)),s}#C(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=t,h=this.#s.get(e);if(h===void 0){r&&(r.get="miss");return}let a=this.#t[h],o=this.#e(a);return r&&this.#v(r,h),this.#p(h)?o?(r&&(r.get="stale-fetching"),i&&a.__staleWhileFetching!==void 0?(r&&(r.returnedStale=!0),a.__staleWhileFetching):void 0):(n||this.#E(e,"expire"),r&&(r.get="stale"),i?(r&&(r.returnedStale=!0),a):void 0):(r&&(r.get=o?"fetching":"hit"),this.#L(h),s&&this.#D(h),o?a.__staleWhileFetching:a)}#$(e,t){this.#u[t]=e,this.#l[e]=t}#L(e){e!==this.#h&&(e===this.#a?this.#a=this.#l[e]:this.#$(this.#u[e],this.#l[e]),this.#$(this.#h,e),this.#h=e)}delete(e){return this.#E(e,"delete")}#E(e,t){S.hasSubscribers&&S.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#n!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#g?.[s]&&(clearTimeout(this.#g?.[s]),this.#g[s]=void 0),i=!0,this.#n===1)this.#q(t);else{this.#R(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#T||this.#f)&&(this.#T&&this.#S?.(n,e,t),this.#f&&this.#r?.push([n,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#h)this.#h=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{let r=this.#u[s];this.#l[r]=this.#l[s];let h=this.#l[s];this.#u[h]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#r?.length){let s=this.#r,n;for(;n=s?.shift();)this.#w?.(...n)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#z({allowStale:!0})){let i=this.#t[t];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#i[t];this.#T&&this.#S?.(i,s,e),this.#f&&this.#r?.push([i,s,e])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#F){this.#d.fill(0),this.#F.fill(0);for(let t of this.#g??[])t!==void 0&&clearTimeout(t);this.#g?.fill(void 0)}if(this.#_&&this.#_.fill(0),this.#a=0,this.#h=0,this.#y.length=0,this.#b=0,this.#n=0,this.#f&&this.#r){let t=this.#r,i;for(;i=t?.shift();)this.#w?.(...i)}}};export{I as LRUCache}; +//# sourceMappingURL=index.min.js.map diff --git a/node_modules/lru-cache/dist/esm/node/index.min.js.map b/node_modules/lru-cache/dist/esm/node/index.min.js.map new file mode 100644 index 00000000..76a87846 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/index.min.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../../src/diagnostics-channel-node.ts", "../../../src/perf.ts", "../../../src/index.ts"], + "sourcesContent": ["// simple node version that imports from node builtin\n// this is built to both ESM and CommonJS on the 'node' import path\nimport { tracingChannel, channel } from 'node:diagnostics_channel'\nimport type { TracingChannel, Channel } from 'node:diagnostics_channel'\nexport type { TracingChannel, Channel }\nexport const metrics: Channel = channel('lru-cache:metrics')\nexport const tracing: TracingChannel = tracingChannel('lru-cache')\n", "/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n", "/**\n * @module LRUCache\n */\n\nimport { metrics, tracing } from './diagnostics-channel.js'\nimport { defaultPerf } from './perf.js'\nimport type { Perf } from './perf.js'\nexport type { Perf } from './perf.js'\n\nconst hasSubscribers = () =>\n metrics.hasSubscribers || tracing.hasSubscribers\n\nconst warned = new Set()\n\n// either a function or a class\n// oxlint-disable-next-line no-explicit-any\ntype ForC = ((...a: any[]) => any) | { new (...a: any[]): any }\n\n/* c8 ignore start */\nconst PROCESS = (\n typeof process === 'object' && !!process ?\n process\n : {}) as { [k: string]: unknown }\n/* c8 ignore stop */\n\nconst emitWarning = (\n msg: string,\n type: string,\n code: string,\n fn: ForC,\n) => {\n if (typeof PROCESS.emitWarning === 'function') {\n PROCESS.emitWarning(msg, type, code, fn)\n } else {\n //oxlint-disable-next-line no-console\n console.error(`[${code}] ${type}: ${msg}`)\n }\n}\nconst shouldWarn = (code: string) => !warned.has(code)\n\nconst TYPE = Symbol('type')\nexport type PosInt = number & { [TYPE]: 'Positive Integer' }\nexport type Index = number & { [TYPE]: 'LRUCache Index' }\n\nconst isPosInt = (n: unknown): n is PosInt =>\n !!n && n === Math.floor(n as number) && n > 0 && isFinite(n)\n\nexport type UintArray = Uint8Array | Uint16Array | Uint32Array\nexport type NumberArray = UintArray | number[]\n\n// This is a little bit ridiculous, tbh.\n// The maximum array length is 2^32-1 or thereabouts on most JS impls.\n// And well before that point, you're caching the entire world, I mean,\n// that's ~32GB of just integers for the next/prev links, plus whatever\n// else to hold that many keys and values. Just filling the memory with\n// zeroes at init time is brutal when you get that big.\n// But why not be complete?\n// Maybe in the future, these limits will have expanded.\n/* c8 ignore start */\nconst getUintArray = (max: number) =>\n !isPosInt(max) ? null\n : max <= Math.pow(2, 8) ? Uint8Array\n : max <= Math.pow(2, 16) ? Uint16Array\n : max <= Math.pow(2, 32) ? Uint32Array\n : max <= Number.MAX_SAFE_INTEGER ? ZeroArray\n : null\n/* c8 ignore stop */\n\nclass ZeroArray extends Array {\n constructor(size: number) {\n super(size)\n this.fill(0)\n }\n}\nexport type { ZeroArray }\nexport type { Stack }\n\nexport type StackLike = Stack | Index[]\nclass Stack {\n /* c8 ignore start - not sure why this is showing up uncovered?? */\n heap: NumberArray\n /* c8 ignore stop */\n length: number\n // private constructor\n static #constructing: boolean = false\n static create(max: number): StackLike {\n const HeapCls = getUintArray(max)\n if (!HeapCls) return []\n Stack.#constructing = true\n const s = new Stack(max, HeapCls)\n Stack.#constructing = false\n return s\n }\n constructor(max: number, HeapCls: { new (n: number): NumberArray }) {\n /* c8 ignore start */\n if (!Stack.#constructing) {\n throw new TypeError('instantiate Stack using Stack.create(n)')\n }\n /* c8 ignore stop */\n this.heap = new HeapCls(max)\n this.length = 0\n }\n push(n: Index) {\n this.heap[this.length++] = n\n }\n pop(): Index {\n return this.heap[--this.length] as Index\n }\n}\n\n/**\n * Promise representing an in-progress {@link LRUCache#fetch} call\n */\nexport type BackgroundFetch = Promise & {\n __returned: BackgroundFetch | undefined\n __abortController: AbortController\n __staleWhileFetching: V | undefined\n}\n\nexport type DisposeTask = [\n value: V,\n key: K,\n reason: LRUCache.DisposeReason,\n]\n\nexport namespace LRUCache {\n /**\n * An integer greater than 0, reflecting the calculated size of items\n */\n export type Size = number\n\n /**\n * Integer greater than 0, representing some number of milliseconds, or the\n * time at which a TTL started counting from.\n */\n export type Milliseconds = number\n\n /**\n * An integer greater than 0, reflecting a number of items\n */\n export type Count = number\n\n /**\n * The reason why an item was removed from the cache, passed\n * to the {@link Disposer} methods.\n *\n * - `evict`: The item was evicted because it is the least recently used,\n * and the cache is full.\n * - `set`: A new value was set, overwriting the old value being disposed.\n * - `delete`: The item was explicitly deleted, either by calling\n * {@link LRUCache#delete}, {@link LRUCache#clear}, or\n * {@link LRUCache#set} with an undefined value.\n * - `expire`: The item was removed due to exceeding its TTL.\n * - `fetch`: A {@link OptionsBase#fetchMethod} operation returned\n * `undefined` or was aborted, causing the item to be deleted.\n */\n export type DisposeReason =\n | 'evict'\n | 'set'\n | 'delete'\n | 'expire'\n | 'fetch'\n /**\n * A method called upon item removal, passed as the\n * {@link OptionsBase.dispose} and/or\n * {@link OptionsBase.disposeAfter} options.\n */\n export type Disposer = (\n value: V,\n key: K,\n reason: DisposeReason,\n ) => void\n\n /**\n * The reason why an item was added to the cache, passed\n * to the {@link Inserter} methods.\n *\n * - `add`: the item was not found in the cache, and was added\n * - `update`: the item was in the cache, with the same value provided\n * - `replace`: the item was in the cache, and replaced\n */\n export type InsertReason = 'add' | 'update' | 'replace'\n\n /**\n * A method called upon item insertion, passed as the\n * {@link OptionsBase.insert}\n */\n export type Inserter = (\n value: V,\n key: K,\n reason: InsertReason,\n ) => void\n\n /**\n * A function that returns the effective calculated size\n * of an entry in the cache.\n */\n export type SizeCalculator = (value: V, key: K) => Size\n\n /**\n * Options provided to the\n * {@link OptionsBase.fetchMethod} function.\n */\n export interface FetcherOptions {\n signal: AbortSignal\n options: FetcherFetchOptions\n /**\n * Object provided in the {@link FetchOptions.context} option to\n * {@link LRUCache#fetch}\n */\n context: FC\n }\n\n /**\n * Occasionally, it may be useful to track the internal behavior of the\n * cache, particularly for logging, debugging, or for behavior within the\n * `fetchMethod`. To do this, you can pass a `status` object to the\n * {@link LRUCache#fetch}, {@link LRUCache#get}, {@link LRUCache#set},\n * {@link LRUCache#memo}, and {@link LRUCache#has} methods.\n *\n * The `status` option should be a plain JavaScript object. The following\n * fields will be set on it appropriately, depending on the situation.\n *\n * These objects are also the context objects passed to listeners on the\n * `lru-cache:metrics` diagnostic channel, and the `lru-cache` tracing\n * channels, in platforms that support them.\n */\n export interface Status {\n /**\n * The operation being performed\n */\n op?: 'get' | 'set' | 'memo' | 'fetch' | 'delete' | 'has' | 'peek'\n /**\n * The status of a set() operation.\n *\n * - add: the item was not found in the cache, and was added\n * - update: the item was in the cache, with the same value provided\n * - replace: the item was in the cache, and replaced\n * - miss: the item was not added to the cache for some reason\n */\n set?: 'add' | 'update' | 'replace' | 'miss' | 'deleted'\n\n /**\n * The status of a delete() operation.\n */\n delete?: LRUCache.DisposeReason\n\n /**\n * The result of a peek() operation\n *\n * - hit: the item was found and returned\n * - stale: the item is in the cache, but past its ttl and not returned\n * - miss: item not in the cache\n */\n peek?: 'hit' | 'miss' | 'stale'\n\n /**\n * The status of a memo() operation.\n *\n * - 'hit': the item was found in the cache and returned\n * - 'miss': the `memoMethod` function was called\n */\n memo?: 'hit' | 'miss'\n\n /**\n * The `context` option provided to a memo or fetch operation\n *\n * In practice, of course, this will be the same type as the `FC`\n * fetch context param used to instantiate the LRUCache, but the\n * convolutions of threading that through would get quite complicated,\n * and preclude forcing/forbidding the passing of a `context` param\n * where it is/isn't expected, which is more valuable for error\n * prevention.\n */\n context?: unknown\n\n /**\n * the ttl stored for the item, or undefined if ttls are not used.\n */\n ttl?: Milliseconds\n\n /**\n * the start time for the item, or undefined if ttls are not used.\n */\n start?: Milliseconds\n\n /**\n * The timestamp used for TTL calculation\n */\n now?: Milliseconds\n\n /**\n * the remaining ttl for the item, or undefined if ttls are not used.\n */\n remainingTTL?: Milliseconds\n\n /**\n * The calculated size for the item, if sizes are used.\n */\n entrySize?: Size\n\n /**\n * The total calculated size of the cache, if sizes are used.\n */\n totalCalculatedSize?: Size\n\n /**\n * A flag indicating that the item was not stored, due to exceeding the\n * {@link OptionsBase.maxEntrySize}\n */\n maxEntrySizeExceeded?: true\n\n /**\n * The key that was set or retrieved\n */\n key?: K\n\n /**\n * The value that was set\n */\n value?: V\n\n /**\n * The old value, specified in the case of `set:'replace'`\n */\n oldValue?: V\n\n /**\n * The results of a {@link LRUCache#has} operation\n *\n * - hit: the item was found in the cache\n * - stale: the item was found in the cache, but is stale\n * - miss: the item was not found in the cache\n */\n has?: 'hit' | 'stale' | 'miss'\n\n /**\n * The status of a {@link LRUCache#fetch} operation.\n * Note that this can change as the underlying fetch() moves through\n * various states.\n *\n * - inflight: there is another fetch() for this key which is in process\n * - get: there is no {@link OptionsBase.fetchMethod}, so\n * {@link LRUCache#get} was called.\n * - miss: the item is not in cache, and will be fetched.\n * - hit: the item is in the cache, and was resolved immediately.\n * - stale: the item is in the cache, but stale.\n * - refresh: the item is in the cache, and not stale, but\n * {@link FetchOptions.forceRefresh} was specified.\n */\n fetch?: 'get' | 'inflight' | 'miss' | 'hit' | 'stale' | 'refresh'\n\n /**\n * `forceRefresh` option was used for either a fetch or memo operation\n */\n forceRefresh?: boolean\n\n /**\n * The {@link OptionsBase.fetchMethod} was called\n */\n fetchDispatched?: true\n\n /**\n * The cached value was updated after a successful call to\n * {@link OptionsBase.fetchMethod}\n */\n fetchUpdated?: true\n\n /**\n * The reason for a fetch() rejection. Either the error raised by the\n * {@link OptionsBase.fetchMethod}, or the reason for an\n * AbortSignal.\n */\n fetchError?: Error\n\n /**\n * The fetch received an abort signal\n */\n fetchAborted?: true\n\n /**\n * The abort signal received was ignored, and the fetch was allowed to\n * continue in the background.\n */\n fetchAbortIgnored?: true\n\n /**\n * The fetchMethod promise resolved successfully\n */\n fetchResolved?: true\n\n /**\n * The fetchMethod promise was rejected\n */\n fetchRejected?: true\n\n /**\n * The status of a {@link LRUCache#get} operation.\n *\n * - fetching: The item is currently being fetched. If a previous value\n * is present and allowed, that will be returned.\n * - stale: The item is in the cache, and is stale. If it was returned,\n * then the `returnedStale` flag will be set.\n * - stale-fetching: The value is being fetched in the background, but is\n * currently stale. If the stale value was returned, then the\n * `returnedStale` flag will be set.\n * - hit: the item is in the cache\n * - miss: the item is not in the cache\n */\n get?: 'stale' | 'hit' | 'miss' | 'fetching' | 'stale-fetching'\n\n /**\n * A fetch or get operation returned a stale value.\n */\n returnedStale?: true\n\n /**\n * A tracingChannel trace was started for this operation\n */\n trace?: boolean\n\n /**\n * A reference to the cache instance associated with this operation\n */\n cache?: LRUCache\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#fetch}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link OptionsBase.noDeleteOnFetchRejection},\n * {@link OptionsBase.allowStaleOnFetchRejection},\n * {@link FetchOptions.forceRefresh}, and\n * {@link FetcherOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.fetchMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the fetchMethod is called.\n */\n export interface FetcherFetchOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n status?: Status\n size?: Size\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#fetch} method.\n */\n export interface FetchOptions extends FetcherFetchOptions<\n K,\n V,\n FC\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.fetchMethod} as\n * the {@link FetcherOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n signal?: AbortSignal\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface FetchOptionsWithContext extends FetchOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#fetch} when the FC type is\n * `undefined` or `void`\n */\n export interface FetchOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends FetchOptions {\n context?: FC\n }\n\n export interface MemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n | 'noDeleteOnFetchRejection'\n | 'allowStaleOnFetchRejection'\n | 'ignoreFetchAbort'\n | 'allowStaleOnFetchAbort'\n > {\n /**\n * Set to true to force a re-load of the existing data, even if it\n * is not yet stale.\n */\n forceRefresh?: boolean\n /**\n * Context provided to the {@link OptionsBase.memoMethod} as\n * the {@link MemoizerOptions.context} param.\n *\n * If the FC type is specified as unknown (the default),\n * undefined or void, then this is optional. Otherwise, it will\n * be required.\n */\n context?: FC\n status?: Status\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is something\n * other than `unknown`, `undefined`, or `void`\n */\n export interface MemoOptionsWithContext extends MemoOptions<\n K,\n V,\n FC\n > {\n context: FC\n }\n /**\n * Options provided to {@link LRUCache#memo} when the FC type is\n * `undefined` or `void`\n */\n export interface MemoOptionsNoContext<\n K,\n V,\n FC extends undefined | void = undefined,\n > extends MemoOptions {\n context?: FC\n }\n\n /**\n * Options provided to the\n * {@link OptionsBase.memoMethod} function.\n */\n export interface MemoizerOptions {\n options: MemoizerMemoOptions\n /**\n * Object provided in the {@link MemoOptions.context} option to\n * {@link LRUCache#memo}\n */\n context: FC\n }\n\n /**\n * options which override the options set in the LRUCache constructor\n * when calling {@link LRUCache#memo}.\n *\n * This is the union of {@link GetOptions} and {@link SetOptions}, plus\n * {@link MemoOptions.forceRefresh}, and\n * {@link MemoOptions.context}\n *\n * Any of these may be modified in the {@link OptionsBase.memoMethod}\n * function, but the {@link GetOptions} fields will of course have no\n * effect, as the {@link LRUCache#get} call already happened by the time\n * the memoMethod is called.\n */\n export interface MemoizerMemoOptions extends Pick<\n OptionsBase,\n | 'allowStale'\n | 'updateAgeOnGet'\n | 'noDeleteOnStaleGet'\n | 'sizeCalculation'\n | 'ttl'\n | 'noDisposeOnSet'\n | 'noUpdateTTL'\n > {\n status?: Status\n size?: Size\n start?: Milliseconds\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#has} method.\n */\n export interface HasOptions extends Pick<\n OptionsBase,\n 'updateAgeOnHas'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#get} method.\n */\n export interface GetOptions extends Pick<\n OptionsBase,\n 'allowStale' | 'updateAgeOnGet' | 'noDeleteOnStaleGet'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#peek} method.\n */\n export interface PeekOptions extends Pick<\n OptionsBase,\n 'allowStale'\n > {\n status?: Status\n }\n\n /**\n * Options that may be passed to the {@link LRUCache#set} method.\n */\n export interface SetOptions extends Pick<\n OptionsBase,\n 'sizeCalculation' | 'ttl' | 'noDisposeOnSet' | 'noUpdateTTL'\n > {\n /**\n * If size tracking is enabled, then setting an explicit size\n * in the {@link LRUCache#set} call will prevent calling the\n * {@link OptionsBase.sizeCalculation} function.\n */\n size?: Size\n /**\n * If TTL tracking is enabled, then setting an explicit start\n * time in the {@link LRUCache#set} call will override the\n * default time from `performance.now()` or `Date.now()`.\n *\n * Note that it must be a valid value for whichever time-tracking\n * method is in use.\n */\n start?: Milliseconds\n status?: Status\n }\n\n /**\n * The type signature for the {@link OptionsBase.fetchMethod} option.\n */\n export type Fetcher = (\n key: K,\n staleValue: V | undefined,\n options: FetcherOptions,\n ) => Promise | V | undefined | void\n\n /**\n * the type signature for the {@link OptionsBase.memoMethod} option.\n */\n export type Memoizer = (\n key: K,\n staleValue: V | undefined,\n options: MemoizerOptions,\n ) => V\n\n /**\n * Options which may be passed to the {@link LRUCache} constructor.\n *\n * Most of these may be overridden in the various options that use\n * them.\n *\n * Despite all being technically optional, the constructor requires that\n * a cache is at minimum limited by one or more of {@link OptionsBase.max},\n * {@link OptionsBase.ttl}, or {@link OptionsBase.maxSize}.\n *\n * If {@link OptionsBase.ttl} is used alone, then it is strongly advised\n * (and in fact required by the type definitions here) that the cache\n * also set {@link OptionsBase.ttlAutopurge}, to prevent potentially\n * unbounded storage.\n *\n * All options are also available on the {@link LRUCache} instance, making\n * it safe to pass an LRUCache instance as the options argumemnt to\n * make another empty cache of the same type.\n *\n * Some options are marked as read-only, because changing them after\n * instantiation is not safe. Changing any of the other options will of\n * course only have an effect on subsequent method calls.\n */\n export interface OptionsBase {\n /**\n * The maximum number of items to store in the cache before evicting\n * old entries. This is read-only on the {@link LRUCache} instance,\n * and may not be overridden.\n *\n * If set, then storage space will be pre-allocated at construction\n * time, and the cache will perform significantly faster.\n *\n * Note that significantly fewer items may be stored, if\n * {@link OptionsBase.maxSize} and/or {@link OptionsBase.ttl} are also\n * set.\n *\n * **It is strongly recommended to set a `max` to prevent unbounded growth\n * of the cache.**\n */\n max?: Count\n\n /**\n * Max time in milliseconds for items to live in cache before they are\n * considered stale. Note that stale items are NOT preemptively removed by\n * default, and MAY live in the cache, contributing to its LRU max, long\n * after they have expired, unless {@link OptionsBase.ttlAutopurge} is\n * set.\n *\n * If set to `0` (the default value), then that means \"do not track\n * TTL\", not \"expire immediately\".\n *\n * Also, as this cache is optimized for LRU/MRU operations, some of\n * the staleness/TTL checks will reduce performance, as they will incur\n * overhead by deleting items.\n *\n * This is not primarily a TTL cache, and does not make strong TTL\n * guarantees. There is no pre-emptive pruning of expired items, but you\n * _may_ set a TTL on the cache, and it will treat expired items as missing\n * when they are fetched, and delete them.\n *\n * Optional, but must be a non-negative integer in ms if specified.\n *\n * This may be overridden by passing an options object to `cache.set()`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if ttl tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * If ttl tracking is enabled, and `max` and `maxSize` are not set,\n * and `ttlAutopurge` is not set, then a warning will be emitted\n * cautioning about the potential for unbounded memory consumption.\n * (The TypeScript definitions will also discourage this.)\n */\n ttl?: Milliseconds\n\n /**\n * Minimum amount of time in ms in which to check for staleness.\n * Defaults to 1, which means that the current time is checked\n * at most once per millisecond.\n *\n * Set to 0 to check the current time every time staleness is tested.\n * (This reduces performance, and is theoretically unnecessary.)\n *\n * Setting this to a higher value will improve performance somewhat\n * while using ttl tracking, albeit at the expense of keeping stale\n * items around a bit longer than their TTLs would indicate.\n *\n * @default 1\n */\n ttlResolution?: Milliseconds\n\n /**\n * Preemptively remove stale items from the cache.\n *\n * Note that this may *significantly* degrade performance, especially if\n * the cache is storing a large number of items. It is almost always best\n * to just leave the stale items in the cache, and let them fall out as new\n * items are added.\n *\n * Note that this means that {@link OptionsBase.allowStale} is a bit\n * pointless, as stale items will be deleted almost as soon as they\n * expire.\n *\n * Use with caution!\n */\n ttlAutopurge?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever it is retrieved from cache with\n * {@link LRUCache#get}, causing it to not expire. (It can still fall out\n * of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n */\n updateAgeOnGet?: boolean\n\n /**\n * When using time-expiring entries with `ttl`, setting this to `true` will\n * make each item's age reset to 0 whenever its presence in the cache is\n * checked with {@link LRUCache#has}, causing it to not expire. (It can\n * still fall out of cache based on recency of use, of course.)\n *\n * Has no effect if {@link OptionsBase.ttl} is not set.\n */\n updateAgeOnHas?: boolean\n\n /**\n * Allow {@link LRUCache#get} and {@link LRUCache#fetch} calls to return\n * stale data, if available.\n *\n * By default, if you set `ttl`, stale items will only be deleted from the\n * cache when you `get(key)`. That is, it's not preemptively pruning items,\n * unless {@link OptionsBase.ttlAutopurge} is set.\n *\n * If you set `allowStale:true`, it'll return the stale value *as well as*\n * deleting it. If you don't set this, then it'll return `undefined` when\n * you try to get a stale entry.\n *\n * Note that when a stale entry is fetched, _even if it is returned due to\n * `allowStale` being set_, it is removed from the cache immediately. You\n * can suppress this behavior by setting\n * {@link OptionsBase.noDeleteOnStaleGet}, either in the constructor, or in\n * the options provided to {@link LRUCache#get}.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n * The `cache.has()` method will always return `false` for stale items.\n *\n * Only relevant if a ttl is set.\n */\n allowStale?: boolean\n\n /**\n * Function that is called on items when they are dropped from the\n * cache, as `dispose(value, key, reason)`.\n *\n * This can be handy if you want to close file descriptors or do\n * other cleanup tasks when items are no longer stored in the cache.\n *\n * **NOTE**: It is called _before_ the item has been fully removed\n * from the cache, so if you want to put it right back in, you need\n * to wait until the next tick. If you try to add it back in during\n * the `dispose()` function call, it will break things in subtle and\n * weird ways.\n *\n * Unlike several other options, this may _not_ be overridden by\n * passing an option to `set()`, for performance reasons.\n *\n * The `reason` will be one of the following strings, corresponding\n * to the reason for the item's deletion:\n *\n * - `evict` Item was evicted to make space for a new addition\n * - `set` Item was overwritten by a new value\n * - `expire` Item expired its TTL\n * - `fetch` Item was deleted due to a failed or aborted fetch, or a\n * fetchMethod returning `undefined.\n * - `delete` Item was removed by explicit `cache.delete(key)`,\n * `cache.clear()`, or `cache.set(key, undefined)`.\n */\n dispose?: Disposer\n\n /**\n * Function that is called when new items are inserted into the cache,\n * as `onInsert(value, key, reason)`.\n *\n * This can be useful if you need to perform actions when an item is\n * added, such as logging or tracking insertions.\n *\n * Unlike some other options, this may _not_ be overridden by passing\n * an option to `set()`, for performance and consistency reasons.\n */\n onInsert?: Inserter\n\n /**\n * The same as {@link OptionsBase.dispose}, but called *after* the entry\n * is completely removed and the cache is once again in a clean state.\n *\n * It is safe to add an item right back into the cache at this point.\n * However, note that it is *very* easy to inadvertently create infinite\n * recursion this way.\n */\n disposeAfter?: Disposer\n\n /**\n * Set to true to suppress calling the\n * {@link OptionsBase.dispose} function if the entry key is\n * still accessible within the cache.\n *\n * This may be overridden by passing an options object to\n * {@link LRUCache#set}.\n *\n * Only relevant if `dispose` or `disposeAfter` are set.\n */\n noDisposeOnSet?: boolean\n\n /**\n * Boolean flag to tell the cache to not update the TTL when setting a new\n * value for an existing key (ie, when updating a value rather than\n * inserting a new value). Note that the TTL value is _always_ set (if\n * provided) when adding a new entry into the cache.\n *\n * Has no effect if a {@link OptionsBase.ttl} is not set.\n *\n * May be passed as an option to {@link LRUCache#set}.\n */\n noUpdateTTL?: boolean\n\n /**\n * Set to a positive integer to track the sizes of items added to the\n * cache, and automatically evict items in order to stay below this size.\n * Note that this may result in fewer than `max` items being stored.\n *\n * Attempting to add an item to the cache whose calculated size is greater\n * that this amount will be a no-op. The item will not be cached, and no\n * other items will be evicted.\n *\n * Optional, must be a positive integer if provided.\n *\n * Sets `maxEntrySize` to the same value, unless a different value is\n * provided for `maxEntrySize`.\n *\n * At least one of `max`, `maxSize`, or `TTL` is required. This must be a\n * positive integer if set.\n *\n * Even if size tracking is enabled, **it is strongly recommended to set a\n * `max` to prevent unbounded growth of the cache.**\n *\n * Note also that size tracking can negatively impact performance,\n * though for most cases, only minimally.\n */\n maxSize?: Size\n\n /**\n * The effective size for background fetch promises.\n *\n * This has no effect unless `maxSize` and `sizeCalculation` are used,\n * and a {@link LRUCache.OptionsBase.fetchMethod} is provided to\n * support {@link LRUCache#fetch}.\n *\n * If a stale value is present in the cache, then the effective size of\n * the background fetch is the size of the stale item it will eventually\n * replace. If not, then this value is used as its effective size.\n *\n * @default 1\n */\n backgroundFetchSize?: number\n\n /**\n * The maximum allowed size for any single item in the cache.\n *\n * If a larger item is passed to {@link LRUCache#set} or returned by a\n * {@link OptionsBase.fetchMethod} or {@link OptionsBase.memoMethod}, then\n * it will not be stored in the cache.\n *\n * Attempting to add an item whose calculated size is greater than\n * this amount will not cache the item or evict any old items, but\n * WILL delete an existing value if one is already present.\n *\n * Optional, must be a positive integer if provided. Defaults to\n * the value of `maxSize` if provided.\n */\n maxEntrySize?: Size\n\n /**\n * A function that returns a number indicating the item's size.\n *\n * Requires {@link OptionsBase.maxSize} to be set.\n *\n * If not provided, and {@link OptionsBase.maxSize} or\n * {@link OptionsBase.maxEntrySize} are set, then all\n * {@link LRUCache#set} calls **must** provide an explicit\n * {@link SetOptions.size} or sizeCalculation param.\n */\n sizeCalculation?: SizeCalculator\n\n /**\n * Method that provides the implementation for {@link LRUCache#fetch}\n *\n * ```ts\n * fetchMethod(key, staleValue, { signal, options, context })\n * ```\n *\n * If `fetchMethod` is not provided, then `cache.fetch(key)` is equivalent\n * to `Promise.resolve(cache.get(key))`.\n *\n * If at any time, `signal.aborted` is set to `true`, or if the\n * `signal.onabort` method is called, or if it emits an `'abort'` event\n * which you can listen to with `addEventListener`, then that means that\n * the fetch should be abandoned. This may be passed along to async\n * functions aware of AbortController/AbortSignal behavior.\n *\n * The `fetchMethod` should **only** return `undefined` or a Promise\n * resolving to `undefined` if the AbortController signaled an `abort`\n * event. In all other cases, it should return or resolve to a value\n * suitable for adding to the cache.\n *\n * The `options` object is a union of the options that may be provided to\n * `set()` and `get()`. If they are modified, then that will result in\n * modifying the settings to `cache.set()` when the value is resolved, and\n * in the case of\n * {@link OptionsBase.noDeleteOnFetchRejection} and\n * {@link OptionsBase.allowStaleOnFetchRejection}, the handling of\n * `fetchMethod` failures.\n *\n * For example, a DNS cache may update the TTL based on the value returned\n * from a remote DNS server by changing `options.ttl` in the `fetchMethod`.\n */\n fetchMethod?: Fetcher\n\n /**\n * Method that provides the implementation for {@link LRUCache#memo}\n */\n memoMethod?: Memoizer\n\n /**\n * Set to true to suppress the deletion of stale data when a\n * {@link OptionsBase.fetchMethod} returns a rejected promise.\n */\n noDeleteOnFetchRejection?: boolean\n\n /**\n * Do not delete stale items when they are retrieved with\n * {@link LRUCache#get}.\n *\n * Note that the `get` return value will still be `undefined`\n * unless {@link OptionsBase.allowStale} is true.\n *\n * When using time-expiring entries with `ttl`, by default stale\n * items will be removed from the cache when the key is accessed\n * with `cache.get()`.\n *\n * Setting this option will cause stale items to remain in the cache, until\n * they are explicitly deleted with `cache.delete(key)`, or retrieved with\n * `noDeleteOnStaleGet` set to `false`.\n *\n * This may be overridden by passing an options object to `cache.get()`.\n *\n * Only relevant if a ttl is used.\n */\n noDeleteOnStaleGet?: boolean\n\n /**\n * Set to true to allow returning stale data when a\n * {@link OptionsBase.fetchMethod} throws an error or returns a rejected\n * promise.\n *\n * This differs from using {@link OptionsBase.allowStale} in that stale\n * data will ONLY be returned in the case that the {@link LRUCache#fetch}\n * fails, not any other times.\n *\n * If a `fetchMethod` fails, and there is no stale value available, the\n * `fetch()` will resolve to `undefined`. Ie, all `fetchMethod` errors are\n * suppressed.\n *\n * Implies `noDeleteOnFetchRejection`.\n *\n * This may be set in calls to `fetch()`, or defaulted on the constructor,\n * or overridden by modifying the options object in the `fetchMethod`.\n */\n allowStaleOnFetchRejection?: boolean\n\n /**\n * Set to true to return a stale value from the cache when the\n * `AbortSignal` passed to the {@link OptionsBase.fetchMethod} dispatches\n * an `'abort'` event, whether user-triggered, or due to internal cache\n * behavior.\n *\n * Unless {@link OptionsBase.ignoreFetchAbort} is also set, the underlying\n * {@link OptionsBase.fetchMethod} will still be considered canceled, and\n * any value it returns will be ignored and not cached.\n *\n * Caveat: since fetches are aborted when a new value is explicitly\n * set in the cache, this can lead to fetch returning a stale value,\n * since that was the fallback value _at the moment the `fetch()` was\n * initiated_, even though the new updated value is now present in\n * the cache.\n *\n * For example:\n *\n * ```ts\n * const cache = new LRUCache({\n * ttl: 100,\n * fetchMethod: async (url, oldValue, { signal }) => {\n * const res = await fetch(url, { signal })\n * return await res.json()\n * }\n * })\n * cache.set('https://example.com/', { some: 'data' })\n * // 100ms go by...\n * const result = cache.fetch('https://example.com/')\n * cache.set('https://example.com/', { other: 'thing' })\n * console.log(await result) // { some: 'data' }\n * console.log(cache.get('https://example.com/')) // { other: 'thing' }\n * ```\n */\n allowStaleOnFetchAbort?: boolean\n\n /**\n * Set to true to ignore the `abort` event emitted by the `AbortSignal`\n * object passed to {@link OptionsBase.fetchMethod}, and still cache the\n * resulting resolution value, as long as it is not `undefined`.\n *\n * When used on its own, this means aborted {@link LRUCache#fetch} calls\n * are not immediately resolved or rejected when they are aborted, and\n * instead take the full time to await.\n *\n * When used with {@link OptionsBase.allowStaleOnFetchAbort}, aborted\n * {@link LRUCache#fetch} calls will resolve immediately to their stale\n * cached value or `undefined`, and will continue to process and eventually\n * update the cache when they resolve, as long as the resulting value is\n * not `undefined`, thus supporting a \"return stale on timeout while\n * refreshing\" mechanism by passing `AbortSignal.timeout(n)` as the signal.\n *\n * For example:\n *\n * ```ts\n * const c = new LRUCache({\n * ttl: 100,\n * ignoreFetchAbort: true,\n * allowStaleOnFetchAbort: true,\n * fetchMethod: async (key, oldValue, { signal }) => {\n * // note: do NOT pass the signal to fetch()!\n * // let's say this fetch can take a long time.\n * const res = await fetch(`https://slow-backend-server/${key}`)\n * return await res.json()\n * },\n * })\n *\n * // this will return the stale value after 100ms, while still\n * // updating in the background for next time.\n * const val = await c.fetch('key', { signal: AbortSignal.timeout(100) })\n * ```\n *\n * **Note**: regardless of this setting, an `abort` event _is still\n * emitted on the `AbortSignal` object_, so may result in invalid results\n * when passed to other underlying APIs that use AbortSignals.\n *\n * This may be overridden in the {@link OptionsBase.fetchMethod} or the\n * call to {@link LRUCache#fetch}.\n */\n ignoreFetchAbort?: boolean\n\n /**\n * In some cases, you may want to swap out the performance/Date object\n * used for TTL tracking. This should almost certainly NOT be done in\n * production environments!\n *\n * This value defaults to `global.performance` if it has a `now()` method,\n * or the `global.Date` object otherwise.\n */\n perf?: Perf\n }\n\n export interface OptionsMaxLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n max: Count\n }\n export interface OptionsTTLLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n ttl: Milliseconds\n ttlAutopurge: boolean\n }\n export interface OptionsSizeLimit extends OptionsBase<\n K,\n V,\n FC\n > {\n maxSize: Size\n }\n\n /**\n * The valid safe options for the {@link LRUCache} constructor\n */\n export type Options =\n | OptionsMaxLimit\n | OptionsSizeLimit\n | OptionsTTLLimit\n\n /**\n * Entry objects used by {@link LRUCache#load} and {@link LRUCache#dump},\n * and returned by {@link LRUCache#info}.\n */\n export interface Entry {\n value: V\n ttl?: Milliseconds\n size?: Size\n start?: Milliseconds\n }\n}\n\n/**\n * Default export, the thing you're using this module to get.\n *\n * The `K` and `V` types define the key and value types, respectively. The\n * optional `FC` type defines the type of the `context` object passed to\n * `cache.fetch()` and `cache.memo()`.\n *\n * Keys and values **must not** be `null` or `undefined`.\n *\n * All properties from the options object (with the exception of `max`,\n * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are\n * added as normal public members. (The listed options are read-only getters.)\n *\n * Changing any of these will alter the defaults for subsequent method calls.\n */\nexport class LRUCache {\n // options that cannot be changed without disaster\n readonly #max: LRUCache.Count\n readonly #maxSize: LRUCache.Size\n readonly #dispose?: LRUCache.Disposer\n readonly #onInsert?: LRUCache.Inserter\n readonly #disposeAfter?: LRUCache.Disposer\n readonly #fetchMethod?: LRUCache.Fetcher\n readonly #memoMethod?: LRUCache.Memoizer\n readonly #perf: Perf\n\n /**\n * {@link LRUCache.OptionsBase.perf}\n */\n get perf() {\n return this.#perf\n }\n\n /**\n * {@link LRUCache.OptionsBase.ttl}\n */\n ttl: LRUCache.Milliseconds\n\n /**\n * {@link LRUCache.OptionsBase.ttlResolution}\n */\n ttlResolution: LRUCache.Milliseconds\n /**\n * {@link LRUCache.OptionsBase.ttlAutopurge}\n */\n ttlAutopurge: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnGet}\n */\n updateAgeOnGet: boolean\n /**\n * {@link LRUCache.OptionsBase.updateAgeOnHas}\n */\n updateAgeOnHas: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStale}\n */\n allowStale: boolean\n\n /**\n * {@link LRUCache.OptionsBase.noDisposeOnSet}\n */\n noDisposeOnSet: boolean\n /**\n * {@link LRUCache.OptionsBase.noUpdateTTL}\n */\n noUpdateTTL: boolean\n /**\n * {@link LRUCache.OptionsBase.maxEntrySize}\n */\n maxEntrySize: LRUCache.Size\n /**\n * {@link LRUCache.OptionsBase.sizeCalculation}\n */\n sizeCalculation?: LRUCache.SizeCalculator\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}\n */\n noDeleteOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}\n */\n noDeleteOnStaleGet: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}\n */\n allowStaleOnFetchAbort: boolean\n /**\n * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}\n */\n allowStaleOnFetchRejection: boolean\n /**\n * {@link LRUCache.OptionsBase.ignoreFetchAbort}\n */\n ignoreFetchAbort: boolean\n\n /** {@link LRUCache.OptionsBase.backgroundFetchSize} */\n backgroundFetchSize: number\n\n // computed properties\n #size: LRUCache.Count\n #calculatedSize: LRUCache.Size\n #keyMap: Map\n #keyList: (K | undefined)[]\n #valList: (V | BackgroundFetch | undefined)[]\n #next: NumberArray\n #prev: NumberArray\n #head: Index\n #tail: Index\n #free: StackLike\n #disposed?: DisposeTask[]\n #sizes?: ZeroArray\n #starts?: ZeroArray\n #ttls?: ZeroArray\n #autopurgeTimers?: (undefined | ReturnType)[]\n\n #hasDispose: boolean\n #hasFetchMethod: boolean\n #hasDisposeAfter: boolean\n #hasOnInsert: boolean\n\n /**\n * Do not call this method unless you need to inspect the\n * inner workings of the cache. If anything returned by this\n * object is modified in any way, strange breakage may occur.\n *\n * These fields are private for a reason!\n *\n * @internal\n */\n static unsafeExposeInternals<\n K extends {},\n V extends {},\n FC extends unknown = unknown,\n >(c: LRUCache) {\n return {\n // properties\n starts: c.#starts,\n ttls: c.#ttls,\n autopurgeTimers: c.#autopurgeTimers,\n sizes: c.#sizes,\n keyMap: c.#keyMap as Map,\n keyList: c.#keyList,\n valList: c.#valList,\n next: c.#next,\n prev: c.#prev,\n get head() {\n return c.#head\n },\n get tail() {\n return c.#tail\n },\n free: c.#free,\n // methods\n isBackgroundFetch: (p: unknown) => c.#isBackgroundFetch(p),\n backgroundFetch: (\n k: K,\n index: number | undefined,\n options: LRUCache.FetchOptions,\n context: unknown,\n ): BackgroundFetch =>\n c.#backgroundFetch(\n k,\n index as Index | undefined,\n options,\n context as FC,\n ),\n moveToTail: (index: number): void => c.#moveToTail(index as Index),\n indexes: (options?: { allowStale: boolean }) => c.#indexes(options),\n rindexes: (options?: { allowStale: boolean }) =>\n c.#rindexes(options),\n isStale: (index: number | undefined) => c.#isStale(index as Index),\n }\n }\n\n // Protected read-only members\n\n /**\n * {@link LRUCache.OptionsBase.max} (read-only)\n */\n get max(): LRUCache.Count {\n return this.#max\n }\n /**\n * {@link LRUCache.OptionsBase.maxSize} (read-only)\n */\n get maxSize(): LRUCache.Count {\n return this.#maxSize\n }\n /**\n * The total computed size of items in the cache (read-only)\n */\n get calculatedSize(): LRUCache.Size {\n return this.#calculatedSize\n }\n /**\n * The number of items stored in the cache (read-only)\n */\n get size(): LRUCache.Count {\n return this.#size\n }\n /**\n * {@link LRUCache.OptionsBase.fetchMethod} (read-only)\n */\n get fetchMethod(): LRUCache.Fetcher | undefined {\n return this.#fetchMethod\n }\n get memoMethod(): LRUCache.Memoizer | undefined {\n return this.#memoMethod\n }\n /**\n * {@link LRUCache.OptionsBase.dispose} (read-only)\n */\n get dispose() {\n return this.#dispose\n }\n /**\n * {@link LRUCache.OptionsBase.onInsert} (read-only)\n */\n get onInsert() {\n return this.#onInsert\n }\n /**\n * {@link LRUCache.OptionsBase.disposeAfter} (read-only)\n */\n get disposeAfter() {\n return this.#disposeAfter\n }\n\n constructor(options: LRUCache.Options | LRUCache) {\n const {\n max = 0,\n ttl,\n ttlResolution = 1,\n ttlAutopurge,\n updateAgeOnGet,\n updateAgeOnHas,\n allowStale,\n dispose,\n onInsert,\n disposeAfter,\n noDisposeOnSet,\n noUpdateTTL,\n maxSize = 0,\n maxEntrySize = 0,\n sizeCalculation,\n fetchMethod,\n memoMethod,\n noDeleteOnFetchRejection,\n noDeleteOnStaleGet,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n backgroundFetchSize = 1,\n perf,\n } = options\n\n this.backgroundFetchSize = backgroundFetchSize\n\n if (perf !== undefined) {\n if (typeof perf?.now !== 'function') {\n throw new TypeError(\n 'perf option must have a now() method if specified',\n )\n }\n }\n\n this.#perf = perf ?? defaultPerf\n\n if (max !== 0 && !isPosInt(max)) {\n throw new TypeError('max option must be a nonnegative integer')\n }\n\n const UintArray = max ? getUintArray(max) : Array\n if (!UintArray) {\n throw new Error('invalid max value: ' + max)\n }\n\n this.#max = max\n this.#maxSize = maxSize\n this.maxEntrySize = maxEntrySize || this.#maxSize\n this.sizeCalculation = sizeCalculation\n if (this.sizeCalculation) {\n if (!this.#maxSize && !this.maxEntrySize) {\n throw new TypeError(\n 'cannot set sizeCalculation without setting maxSize or maxEntrySize',\n )\n }\n if (typeof this.sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation set to non-function')\n }\n }\n\n if (memoMethod !== undefined && typeof memoMethod !== 'function') {\n throw new TypeError('memoMethod must be a function if defined')\n }\n this.#memoMethod = memoMethod\n\n if (fetchMethod !== undefined && typeof fetchMethod !== 'function') {\n throw new TypeError('fetchMethod must be a function if specified')\n }\n this.#fetchMethod = fetchMethod\n this.#hasFetchMethod = !!fetchMethod\n\n this.#keyMap = new Map()\n this.#keyList = Array.from({ length: max }).fill(undefined) as (\n | K\n | undefined\n )[]\n this.#valList = Array.from({ length: max }).fill(undefined) as (\n | V\n | undefined\n )[]\n this.#next = new UintArray(max)\n this.#prev = new UintArray(max)\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free = Stack.create(max)\n this.#size = 0\n this.#calculatedSize = 0\n\n if (typeof dispose === 'function') {\n this.#dispose = dispose\n }\n if (typeof onInsert === 'function') {\n this.#onInsert = onInsert\n }\n if (typeof disposeAfter === 'function') {\n this.#disposeAfter = disposeAfter\n this.#disposed = []\n } else {\n this.#disposeAfter = undefined\n this.#disposed = undefined\n }\n this.#hasDispose = !!this.#dispose\n this.#hasOnInsert = !!this.#onInsert\n this.#hasDisposeAfter = !!this.#disposeAfter\n\n this.noDisposeOnSet = !!noDisposeOnSet\n this.noUpdateTTL = !!noUpdateTTL\n this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection\n this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection\n this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort\n this.ignoreFetchAbort = !!ignoreFetchAbort\n\n // NB: maxEntrySize is set to maxSize if it's set\n if (this.maxEntrySize !== 0) {\n if (this.#maxSize !== 0) {\n if (!isPosInt(this.#maxSize)) {\n throw new TypeError(\n 'maxSize must be a positive integer if specified',\n )\n }\n }\n if (!isPosInt(this.maxEntrySize)) {\n throw new TypeError(\n 'maxEntrySize must be a positive integer if specified',\n )\n }\n this.#initializeSizeTracking()\n }\n\n this.allowStale = !!allowStale\n this.noDeleteOnStaleGet = !!noDeleteOnStaleGet\n this.updateAgeOnGet = !!updateAgeOnGet\n this.updateAgeOnHas = !!updateAgeOnHas\n this.ttlResolution =\n isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1\n this.ttlAutopurge = !!ttlAutopurge\n this.ttl = ttl || 0\n if (this.ttl) {\n if (!isPosInt(this.ttl)) {\n throw new TypeError('ttl must be a positive integer if specified')\n }\n this.#initializeTTLTracking()\n }\n\n // do not allow completely unbounded caches\n if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {\n throw new TypeError(\n 'At least one of max, maxSize, or ttl is required',\n )\n }\n if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {\n const code = 'LRU_CACHE_UNBOUNDED'\n if (shouldWarn(code)) {\n warned.add(code)\n const msg =\n 'TTL caching without ttlAutopurge, max, or maxSize can ' +\n 'result in unbounded memory consumption.'\n emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache)\n }\n }\n }\n\n /**\n * Return the number of ms left in the item's TTL. If item is not in cache,\n * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.\n */\n getRemainingTTL(key: K) {\n return this.#keyMap.has(key) ? Infinity : 0\n }\n\n #initializeTTLTracking() {\n const ttls = new ZeroArray(this.#max)\n const starts = new ZeroArray(this.#max)\n this.#ttls = ttls\n this.#starts = starts\n const purgeTimers =\n this.ttlAutopurge ?\n Array.from>({\n length: this.#max,\n })\n : undefined\n this.#autopurgeTimers = purgeTimers\n\n this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {\n starts[index] = ttl !== 0 ? start : 0\n ttls[index] = ttl\n setPurgetTimer(index, ttl)\n }\n\n this.#updateItemAge = index => {\n starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0\n setPurgetTimer(index, ttls[index])\n }\n\n // clear out the purge timer if we're setting TTL to 0, and\n // previously had a ttl purge timer running, so it doesn't\n // fire unnecessarily. Don't need to do this if we're not doing\n // autopurge.\n const setPurgetTimer =\n !this.ttlAutopurge ?\n () => {}\n : (index: Index, ttl?: number) => {\n if (purgeTimers?.[index]) {\n clearTimeout(purgeTimers[index])\n purgeTimers[index] = undefined\n }\n if (ttl && ttl !== 0 && purgeTimers) {\n const t = setTimeout(() => {\n if (this.#isStale(index)) {\n this.#delete(this.#keyList[index] as K, 'expire')\n }\n }, ttl + 1)\n // unref() not supported on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n purgeTimers[index] = t\n }\n }\n\n this.#statusTTL = (status, index) => {\n if (ttls[index]) {\n const ttl = ttls[index]\n const start = starts[index]\n /* c8 ignore start */\n if (!ttl || !start) {\n return\n }\n /* c8 ignore stop */\n status.ttl = ttl\n status.start = start\n status.now = cachedNow || getNow()\n const age = status.now - start\n status.remainingTTL = ttl - age\n }\n }\n\n // debounce calls to perf.now() to 1s so we're not hitting\n // that costly call repeatedly.\n let cachedNow = 0\n const getNow = () => {\n const n = this.#perf.now()\n if (this.ttlResolution > 0) {\n cachedNow = n\n const t = setTimeout(() => (cachedNow = 0), this.ttlResolution)\n // not available on all platforms\n /* c8 ignore start */\n if (t.unref) {\n t.unref()\n }\n /* c8 ignore stop */\n }\n return n\n }\n\n this.getRemainingTTL = key => {\n const index = this.#keyMap.get(key)\n if (index === undefined) {\n return 0\n }\n const ttl = ttls[index]\n const start = starts[index]\n if (!ttl || !start) {\n return Infinity\n }\n const age = (cachedNow || getNow()) - start\n return ttl - age\n }\n\n this.#isStale = index => {\n const s = starts[index]\n const t = ttls[index]\n return !!t && !!s && (cachedNow || getNow()) - s > t\n }\n }\n\n // conditionally set private methods related to TTL\n #updateItemAge: (index: Index) => void = () => {}\n #statusTTL: (status: LRUCache.Status, index: Index) => void =\n () => {}\n #setItemTTL: (\n index: Index,\n ttl: LRUCache.Milliseconds,\n start?: LRUCache.Milliseconds,\n // ignore because we never call this if we're not already in TTL mode\n /* c8 ignore start */\n ) => void = () => {}\n /* c8 ignore stop */\n\n #isStale: (index: Index) => boolean = () => false\n\n #initializeSizeTracking() {\n const sizes = new ZeroArray(this.#max)\n this.#calculatedSize = 0\n this.#sizes = sizes\n this.#removeItemSize = index => {\n this.#calculatedSize -= sizes[index] as number\n sizes[index] = 0\n }\n this.#requireSize = (k, v, size, sizeCalculation) => {\n if (!isPosInt(size)) {\n // provisionally accept background fetches.\n // actual value size will be checked when they return.\n if (this.#isBackgroundFetch(v)) {\n // NB: this cannot occur if v.__staleWhileFetching is set,\n // because in that case, it would take on the size of the\n // existing entry that it temporarily replaces.\n return this.backgroundFetchSize\n }\n if (sizeCalculation) {\n if (typeof sizeCalculation !== 'function') {\n throw new TypeError('sizeCalculation must be a function')\n }\n size = sizeCalculation(v, k)\n if (!isPosInt(size)) {\n throw new TypeError(\n 'sizeCalculation return invalid (expect positive integer)',\n )\n }\n } else {\n throw new TypeError(\n 'invalid size value (must be positive integer). ' +\n 'When maxSize or maxEntrySize is used, sizeCalculation ' +\n 'or size must be set.',\n )\n }\n }\n return size\n }\n\n this.#addItemSize = (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => {\n sizes[index] = size\n if (this.#maxSize) {\n const maxSize = this.#maxSize - sizes[index]\n while (this.#calculatedSize > maxSize) {\n this.#evict(true)\n }\n }\n this.#calculatedSize += sizes[index]\n if (status) {\n status.entrySize = size\n status.totalCalculatedSize = this.#calculatedSize\n }\n }\n }\n\n #removeItemSize: (index: Index) => void = _i => {}\n\n #addItemSize: (\n index: Index,\n size: LRUCache.Size,\n status?: LRUCache.Status,\n ) => void = (_i, _s, _st) => {}\n\n #requireSize: (\n k: K,\n v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n status?: LRUCache.Status,\n ) => LRUCache.Size = (\n _k: K,\n _v: V | BackgroundFetch,\n size?: LRUCache.Size,\n sizeCalculation?: LRUCache.SizeCalculator,\n ) => {\n if (size || sizeCalculation) {\n throw new TypeError(\n 'cannot set size without setting maxSize or maxEntrySize on cache',\n )\n }\n return 0\n };\n\n *#indexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#tail; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#head) {\n break\n } else {\n i = this.#prev[i] as Index\n }\n }\n }\n }\n\n *#rindexes({ allowStale = this.allowStale } = {}) {\n if (this.#size) {\n for (let i = this.#head; this.#isValidIndex(i); ) {\n if (allowStale || !this.#isStale(i)) {\n yield i\n }\n if (i === this.#tail) {\n break\n } else {\n i = this.#next[i] as Index\n }\n }\n }\n }\n\n #isValidIndex(index: Index) {\n return (\n index !== undefined &&\n this.#keyMap.get(this.#keyList[index] as K) === index\n )\n }\n\n /**\n * Return a generator yielding `[key, value]` pairs,\n * in order from most recently used to least recently used.\n */\n *entries() {\n for (const i of this.#indexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]] as [K, V]\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.entries}\n *\n * Return a generator yielding `[key, value]` pairs,\n * in order from least recently used to most recently used.\n */\n *rentries() {\n for (const i of this.#rindexes()) {\n if (\n this.#valList[i] !== undefined &&\n this.#keyList[i] !== undefined &&\n !this.#isBackgroundFetch(this.#valList[i])\n ) {\n yield [this.#keyList[i], this.#valList[i]]\n }\n }\n }\n\n /**\n * Return a generator yielding the keys in the cache,\n * in order from most recently used to least recently used.\n */\n *keys() {\n for (const i of this.#indexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.keys}\n *\n * Return a generator yielding the keys in the cache,\n * in order from least recently used to most recently used.\n */\n *rkeys() {\n for (const i of this.#rindexes()) {\n const k = this.#keyList[i]\n if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield k\n }\n }\n }\n\n /**\n * Return a generator yielding the values in the cache,\n * in order from most recently used to least recently used.\n */\n *values() {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i] as V\n }\n }\n }\n\n /**\n * Inverse order version of {@link LRUCache.values}\n *\n * Return a generator yielding the values in the cache,\n * in order from least recently used to most recently used.\n */\n *rvalues() {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i])) {\n yield this.#valList[i]\n }\n }\n }\n\n /**\n * Iterating over the cache itself yields the same results as\n * {@link LRUCache.entries}\n */\n [Symbol.iterator]() {\n return this.entries()\n }\n\n /**\n * A String value that is used in the creation of the default string\n * description of an object. Called by the built-in method\n * `Object.prototype.toString`.\n */\n [Symbol.toStringTag] = 'LRUCache'\n\n /**\n * Find a value for which the supplied fn method returns a truthy value,\n * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.\n */\n find(\n fn: (v: V, k: K, self: LRUCache) => boolean,\n getOptions: LRUCache.GetOptions = {},\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n if (fn(value, this.#keyList[i] as K, this)) {\n return this.#get(this.#keyList[i] as K, getOptions)\n }\n }\n }\n\n /**\n * Call the supplied function on each item in the cache, in order from most\n * recently used to least recently used.\n *\n * `fn` is called as `fn(value, key, cache)`.\n *\n * If `thisp` is provided, function will be called in the `this`-context of\n * the provided object, or the cache if no `thisp` object is provided.\n *\n * Does not update age or recenty of use, or iterate over stale values.\n */\n forEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#indexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * The same as {@link LRUCache.forEach} but items are iterated over in\n * reverse order. (ie, less recently used items are iterated over first.)\n */\n rforEach(\n fn: (v: V, k: K, self: LRUCache) => unknown,\n thisp: unknown = this,\n ) {\n for (const i of this.#rindexes()) {\n const v = this.#valList[i]\n const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) continue\n fn.call(thisp, value, this.#keyList[i] as K, this)\n }\n }\n\n /**\n * Delete any stale entries. Returns true if anything was removed,\n * false otherwise.\n */\n purgeStale() {\n let deleted = false\n for (const i of this.#rindexes({ allowStale: true })) {\n if (this.#isStale(i)) {\n this.#delete(this.#keyList[i] as K, 'expire')\n deleted = true\n }\n }\n return deleted\n }\n\n /**\n * Get the extended info about a given entry, to get its value, size, and\n * TTL info simultaneously. Returns `undefined` if the key is not present.\n *\n * Unlike {@link LRUCache#dump}, which is designed to be portable and survive\n * serialization, the `start` value is always the current timestamp, and the\n * `ttl` is a calculated remaining time to live (negative if expired).\n *\n * Always returns stale values, if their info is found in the cache, so be\n * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})\n * if relevant.\n */\n info(key: K): LRUCache.Entry | undefined {\n const i = this.#keyMap.get(key)\n if (i === undefined) return undefined\n const v = this.#valList[i]\n /* c8 ignore start - this isn't tested for the info function,\n * but it's the same logic as found in other places. */\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined) return undefined\n /* c8 ignore stop */\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n const ttl = this.#ttls[i]\n const start = this.#starts[i]\n if (ttl && start) {\n const remain = ttl - (this.#perf.now() - start)\n entry.ttl = remain\n entry.start = Date.now()\n }\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n return entry\n }\n\n /**\n * Return an array of [key, {@link LRUCache.Entry}] tuples which can be\n * passed to {@link LRUCache#load}.\n *\n * The `start` fields are calculated relative to a portable `Date.now()`\n * timestamp, even if `performance.now()` is available.\n *\n * Stale entries are always included in the `dump`, even if\n * {@link LRUCache.OptionsBase.allowStale} is false.\n *\n * Note: this returns an actual array, not a generator, so it can be more\n * easily passed around.\n */\n dump() {\n const arr: [K, LRUCache.Entry][] = []\n for (const i of this.#indexes({ allowStale: true })) {\n const key = this.#keyList[i]\n const v = this.#valList[i]\n const value: V | undefined =\n this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (value === undefined || key === undefined) continue\n const entry: LRUCache.Entry = { value }\n if (this.#ttls && this.#starts) {\n entry.ttl = this.#ttls[i]\n // always dump the start relative to a portable timestamp\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = this.#perf.now() - (this.#starts[i] as number)\n entry.start = Math.floor(Date.now() - age)\n }\n if (this.#sizes) {\n entry.size = this.#sizes[i]\n }\n arr.unshift([key, entry])\n }\n return arr\n }\n\n /**\n * Reset the cache and load in the items in entries in the order listed.\n *\n * The shape of the resulting cache may be different if the same options are\n * not used in both caches.\n *\n * The `start` fields are assumed to be calculated relative to a portable\n * `Date.now()` timestamp, even if `performance.now()` is available.\n */\n load(arr: [K, LRUCache.Entry][]) {\n this.clear()\n for (const [key, entry] of arr) {\n if (entry.start) {\n // entry.start is a portable timestamp, but we may be using\n // node's performance.now(), so calculate the offset, so that\n // we get the intended remaining TTL, no matter how long it's\n // been on ice.\n //\n // it's ok for this to be a bit slow, it's a rare operation.\n const age = Date.now() - entry.start\n entry.start = this.#perf.now() - age\n }\n this.#set(key, entry.value, entry)\n }\n }\n\n /**\n * Add a value to the cache.\n *\n * Note: if `undefined` is specified as a value, this is an alias for\n * {@link LRUCache#delete}\n *\n * Fields on the {@link LRUCache.SetOptions} options param will override\n * their corresponding values in the constructor options for the scope\n * of this single `set()` operation.\n *\n * If `start` is provided, then that will set the effective start\n * time for the TTL calculation. Note that this must be a previous\n * value of `performance.now()` if supported, or a previous value of\n * `Date.now()` if not.\n *\n * Options object may also include `size`, which will prevent\n * calling the `sizeCalculation` function and just use the specified\n * number if it is a positive integer, and `noDisposeOnSet` which\n * will prevent calling a `dispose` function in the case of\n * overwrites.\n *\n * If the `size` (or return value of `sizeCalculation`) for a given\n * entry is greater than `maxEntrySize`, then the item will not be\n * added to the cache.\n *\n * Will update the recency of the entry.\n *\n * If the value is `undefined`, then this is an alias for\n * `cache.delete(key)`. `undefined` is never stored in the cache.\n */\n set(\n k: K,\n v: V | undefined,\n setOptions: LRUCache.SetOptions = {},\n ) {\n const { status = metrics.hasSubscribers ? {} : undefined } = setOptions\n setOptions.status = status\n if (status) {\n status.op = 'set'\n status.key = k\n if (v !== undefined) status.value = v\n status.cache = this\n }\n const result = this.#set(k, v, setOptions)\n if (status && metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n\n #set(\n k: K,\n v: V | BackgroundFetch | undefined,\n setOptions: LRUCache.SetOptions,\n bf?: BackgroundFetch,\n ) {\n const {\n ttl = this.ttl,\n start,\n noDisposeOnSet = this.noDisposeOnSet,\n sizeCalculation = this.sizeCalculation,\n status,\n } = setOptions\n\n const isBF = this.#isBackgroundFetch(v)\n if (v === undefined) {\n if (status) status.set = 'deleted'\n this.delete(k)\n return this\n }\n let { noUpdateTTL = this.noUpdateTTL } = setOptions\n\n if (status && !isBF) status.value = v\n\n const size = this.#requireSize(\n k,\n v,\n setOptions.size || 0,\n sizeCalculation,\n status,\n )\n // if the item doesn't fit, don't do anything\n // NB: maxEntrySize set to maxSize by default\n if (this.maxEntrySize && size > this.maxEntrySize) {\n // have to delete, in case something is there already.\n this.#delete(k, 'set')\n if (status) {\n status.set = 'miss'\n status.maxEntrySizeExceeded = true\n }\n return this\n }\n let index = this.#size === 0 ? undefined : this.#keyMap.get(k)\n if (index === undefined) {\n // addition\n index = (\n this.#size === 0 ? this.#tail\n : this.#free.length !== 0 ? this.#free.pop()\n : this.#size === this.#max ? this.#evict(false)\n : this.#size) as Index\n this.#keyList[index] = k\n this.#valList[index] = v\n this.#keyMap.set(k, index)\n this.#next[this.#tail] = index\n this.#prev[index] = this.#tail\n this.#tail = index\n this.#size++\n this.#addItemSize(index, size, status)\n if (status) status.set = 'add'\n noUpdateTTL = false\n if (this.#hasOnInsert && !isBF) {\n this.#onInsert?.(v, k, 'add')\n }\n } else {\n // update\n // might be updating a background fetch!\n this.#moveToTail(index)\n const oldVal = this.#valList[index]!\n if (v !== oldVal) {\n if (!noDisposeOnSet) {\n if (this.#isBackgroundFetch(oldVal)) {\n if (oldVal !== bf) {\n // setting over a background fetch, not merely resolving it.\n oldVal.__abortController.abort(new Error('replaced'))\n }\n const { __staleWhileFetching: s } = oldVal\n if (s !== undefined && s !== v) {\n if (this.#hasDispose) {\n this.#dispose?.(s, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([s, k, 'set'])\n }\n }\n } else {\n if (this.#hasDispose) {\n this.#dispose?.(oldVal, k, 'set')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldVal, k, 'set'])\n }\n }\n }\n this.#removeItemSize(index)\n this.#addItemSize(index, size, status)\n this.#valList[index] = v\n if (!isBF) {\n const oldValue =\n oldVal && this.#isBackgroundFetch(oldVal) ?\n oldVal.__staleWhileFetching\n : oldVal\n const setType =\n oldValue === undefined ? 'add'\n : v !== oldValue ? 'replace'\n : 'update'\n if (status) {\n status.set = setType\n if (oldValue !== undefined) status.oldValue = oldValue\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, setType)\n }\n }\n } else if (!isBF) {\n if (status) {\n status.set = 'update'\n }\n if (this.#hasOnInsert) {\n this.onInsert?.(v, k, 'update')\n }\n }\n }\n if (ttl !== 0 && !this.#ttls) {\n this.#initializeTTLTracking()\n }\n if (this.#ttls) {\n if (!noUpdateTTL) {\n this.#setItemTTL(index, ttl, start)\n }\n if (status) this.#statusTTL(status, index)\n }\n if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return this\n }\n\n /**\n * Evict the least recently used item, returning its value or\n * `undefined` if cache is empty.\n */\n pop(): V | undefined {\n try {\n while (this.#size) {\n const val = this.#valList[this.#head]\n this.#evict(true)\n if (this.#isBackgroundFetch(val)) {\n if (val.__staleWhileFetching) {\n return val.__staleWhileFetching\n }\n } else if (val !== undefined) {\n return val\n }\n }\n } finally {\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n }\n\n #evict(free: boolean) {\n const head = this.#head\n const k = this.#keyList[head]!\n const v = this.#valList[head]!\n const isBF = this.#isBackgroundFetch(v)\n if (isBF) {\n v.__abortController.abort(new Error('evicted'))\n }\n const oldValue = isBF ? v.__staleWhileFetching : v\n if (\n (this.#hasDispose || this.#hasDisposeAfter) &&\n oldValue !== undefined\n ) {\n if (this.#hasDispose) {\n this.#dispose?.(oldValue, k, 'evict')\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([oldValue, k, 'evict'])\n }\n }\n this.#removeItemSize(head)\n if (this.#autopurgeTimers?.[head]) {\n clearTimeout(this.#autopurgeTimers[head])\n this.#autopurgeTimers[head] = undefined\n }\n // if we aren't about to use the index, then null these out\n if (free) {\n this.#keyList[head] = undefined\n this.#valList[head] = undefined\n this.#free.push(head)\n }\n if (this.#size === 1) {\n this.#head = this.#tail = 0 as Index\n this.#free.length = 0\n } else {\n this.#head = this.#next[head] as Index\n }\n this.#keyMap.delete(k)\n this.#size--\n return head\n }\n\n /**\n * Check if a key is in the cache, without updating the recency of use.\n * Will return false if the item is stale, even though it is technically\n * in the cache.\n *\n * Check if a key is in the cache, without updating the recency of\n * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set\n * to `true` in either the options or the constructor.\n *\n * Will return `false` if the item is stale, even though it is technically in\n * the cache. The difference can be determined (if it matters) by using a\n * `status` argument, and inspecting the `has` field.\n *\n * Will not update item age unless\n * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.\n */\n has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = hasOptions\n hasOptions.status = status\n if (status) {\n status.op = 'has'\n status.key = k\n status.cache = this\n }\n const result = this.#has(k, hasOptions)\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #has(k: K, hasOptions: LRUCache.HasOptions = {}) {\n const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n const v = this.#valList[index]\n if (\n this.#isBackgroundFetch(v) &&\n v.__staleWhileFetching === undefined\n ) {\n return false\n }\n if (!this.#isStale(index)) {\n if (updateAgeOnHas) {\n this.#updateItemAge(index)\n }\n if (status) {\n status.has = 'hit'\n this.#statusTTL(status, index)\n }\n return true\n } else if (status) {\n status.has = 'stale'\n this.#statusTTL(status, index)\n }\n } else if (status) {\n status.has = 'miss'\n }\n return false\n }\n\n /**\n * Like {@link LRUCache#get} but doesn't update recency or delete stale\n * items.\n *\n * Returns `undefined` if the item is stale, unless\n * {@link LRUCache.OptionsBase.allowStale} is set.\n */\n peek(k: K, peekOptions: LRUCache.PeekOptions = {}) {\n const { status = hasSubscribers() ? {} : undefined } = peekOptions\n if (status) {\n status.op = 'peek'\n status.key = k\n status.cache = this\n }\n peekOptions.status = status\n const result = this.#peek(k, peekOptions)\n if (metrics.hasSubscribers) {\n metrics.publish(status)\n }\n return result\n }\n #peek(k: K, peekOptions: LRUCache.PeekOptions) {\n const { status, allowStale = this.allowStale } = peekOptions\n const index = this.#keyMap.get(k)\n if (index === undefined || (!allowStale && this.#isStale(index))) {\n if (status) status.peek = index === undefined ? 'miss' : 'stale'\n return undefined\n }\n const v = this.#valList[index]\n const val = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v\n if (status) {\n if (val !== undefined) {\n status.peek = 'hit'\n status.value = val\n } else {\n status.peek = 'miss'\n }\n }\n return val\n }\n\n #backgroundFetch(\n k: K,\n index: Index | undefined,\n options: LRUCache.FetchOptions,\n context: FC,\n ): BackgroundFetch {\n const v = index === undefined ? undefined : this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n return v\n }\n\n const ac = new AbortController()\n const { signal } = options\n // when/if our AC signals, then stop listening to theirs.\n signal?.addEventListener('abort', () => ac.abort(signal.reason), {\n signal: ac.signal,\n })\n\n const fetchOpts = {\n signal: ac.signal,\n options,\n context,\n }\n\n const cb = (v: V | undefined, updateCache = false): V | undefined => {\n const { aborted } = ac.signal\n const ignoreAbort = options.ignoreFetchAbort && v !== undefined\n const proceed =\n options.ignoreFetchAbort ||\n !!(options.allowStaleOnFetchAbort && v !== undefined)\n if (options.status) {\n if (aborted && !updateCache) {\n options.status.fetchAborted = true\n options.status.fetchError = ac.signal.reason\n if (ignoreAbort) options.status.fetchAbortIgnored = true\n } else {\n options.status.fetchResolved = true\n }\n }\n if (aborted && !ignoreAbort && !updateCache) {\n return fetchFail(ac.signal.reason, proceed)\n }\n // either we didn't abort, and are still here, or we did, and ignored\n const bf = p as BackgroundFetch\n // if nothing else has been written there but we're set to update the\n // cache and ignore the abort, or if it's still pending on this specific\n // background request, then write it to the cache.\n const vl = this.#valList[index as Index]\n if (vl === p || (vl === undefined && ignoreAbort && updateCache)) {\n if (v === undefined) {\n if (bf.__staleWhileFetching !== undefined) {\n this.#valList[index as Index] = bf.__staleWhileFetching\n } else {\n this.#delete(k, 'fetch')\n }\n } else {\n if (options.status) options.status.fetchUpdated = true\n this.#set(k, v, fetchOpts.options, bf)\n }\n }\n return v\n }\n\n const eb = (er: unknown) => {\n if (options.status) {\n options.status.fetchRejected = true\n options.status.fetchError = er as Error\n }\n // do not pass go, do not collect $200\n return fetchFail(er, false)\n }\n\n const fetchFail = (er: unknown, proceed: boolean): V | undefined => {\n const { aborted } = ac.signal\n const allowStaleAborted = aborted && options.allowStaleOnFetchAbort\n const allowStale =\n allowStaleAborted || options.allowStaleOnFetchRejection\n const noDelete = allowStale || options.noDeleteOnFetchRejection\n const bf = p as BackgroundFetch\n if (this.#valList[index as Index] === p) {\n // if we allow stale on fetch rejections, then we need to ensure that\n // the stale value is not removed from the cache when the fetch fails.\n const del =\n !noDelete || (!proceed && bf.__staleWhileFetching === undefined)\n if (del) {\n this.#delete(k, 'fetch')\n } else if (!allowStaleAborted) {\n // still replace the *promise* with the stale value,\n // since we are done with the promise at this point.\n // leave it untouched if we're still waiting for an\n // aborted background fetch that hasn't yet returned.\n this.#valList[index as Index] = bf.__staleWhileFetching\n }\n }\n if (allowStale) {\n if (options.status && bf.__staleWhileFetching !== undefined) {\n options.status.returnedStale = true\n }\n return bf.__staleWhileFetching\n } else if (bf.__returned === bf) {\n throw er\n }\n }\n\n const pcall = (\n res: (v: V | undefined) => void,\n rej: (e: unknown) => void,\n ) => {\n const fmp = this.#fetchMethod?.(k, v, fetchOpts)\n // ignored, we go until we finish, regardless.\n // defer check until we are actually aborting,\n // so fetchMethod can override.\n ac.signal.addEventListener('abort', () => {\n if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {\n res(undefined)\n // when it eventually resolves, update the cache.\n if (options.allowStaleOnFetchAbort) {\n res = v => cb(v, true)\n }\n }\n })\n if (fmp && fmp instanceof Promise) {\n fmp.then(v => res(v === undefined ? undefined : v), rej)\n } else if (fmp !== undefined) {\n res(fmp)\n }\n }\n\n if (options.status) options.status.fetchDispatched = true\n const p = new Promise(pcall).then(cb, eb)\n const bf: BackgroundFetch = Object.assign(p, {\n __abortController: ac,\n __staleWhileFetching: v,\n __returned: undefined,\n })\n\n if (index === undefined) {\n // internal, don't expose status.\n this.#set(k, bf, { ...fetchOpts.options, status: undefined })\n index = this.#keyMap.get(k)\n } else {\n // do not call #set, because we do not want to adjust its place\n // in the lru queue, as it has not yet been \"used\". Also, we don't\n // need to worry about evicting for size, because a background fetch\n // over a stale value is treated as the same size as its stale value.\n this.#valList[index] = bf\n }\n return bf\n }\n\n #isBackgroundFetch(p: unknown): p is BackgroundFetch {\n if (!this.#hasFetchMethod) return false\n const b = p as BackgroundFetch\n return (\n !!b &&\n b instanceof Promise &&\n b.hasOwnProperty('__staleWhileFetching') &&\n b.__abortController instanceof AbortController\n )\n }\n\n /**\n * Make an asynchronous cached fetch using the\n * {@link LRUCache.OptionsBase.fetchMethod} function.\n *\n * If the value is in the cache and not stale, then the returned\n * Promise resolves to the value.\n *\n * If not in the cache, or beyond its TTL staleness, then\n * `fetchMethod(key, staleValue, { options, signal, context })` is\n * called, and the value returned will be added to the cache once\n * resolved.\n *\n * If called with `allowStale`, and an asynchronous fetch is\n * currently in progress to reload a stale value, then the former\n * stale value will be returned.\n *\n * If called with `forceRefresh`, then the cached item will be\n * re-fetched, even if it is not stale. However, if `allowStale` is also\n * set, then the old value will still be returned. This is useful\n * in cases where you want to force a reload of a cached value. If\n * a background fetch is already in progress, then `forceRefresh`\n * has no effect.\n *\n * If multiple fetches for the same key are issued, then they will all be\n * coalesced into a single call to fetchMethod.\n *\n * Note that this means that handling options such as\n * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort},\n * {@link LRUCache.FetchOptions.signal},\n * and {@link LRUCache.OptionsBase.allowStaleOnFetchRejection} will be\n * determined by the FIRST fetch() call for a given key.\n *\n * This is a known (fixable) shortcoming which will be addresed on when\n * someone complains about it, as the fix would involve added complexity and\n * may not be worth the costs for this edge case.\n *\n * If {@link LRUCache.OptionsBase.fetchMethod} is not specified, then this is\n * effectively an alias for `Promise.resolve(cache.get(key))`.\n *\n * When the fetch method resolves to a value, if the fetch has not\n * been aborted due to deletion, eviction, or being overwritten,\n * then it is added to the cache using the options provided.\n *\n * If the key is evicted or deleted before the `fetchMethod`\n * resolves, then the AbortSignal passed to the `fetchMethod` will\n * receive an `abort` event, and the promise returned by `fetch()`\n * will reject with the reason for the abort.\n *\n * If a `signal` is passed to the `fetch()` call, then aborting the\n * signal will abort the fetch and cause the `fetch()` promise to\n * reject with the reason provided.\n *\n * **Setting `context`**\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the {@link LRUCache} constructor, then all\n * calls to `cache.fetch()` _must_ provide a `context` option. If\n * set to `undefined` or `void`, then calls to fetch _must not_\n * provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that\n * might be relevant in the course of fetching the data. It is only\n * relevant for the course of a single `fetch()` operation, and\n * discarded afterwards.\n *\n * **Note: `fetch()` calls are inflight-unique**\n *\n * If you call `fetch()` multiple times with the same key value,\n * then every call after the first will resolve on the same\n * promise1,\n * _even if they have different settings that would otherwise change\n * the behavior of the fetch_, such as `noDeleteOnFetchRejection`\n * or `ignoreFetchAbort`.\n *\n * In most cases, this is not a problem (in fact, only fetching\n * something once is what you probably want, if you're caching in\n * the first place). If you are changing the fetch() options\n * dramatically between runs, there's a good chance that you might\n * be trying to fit divergent semantics into a single object, and\n * would be better off with multiple cache instances.\n *\n * **1**: Ie, they're not the \"same Promise\", but they resolve at\n * the same time, because they're both waiting on the same\n * underlying fetchMethod response.\n */\n\n fetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n\n // this overload not allowed if context is required\n fetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#fetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #fetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const {\n // get options\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n // set options\n ttl = this.ttl,\n noDisposeOnSet = this.noDisposeOnSet,\n size = 0,\n sizeCalculation = this.sizeCalculation,\n noUpdateTTL = this.noUpdateTTL,\n // fetch exclusive options\n noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,\n allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,\n ignoreFetchAbort = this.ignoreFetchAbort,\n allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,\n context,\n forceRefresh = false,\n status,\n signal,\n } = fetchOptions\n if (status) {\n status.op = 'fetch'\n status.key = k\n if (forceRefresh) status.forceRefresh = true\n status.cache = this\n }\n\n if (!this.#hasFetchMethod) {\n if (status) status.fetch = 'get'\n return this.#get(k, {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n status,\n })\n }\n\n const options = {\n allowStale,\n updateAgeOnGet,\n noDeleteOnStaleGet,\n ttl,\n noDisposeOnSet,\n size,\n sizeCalculation,\n noUpdateTTL,\n noDeleteOnFetchRejection,\n allowStaleOnFetchRejection,\n allowStaleOnFetchAbort,\n ignoreFetchAbort,\n status,\n signal,\n }\n\n let index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.fetch = 'miss'\n const p = this.#backgroundFetch(k, index, options, context as FC)\n return (p.__returned = p)\n } else {\n // in cache, maybe already fetching\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n const stale = allowStale && v.__staleWhileFetching !== undefined\n if (status) {\n status.fetch = 'inflight'\n if (stale) status.returnedStale = true\n }\n return stale ? v.__staleWhileFetching : (v.__returned = v)\n }\n\n // if we force a refresh, that means do NOT serve the cached value,\n // unless we are already in the process of refreshing the cache.\n const isStale = this.#isStale(index)\n if (!forceRefresh && !isStale) {\n if (status) status.fetch = 'hit'\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n if (status) this.#statusTTL(status, index)\n return v\n }\n\n // ok, it is stale or a forced refresh, and not already fetching.\n // refresh the cache.\n const p = this.#backgroundFetch(k, index, options, context as FC)\n const hasStale = p.__staleWhileFetching !== undefined\n const staleVal = hasStale && allowStale\n if (status) {\n status.fetch = isStale ? 'stale' : 'refresh'\n if (staleVal && isStale) status.returnedStale = true\n }\n return staleVal ? p.__staleWhileFetching : (p.__returned = p)\n }\n }\n\n /**\n * In some cases, `cache.fetch()` may resolve to `undefined`, either because\n * a {@link LRUCache.OptionsBase#fetchMethod} was not provided (turning\n * `cache.fetch(k)` into just an async wrapper around `cache.get(k)`) or\n * because `ignoreFetchAbort` was specified (either to the constructor or\n * in the {@link LRUCache.FetchOptions}). Also, the\n * {@link LRUCache.OptionsBase.fetchMethod} may return `undefined` or `void`, making\n * the test even more complicated.\n *\n * Because inferring the cases where `undefined` might be returned are so\n * cumbersome, but testing for `undefined` can also be annoying, this method\n * can be used, which will reject if `this.fetch()` resolves to undefined.\n */\n forceFetch(\n k: K,\n fetchOptions: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : LRUCache.FetchOptionsWithContext,\n ): Promise\n // this overload not allowed if context is required\n forceFetch(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n fetchOptions?: unknown extends FC ? LRUCache.FetchOptions\n : FC extends undefined | void ?\n LRUCache.FetchOptionsNoContext\n : never,\n ): Promise\n forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ): Promise {\n const ths = tracing.hasSubscribers\n const { status = hasSubscribers() ? {} : undefined } = fetchOptions\n fetchOptions.status = status\n if (status && fetchOptions.context) {\n status.context = fetchOptions.context\n }\n const p = this.#forceFetch(k, fetchOptions)\n if (status && ths) {\n status.trace = true\n tracing.tracePromise(() => p, status).catch(() => {})\n }\n return p\n }\n\n async #forceFetch(\n k: K,\n fetchOptions: LRUCache.FetchOptions = {},\n ) {\n const v = await this.#fetch(k, fetchOptions)\n if (v === undefined) throw new Error('fetch() returned undefined')\n return v\n }\n\n /**\n * If the key is found in the cache, then this is equivalent to\n * {@link LRUCache#get}. If not, in the cache, then calculate the value using\n * the {@link LRUCache.OptionsBase.memoMethod}, and add it to the cache.\n *\n * If an `FC` type is set to a type other than `unknown`, `void`, or\n * `undefined` in the LRUCache constructor, then all calls to `cache.memo()`\n * _must_ provide a `context` option. If set to `undefined` or `void`, then\n * calls to memo _must not_ provide a `context` option.\n *\n * The `context` param allows you to provide arbitrary data that might be\n * relevant in the course of fetching the data. It is only relevant for the\n * course of a single `memo()` operation, and discarded afterwards.\n */\n memo(\n k: K,\n memoOptions: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : LRUCache.MemoOptionsWithContext,\n ): V\n // this overload not allowed if context is required\n memo(\n k: unknown extends FC ? K\n : FC extends undefined | void ? K\n : never,\n memoOptions?: unknown extends FC ? LRUCache.MemoOptions\n : FC extends undefined | void ? LRUCache.MemoOptionsNoContext\n : never,\n ): V\n memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } =\n memoOptions\n memoOptions.status = status\n if (status) {\n status.op = 'memo'\n status.key = k\n if (memoOptions.context) {\n status.context = memoOptions.context\n }\n status.cache = this\n }\n const result = this.#memo(k, memoOptions)\n if (status) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n return result\n }\n #memo(k: K, memoOptions: LRUCache.MemoOptions = {}) {\n const memoMethod = this.#memoMethod\n if (!memoMethod) {\n throw new Error('no memoMethod provided to constructor')\n }\n const { context, status, forceRefresh, ...options } = memoOptions\n if (status && forceRefresh) status.forceRefresh = true\n const v = this.#get(k, options)\n const refresh = forceRefresh || v === undefined\n if (status) {\n status.memo = refresh ? 'miss' : 'hit'\n if (!refresh) status.value = v\n }\n if (!refresh) return v\n const vv = memoMethod(k, v, {\n options,\n context,\n } as LRUCache.MemoizerOptions)\n if (status) status.value = vv\n this.#set(k, vv, options)\n return vv\n }\n\n /**\n * Return a value from the cache. Will update the recency of the cache\n * entry found.\n *\n * If the key is not found, get() will return `undefined`.\n */\n get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const { status = metrics.hasSubscribers ? {} : undefined } = getOptions\n getOptions.status = status\n if (status) {\n status.op = 'get'\n status.key = k\n status.cache = this\n }\n const result = this.#get(k, getOptions)\n if (status) {\n if (result !== undefined) status.value = result\n if (metrics.hasSubscribers) metrics.publish(status)\n }\n return result\n }\n\n #get(k: K, getOptions: LRUCache.GetOptions = {}) {\n const {\n allowStale = this.allowStale,\n updateAgeOnGet = this.updateAgeOnGet,\n noDeleteOnStaleGet = this.noDeleteOnStaleGet,\n status,\n } = getOptions\n const index = this.#keyMap.get(k)\n if (index === undefined) {\n if (status) status.get = 'miss'\n return undefined\n }\n const value = this.#valList[index]\n const fetching = this.#isBackgroundFetch(value)\n if (status) this.#statusTTL(status, index)\n if (this.#isStale(index)) {\n // delete only if not an in-flight background fetch\n if (!fetching) {\n if (!noDeleteOnStaleGet) {\n this.#delete(k, 'expire')\n }\n if (status) status.get = 'stale'\n if (allowStale) {\n if (status) status.returnedStale = true\n return value\n }\n return undefined\n }\n if (status) status.get = 'stale-fetching'\n if (allowStale && value.__staleWhileFetching !== undefined) {\n if (status) status.returnedStale = true\n return value.__staleWhileFetching\n }\n return undefined\n }\n // not stale\n if (status) status.get = fetching ? 'fetching' : 'hit'\n // if we're currently fetching it, we don't actually have it yet\n // it's not stale, which means this isn't a staleWhileRefetching.\n // If it's not stale, and fetching, AND has a __staleWhileFetching\n // value, then that means the user fetched with {forceRefresh:true},\n // so it's safe to return that value.\n this.#moveToTail(index)\n if (updateAgeOnGet) {\n this.#updateItemAge(index)\n }\n return fetching ? value.__staleWhileFetching : value\n }\n\n #connect(p: Index, n: Index) {\n this.#prev[n] = p\n this.#next[p] = n\n }\n\n #moveToTail(index: Index): void {\n // if tail already, nothing to do\n // if head, move head to next[index]\n // else\n // move next[prev[index]] to next[index] (head has no prev)\n // move prev[next[index]] to prev[index]\n // prev[index] = tail\n // next[tail] = index\n // tail = index\n if (index !== this.#tail) {\n if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n this.#connect(\n this.#prev[index] as Index,\n this.#next[index] as Index,\n )\n }\n this.#connect(this.#tail, index)\n this.#tail = index\n }\n }\n\n /**\n * Deletes a key out of the cache.\n *\n * Returns true if the key was deleted, false otherwise.\n */\n delete(k: K) {\n return this.#delete(k, 'delete')\n }\n\n #delete(k: K, reason: LRUCache.DisposeReason) {\n if (metrics.hasSubscribers) {\n metrics.publish({\n op: 'delete',\n delete: reason,\n key: k,\n cache: this,\n })\n }\n let deleted = false\n if (this.#size !== 0) {\n const index = this.#keyMap.get(k)\n if (index !== undefined) {\n if (this.#autopurgeTimers?.[index]) {\n clearTimeout(this.#autopurgeTimers?.[index])\n this.#autopurgeTimers[index] = undefined\n }\n deleted = true\n if (this.#size === 1) {\n this.#clear(reason)\n } else {\n this.#removeItemSize(index)\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else if (this.#hasDispose || this.#hasDisposeAfter) {\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k, reason])\n }\n }\n this.#keyMap.delete(k)\n this.#keyList[index] = undefined\n this.#valList[index] = undefined\n if (index === this.#tail) {\n this.#tail = this.#prev[index] as Index\n } else if (index === this.#head) {\n this.#head = this.#next[index] as Index\n } else {\n const pi = this.#prev[index] as number\n this.#next[pi] = this.#next[index] as number\n const ni = this.#next[index] as number\n this.#prev[ni] = this.#prev[index] as number\n }\n this.#size--\n this.#free.push(index)\n }\n }\n }\n if (this.#hasDisposeAfter && this.#disposed?.length) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n return deleted\n }\n\n /**\n * Clear the cache entirely, throwing away all values.\n */\n clear() {\n return this.#clear('delete')\n }\n #clear(reason: LRUCache.DisposeReason) {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index]\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'))\n } else {\n const k = this.#keyList[index]\n if (this.#hasDispose) {\n this.#dispose?.(v as V, k as K, reason)\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v as V, k as K, reason])\n }\n }\n }\n\n this.#keyMap.clear()\n void this.#valList.fill(undefined)\n this.#keyList.fill(undefined)\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0)\n this.#starts.fill(0)\n for (const t of this.#autopurgeTimers ?? []) {\n if (t !== undefined) clearTimeout(t)\n }\n this.#autopurgeTimers?.fill(undefined)\n }\n if (this.#sizes) {\n this.#sizes.fill(0)\n }\n this.#head = 0 as Index\n this.#tail = 0 as Index\n this.#free.length = 0\n this.#calculatedSize = 0\n this.#size = 0\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed\n let task: DisposeTask | undefined\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task)\n }\n }\n }\n}\n"], + "mappings": "AAEA,OAAS,kBAAAA,EAAgB,WAAAC,MAAe,2BAGjC,IAAMC,EAA4BD,EAAQ,mBAAmB,EACvDE,EAAmCH,EAAe,WAAW,ECEnE,IAAMI,EAET,OAAO,aAAgB,UACvB,aACA,OAAO,YAAY,KAAQ,WAG3B,YACqB,KCPzB,IAAMC,EAAiB,IACrBC,EAAQ,gBAAkBC,EAAQ,eAE9BC,EAAS,IAAI,IAObC,EACJ,OAAO,SAAY,UAAc,QAC/B,QACA,CAAA,EAGEC,EAAc,CAClBC,EACAC,EACAC,EACAC,IACE,CACE,OAAOL,EAAQ,aAAgB,WACjCA,EAAQ,YAAYE,EAAKC,EAAMC,EAAMC,CAAE,EAGvC,QAAQ,MAAM,IAAID,CAAI,KAAKD,CAAI,KAAKD,CAAG,EAAE,CAE7C,EACMI,EAAcF,GAAiB,CAACL,EAAO,IAAIK,CAAI,EAMrD,IAAMG,EAAYC,GAChB,CAAC,CAACA,GAAKA,IAAM,KAAK,MAAMA,CAAW,GAAKA,EAAI,GAAK,SAASA,CAAC,EAcvDC,EAAgBC,GACnBH,EAASG,CAAG,EACXA,GAAO,K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CASA,GARI,KAAKH,IACP,KAAKA,GAAO,KAAK,CAAC,EAEpB,KAAKJ,GAAQ,EACb,KAAKC,GAAQ,EACb,KAAKC,GAAM,OAAS,EACpB,KAAKR,GAAkB,EACvB,KAAKD,GAAQ,EACT,KAAKiB,IAAoB,KAAKP,GAAW,CAC3C,IAAMkG,EAAK,KAAKlG,GACZmG,EACJ,KAAQA,EAAOD,GAAI,MAAK,GACtB,KAAKhH,KAAgB,GAAGiH,CAAI,CAEhC,CACF", + "names": ["tracingChannel", "channel", "metrics", "tracing", "defaultPerf", "hasSubscribers", "metrics", "tracing", "warned", "PROCESS", "emitWarning", "msg", "type", "code", "fn", "shouldWarn", "isPosInt", "n", "getUintArray", "max", "ZeroArray", "size", "Stack", "_Stack", "#constructing", "HeapCls", "s", "LRUCache", "_LRUCache", "#max", "#maxSize", "#dispose", "#onInsert", "#disposeAfter", "#fetchMethod", "#memoMethod", "#perf", "#size", "#calculatedSize", "#keyMap", "#keyList", "#valList", "#next", "#prev", "#head", "#tail", "#free", "#disposed", "#sizes", "#starts", "#ttls", "#autopurgeTimers", "#hasDispose", "#hasFetchMethod", "#hasDisposeAfter", "#hasOnInsert", "c", "p", "#isBackgroundFetch", "k", "index", "options", "context", "#backgroundFetch", "#moveToTail", "#indexes", "#rindexes", "#isStale", "ttl", "ttlResolution", "ttlAutopurge", "updateAgeOnGet", "updateAgeOnHas", "allowStale", "dispose", "onInsert", "disposeAfter", "noDisposeOnSet", "noUpdateTTL", "maxSize", "maxEntrySize", "sizeCalculation", "fetchMethod", "memoMethod", "noDeleteOnFetchRejection", "noDeleteOnStaleGet", "allowStaleOnFetchRejection", "allowStaleOnFetchAbort", "ignoreFetchAbort", "backgroundFetchSize", "perf", "defaultPerf", "UintArray", "#initializeSizeTracking", "#initializeTTLTracking", "code", "shouldWarn", "warned", "emitWarning", "key", "ttls", "starts", "purgeTimers", "#setItemTTL", "start", "setPurgetTimer", "#updateItemAge", "t", "#delete", "#statusTTL", "status", "cachedNow", "getNow", "age", "sizes", "#removeItemSize", "#requireSize", "v", "#addItemSize", "#evict", "_i", "_s", "_st", "_k", "_v", "i", "#isValidIndex", "fn", "getOptions", "value", "#get", "thisp", "deleted", "entry", "remain", "arr", "#set", "setOptions", "metrics", "result", "bf", "isBF", "oldVal", "oldValue", "setType", "dt", "task", "val", "free", "head", "hasOptions", "#has", "peekOptions", "hasSubscribers", "#peek", "ac", "signal", "fetchOpts", "cb", "updateCache", "aborted", "ignoreAbort", "proceed", "fetchFail", "vl", "eb", "er", "allowStaleAborted", "noDelete", "pcall", "res", "rej", "fmp", "b", "fetchOptions", "ths", "tracing", "#fetch", "forceRefresh", "stale", "isStale", "staleVal", "#forceFetch", "memoOptions", "#memo", "refresh", "vv", "fetching", "#connect", "reason", "#clear", "pi", "ni"] +} diff --git a/node_modules/lru-cache/dist/esm/node/perf.d.ts b/node_modules/lru-cache/dist/esm/node/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/perf.d.ts.map b/node_modules/lru-cache/dist/esm/node/perf.d.ts.map new file mode 100644 index 00000000..3e239ce9 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/perf.js b/node_modules/lru-cache/dist/esm/node/perf.js new file mode 100644 index 00000000..f21cd88c --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/node/perf.js.map b/node_modules/lru-cache/dist/esm/node/perf.js.map new file mode 100644 index 00000000..5dc82212 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/node/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/package.json b/node_modules/lru-cache/dist/esm/package.json new file mode 100644 index 00000000..3dbc1ca5 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/lru-cache/dist/esm/perf.d.ts b/node_modules/lru-cache/dist/esm/perf.d.ts new file mode 100644 index 00000000..15a4a627 --- /dev/null +++ b/node_modules/lru-cache/dist/esm/perf.d.ts @@ -0,0 +1,12 @@ +/** + * this provides the default Perf object source, either the + * `performance` global, or the `Date` constructor. + * + * it can be passed in via configuration to override it + * for a single LRU object. + */ +export type Perf = { + now: () => number; +}; +export declare const defaultPerf: Perf; +//# sourceMappingURL=perf.d.ts.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/perf.d.ts.map b/node_modules/lru-cache/dist/esm/perf.d.ts.map new file mode 100644 index 00000000..fd6eeeed --- /dev/null +++ b/node_modules/lru-cache/dist/esm/perf.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,GAAG;IAAE,GAAG,EAAE,MAAM,MAAM,CAAA;CAAE,CAAA;AACxC,eAAO,MAAM,WAAW,EAAE,IAQG,CAAA"} \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/perf.js b/node_modules/lru-cache/dist/esm/perf.js new file mode 100644 index 00000000..f21cd88c --- /dev/null +++ b/node_modules/lru-cache/dist/esm/perf.js @@ -0,0 +1,7 @@ +export const defaultPerf = (typeof performance === 'object' && + performance && + typeof performance.now === 'function') ? + /* c8 ignore start - this gets covered, but c8 gets confused */ + performance + : /* c8 ignore stop */ Date; +//# sourceMappingURL=perf.js.map \ No newline at end of file diff --git a/node_modules/lru-cache/dist/esm/perf.js.map b/node_modules/lru-cache/dist/esm/perf.js.map new file mode 100644 index 00000000..86425c7d --- /dev/null +++ b/node_modules/lru-cache/dist/esm/perf.js.map @@ -0,0 +1 @@ +{"version":3,"file":"perf.js","sourceRoot":"","sources":["../../src/perf.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GACtB,CACE,OAAO,WAAW,KAAK,QAAQ;IAC/B,WAAW;IACX,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,CACtC,CAAC,CAAC;IACD,+DAA+D;IAC/D,WAAW;IACb,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAA","sourcesContent":["/**\n * this provides the default Perf object source, either the\n * `performance` global, or the `Date` constructor.\n *\n * it can be passed in via configuration to override it\n * for a single LRU object.\n */\nexport type Perf = { now: () => number }\nexport const defaultPerf: Perf =\n (\n typeof performance === 'object' &&\n performance &&\n typeof performance.now === 'function'\n ) ?\n /* c8 ignore start - this gets covered, but c8 gets confused */\n performance\n : /* c8 ignore stop */ Date\n"]} \ No newline at end of file diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json new file mode 100644 index 00000000..6ada2c21 --- /dev/null +++ b/node_modules/lru-cache/package.json @@ -0,0 +1,154 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "11.5.1", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "sideEffects": false, + "scripts": { + "build": "npm run prepare", + "prepare": "tshy && bash scripts/build.sh", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "format": "prettier --write .", + "typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts", + "benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh", + "prebenchmark": "npm run prepare", + "benchmark": "make -C benchmark", + "preprofile": "npm run prepare", + "profile": "make -C benchmark profile", + "lint": "oxlint --fix src test", + "postsnap": "npm run lint", + "postlint": "npm run format" + }, + "main": "./dist/commonjs/index.min.js", + "types": "./dist/commonjs/index.d.ts", + "tshy": { + "esmDialects": [ + "browser", + "node" + ], + "commonjsDialects": [ + "browser", + "node" + ], + "exports": { + "./raw": "./src/index.ts", + ".": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.min.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.min.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.min.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.min.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "selfLink": false + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "benchmark": "^2.1.4", + "esbuild": "^0.28.0", + "marked": "^4.2.12", + "mkdirp": "^3.0.1", + "oxlint": "^1.65.0", + "oxlint-tsgolint": "^0.22.1", + "prettier": "^3.8.3", + "tap": "^21.7.4", + "tshy": "^4.1.2", + "typedoc": "^0.28.19" + }, + "license": "BlueOak-1.0.0", + "files": [ + "dist" + ], + "engines": { + "node": "20 || >=22" + }, + "exports": { + "./raw": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + ".": { + "import": { + "browser": { + "types": "./dist/esm/browser/index.d.ts", + "default": "./dist/esm/browser/index.min.js" + }, + "node": { + "types": "./dist/esm/node/index.d.ts", + "default": "./dist/esm/node/index.min.js" + }, + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.min.js" + }, + "require": { + "browser": { + "types": "./dist/commonjs/browser/index.d.ts", + "default": "./dist/commonjs/browser/index.min.js" + }, + "node": { + "types": "./dist/commonjs/node/index.d.ts", + "default": "./dist/commonjs/node/index.min.js" + }, + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.min.js" + } + } + }, + "type": "module", + "module": "./dist/esm/index.min.js" +} diff --git a/node_modules/luxon/LICENSE.md b/node_modules/luxon/LICENSE.md new file mode 100644 index 00000000..2d560a64 --- /dev/null +++ b/node_modules/luxon/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2019 JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/luxon/README.md b/node_modules/luxon/README.md new file mode 100644 index 00000000..3fcacd7d --- /dev/null +++ b/node_modules/luxon/README.md @@ -0,0 +1,55 @@ +# Luxon + +[![MIT License][license-image]][license] [![Build Status][github-action-image]][github-action-url] [![NPM version][npm-version-image]][npm-url] [![Coverage Status][test-coverage-image]][test-coverage-url] [![PRs welcome][contributing-image]][contributing-url] + +Luxon is a library for working with dates and times in JavaScript. + +```js +DateTime.now().setZone("America/New_York").minus({ weeks: 1 }).endOf("day").toISO(); +``` + +## Upgrading to 3.0 + +[Guide](https://moment.github.io/luxon/#upgrading) + +## Features + * DateTime, Duration, and Interval types. + * Immutable, chainable, unambiguous API. + * Parsing and formatting for common and custom formats. + * Native time zone and Intl support (no locale or tz files). + +## Download/install + +[Download/install instructions](https://moment.github.io/luxon/#/install) + +## Documentation + +* [General documentation](https://moment.github.io/luxon/#/?id=luxon) +* [API docs](https://moment.github.io/luxon/api-docs/index.html) +* [Quick tour](https://moment.github.io/luxon/#/tour) +* [For Moment users](https://moment.github.io/luxon/#/moment) +* [Why does Luxon exist?](https://moment.github.io/luxon/#/why) +* [A quick demo](https://moment.github.io/luxon/demo/global.html) + +## Development + +See [contributing](CONTRIBUTING.md). + +![Phasers to stun][phasers-image] + +[license-image]: https://img.shields.io/badge/license-MIT-blue.svg +[license]: LICENSE.md + +[github-action-image]: https://github.com/moment/luxon/actions/workflows/test.yml/badge.svg +[github-action-url]: https://github.com/moment/luxon/actions/workflows/test.yml + +[npm-url]: https://npmjs.org/package/luxon +[npm-version-image]: https://badge.fury.io/js/luxon.svg + +[test-coverage-url]: https://codecov.io/gh/moment/luxon +[test-coverage-image]: https://codecov.io/gh/moment/luxon/branch/master/graph/badge.svg + +[contributing-url]: https://github.com/moment/luxon/blob/master/CONTRIBUTING.md +[contributing-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg + +[phasers-image]: https://img.shields.io/badge/phasers-stun-brightgreen.svg diff --git a/node_modules/luxon/build/amd/luxon.js b/node_modules/luxon/build/amd/luxon.js new file mode 100644 index 00000000..dcdb4f91 --- /dev/null +++ b/node_modules/luxon/build/amd/luxon.js @@ -0,0 +1,8741 @@ +define(['exports'], (function (exports) { 'use strict'; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct.bind(); + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } + function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + return _wrapNativeSuper(Class); + } + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + + // these aren't really private, but nor are they really useful to document + /** + * @private + */ + var LuxonError = /*#__PURE__*/function (_Error) { + _inheritsLoose(LuxonError, _Error); + function LuxonError() { + return _Error.apply(this, arguments) || this; + } + return LuxonError; + }( /*#__PURE__*/_wrapNativeSuper(Error)); + /** + * @private + */ + var InvalidDateTimeError = /*#__PURE__*/function (_LuxonError) { + _inheritsLoose(InvalidDateTimeError, _LuxonError); + function InvalidDateTimeError(reason) { + return _LuxonError.call(this, "Invalid DateTime: " + reason.toMessage()) || this; + } + return InvalidDateTimeError; + }(LuxonError); + + /** + * @private + */ + var InvalidIntervalError = /*#__PURE__*/function (_LuxonError2) { + _inheritsLoose(InvalidIntervalError, _LuxonError2); + function InvalidIntervalError(reason) { + return _LuxonError2.call(this, "Invalid Interval: " + reason.toMessage()) || this; + } + return InvalidIntervalError; + }(LuxonError); + + /** + * @private + */ + var InvalidDurationError = /*#__PURE__*/function (_LuxonError3) { + _inheritsLoose(InvalidDurationError, _LuxonError3); + function InvalidDurationError(reason) { + return _LuxonError3.call(this, "Invalid Duration: " + reason.toMessage()) || this; + } + return InvalidDurationError; + }(LuxonError); + + /** + * @private + */ + var ConflictingSpecificationError = /*#__PURE__*/function (_LuxonError4) { + _inheritsLoose(ConflictingSpecificationError, _LuxonError4); + function ConflictingSpecificationError() { + return _LuxonError4.apply(this, arguments) || this; + } + return ConflictingSpecificationError; + }(LuxonError); + + /** + * @private + */ + var InvalidUnitError = /*#__PURE__*/function (_LuxonError5) { + _inheritsLoose(InvalidUnitError, _LuxonError5); + function InvalidUnitError(unit) { + return _LuxonError5.call(this, "Invalid unit " + unit) || this; + } + return InvalidUnitError; + }(LuxonError); + + /** + * @private + */ + var InvalidArgumentError = /*#__PURE__*/function (_LuxonError6) { + _inheritsLoose(InvalidArgumentError, _LuxonError6); + function InvalidArgumentError() { + return _LuxonError6.apply(this, arguments) || this; + } + return InvalidArgumentError; + }(LuxonError); + + /** + * @private + */ + var ZoneIsAbstractError = /*#__PURE__*/function (_LuxonError7) { + _inheritsLoose(ZoneIsAbstractError, _LuxonError7); + function ZoneIsAbstractError() { + return _LuxonError7.call(this, "Zone is an abstract class") || this; + } + return ZoneIsAbstractError; + }(LuxonError); + + /** + * @private + */ + + var n = "numeric", + s = "short", + l = "long"; + var DATE_SHORT = { + year: n, + month: n, + day: n + }; + var DATE_MED = { + year: n, + month: s, + day: n + }; + var DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s + }; + var DATE_FULL = { + year: n, + month: l, + day: n + }; + var DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l + }; + var TIME_SIMPLE = { + hour: n, + minute: n + }; + var TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n + }; + var TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + var TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s + }; + var TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l + }; + var DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n + }; + var DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n + }; + var DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n + }; + var DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s + }; + var DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l + }; + var DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + + /** + * @interface + */ + var Zone = /*#__PURE__*/function () { + function Zone() {} + var _proto = Zone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */; + _createClass(Zone, [{ + key: "type", + get: + /** + * The type of zone + * @abstract + * @type {string} + */ + function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + }, { + key: "name", + get: function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The IANA name of this zone. + * Defaults to `name` if not overwritten by a subclass. + * @abstract + * @type {string} + */ + }, { + key: "ianaName", + get: function get() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "isValid", + get: function get() { + throw new ZoneIsAbstractError(); + } + }]); + return Zone; + }(); + + var singleton$1 = null; + + /** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ + var SystemZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(SystemZone, _Zone); + function SystemZone() { + return _Zone.apply(this, arguments) || this; + } + var _proto = SystemZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/; + _createClass(SystemZone, [{ + key: "type", + get: /** @override **/ + function get() { + return "system"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "instance", + get: + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + function get() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + }]); + return SystemZone; + }(Zone); + + var dtfCache = new Map(); + function makeDTF(zoneName) { + var dtf = dtfCache.get(zoneName); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zoneName, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + dtfCache.set(zoneName, dtf); + } + return dtf; + } + var typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 + }; + function hackyOffset(dtf, date) { + var formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + fMonth = parsed[1], + fDay = parsed[2], + fYear = parsed[3], + fadOrBc = parsed[4], + fHour = parsed[5], + fMinute = parsed[6], + fSecond = parsed[7]; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; + } + function partsOffset(dtf, date) { + var formatted = dtf.formatToParts(date); + var filled = []; + for (var i = 0; i < formatted.length; i++) { + var _formatted$i = formatted[i], + type = _formatted$i.type, + value = _formatted$i.value; + var pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; + } + var ianaZoneCache = new Map(); + /** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ + var IANAZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(IANAZone, _Zone); + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + IANAZone.create = function create(name) { + var zone = ianaZoneCache.get(name); + if (zone === undefined) { + ianaZoneCache.set(name, zone = new IANAZone(name)); + } + return zone; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */; + IANAZone.resetCache = function resetCache() { + ianaZoneCache.clear(); + dtfCache.clear(); + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead. + * @return {boolean} + */; + IANAZone.isValidSpecifier = function isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */; + IANAZone.isValidZone = function isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + }; + function IANAZone(name) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.zoneName = name; + /** @private **/ + _this.valid = IANAZone.isValidZone(name); + return _this; + } + + /** + * The type of zone. `iana` for all instances of `IANAZone`. + * @override + * @type {string} + */ + var _proto = IANAZone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @override + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale, this.name); + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @override + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + if (!this.valid) return NaN; + var date = new Date(ts); + if (isNaN(date)) return NaN; + var dtf = makeDTF(this.name); + var _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date), + year = _ref2[0], + month = _ref2[1], + day = _ref2[2], + adOrBc = _ref2[3], + hour = _ref2[4], + minute = _ref2[5], + second = _ref2[6]; + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + var adjustedHour = hour === 24 ? 0 : hour; + var asUTC = objToLocalTS({ + year: year, + month: month, + day: day, + hour: adjustedHour, + minute: minute, + second: second, + millisecond: 0 + }); + var asTS = +date; + var over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** + * Return whether this Zone is equal to another zone + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** + * Return whether this Zone is valid. + * @override + * @type {boolean} + */; + _createClass(IANAZone, [{ + key: "type", + get: function get() { + return "iana"; + } + + /** + * The name of this zone (i.e. the IANA zone name). + * @override + * @type {string} + */ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns false for all IANA zones. + * @override + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return this.valid; + } + }]); + return IANAZone; + }(Zone); + + var _excluded = ["base"], + _excluded2 = ["padTo", "floor"]; + + // todo - remap caching + + var intlLFCache = {}; + function getCachedLF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; + } + var intlDTCache = new Map(); + function getCachedDTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlDTCache.get(key); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache.set(key, dtf); + } + return dtf; + } + var intlNumCache = new Map(); + function getCachedINF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var inf = intlNumCache.get(key); + if (inf === undefined) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache.set(key, inf); + } + return inf; + } + var intlRelCache = new Map(); + function getCachedRTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var _opts = opts; + _opts.base; + var cacheKeyOpts = _objectWithoutPropertiesLoose(_opts, _excluded); // exclude `base` from the options + var key = JSON.stringify([locString, cacheKeyOpts]); + var inf = intlRelCache.get(key); + if (inf === undefined) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache.set(key, inf); + } + return inf; + } + var sysLocaleCache = null; + function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } + } + var intlResolvedOptionsCache = new Map(); + function getCachedIntResolvedOptions(locString) { + var opts = intlResolvedOptionsCache.get(locString); + if (opts === undefined) { + opts = new Intl.DateTimeFormat(locString).resolvedOptions(); + intlResolvedOptionsCache.set(locString, opts); + } + return opts; + } + var weekInfoCache = new Map(); + function getCachedWeekInfo(locString) { + var data = weekInfoCache.get(locString); + if (!data) { + var locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86 + if (!("minimalDays" in data)) { + data = _extends({}, fallbackWeekSettings, data); + } + weekInfoCache.set(locString, data); + } + return data; + } + function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + var xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + var uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + var options; + var selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + var smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + var _options = options, + numberingSystem = _options.numberingSystem, + calendar = _options.calendar; + return [selectedStr, numberingSystem, calendar]; + } + } + function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += "-ca-" + outputCalendar; + } + if (numberingSystem) { + localeStr += "-nu-" + numberingSystem; + } + return localeStr; + } else { + return localeStr; + } + } + function mapMonths(f) { + var ms = []; + for (var i = 1; i <= 12; i++) { + var dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; + } + function mapWeekdays(f) { + var ms = []; + for (var i = 1; i <= 7; i++) { + var dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; + } + function listStuff(loc, length, englishFn, intlFn) { + var mode = loc.listingMode(); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } + } + function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || getCachedIntResolvedOptions(loc.locale).numberingSystem === "latn"; + } + } + + /** + * @private + */ + var PolyNumberFormatter = /*#__PURE__*/function () { + function PolyNumberFormatter(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + opts.padTo; + opts.floor; + var otherOpts = _objectWithoutPropertiesLoose(opts, _excluded2); + if (!forceSimple || Object.keys(otherOpts).length > 0) { + var intlOpts = _extends({ + useGrouping: false + }, opts); + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + var _proto = PolyNumberFormatter.prototype; + _proto.format = function format(i) { + if (this.inf) { + var fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + var _fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(_fixed, this.padTo); + } + }; + return PolyNumberFormatter; + }(); + /** + * @private + */ + var PolyDateFormatter = /*#__PURE__*/function () { + function PolyDateFormatter(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + var z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + var gmtOffset = -1 * (dt.offset / 60); + var offsetZ = gmtOffset >= 0 ? "Etc/GMT+" + gmtOffset : "Etc/GMT" + gmtOffset; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + var intlOpts = _extends({}, this.opts); + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + var _proto2 = PolyDateFormatter.prototype; + _proto2.format = function format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts().map(function (_ref) { + var value = _ref.value; + return value; + }).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + }; + _proto2.formatToParts = function formatToParts() { + var _this = this; + var parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map(function (part) { + if (part.type === "timeZoneName") { + var offsetName = _this.originalZone.offsetName(_this.dt.ts, { + locale: _this.dt.locale, + format: _this.opts.timeZoneName + }); + return _extends({}, part, { + value: offsetName + }); + } else { + return part; + } + }); + } + return parts; + }; + _proto2.resolvedOptions = function resolvedOptions() { + return this.dtf.resolvedOptions(); + }; + return PolyDateFormatter; + }(); + /** + * @private + */ + var PolyRelFormatter = /*#__PURE__*/function () { + function PolyRelFormatter(intl, isEnglish, opts) { + this.opts = _extends({ + style: "long" + }, opts); + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + var _proto3 = PolyRelFormatter.prototype; + _proto3.format = function format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + }; + _proto3.formatToParts = function formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + }; + return PolyRelFormatter; + }(); + var fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7] + }; + + /** + * @private + */ + var Locale = /*#__PURE__*/function () { + Locale.fromOpts = function fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.weekSettings, opts.defaultToEN); + }; + Locale.create = function create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN) { + if (defaultToEN === void 0) { + defaultToEN = false; + } + var specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats + var localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + var numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + var outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + var weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + }; + Locale.resetCache = function resetCache() { + sysLocaleCache = null; + intlDTCache.clear(); + intlNumCache.clear(); + intlRelCache.clear(); + intlResolvedOptionsCache.clear(); + weekInfoCache.clear(); + }; + Locale.fromObject = function fromObject(_temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + locale = _ref2.locale, + numberingSystem = _ref2.numberingSystem, + outputCalendar = _ref2.outputCalendar, + weekSettings = _ref2.weekSettings; + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + }; + function Locale(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + var _parseLocaleString = parseLocaleString(locale), + parsedLocale = _parseLocaleString[0], + parsedNumberingSystem = _parseLocaleString[1], + parsedOutputCalendar = _parseLocaleString[2]; + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + var _proto4 = Locale.prototype; + _proto4.listingMode = function listingMode() { + var isActuallyEn = this.isEnglish(); + var hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + }; + _proto4.clone = function clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, validateWeekSettings(alts.weekSettings) || this.weekSettings, alts.defaultToEN || false); + } + }; + _proto4.redefaultToEN = function redefaultToEN(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: true + })); + }; + _proto4.redefaultToSystem = function redefaultToSystem(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: false + })); + }; + _proto4.months = function months$1(length, format) { + var _this2 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, months, function () { + // Workaround for "ja" locale: formatToParts does not label all parts of the month + // as "month" and for this locale there is no difference between "format" and "non-format". + // As such, just use format() instead of formatToParts() and take the whole string + var monthSpecialCase = _this2.intl === "ja" || _this2.intl.startsWith("ja-"); + format &= !monthSpecialCase; + var intl = format ? { + month: length, + day: "numeric" + } : { + month: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this2.monthsCache[formatStr][length]) { + var mapper = !monthSpecialCase ? function (dt) { + return _this2.extract(dt, intl, "month"); + } : function (dt) { + return _this2.dtFormatter(dt, intl).format(); + }; + _this2.monthsCache[formatStr][length] = mapMonths(mapper); + } + return _this2.monthsCache[formatStr][length]; + }); + }; + _proto4.weekdays = function weekdays$1(length, format) { + var _this3 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, weekdays, function () { + var intl = format ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this3.weekdaysCache[formatStr][length]) { + _this3.weekdaysCache[formatStr][length] = mapWeekdays(function (dt) { + return _this3.extract(dt, intl, "weekday"); + }); + } + return _this3.weekdaysCache[formatStr][length]; + }); + }; + _proto4.meridiems = function meridiems$1() { + var _this4 = this; + return listStuff(this, undefined, function () { + return meridiems; + }, function () { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!_this4.meridiemCache) { + var intl = { + hour: "numeric", + hourCycle: "h12" + }; + _this4.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(function (dt) { + return _this4.extract(dt, intl, "dayperiod"); + }); + } + return _this4.meridiemCache; + }); + }; + _proto4.eras = function eras$1(length) { + var _this5 = this; + return listStuff(this, length, eras, function () { + var intl = { + era: length + }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!_this5.eraCache[length]) { + _this5.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(function (dt) { + return _this5.extract(dt, intl, "era"); + }); + } + return _this5.eraCache[length]; + }); + }; + _proto4.extract = function extract(dt, intlOpts, field) { + var df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find(function (m) { + return m.type.toLowerCase() === field; + }); + return matching ? matching.value : null; + }; + _proto4.numberFormatter = function numberFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + }; + _proto4.dtFormatter = function dtFormatter(dt, intlOpts) { + if (intlOpts === void 0) { + intlOpts = {}; + } + return new PolyDateFormatter(dt, this.intl, intlOpts); + }; + _proto4.relFormatter = function relFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + }; + _proto4.listFormatter = function listFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return getCachedLF(this.intl, opts); + }; + _proto4.isEnglish = function isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us"); + }; + _proto4.getWeekSettings = function getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + }; + _proto4.getStartOfWeek = function getStartOfWeek() { + return this.getWeekSettings().firstDay; + }; + _proto4.getMinDaysInFirstWeek = function getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + }; + _proto4.getWeekendDays = function getWeekendDays() { + return this.getWeekSettings().weekend; + }; + _proto4.equals = function equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + }; + _proto4.toString = function toString() { + return "Locale(" + this.locale + ", " + this.numberingSystem + ", " + this.outputCalendar + ")"; + }; + _createClass(Locale, [{ + key: "fastNumbers", + get: function get() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + }]); + return Locale; + }(); + + var singleton = null; + + /** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ + var FixedOffsetZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(FixedOffsetZone, _Zone); + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + FixedOffsetZone.instance = function instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */; + FixedOffsetZone.parseSpecifier = function parseSpecifier(s) { + if (s) { + var r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + }; + function FixedOffsetZone(offset) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.fixed = offset; + return _this; + } + + /** + * The type of zone. `fixed` for all instances of `FixedOffsetZone`. + * @override + * @type {string} + */ + var _proto = FixedOffsetZone.prototype; + /** + * Returns the offset's common name at the specified timestamp. + * + * For fixed offset zones this equals to the zone name. + * @override + */ + _proto.offsetName = function offsetName() { + return this.name; + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.fixed, format); + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns true for all fixed offset zones. + * @override + * @type {boolean} + */; + /** + * Return the offset in minutes for this zone at the specified timestamp. + * + * For fixed offset zones, this is constant and does not depend on a timestamp. + * @override + * @return {number} + */ + _proto.offset = function offset() { + return this.fixed; + } + + /** + * Return whether this Zone is equal to another zone (i.e. also fixed and same offset) + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** + * Return whether this Zone is valid: + * All fixed offset zones are valid. + * @override + * @type {boolean} + */; + _createClass(FixedOffsetZone, [{ + key: "type", + get: function get() { + return "fixed"; + } + + /** + * The name of this zone. + * All fixed zones' names always start with "UTC" (plus optional offset) + * @override + * @type {string} + */ + }, { + key: "name", + get: function get() { + return this.fixed === 0 ? "UTC" : "UTC" + formatOffset(this.fixed, "narrow"); + } + + /** + * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn` + * + * @override + * @type {string} + */ + }, { + key: "ianaName", + get: function get() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return "Etc/GMT" + formatOffset(-this.fixed, "narrow"); + } + } + }, { + key: "isUniversal", + get: function get() { + return true; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "utcInstance", + get: + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + function get() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + }]); + return FixedOffsetZone; + }(Zone); + + /** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ + var InvalidZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(InvalidZone, _Zone); + function InvalidZone(zoneName) { + var _this; + _this = _Zone.call(this) || this; + /** @private */ + _this.zoneName = zoneName; + return _this; + } + + /** @override **/ + var _proto = InvalidZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return null; + } + + /** @override **/; + _proto.formatOffset = function formatOffset() { + return ""; + } + + /** @override **/; + _proto.offset = function offset() { + return NaN; + } + + /** @override **/; + _proto.equals = function equals() { + return false; + } + + /** @override **/; + _createClass(InvalidZone, [{ + key: "type", + get: function get() { + return "invalid"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return false; + } + }]); + return InvalidZone; + }(Zone); + + /** + * @private + */ + function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + var lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone;else if (lowered === "local" || lowered === "system") return SystemZone.instance;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } + } + + var numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d" + }; + var numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881] + }; + var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); + function parseDigits(str) { + var value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (var i = 0; i < str.length; i++) { + var code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (var key in numberingSystemsUTF16) { + var _numberingSystemsUTF = numberingSystemsUTF16[key], + min = _numberingSystemsUTF[0], + max = _numberingSystemsUTF[1]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } + } + + // cache of {numberingSystem: {append: regex}} + var digitRegexCache = new Map(); + function resetDigitRegexCache() { + digitRegexCache.clear(); + } + function digitRegex(_ref, append) { + var numberingSystem = _ref.numberingSystem; + if (append === void 0) { + append = ""; + } + var ns = numberingSystem || "latn"; + var appendCache = digitRegexCache.get(ns); + if (appendCache === undefined) { + appendCache = new Map(); + digitRegexCache.set(ns, appendCache); + } + var regex = appendCache.get(append); + if (regex === undefined) { + regex = new RegExp("" + numberingSystems[ns] + append); + appendCache.set(append, regex); + } + return regex; + } + + var now = function now() { + return Date.now(); + }, + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + + /** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ + var Settings = /*#__PURE__*/function () { + function Settings() {} + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + Settings.resetCaches = function resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + DateTime.resetCache(); + resetDigitRegexCache(); + }; + _createClass(Settings, null, [{ + key: "now", + get: + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + function get() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */, + set: function set(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + }, { + key: "defaultZone", + get: + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + function get() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(zone) { + defaultZone = zone; + } + }, { + key: "defaultLocale", + get: function get() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultNumberingSystem", + get: function get() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultOutputCalendar", + get: function get() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + }, { + key: "defaultWeekSettings", + get: function get() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */, + set: function set(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + */ + }, { + key: "twoDigitCutoffYear", + get: function get() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century + * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */, + set: function set(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + }, { + key: "throwOnInvalid", + get: function get() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */, + set: function set(t) { + throwOnInvalid = t; + } + }]); + return Settings; + }(); + + var Invalid = /*#__PURE__*/function () { + function Invalid(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + var _proto = Invalid.prototype; + _proto.toMessage = function toMessage() { + if (this.explanation) { + return this.reason + ": " + this.explanation; + } else { + return this.reason; + } + }; + return Invalid; + }(); + + var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; + function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", "you specified " + value + " (of type " + typeof value + ") as a " + unit + ", which is invalid"); + } + function dayOfWeek(year, month, day) { + var d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + var js = d.getUTCDay(); + return js === 0 ? 7 : js; + } + function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; + } + function uncomputeOrdinal(year, ordinal) { + var table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex(function (i) { + return i < ordinal; + }), + day = ordinal - table[month0]; + return { + month: month0 + 1, + day: day + }; + } + function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return (isoWeekday - startOfWeek + 7) % 7 + 1; + } + + /** + * @private + */ + + function gregorianToWeek(gregObj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var year = gregObj.year, + month = gregObj.month, + day = gregObj.day, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + var weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return _extends({ + weekYear: weekYear, + weekNumber: weekNumber, + weekday: weekday + }, timeObject(gregObj)); + } + function weekToGregorian(weekData, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekYear = weekData.weekYear, + weekNumber = weekData.weekNumber, + weekday = weekData.weekday, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + var ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal.month, + day = _uncomputeOrdinal.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(weekData)); + } + function gregorianToOrdinal(gregData) { + var year = gregData.year, + month = gregData.month, + day = gregData.day; + var ordinal = computeOrdinal(year, month, day); + return _extends({ + year: year, + ordinal: ordinal + }, timeObject(gregData)); + } + function ordinalToGregorian(ordinalData) { + var year = ordinalData.year, + ordinal = ordinalData.ordinal; + var _uncomputeOrdinal2 = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal2.month, + day = _uncomputeOrdinal2.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(ordinalData)); + } + + /** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ + function usesLocalWeekValues(obj, loc) { + var hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + var hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + if (hasIsoWeekData) { + throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields"); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek() + }; + } else { + return { + minDaysInFirstWeek: 4, + startOfWeek: 1 + }; + } + } + function hasInvalidWeekData(obj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var validYear = isInteger(obj.weekYear), + validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), + validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; + } + function hasInvalidOrdinalData(obj) { + var validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; + } + function hasInvalidGregorianData(obj) { + var validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; + } + function hasInvalidTimeData(obj) { + var hour = obj.hour, + minute = obj.minute, + second = obj.second, + millisecond = obj.millisecond; + var validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; + } + + /** + * @private + */ + + // TYPES + + function isUndefined(o) { + return typeof o === "undefined"; + } + function isNumber(o) { + return typeof o === "number"; + } + function isInteger(o) { + return typeof o === "number" && o % 1 === 0; + } + function isString(o) { + return typeof o === "string"; + } + function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; + } + + // CAPABILITIES + + function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } + } + function hasLocaleWeekInfo() { + try { + return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype); + } catch (e) { + return false; + } + } + + // OBJECTS AND ARRAYS + + function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; + } + function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce(function (best, next) { + var pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; + } + function pick(obj, keys) { + return keys.reduce(function (a, k) { + a[k] = obj[k]; + return a; + }, {}); + } + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(function (v) { + return !integerBetween(v, 1, 7); + })) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend) + }; + } + } + + // NUMBERS AND STRINGS + + function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; + } + + // x % n but takes the sign of n instead of x + function floorMod(x, n) { + return x - n * Math.floor(x / n); + } + function padStart(input, n) { + if (n === void 0) { + n = 2; + } + var isNeg = input < 0; + var padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; + } + function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } + } + function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } + } + function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + var f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } + } + function roundTo(number, digits, rounding) { + if (rounding === void 0) { + rounding = "round"; + } + var factor = Math.pow(10, digits); + switch (rounding) { + case "expand": + return number > 0 ? Math.ceil(number * factor) / factor : Math.floor(number * factor) / factor; + case "trunc": + return Math.trunc(number * factor) / factor; + case "round": + return Math.round(number * factor) / factor; + case "floor": + return Math.floor(number * factor) / factor; + case "ceil": + return Math.ceil(number * factor) / factor; + default: + throw new RangeError("Value rounding " + rounding + " is out of range"); + } + } + + // DATE BASICS + + function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + } + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + function daysInMonth(year, month) { + var modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } + } + + // convert a calendar object to a local timestamp (epoch, but with the offset baked in) + function objToLocalTS(obj) { + var d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; + } + + // adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js + function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + var fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; + } + function weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + var weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; + } + function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; + } + + // PARSING + + function parseZoneInfo(ts, offsetFormat, locale, timeZone) { + if (timeZone === void 0) { + timeZone = null; + } + var date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + var modified = _extends({ + timeZoneName: offsetFormat + }, intlOpts); + var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function (m) { + return m.type.toLowerCase() === "timezonename"; + }); + return parsed ? parsed.value : null; + } + + // signedOffset('-5', '30') -> -330 + function signedOffset(offHourStr, offMinuteStr) { + var offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + var offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; + } + + // COERCION + + function asNumber(value) { + var numericValue = Number(value); + if (typeof value === "boolean" || value === "" || !Number.isFinite(numericValue)) throw new InvalidArgumentError("Invalid unit value " + value); + return numericValue; + } + function normalizeObject(obj, normalizer) { + var normalized = {}; + for (var u in obj) { + if (hasOwnProperty(obj, u)) { + var v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; + } + + /** + * Returns the offset's value as a string + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + function formatOffset(offset, format) { + var hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + switch (format) { + case "short": + return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2); + case "narrow": + return "" + sign + hours + (minutes > 0 ? ":" + minutes : ""); + case "techie": + return "" + sign + padStart(hours, 2) + padStart(minutes, 2); + default: + throw new RangeError("Value format " + format + " is out of range for property format"); + } + } + function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); + } + + /** + * @private + */ + + var monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + var monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; + function months(length) { + switch (length) { + case "narrow": + return [].concat(monthsNarrow); + case "short": + return [].concat(monthsShort); + case "long": + return [].concat(monthsLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } + } + var weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; + var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; + var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; + function weekdays(length) { + switch (length) { + case "narrow": + return [].concat(weekdaysNarrow); + case "short": + return [].concat(weekdaysShort); + case "long": + return [].concat(weekdaysLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } + } + var meridiems = ["AM", "PM"]; + var erasLong = ["Before Christ", "Anno Domini"]; + var erasShort = ["BC", "AD"]; + var erasNarrow = ["B", "A"]; + function eras(length) { + switch (length) { + case "narrow": + return [].concat(erasNarrow); + case "short": + return [].concat(erasShort); + case "long": + return [].concat(erasLong); + default: + return null; + } + } + function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; + } + function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; + } + function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; + } + function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; + } + function formatRelativeTime(unit, count, numeric, narrow) { + if (numeric === void 0) { + numeric = "always"; + } + if (narrow === void 0) { + narrow = false; + } + var units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."] + }; + var lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + var isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : "next " + units[unit][0]; + case -1: + return isDay ? "yesterday" : "last " + units[unit][0]; + case 0: + return isDay ? "today" : "this " + units[unit][0]; + } + } + + var isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? fmtValue + " " + fmtUnit + " ago" : "in " + fmtValue + " " + fmtUnit; + } + + function stringifyTokens(splits, tokenToString) { + var s = ""; + for (var _iterator = _createForOfIteratorHelperLoose(splits), _step; !(_step = _iterator()).done;) { + var token = _step.value; + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; + } + var _macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS + }; + + /** + * @private + */ + var Formatter = /*#__PURE__*/function () { + Formatter.create = function create(locale, opts) { + if (opts === void 0) { + opts = {}; + } + return new Formatter(locale, opts); + }; + Formatter.parseFormat = function parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + var current = null, + currentFull = "", + bracketed = false; + var splits = []; + for (var i = 0; i < fmt.length; i++) { + var c = fmt.charAt(i); + if (c === "'") { + // turn '' into a literal signal quote instead of just skipping the empty literal + if (currentFull.length > 0 || bracketed) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull === "" ? "'" : currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + }; + Formatter.macroTokenToFormatOpts = function macroTokenToFormatOpts(token) { + return _macroTokenToFormatOpts[token]; + }; + function Formatter(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + var _proto = Formatter.prototype; + _proto.formatWithSystemDefault = function formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + var df = this.systemLoc.dtFormatter(dt, _extends({}, this.opts, opts)); + return df.format(); + }; + _proto.dtFormatter = function dtFormatter(dt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.loc.dtFormatter(dt, _extends({}, this.opts, opts)); + }; + _proto.formatDateTime = function formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + }; + _proto.formatDateTimeParts = function formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + }; + _proto.formatInterval = function formatInterval(interval, opts) { + var df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + }; + _proto.resolvedOptions = function resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + }; + _proto.num = function num(n, p, signDisplay) { + if (p === void 0) { + p = 0; + } + if (signDisplay === void 0) { + signDisplay = undefined; + } + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + var opts = _extends({}, this.opts); + if (p > 0) { + opts.padTo = p; + } + if (signDisplay) { + opts.signDisplay = signDisplay; + } + return this.loc.numberFormatter(opts).format(n); + }; + _proto.formatDateTimeFromString = function formatDateTimeFromString(dt, fmt) { + var _this = this; + var knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = function string(opts, extract) { + return _this.loc.extract(dt, opts, extract); + }, + formatOffset = function formatOffset(opts) { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = function meridiem() { + return knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"); + }, + month = function month(length, standalone) { + return knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"); + }, + weekday = function weekday(length, standalone) { + return knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"); + }, + maybeMacro = function maybeMacro(token) { + var formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return _this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = function era(length) { + return knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"); + }, + tokenToString = function tokenToString(token) { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return _this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return _this.num(dt.millisecond, 3); + // seconds + case "s": + return _this.num(dt.second); + case "ss": + return _this.num(dt.second, 2); + // fractional seconds + case "uu": + return _this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return _this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return _this.num(dt.minute); + case "mm": + return _this.num(dt.minute, 2); + // hours + case "h": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return _this.num(dt.hour); + case "HH": + return _this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ + format: "narrow", + allowZ: _this.opts.allowZ + }); + case "ZZ": + // like +06:00 + return formatOffset({ + format: "short", + allowZ: _this.opts.allowZ + }); + case "ZZZ": + // like +0600 + return formatOffset({ + format: "techie", + allowZ: _this.opts.allowZ + }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: _this.loc.locale + }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: _this.loc.locale + }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : _this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : _this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return _this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return _this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : _this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : _this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : _this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : _this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : _this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return _this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return _this.num(dt.weekYear, 4); + case "W": + return _this.num(dt.weekNumber); + case "WW": + return _this.num(dt.weekNumber, 2); + case "n": + return _this.num(dt.localWeekNumber); + case "nn": + return _this.num(dt.localWeekNumber, 2); + case "ii": + return _this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return _this.num(dt.localWeekYear, 4); + case "o": + return _this.num(dt.ordinal); + case "ooo": + return _this.num(dt.ordinal, 3); + case "q": + // like 1 + return _this.num(dt.quarter); + case "qq": + // like 01 + return _this.num(dt.quarter, 2); + case "X": + return _this.num(Math.floor(dt.ts / 1000)); + case "x": + return _this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + }; + _proto.formatDurationFromString = function formatDurationFromString(dur, fmt) { + var _this2 = this; + var invertLargest = this.opts.signMode === "negativeLargestOnly" ? -1 : 1; + var tokenToField = function tokenToField(token) { + switch (token[0]) { + case "S": + return "milliseconds"; + case "s": + return "seconds"; + case "m": + return "minutes"; + case "h": + return "hours"; + case "d": + return "days"; + case "w": + return "weeks"; + case "M": + return "months"; + case "y": + return "years"; + default: + return null; + } + }, + tokenToString = function tokenToString(lildur, info) { + return function (token) { + var mapped = tokenToField(token); + if (mapped) { + var inversionFactor = info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1; + var signDisplay; + if (_this2.opts.signMode === "negativeLargestOnly" && mapped !== info.largestUnit) { + signDisplay = "never"; + } else if (_this2.opts.signMode === "all") { + signDisplay = "always"; + } else { + // "auto" and "negative" are the same, but "auto" has better support + signDisplay = "auto"; + } + return _this2.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay); + } else { + return token; + } + }; + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce(function (found, _ref) { + var literal = _ref.literal, + val = _ref.val; + return literal ? found : found.concat(val); + }, []), + collapsed = dur.shiftTo.apply(dur, realTokens.map(tokenToField).filter(function (t) { + return t; + })), + durationInfo = { + isNegativeDuration: collapsed < 0, + // this relies on "collapsed" being based on "shiftTo", which builds up the object + // in order + largestUnit: Object.keys(collapsed.values)[0] + }; + return stringifyTokens(tokens, tokenToString(collapsed, durationInfo)); + }; + return Formatter; + }(); + + /* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + + var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; + function combineRegexes() { + for (var _len = arguments.length, regexes = new Array(_len), _key = 0; _key < _len; _key++) { + regexes[_key] = arguments[_key]; + } + var full = regexes.reduce(function (f, r) { + return f + r.source; + }, ""); + return RegExp("^" + full + "$"); + } + function combineExtractors() { + for (var _len2 = arguments.length, extractors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + extractors[_key2] = arguments[_key2]; + } + return function (m) { + return extractors.reduce(function (_ref, ex) { + var mergedVals = _ref[0], + mergedZone = _ref[1], + cursor = _ref[2]; + var _ex = ex(m, cursor), + val = _ex[0], + zone = _ex[1], + next = _ex[2]; + return [_extends({}, mergedVals, val), zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); + }; + } + function parse(s) { + if (s == null) { + return [null, null]; + } + for (var _len3 = arguments.length, patterns = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + patterns[_key3 - 1] = arguments[_key3]; + } + for (var _i = 0, _patterns = patterns; _i < _patterns.length; _i++) { + var _patterns$_i = _patterns[_i], + regex = _patterns$_i[0], + extractor = _patterns$_i[1]; + var m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; + } + function simpleParse() { + for (var _len4 = arguments.length, keys = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + keys[_key4] = arguments[_key4]; + } + return function (match, cursor) { + var ret = {}; + var i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; + } + + // ISO and SQL parsing + var offsetRegex = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/; + var isoExtendedZone = "(?:" + offsetRegex.source + "?(?:\\[(" + ianaRegex.source + ")\\])?)?"; + var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; + var isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + isoExtendedZone); + var isoTimeExtensionRegex = RegExp("(?:[Tt]" + isoTimeRegex.source + ")?"); + var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; + var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; + var isoOrdinalRegex = /(\d{4})-?(\d{3})/; + var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); + var extractISOOrdinalData = simpleParse("year", "ordinal"); + var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one + var sqlTimeRegex = RegExp(isoTimeBaseRegex.source + " ?(?:" + offsetRegex.source + "|(" + ianaRegex.source + "))?"); + var sqlTimeExtensionRegex = RegExp("(?: " + sqlTimeRegex.source + ")?"); + function int(match, pos, fallback) { + var m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); + } + function extractISOYmd(match, cursor) { + var item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1) + }; + return [item, null, cursor + 3]; + } + function extractISOTime(match, cursor) { + var item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]) + }; + return [item, null, cursor + 4]; + } + function extractISOOffset(match, cursor) { + var local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; + } + function extractIANAZone(match, cursor) { + var zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; + } + + // ISO time parsing + + var isoTimeOnly = RegExp("^T?" + isoTimeBaseRegex.source + "$"); + + // ISO duration parsing + + var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; + function extractISODuration(match) { + var s = match[0], + yearStr = match[1], + monthStr = match[2], + weekStr = match[3], + dayStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + millisecondsStr = match[8]; + var hasNegativePrefix = s[0] === "-"; + var negativeSeconds = secondStr && secondStr[0] === "-"; + var maybeNegate = function maybeNegate(num, force) { + if (force === void 0) { + force = false; + } + return num !== undefined && (force || num && hasNegativePrefix) ? -num : num; + }; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; + } + + // These are a little braindead. EDT *should* tell us that we're in, say, America/New_York + // and not just that we're in -240 *right now*. But since I don't think these are used that often + // I'm just going to ignore that + var obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; + } + + // RFC 2822/5322 + var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; + function extractRFC2822(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + obsOffset = match[8], + milOffset = match[9], + offHourStr = match[10], + offMinuteStr = match[11], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + var offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset)]; + } + function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); + } + + // http date + + var rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; + function extractRFC1123Or850(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + function extractASCII(match) { + var weekdayStr = match[1], + monthStr = match[2], + dayStr = match[3], + hourStr = match[4], + minuteStr = match[5], + secondStr = match[6], + yearStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); + var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); + var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); + var isoTimeCombinedRegex = combineRegexes(isoTimeRegex); + var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + + /* + * @private + */ + + function parseISODate(s) { + return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); + } + function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); + } + function parseHTTPDate(s) { + return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); + } + function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); + } + var extractISOTimeOnly = combineExtractors(extractISOTime); + function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); + } + var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); + var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); + var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + function parseSQL(s) { + return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); + } + + var INVALID$2 = "Invalid Duration"; + + // unit conversion constants + var lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000 + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000 + }, + hours: { + minutes: 60, + seconds: 60 * 60, + milliseconds: 60 * 60 * 1000 + }, + minutes: { + seconds: 60, + milliseconds: 60 * 1000 + }, + seconds: { + milliseconds: 1000 + } + }, + casualMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000 + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix), + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix); + + // units ordered by size + var orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; + var reverseUnits = orderedUnits$1.slice(0).reverse(); + + // clone really means "create another instance just like this one, but with these changes" + function clone$1(dur, alts, clear) { + if (clear === void 0) { + clear = false; + } + // deep merge for vals + var conf = { + values: clear ? alts.values : _extends({}, dur.values, alts.values || {}), + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); + } + function durationToMillis(matrix, vals) { + var _vals$milliseconds; + var sum = (_vals$milliseconds = vals.milliseconds) != null ? _vals$milliseconds : 0; + for (var _iterator = _createForOfIteratorHelperLoose(reverseUnits.slice(1)), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; + } + + // NB: mutates parameters + function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + var factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + orderedUnits$1.reduceRight(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var previousVal = vals[previous] * factor; + var conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + var rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); + } + + // Remove all properties with a value of 0 from an object + function removeZeroes(vals) { + var newVals = {}; + for (var _i = 0, _Object$entries = Object.entries(vals); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _Object$entries[_i], + key = _Object$entries$_i[0], + value = _Object$entries$_i[1]; + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; + } + + /** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ + var Duration = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Duration(config) { + var accurate = config.conversionAccuracy === "longterm" || false; + var matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + Duration.fromMillis = function fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */; + Duration.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got " + (obj === null ? "null" : typeof obj)); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */; + Duration.fromDurationLike = function fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError("Unknown duration argument " + durationLike + " of type " + typeof durationLike); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */; + Duration.fromISO = function fromISO(text, opts) { + var _parseISODuration = parseISODuration(text), + parsed = _parseISODuration[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */; + Duration.fromISOTime = function fromISOTime(text, opts) { + var _parseISOTimeOnly = parseISOTimeOnly(text), + parsed = _parseISOTimeOnly[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */; + Duration.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid: invalid + }); + } + } + + /** + * @private + */; + Duration.normalizeUnit = function normalizeUnit(unit) { + var normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Duration.isDuration = function isDuration(o) { + return o && o.isLuxonDuration || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */; + var _proto = Duration.prototype; + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat("d s", { signMode: "all" }) //=> "+6 +2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "all" }) //=> "-6 -2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "negativeLargestOnly" }) //=> "-6 2" + * @return {string} + */ + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + var fmtOpts = _extends({}, opts, { + floor: opts.round !== false && opts.floor !== false + }); + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero + * @example + * ```js + * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 mth, 0 wks, 5 hr, 6 min' + * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes' + * ``` + */; + _proto.toHuman = function toHuman(opts) { + var _this = this; + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return INVALID$2; + var showZeros = opts.showZeros !== false; + var l = orderedUnits$1.map(function (unit) { + var val = _this.values[unit]; + if (isUndefined(val) || val === 0 && !showZeros) { + return null; + } + return _this.loc.numberFormatter(_extends({ + style: "unit", + unitDisplay: "long" + }, opts, { + unit: unit.slice(0, -1) + })).format(val); + }).filter(function (n) { + return n; + }); + return this.loc.listFormatter(_extends({ + type: "conjunction", + style: opts.listStyle || "narrow" + }, opts)).format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */; + _proto.toObject = function toObject() { + if (!this.isValid) return {}; + return _extends({}, this.values); + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */; + _proto.toISO = function toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + var s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return null; + var millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + opts = _extends({ + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended" + }, opts, { + includeOffset: false + }); + var dateTime = DateTime.fromMillis(millis, { + zone: "UTC" + }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */; + _proto.toString = function toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Duration { values: " + JSON.stringify(this.values) + " }"; + } else { + return "Duration { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */; + _proto.toMillis = function toMillis() { + if (!this.isValid) return NaN; + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration), + result = {}; + for (var _i2 = 0, _orderedUnits = orderedUnits$1; _i2 < _orderedUnits.length; _i2++) { + var k = _orderedUnits[_i2]; + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */; + _proto.mapUnits = function mapUnits(fn) { + if (!this.isValid) return this; + var result = {}; + for (var _i3 = 0, _Object$keys = Object.keys(this.values); _i3 < _Object$keys.length; _i3++) { + var k = _Object$keys[_i3]; + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */; + _proto.get = function get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var mixed = _extends({}, this.values, normalizeObject(values, Duration.normalizeUnit)); + return clone$1(this, { + values: mixed + }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */; + _proto.reconfigure = function reconfigure(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + locale = _ref.locale, + numberingSystem = _ref.numberingSystem, + conversionAccuracy = _ref.conversionAccuracy, + matrix = _ref.matrix; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem + }); + var opts = { + loc: loc, + matrix: matrix, + conversionAccuracy: conversionAccuracy + }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */; + _proto.as = function as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */; + _proto.normalize = function normalize() { + if (!this.isValid) return this; + var vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */; + _proto.rescale = function rescale() { + if (!this.isValid) return this; + var vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */; + _proto.shiftTo = function shiftTo() { + for (var _len = arguments.length, units = new Array(_len), _key = 0; _key < _len; _key++) { + units[_key] = arguments[_key]; + } + if (!this.isValid) return this; + if (units.length === 0) { + return this; + } + units = units.map(function (u) { + return Duration.normalizeUnit(u); + }); + var built = {}, + accumulated = {}, + vals = this.toObject(); + var lastUnit; + for (var _i4 = 0, _orderedUnits2 = orderedUnits$1; _i4 < _orderedUnits2.length; _i4++) { + var k = _orderedUnits2[_i4]; + if (units.indexOf(k) >= 0) { + lastUnit = k; + var own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (var ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + var i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (var key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + normalizeValues(this.matrix, built); + return clone$1(this, { + values: built + }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */; + _proto.shiftToAll = function shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */; + _proto.negate = function negate() { + if (!this.isValid) return this; + var negated = {}; + for (var _i5 = 0, _Object$keys2 = Object.keys(this.values); _i5 < _Object$keys2.length; _i5++) { + var k = _Object$keys2[_i5]; + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + + /** + * Removes all units with values equal to 0 from this Duration. + * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 } + * @return {Duration} + */; + _proto.removeZeros = function removeZeros() { + if (!this.isValid) return this; + var vals = removeZeroes(this.values); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Get the years. + * @type {number} + */; + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + for (var _i6 = 0, _orderedUnits3 = orderedUnits$1; _i6 < _orderedUnits3.length; _i6++) { + var u = _orderedUnits3[_i6]; + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + }; + _createClass(Duration, [{ + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + }, { + key: "years", + get: function get() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + }, { + key: "quarters", + get: function get() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + }, { + key: "months", + get: function get() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + }, { + key: "weeks", + get: function get() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + }, { + key: "days", + get: function get() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + }, { + key: "hours", + get: function get() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + }, { + key: "minutes", + get: function get() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + }, { + key: "seconds", + get: function get() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + }, { + key: "milliseconds", + get: function get() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Duration; + }(Symbol.for("nodejs.util.inspect.custom")); + + var INVALID$1 = "Invalid Interval"; + + // checks if the start is equal to or before the end + function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid("end before start", "The end of an interval must be after its start, but you had start=" + start.toISO() + " and end=" + end.toISO()); + } else { + return null; + } + } + + /** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ + var Interval = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Interval(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + Interval.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid: invalid + }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */; + Interval.fromDateTimes = function fromDateTimes(start, end) { + var builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + var validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.after = function after(start, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.before = function before(end, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */; + Interval.fromISO = function fromISO(text, opts) { + var _split = (text || "").split("/", 2), + s = _split[0], + e = _split[1]; + if (s && e) { + var start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + var end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + if (startIsValid) { + var dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + var _dur = Duration.fromISO(s, opts); + if (_dur.isValid) { + return Interval.before(end, _dur); + } + } + } + return Interval.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Interval.isInterval = function isInterval(o) { + return o && o.isLuxonInterval || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */; + var _proto = Interval.prototype; + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + _proto.length = function length(unit) { + if (unit === void 0) { + unit = "milliseconds"; + } + return this.isValid ? this.toDuration.apply(this, [unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */; + _proto.count = function count(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (!this.isValid) return NaN; + var start = this.start.startOf(unit, opts); + var end; + if (opts != null && opts.useLocaleWeeks) { + end = this.end.reconfigure({ + locale: start.locale + }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */; + _proto.hasSame = function hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */; + _proto.isEmpty = function isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isAfter = function isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isBefore = function isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.contains = function contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */; + _proto.set = function set(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + start = _ref.start, + end = _ref.end; + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */; + _proto.splitAt = function splitAt() { + var _this = this; + if (!this.isValid) return []; + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + var sorted = dateTimes.map(friendlyDateTime).filter(function (d) { + return _this.contains(d); + }).sort(function (a, b) { + return a.toMillis() - b.toMillis(); + }), + results = []; + var s = this.s, + i = 0; + while (s < this.e) { + var added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */; + _proto.splitBy = function splitBy(duration) { + var dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + var s = this.s, + idx = 1, + next; + var results = []; + while (s < this.e) { + var added = this.start.plus(dur.mapUnits(function (x) { + return x * idx; + })); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */; + _proto.divideEqually = function divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */; + _proto.overlaps = function overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsStart = function abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsEnd = function abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise. + * @param {Interval} other + * @return {boolean} + */; + _proto.engulfs = function engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */; + _proto.intersection = function intersection(other) { + if (!this.isValid) return this; + var s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */; + _proto.union = function union(other) { + if (!this.isValid) return this; + var s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into an equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval + * and ending with the latest. + * + * @param {Array} intervals + * @return {Array} + */; + Interval.merge = function merge(intervals) { + var _intervals$sort$reduc = intervals.sort(function (a, b) { + return a.s - b.s; + }).reduce(function (_ref2, item) { + var sofar = _ref2[0], + current = _ref2[1]; + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]), + found = _intervals$sort$reduc[0], + final = _intervals$sort$reduc[1]; + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.xor = function xor(intervals) { + var _Array$prototype; + var start = null, + currentCount = 0; + var results = [], + ends = intervals.map(function (i) { + return [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]; + }), + flattened = (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, ends), + arr = flattened.sort(function (a, b) { + return a.time - b.time; + }); + for (var _iterator = _createForOfIteratorHelperLoose(arr), _step; !(_step = _iterator()).done;) { + var i = _step.value; + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + start = null; + } + } + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */; + _proto.difference = function difference() { + var _this2 = this; + for (var _len2 = arguments.length, intervals = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + intervals[_key2] = arguments[_key2]; + } + return Interval.xor([this].concat(intervals)).map(function (i) { + return _this2.intersection(i); + }).filter(function (i) { + return i && !i.isEmpty(); + }); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */; + _proto.toString = function toString() { + if (!this.isValid) return INVALID$1; + return "[" + this.s.toISO() + " \u2013 " + this.e.toISO() + ")"; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Interval { start: " + this.s.toISO() + ", end: " + this.e.toISO() + " }"; + } else { + return "Interval { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISO = function toISO(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISO(opts) + "/" + this.e.toISO(opts); + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */; + _proto.toISODate = function toISODate() { + if (!this.isValid) return INVALID$1; + return this.s.toISODate() + "/" + this.e.toISODate(); + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISOTime(opts) + "/" + this.e.toISOTime(opts); + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */; + _proto.toFormat = function toFormat(dateFormat, _temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + _ref3$separator = _ref3.separator, + separator = _ref3$separator === void 0 ? " – " : _ref3$separator; + if (!this.isValid) return INVALID$1; + return "" + this.s.toFormat(dateFormat) + separator + this.e.toFormat(dateFormat); + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */; + _proto.toDuration = function toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */; + _proto.mapEndpoints = function mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + }; + _createClass(Interval, [{ + key: "start", + get: function get() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval. This is the first instant which is not part of the interval + * (Interval is half-open). + * @type {DateTime} + */ + }, { + key: "end", + get: function get() { + return this.isValid ? this.e : null; + } + + /** + * Returns the last DateTime included in the interval (since end is not part of the interval) + * @type {DateTime} + */ + }, { + key: "lastDateTime", + get: function get() { + return this.isValid ? this.e ? this.e.minus(1) : null : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Interval; + }(Symbol.for("nodejs.util.inspect.custom")); + + /** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ + var Info = /*#__PURE__*/function () { + function Info() {} + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + Info.hasDST = function hasDST(zone) { + if (zone === void 0) { + zone = Settings.defaultZone; + } + var proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */; + Info.isValidIANAZone = function isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */; + Info.normalizeZone = function normalizeZone$1(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */; + Info.getStartOfWeek = function getStartOfWeek(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + _ref$locale = _ref.locale, + locale = _ref$locale === void 0 ? null : _ref$locale, + _ref$locObj = _ref.locObj, + locObj = _ref$locObj === void 0 ? null : _ref$locObj; + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */; + Info.getMinimumDaysInFirstWeek = function getMinimumDaysInFirstWeek(_temp2) { + var _ref2 = _temp2 === void 0 ? {} : _temp2, + _ref2$locale = _ref2.locale, + locale = _ref2$locale === void 0 ? null : _ref2$locale, + _ref2$locObj = _ref2.locObj, + locObj = _ref2$locObj === void 0 ? null : _ref2$locObj; + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */; + Info.getWeekendWeekdays = function getWeekendWeekdays(_temp3) { + var _ref3 = _temp3 === void 0 ? {} : _temp3, + _ref3$locale = _ref3.locale, + locale = _ref3$locale === void 0 ? null : _ref3$locale, + _ref3$locObj = _ref3.locObj, + locObj = _ref3$locObj === void 0 ? null : _ref3$locObj; + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */; + Info.months = function months(length, _temp4) { + if (length === void 0) { + length = "long"; + } + var _ref4 = _temp4 === void 0 ? {} : _temp4, + _ref4$locale = _ref4.locale, + locale = _ref4$locale === void 0 ? null : _ref4$locale, + _ref4$numberingSystem = _ref4.numberingSystem, + numberingSystem = _ref4$numberingSystem === void 0 ? null : _ref4$numberingSystem, + _ref4$locObj = _ref4.locObj, + locObj = _ref4$locObj === void 0 ? null : _ref4$locObj, + _ref4$outputCalendar = _ref4.outputCalendar, + outputCalendar = _ref4$outputCalendar === void 0 ? "gregory" : _ref4$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */; + Info.monthsFormat = function monthsFormat(length, _temp5) { + if (length === void 0) { + length = "long"; + } + var _ref5 = _temp5 === void 0 ? {} : _temp5, + _ref5$locale = _ref5.locale, + locale = _ref5$locale === void 0 ? null : _ref5$locale, + _ref5$numberingSystem = _ref5.numberingSystem, + numberingSystem = _ref5$numberingSystem === void 0 ? null : _ref5$numberingSystem, + _ref5$locObj = _ref5.locObj, + locObj = _ref5$locObj === void 0 ? null : _ref5$locObj, + _ref5$outputCalendar = _ref5.outputCalendar, + outputCalendar = _ref5$outputCalendar === void 0 ? "gregory" : _ref5$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */; + Info.weekdays = function weekdays(length, _temp6) { + if (length === void 0) { + length = "long"; + } + var _ref6 = _temp6 === void 0 ? {} : _temp6, + _ref6$locale = _ref6.locale, + locale = _ref6$locale === void 0 ? null : _ref6$locale, + _ref6$numberingSystem = _ref6.numberingSystem, + numberingSystem = _ref6$numberingSystem === void 0 ? null : _ref6$numberingSystem, + _ref6$locObj = _ref6.locObj, + locObj = _ref6$locObj === void 0 ? null : _ref6$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */; + Info.weekdaysFormat = function weekdaysFormat(length, _temp7) { + if (length === void 0) { + length = "long"; + } + var _ref7 = _temp7 === void 0 ? {} : _temp7, + _ref7$locale = _ref7.locale, + locale = _ref7$locale === void 0 ? null : _ref7$locale, + _ref7$numberingSystem = _ref7.numberingSystem, + numberingSystem = _ref7$numberingSystem === void 0 ? null : _ref7$numberingSystem, + _ref7$locObj = _ref7.locObj, + locObj = _ref7$locObj === void 0 ? null : _ref7$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */; + Info.meridiems = function meridiems(_temp8) { + var _ref8 = _temp8 === void 0 ? {} : _temp8, + _ref8$locale = _ref8.locale, + locale = _ref8$locale === void 0 ? null : _ref8$locale; + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */; + Info.eras = function eras(length, _temp9) { + if (length === void 0) { + length = "short"; + } + var _ref9 = _temp9 === void 0 ? {} : _temp9, + _ref9$locale = _ref9.locale, + locale = _ref9$locale === void 0 ? null : _ref9$locale; + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */; + Info.features = function features() { + return { + relative: hasRelative(), + localeWeek: hasLocaleWeekInfo() + }; + }; + return Info; + }(); + + function dayDiff(earlier, later) { + var utcDayStart = function utcDayStart(dt) { + return dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(); + }, + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); + } + function highOrderDiffs(cursor, later, units) { + var differs = [["years", function (a, b) { + return b.year - a.year; + }], ["quarters", function (a, b) { + return b.quarter - a.quarter + (b.year - a.year) * 4; + }], ["months", function (a, b) { + return b.month - a.month + (b.year - a.year) * 12; + }], ["weeks", function (a, b) { + var days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + var results = {}; + var earlier = cursor; + var lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (var _i = 0, _differs = differs; _i < _differs.length; _i++) { + var _differs$_i = _differs[_i], + unit = _differs$_i[0], + differ = _differs$_i[1]; + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; + } + function _diff (earlier, later, units, opts) { + var _highOrderDiffs = highOrderDiffs(earlier, later, units), + cursor = _highOrderDiffs[0], + results = _highOrderDiffs[1], + highWater = _highOrderDiffs[2], + lowestOrder = _highOrderDiffs[3]; + var remainingMillis = later - cursor; + var lowerOrderUnits = units.filter(function (u) { + return ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0; + }); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + var _cursor$plus; + highWater = cursor.plus((_cursor$plus = {}, _cursor$plus[lowestOrder] = 1, _cursor$plus)); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + var duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + var _Duration$fromMillis; + return (_Duration$fromMillis = Duration.fromMillis(remainingMillis, opts)).shiftTo.apply(_Duration$fromMillis, lowerOrderUnits).plus(duration); + } else { + return duration; + } + } + + var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; + function intUnit(regex, post) { + if (post === void 0) { + post = function post(i) { + return i; + }; + } + return { + regex: regex, + deser: function deser(_ref) { + var s = _ref[0]; + return post(parseDigits(s)); + } + }; + } + var NBSP = String.fromCharCode(160); + var spaceOrNBSP = "[ " + NBSP + "]"; + var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); + function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); + } + function stripInsensitivities(s) { + return s.replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); + } + function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: function deser(_ref2) { + var s = _ref2[0]; + return strings.findIndex(function (i) { + return stripInsensitivities(s) === stripInsensitivities(i); + }) + startIndex; + } + }; + } + } + function offset(regex, groups) { + return { + regex: regex, + deser: function deser(_ref3) { + var h = _ref3[1], + m = _ref3[2]; + return signedOffset(h, m); + }, + groups: groups + }; + } + function simple(regex) { + return { + regex: regex, + deser: function deser(_ref4) { + var s = _ref4[0]; + return s; + } + }; + } + function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + } + + /** + * @param token + * @param {Locale} loc + */ + function unitForToken(token, loc) { + var one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = function literal(t) { + return { + regex: RegExp(escapeToken(t.val)), + deser: function deser(_ref5) { + var s = _ref5[0]; + return s; + }, + literal: true + }; + }, + unitate = function unitate(t) { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(?::(" + two.source + "))?"), 2); + case "ZZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(" + two.source + ")?"), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + var unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; + } + var partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy" + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM" + }, + day: { + numeric: "d", + "2-digit": "dd" + }, + weekday: { + short: "EEE", + long: "EEEE" + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh" + }, + hour24: { + numeric: "H", + "2-digit": "HH" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } + }; + function tokenForPart(part, formatOpts, resolvedOpts) { + var type = part.type, + value = part.value; + if (type === "literal") { + var isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + var style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + var actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + var val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val: val + }; + } + return undefined; + } + function buildRegex(units) { + var re = units.map(function (u) { + return u.regex; + }).reduce(function (f, r) { + return f + "(" + r.source + ")"; + }, ""); + return ["^" + re + "$", units]; + } + function match(input, regex, handlers) { + var matches = input.match(regex); + if (matches) { + var all = {}; + var matchIndex = 1; + for (var i in handlers) { + if (hasOwnProperty(handlers, i)) { + var h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } + } + function dateTimeFromMatches(matches) { + var toField = function toField(token) { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + var zone = null; + var specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + var vals = Object.keys(matches).reduce(function (r, k) { + var f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; + } + var dummyDateTimeCache = null; + function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; + } + function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + var formatOpts = Formatter.macroTokenToFormatOpts(token.val); + var tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(undefined)) { + return token; + } + return tokens; + } + function expandMacroTokens(tokens, locale) { + var _Array$prototype; + return (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, tokens.map(function (t) { + return maybeExpandMacroToken(t, locale); + })); + } + + /** + * @private + */ + + var TokenParser = /*#__PURE__*/function () { + function TokenParser(locale, format) { + this.locale = locale; + this.format = format; + this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale); + this.units = this.tokens.map(function (t) { + return unitForToken(t, locale); + }); + this.disqualifyingUnit = this.units.find(function (t) { + return t.invalidReason; + }); + if (!this.disqualifyingUnit) { + var _buildRegex = buildRegex(this.units), + regexString = _buildRegex[0], + handlers = _buildRegex[1]; + this.regex = RegExp(regexString, "i"); + this.handlers = handlers; + } + } + var _proto = TokenParser.prototype; + _proto.explainFromTokens = function explainFromTokens(input) { + if (!this.isValid) { + return { + input: input, + tokens: this.tokens, + invalidReason: this.invalidReason + }; + } else { + var _match = match(input, this.regex, this.handlers), + rawMatches = _match[0], + matches = _match[1], + _ref6 = matches ? dateTimeFromMatches(matches) : [null, null, undefined], + result = _ref6[0], + zone = _ref6[1], + specificOffset = _ref6[2]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input: input, + tokens: this.tokens, + regex: this.regex, + rawMatches: rawMatches, + matches: matches, + result: result, + zone: zone, + specificOffset: specificOffset + }; + } + }; + _createClass(TokenParser, [{ + key: "isValid", + get: function get() { + return !this.disqualifyingUnit; + } + }, { + key: "invalidReason", + get: function get() { + return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null; + } + }]); + return TokenParser; + }(); + function explainFromTokens(locale, input, format) { + var parser = new TokenParser(locale, format); + return parser.explainFromTokens(input); + } + function parseFromTokens(locale, input, format) { + var _explainFromTokens = explainFromTokens(locale, input, format), + result = _explainFromTokens.result, + zone = _explainFromTokens.zone, + specificOffset = _explainFromTokens.specificOffset, + invalidReason = _explainFromTokens.invalidReason; + return [result, zone, specificOffset, invalidReason]; + } + function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + var formatter = Formatter.create(locale, formatOpts); + var df = formatter.dtFormatter(getDummyDateTime()); + var parts = df.formatToParts(); + var resolvedOpts = df.resolvedOptions(); + return parts.map(function (p) { + return tokenForPart(p, formatOpts, resolvedOpts); + }); + } + + var INVALID = "Invalid DateTime"; + var MAX_DATE = 8.64e15; + function unsupportedZone(zone) { + return new Invalid("unsupported zone", "the zone \"" + zone.name + "\" is not supported"); + } + + // we cache week data on the DT object and this intermediates the cache + /** + * @param {DateTime} dt + */ + function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; + } + + /** + * @param {DateTime} dt + */ + function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek(dt.c, dt.loc.getMinDaysInFirstWeek(), dt.loc.getStartOfWeek()); + } + return dt.localWeekData; + } + + // clone really means, "make a new object with these modifications". all "setters" really use this + // to create a new object while only changing some of the properties + function clone(inst, alts) { + var current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime(_extends({}, current, alts, { + old: current + })); + } + + // find the right offset a given local time. The o input is our guess, which determines which + // offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) + function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + var utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + var o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + var o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; + } + + // convert an epoch timestamp into a calendar object with the given offset + function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + var d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; + } + + // convert a calendar object to a epoch timestamp + function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); + } + + // create a new DT instance by adding a duration, adjusting for DSTs + function adjustTime(inst, dur) { + var oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = _extends({}, inst.c, { + year: year, + month: month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }), + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), + localTS = objToLocalTS(c); + var _fixOffset = fixOffset(localTS, oPre, inst.zone), + ts = _fixOffset[0], + o = _fixOffset[1]; + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + return { + ts: ts, + o: o + }; + } + + // helper useful in turning the results of parsing into real dates + // by handling the zone options + function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + var setZone = opts.setZone, + zone = opts.zone; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + var interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, _extends({}, opts, { + zone: interpretationZone, + specificOffset: specificOffset + })); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", "the input \"" + text + "\" can't be parsed as " + format)); + } + } + + // if you want to output a technical format (e.g. RFC 2822), this helper + // helps handle the details + function toTechFormat(dt, format, allowZ) { + if (allowZ === void 0) { + allowZ = true; + } + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ: allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format) : null; + } + function _toISODate(o, extended, precision) { + var longFormat = o.c.year > 9999 || o.c.year < 0; + var c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (precision === "year") return c; + if (extended) { + c += "-"; + c += padStart(o.c.month); + if (precision === "month") return c; + c += "-"; + } else { + c += padStart(o.c.month); + if (precision === "month") return c; + } + c += padStart(o.c.day); + return c; + } + function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision) { + var showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0, + c = ""; + switch (precision) { + case "day": + case "month": + case "year": + break; + default: + c += padStart(o.c.hour); + if (precision === "hour") break; + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += ":"; + c += padStart(o.c.second); + } + } else { + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += padStart(o.c.second); + } + } + if (precision === "second") break; + if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; + } + + // defaults for unspecified units in the supported calendars + var defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + + // Units in the supported calendars, sorted by bigness + var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + + // standardize case and plurality in units + function normalizeUnit(unit) { + var normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal" + }[unit.toLowerCase()]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } + } + + // cache offsets for zones based on the current timestamp when this function is + // first called. When we are handling a datetime from components like (year, + // month, day, hour) in a time zone, we need a guess about what the timezone + // offset is so that we can convert into a UTC timestamp. One way is to find the + // offset of now in the zone. The actual date may have a different offset (for + // example, if we handle a date in June while we're in December in a zone that + // observes DST), but we can check and adjust that. + // + // When handling many dates, calculating the offset for now every time is + // expensive. It's just a guess, so we can cache the offset to use even if we + // are right on a time change boundary (we'll just correct in the other + // direction). Using a timestamp from first read is a slight optimization for + // handling dates close to the current date, since those dates will usually be + // in the same offset (we could set the timestamp statically, instead). We use a + // single timestamp for all zones to make things a bit more predictable. + // + // This is safe for quickDT (used by local() and utc()) because we don't fill in + // higher-order units from tsNow (as we do in fromObject, this requires that + // offset is calculated from tsNow). + /** + * @param {Zone} zone + * @return {number} + */ + function guessOffsetForZone(zone) { + if (zoneOffsetTs === undefined) { + zoneOffsetTs = Settings.now(); + } + + // Do not cache anything but IANA zones, because it is not safe to do so. + // Guessing an offset which is not present in the zone can cause wrong results from fixOffset + if (zone.type !== "iana") { + return zone.offset(zoneOffsetTs); + } + var zoneName = zone.name; + var offsetGuess = zoneOffsetGuessCache.get(zoneName); + if (offsetGuess === undefined) { + offsetGuess = zone.offset(zoneOffsetTs); + zoneOffsetGuessCache.set(zoneName, offsetGuess); + } + return offsetGuess; + } + + // this is a dumbed down version of fromObject() that runs about 60% faster + // but doesn't do any validation, makes a bunch of assumptions about what units + // are present, and so on. + function quickDT(obj, opts) { + var zone = normalizeZone(opts.zone, Settings.defaultZone); + if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } + var loc = Locale.fromObject(opts); + var ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (var _i = 0, _orderedUnits = orderedUnits; _i < _orderedUnits.length; _i++) { + var u = _orderedUnits[_i]; + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + var invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + var offsetProvis = guessOffsetForZone(zone); + var _objToTS = objToTS(obj, offsetProvis, zone); + ts = _objToTS[0]; + o = _objToTS[1]; + } else { + ts = Settings.now(); + } + return new DateTime({ + ts: ts, + zone: zone, + loc: loc, + o: o + }); + } + function diffRelative(start, end, opts) { + var round = isUndefined(opts.round) ? true : opts.round, + rounding = isUndefined(opts.rounding) ? "trunc" : opts.rounding, + format = function format(c, unit) { + c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? "round" : rounding); + var formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = function differ(unit) { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + for (var _iterator = _createForOfIteratorHelperLoose(opts.units), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + var count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); + } + function lastOpts(argList) { + var opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; + } + + /** + * Timestamp to use for cached zone offset guesses (exposed for test) + */ + var zoneOffsetTs; + /** + * Cache for zone offset guesses (exposed for test). + * + * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of + * zone.offset(). + */ + var zoneOffsetGuessCache = new Map(); + + /** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ + var DateTime = /*#__PURE__*/function (_Symbol$for) { + /** + * @access private + */ + function DateTime(config) { + var zone = config.zone || Settings.defaultZone; + var invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + var c = null, + o = null; + if (!invalid) { + var unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + var _ref = [config.old.c, config.old.o]; + c = _ref[0]; + o = _ref[1]; + } else { + // If an offset has been passed and we have not been called from + // clone(), we can trust it and avoid the offset calculation. + var ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + DateTime.now = function now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */; + DateTime.local = function local() { + var _lastOpts = lastOpts(arguments), + opts = _lastOpts[0], + args = _lastOpts[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */; + DateTime.utc = function utc() { + var _lastOpts2 = lastOpts(arguments), + opts = _lastOpts2[0], + args = _lastOpts2[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */; + DateTime.fromJSDate = function fromJSDate(date, options) { + if (options === void 0) { + options = {}; + } + var ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + var zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromMillis = function fromMillis(milliseconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError("fromMillis requires a numerical input, but received a " + typeof milliseconds + " with value " + milliseconds); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromSeconds = function fromSeconds(seconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */; + DateTime.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + obj = obj || {}; + var zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + var loc = Locale.fromObject(opts); + var normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues = usesLocalWeekValues(normalized, loc), + minDaysInFirstWeek = _usesLocalWeekValues.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues.startOfWeek; + var tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + + // configure ourselves to deal with gregorian dates or week stuff + var units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + var foundFirst = false; + for (var _iterator2 = _createForOfIteratorHelperLoose(units), _step2; !(_step2 = _iterator2()).done;) { + var u = _step2.value; + var v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + var higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + var gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, + _objToTS2 = objToTS(gregorian, offsetProvis, zoneToUse), + tsFinal = _objToTS2[0], + offsetFinal = _objToTS2[1], + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc: loc + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", "you can't specify both a weekday of " + normalized.weekday + " and a date of " + inst.toISO()); + } + if (!inst.isValid) { + return DateTime.invalid(inst.invalid); + } + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */; + DateTime.fromISO = function fromISO(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseISODate = parseISODate(text), + vals = _parseISODate[0], + parsedZone = _parseISODate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */; + DateTime.fromRFC2822 = function fromRFC2822(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseRFC2822Date = parseRFC2822Date(text), + vals = _parseRFC2822Date[0], + parsedZone = _parseRFC2822Date[1]; + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */; + DateTime.fromHTTP = function fromHTTP(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseHTTPDate = parseHTTPDate(text), + vals = _parseHTTPDate[0], + parsedZone = _parseHTTPDate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromFormat = function fromFormat(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + var _opts = opts, + _opts$locale = _opts.locale, + locale = _opts$locale === void 0 ? null : _opts$locale, + _opts$numberingSystem = _opts.numberingSystem, + numberingSystem = _opts$numberingSystem === void 0 ? null : _opts$numberingSystem, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }), + _parseFromTokens = parseFromTokens(localeToUse, text, fmt), + vals = _parseFromTokens[0], + parsedZone = _parseFromTokens[1], + specificOffset = _parseFromTokens[2], + invalid = _parseFromTokens[3]; + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, "format " + fmt, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */; + DateTime.fromString = function fromString(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */; + DateTime.fromSQL = function fromSQL(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseSQL = parseSQL(text), + vals = _parseSQL[0], + parsedZone = _parseSQL[1]; + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */; + DateTime.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid: invalid + }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + DateTime.isDateTime = function isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */; + DateTime.parseFormatForOpts = function parseFormatForOpts(formatOpts, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map(function (t) { + return t ? t.val : null; + }).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */; + DateTime.expandFormat = function expandFormat(fmt, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map(function (t) { + return t.val; + }).join(""); + }; + DateTime.resetCache = function resetCache() { + zoneOffsetTs = undefined; + zoneOffsetGuessCache.clear(); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */; + var _proto = DateTime.prototype; + _proto.get = function get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */; + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + _proto.getPossibleOffsets = function getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + var dayMs = 86400000; + var minuteMs = 60000; + var localTS = objToLocalTS(this.c); + var oEarlier = this.zone.offset(localTS - dayMs); + var oLater = this.zone.offset(localTS + dayMs); + var o1 = this.zone.offset(localTS - oEarlier * minuteMs); + var o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + var ts1 = localTS - o1 * minuteMs; + var ts2 = localTS - o2 * minuteMs; + var c1 = tsToObj(ts1, o1); + var c2 = tsToObj(ts2, o2); + if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { + return [clone(this, { + ts: ts1 + }), clone(this, { + ts: ts2 + })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */; + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + _proto.resolvedLocaleOptions = function resolvedLocaleOptions(opts) { + if (opts === void 0) { + opts = {}; + } + var _Formatter$create$res = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this), + locale = _Formatter$create$res.locale, + numberingSystem = _Formatter$create$res.numberingSystem, + calendar = _Formatter$create$res.calendar; + return { + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: calendar + }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */; + _proto.toUTC = function toUTC(offset, opts) { + if (offset === void 0) { + offset = 0; + } + if (opts === void 0) { + opts = {}; + } + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */; + _proto.toLocal = function toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */; + _proto.setZone = function setZone(zone, _temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + _ref2$keepLocalTime = _ref2.keepLocalTime, + keepLocalTime = _ref2$keepLocalTime === void 0 ? false : _ref2$keepLocalTime, + _ref2$keepCalendarTim = _ref2.keepCalendarTime, + keepCalendarTime = _ref2$keepCalendarTim === void 0 ? false : _ref2$keepCalendarTim; + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + var newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + var offsetGuess = zone.offset(this.ts); + var asObj = this.toObject(); + var _objToTS3 = objToTS(asObj, offsetGuess, zone); + newTS = _objToTS3[0]; + } + return clone(this, { + ts: newTS, + zone: zone + }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */; + _proto.reconfigure = function reconfigure(_temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + locale = _ref3.locale, + numberingSystem = _ref3.numberingSystem, + outputCalendar = _ref3.outputCalendar; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: outputCalendar + }); + return clone(this, { + loc: loc + }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */; + _proto.setLocale = function setLocale(locale) { + return this.reconfigure({ + locale: locale + }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues2 = usesLocalWeekValues(normalized, this.loc), + minDaysInFirstWeek = _usesLocalWeekValues2.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues2.startOfWeek; + var settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var mixed; + if (settingWeekStuff) { + mixed = weekToGregorian(_extends({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian(_extends({}, gregorianToOrdinal(this.c), normalized)); + } else { + mixed = _extends({}, this.toObject(), normalized); + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + var _objToTS4 = objToTS(mixed, this.o, this.zone), + ts = _objToTS4[0], + o = _objToTS4[1]; + return clone(this, { + ts: ts, + o: o + }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */; + _proto.startOf = function startOf(unit, _temp3) { + var _ref4 = _temp3 === void 0 ? {} : _temp3, + _ref4$useLocaleWeeks = _ref4.useLocaleWeeks, + useLocaleWeeks = _ref4$useLocaleWeeks === void 0 ? false : _ref4$useLocaleWeeks; + if (!this.isValid) return this; + var o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + var startOfWeek = this.loc.getStartOfWeek(); + var weekday = this.weekday; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + if (normalizedUnit === "quarters") { + var q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */; + _proto.endOf = function endOf(unit, opts) { + var _this$plus; + return this.isValid ? this.plus((_this$plus = {}, _this$plus[unit] = 1, _this$plus)).startOf(unit, opts).minus(1) : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */; + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */; + _proto.toLocaleParts = function toLocaleParts(opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z' + * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z' + * @return {string|null} + */; + _proto.toISO = function toISO(_temp4) { + var _ref5 = _temp4 === void 0 ? {} : _temp4, + _ref5$format = _ref5.format, + format = _ref5$format === void 0 ? "extended" : _ref5$format, + _ref5$suppressSeconds = _ref5.suppressSeconds, + suppressSeconds = _ref5$suppressSeconds === void 0 ? false : _ref5$suppressSeconds, + _ref5$suppressMillise = _ref5.suppressMilliseconds, + suppressMilliseconds = _ref5$suppressMillise === void 0 ? false : _ref5$suppressMillise, + _ref5$includeOffset = _ref5.includeOffset, + includeOffset = _ref5$includeOffset === void 0 ? true : _ref5$includeOffset, + _ref5$extendedZone = _ref5.extendedZone, + extendedZone = _ref5$extendedZone === void 0 ? false : _ref5$extendedZone, + _ref5$precision = _ref5.precision, + precision = _ref5$precision === void 0 ? "milliseconds" : _ref5$precision; + if (!this.isValid) { + return null; + } + precision = normalizeUnit(precision); + var ext = format === "extended"; + var c = _toISODate(this, ext, precision); + if (orderedUnits.indexOf(precision) >= 3) c += "T"; + c += _toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'. + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05' + * @return {string|null} + */; + _proto.toISODate = function toISODate(_temp5) { + var _ref6 = _temp5 === void 0 ? {} : _temp5, + _ref6$format = _ref6.format, + format = _ref6$format === void 0 ? "extended" : _ref6$format, + _ref6$precision = _ref6.precision, + precision = _ref6$precision === void 0 ? "day" : _ref6$precision; + if (!this.isValid) { + return null; + } + return _toISODate(this, format === "extended", normalizeUnit(precision)); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */; + _proto.toISOWeekDate = function toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z' + * @return {string} + */; + _proto.toISOTime = function toISOTime(_temp6) { + var _ref7 = _temp6 === void 0 ? {} : _temp6, + _ref7$suppressMillise = _ref7.suppressMilliseconds, + suppressMilliseconds = _ref7$suppressMillise === void 0 ? false : _ref7$suppressMillise, + _ref7$suppressSeconds = _ref7.suppressSeconds, + suppressSeconds = _ref7$suppressSeconds === void 0 ? false : _ref7$suppressSeconds, + _ref7$includeOffset = _ref7.includeOffset, + includeOffset = _ref7$includeOffset === void 0 ? true : _ref7$includeOffset, + _ref7$includePrefix = _ref7.includePrefix, + includePrefix = _ref7$includePrefix === void 0 ? false : _ref7$includePrefix, + _ref7$extendedZone = _ref7.extendedZone, + extendedZone = _ref7$extendedZone === void 0 ? false : _ref7$extendedZone, + _ref7$format = _ref7.format, + format = _ref7$format === void 0 ? "extended" : _ref7$format, + _ref7$precision = _ref7.precision, + precision = _ref7$precision === void 0 ? "milliseconds" : _ref7$precision; + if (!this.isValid) { + return null; + } + precision = normalizeUnit(precision); + var c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? "T" : ""; + return c + _toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */; + _proto.toRFC2822 = function toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */; + _proto.toHTTP = function toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string|null} + */; + _proto.toSQLDate = function toSQLDate() { + if (!this.isValid) { + return null; + } + return _toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */; + _proto.toSQLTime = function toSQLTime(_temp7) { + var _ref8 = _temp7 === void 0 ? {} : _temp7, + _ref8$includeOffset = _ref8.includeOffset, + includeOffset = _ref8$includeOffset === void 0 ? true : _ref8$includeOffset, + _ref8$includeZone = _ref8.includeZone, + includeZone = _ref8$includeZone === void 0 ? false : _ref8$includeZone, + _ref8$includeOffsetSp = _ref8.includeOffsetSpace, + includeOffsetSpace = _ref8$includeOffsetSp === void 0 ? true : _ref8$includeOffsetSp; + var fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */; + _proto.toSQL = function toSQL(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) { + return null; + } + return this.toSQLDate() + " " + this.toSQLTime(opts); + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */; + _proto.toString = function toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "DateTime { ts: " + this.toISO() + ", zone: " + this.zone.name + ", locale: " + this.locale + " }"; + } else { + return "DateTime { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */; + _proto.toMillis = function toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime. + * @return {number} + */; + _proto.toSeconds = function toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */; + _proto.toUnixInteger = function toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */; + _proto.toBSON = function toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */; + _proto.toObject = function toObject(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return {}; + var base = _extends({}, this.c); + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */; + _proto.toJSDate = function toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */; + _proto.diff = function diff(otherDateTime, unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + var durOpts = _extends({ + locale: this.locale, + numberingSystem: this.numberingSystem + }, opts); + var units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = _diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */; + _proto.diffNow = function diffNow(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval|DateTime} + */; + _proto.until = function until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */; + _proto.hasSame = function hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + var inputMs = otherDateTime.valueOf(); + var adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */; + _proto.equals = function equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {string} [options.rounding="trunc"] - rounding method to use when rounding the numbers in the output. Can be "trunc" (toward zero), "expand" (away from zero), "round", "floor", or "ceil". + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */; + _proto.toRelative = function toRelative(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + var base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), + padding = options.padding ? this < base ? -options.padding : options.padding : 0; + var units = ["years", "months", "days", "hours", "minutes", "seconds"]; + var unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), _extends({}, options, { + numeric: "always", + units: units, + unit: unit + })); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */; + _proto.toRelativeCalendar = function toRelativeCalendar(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, _extends({}, options, { + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + })); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */; + DateTime.min = function min() { + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */; + DateTime.max = function max() { + for (var _len2 = arguments.length, dateTimes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + dateTimes[_key2] = arguments[_key2]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */; + DateTime.fromFormatExplain = function fromFormatExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + var _options = options, + _options$locale = _options.locale, + locale = _options$locale === void 0 ? null : _options$locale, + _options$numberingSys = _options.numberingSystem, + numberingSystem = _options$numberingSys === void 0 ? null : _options$numberingSys, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */; + DateTime.fromStringExplain = function fromStringExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + return DateTime.fromFormatExplain(text, fmt, options); + } + + /** + * Build a parser for `fmt` using the given locale. This parser can be passed + * to {@link DateTime.fromFormatParser} to a parse a date in this format. This + * can be used to optimize cases where many dates need to be parsed in a + * specific format. + * + * @param {String} fmt - the format the string is expected to be in (see + * description) + * @param {Object} options - options used to set locale and numberingSystem + * for parser + * @returns {TokenParser} - opaque object to be used + */; + DateTime.buildFormatParser = function buildFormatParser(fmt, options) { + if (options === void 0) { + options = {}; + } + var _options2 = options, + _options2$locale = _options2.locale, + locale = _options2$locale === void 0 ? null : _options2$locale, + _options2$numberingSy = _options2.numberingSystem, + numberingSystem = _options2$numberingSy === void 0 ? null : _options2$numberingSy, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return new TokenParser(localeToUse, fmt); + } + + /** + * Create a DateTime from an input string and format parser. + * + * The format parser must have been created with the same locale as this call. + * + * @param {String} text - the string to parse + * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser} + * @param {Object} opts - options taken by fromFormat() + * @returns {DateTime} + */; + DateTime.fromFormatParser = function fromFormatParser(text, formatParser, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(formatParser)) { + throw new InvalidArgumentError("fromFormatParser requires an input string and a format parser"); + } + var _opts2 = opts, + _opts2$locale = _opts2.locale, + locale = _opts2$locale === void 0 ? null : _opts2$locale, + _opts2$numberingSyste = _opts2.numberingSystem, + numberingSystem = _opts2$numberingSyste === void 0 ? null : _opts2$numberingSyste, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + if (!localeToUse.equals(formatParser.locale)) { + throw new InvalidArgumentError("fromFormatParser called with a locale of " + localeToUse + ", " + ("but the format parser was created for " + formatParser.locale)); + } + var _formatParser$explain = formatParser.explainFromTokens(text), + result = _formatParser$explain.result, + zone = _formatParser$explain.zone, + specificOffset = _formatParser$explain.specificOffset, + invalidReason = _formatParser$explain.invalidReason; + if (invalidReason) { + return DateTime.invalid(invalidReason); + } else { + return parseDataToDateTime(result, zone, opts, "format " + formatParser.format, text, specificOffset); + } + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */; + _createClass(DateTime, [{ + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "outputCalendar", + get: function get() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + }, { + key: "zone", + get: function get() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + }, { + key: "zoneName", + get: function get() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + }, { + key: "year", + get: function get() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + }, { + key: "quarter", + get: function get() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + }, { + key: "month", + get: function get() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + }, { + key: "day", + get: function get() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + }, { + key: "hour", + get: function get() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + }, { + key: "minute", + get: function get() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + }, { + key: "second", + get: function get() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + }, { + key: "millisecond", + get: function get() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + }, { + key: "weekYear", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + }, { + key: "weekNumber", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + }, { + key: "weekday", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + }, { + key: "isWeekend", + get: function get() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + }, { + key: "localWeekday", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + }, { + key: "localWeekNumber", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + }, { + key: "localWeekYear", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + }, { + key: "ordinal", + get: function get() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + }, { + key: "monthShort", + get: function get() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + }, { + key: "monthLong", + get: function get() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + }, { + key: "weekdayShort", + get: function get() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + }, { + key: "weekdayLong", + get: function get() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + }, { + key: "offset", + get: function get() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameShort", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameLong", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + }, { + key: "isOffsetFixed", + get: function get() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + }, { + key: "isInDST", + get: function get() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + }, { + key: "isInLeapYear", + get: function get() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + }, { + key: "daysInMonth", + get: function get() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + }, { + key: "daysInYear", + get: function get() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + }, { + key: "weeksInWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + }, { + key: "weeksInLocalWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN; + } + }], [{ + key: "DATE_SHORT", + get: function get() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED", + get: function get() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED_WITH_WEEKDAY", + get: function get() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_FULL", + get: function get() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_HUGE", + get: function get() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_SIMPLE", + get: function get() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SECONDS", + get: function get() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SHORT_OFFSET", + get: function get() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_LONG_OFFSET", + get: function get() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_SIMPLE", + get: function get() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SECONDS", + get: function get() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SHORT_OFFSET", + get: function get() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_LONG_OFFSET", + get: function get() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT", + get: function get() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT_WITH_SECONDS", + get: function get() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED", + get: function get() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_SECONDS", + get: function get() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_WEEKDAY", + get: function get() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL", + get: function get() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL_WITH_SECONDS", + get: function get() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE", + get: function get() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE_WITH_SECONDS", + get: function get() { + return DATETIME_HUGE_WITH_SECONDS; + } + }]); + return DateTime; + }(Symbol.for("nodejs.util.inspect.custom")); + function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError("Unknown datetime argument: " + dateTimeish + ", of type " + typeof dateTimeish); + } + } + + var VERSION = "3.7.2"; + + exports.DateTime = DateTime; + exports.Duration = Duration; + exports.FixedOffsetZone = FixedOffsetZone; + exports.IANAZone = IANAZone; + exports.Info = Info; + exports.Interval = Interval; + exports.InvalidZone = InvalidZone; + exports.Settings = Settings; + exports.SystemZone = SystemZone; + exports.VERSION = VERSION; + exports.Zone = Zone; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/amd/luxon.js.map b/node_modules/luxon/build/amd/luxon.js.map new file mode 100644 index 00000000..30cf2260 --- /dev/null +++ b/node_modules/luxon/build/amd/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/impl/digits.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nconst dtfCache = new Map();\nfunction makeDTF(zoneName) {\n let dtf = dtfCache.get(zoneName);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zoneName,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n dtfCache.set(zoneName, dtf);\n }\n return dtf;\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nconst ianaZoneCache = new Map();\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n let zone = ianaZoneCache.get(name);\n if (zone === undefined) {\n ianaZoneCache.set(name, (zone = new IANAZone(name)));\n }\n return zone;\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache.clear();\n dtfCache.clear();\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n if (!this.valid) return NaN;\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nconst intlDTCache = new Map();\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache.get(key);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache.set(key, dtf);\n }\n return dtf;\n}\n\nconst intlNumCache = new Map();\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache.get(key);\n if (inf === undefined) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache.set(key, inf);\n }\n return inf;\n}\n\nconst intlRelCache = new Map();\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache.get(key);\n if (inf === undefined) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache.set(key, inf);\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nconst intlResolvedOptionsCache = new Map();\nfunction getCachedIntResolvedOptions(locString) {\n let opts = intlResolvedOptionsCache.get(locString);\n if (opts === undefined) {\n opts = new Intl.DateTimeFormat(locString).resolvedOptions();\n intlResolvedOptionsCache.set(locString, opts);\n }\n return opts;\n}\n\nconst weekInfoCache = new Map();\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache.get(locString);\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86\n if (!(\"minimalDays\" in data)) {\n data = { ...fallbackWeekSettings, ...data };\n }\n weekInfoCache.set(locString, data);\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n getCachedIntResolvedOptions(loc.locale).numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache.clear();\n intlNumCache.clear();\n intlRelCache.clear();\n intlResolvedOptionsCache.clear();\n weekInfoCache.clear();\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n // Workaround for \"ja\" locale: formatToParts does not label all parts of the month\n // as \"month\" and for this locale there is no difference between \"format\" and \"non-format\".\n // As such, just use format() instead of formatToParts() and take the whole string\n const monthSpecialCase = this.intl === \"ja\" || this.intl.startsWith(\"ja-\");\n format &= !monthSpecialCase;\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n const mapper = !monthSpecialCase\n ? (dt) => this.extract(dt, intl, \"month\")\n : (dt) => this.dtFormatter(dt, intl).format();\n this.monthsCache[formatStr][length] = mapMonths(mapper);\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n getCachedIntResolvedOptions(this.intl).locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nconst digitRegexCache = new Map();\nexport function resetDigitRegexCache() {\n digitRegexCache.clear();\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n let appendCache = digitRegexCache.get(ns);\n if (appendCache === undefined) {\n appendCache = new Map();\n digitRegexCache.set(ns, appendCache);\n }\n let regex = appendCache.get(append);\n if (regex === undefined) {\n regex = new RegExp(`${numberingSystems[ns]}${append}`);\n appendCache.set(append, regex);\n }\n\n return regex;\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, rounding = \"round\") {\n const factor = 10 ** digits;\n switch (rounding) {\n case \"expand\":\n return number > 0\n ? Math.ceil(number * factor) / factor\n : Math.floor(number * factor) / factor;\n case \"trunc\":\n return Math.trunc(number * factor) / factor;\n case \"round\":\n return Math.round(number * factor) / factor;\n case \"floor\":\n return Math.floor(number * factor) / factor;\n case \"ceil\":\n return Math.ceil(number * factor) / factor;\n default:\n throw new RangeError(`Value rounding ${rounding} is out of range`);\n }\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || !Number.isFinite(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n // turn '' into a literal signal quote instead of just skipping the empty literal\n if (currentFull.length > 0 || bracketed) {\n splits.push({\n literal: bracketed || /^\\s+$/.test(currentFull),\n val: currentFull === \"\" ? \"'\" : currentFull,\n });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0, signDisplay = undefined) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n if (signDisplay) {\n opts.signDisplay = signDisplay;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const invertLargest = this.opts.signMode === \"negativeLargestOnly\" ? -1 : 1;\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"milliseconds\";\n case \"s\":\n return \"seconds\";\n case \"m\":\n return \"minutes\";\n case \"h\":\n return \"hours\";\n case \"d\":\n return \"days\";\n case \"w\":\n return \"weeks\";\n case \"M\":\n return \"months\";\n case \"y\":\n return \"years\";\n default:\n return null;\n }\n },\n tokenToString = (lildur, info) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n const inversionFactor =\n info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1;\n let signDisplay;\n if (this.opts.signMode === \"negativeLargestOnly\" && mapped !== info.largestUnit) {\n signDisplay = \"never\";\n } else if (this.opts.signMode === \"all\") {\n signDisplay = \"always\";\n } else {\n // \"auto\" and \"negative\" are the same, but \"auto\" has better support\n signDisplay = \"auto\";\n }\n return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)),\n durationInfo = {\n isNegativeDuration: collapsed < 0,\n // this relies on \"collapsed\" being based on \"shiftTo\", which builds up the object\n // in order\n largestUnit: Object.keys(collapsed.values)[0],\n };\n return stringifyTokens(tokens, tokenToString(collapsed, durationInfo));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:([Zz])|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"+6 +2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"-6 -2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"negativeLargestOnly\" }) //=> \"-6 2\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero\n * @example\n * ```js\n * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 mth, 0 wks, 5 hr, 6 min'\n * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const showZeros = opts.showZeros !== false;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val) || (val === 0 && !showZeros)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Removes all units with values equal to 0 from this Duration.\n * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 }\n * @return {Duration}\n */\n removeZeros() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.values);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval. This is the first instant which is not part of the interval\n * (Interval is half-open).\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns the last DateTime included in the interval (since end is not part of the interval)\n * @type {DateTime}\n */\n get lastDateTime() {\n return this.isValid ? (this.e ? this.e.minus(1) : null) : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into an equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval\n * and ending with the latest.\n *\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended, precision) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n if (precision === \"year\") return c;\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n c += \"-\";\n } else {\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n }\n c += padStart(o.c.day);\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n) {\n let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0,\n c = \"\";\n switch (precision) {\n case \"day\":\n case \"month\":\n case \"year\":\n break;\n default:\n c += padStart(o.c.hour);\n if (precision === \"hour\") break;\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += \":\";\n c += padStart(o.c.second);\n }\n } else {\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += padStart(o.c.second);\n }\n }\n if (precision === \"second\") break;\n if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\n/**\n * @param {Zone} zone\n * @return {number}\n */\nfunction guessOffsetForZone(zone) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n // Do not cache anything but IANA zones, because it is not safe to do so.\n // Guessing an offset which is not present in the zone can cause wrong results from fixOffset\n if (zone.type !== \"iana\") {\n return zone.offset(zoneOffsetTs);\n }\n const zoneName = zone.name;\n let offsetGuess = zoneOffsetGuessCache.get(zoneName);\n if (offsetGuess === undefined) {\n offsetGuess = zone.offset(zoneOffsetTs);\n zoneOffsetGuessCache.set(zoneName, offsetGuess);\n }\n return offsetGuess;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n rounding = isUndefined(opts.rounding) ? \"trunc\" : opts.rounding,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? \"round\" : rounding);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nconst zoneOffsetGuessCache = new Map();\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache.clear();\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z'\n * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z'\n * @return {string|null}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext, precision);\n if (orderedUnits.indexOf(precision) >= 3) c += \"T\";\n c += toISOTime(\n this,\n ext,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n );\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'.\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05'\n * @return {string|null}\n */\n toISODate({ format = \"extended\", precision = \"day\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, format === \"extended\", normalizeUnit(precision));\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string|null}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval|DateTime}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {string} [options.rounding=\"trunc\"] - rounding method to use when rounding the numbers in the output. Can be \"trunc\" (toward zero), \"expand\" (away from zero), \"round\", \"floor\", or \"ceil\".\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.7.2\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["LuxonError","_Error","_inheritsLoose","apply","arguments","_wrapNativeSuper","Error","InvalidDateTimeError","_LuxonError","reason","call","toMessage","InvalidIntervalError","_LuxonError2","InvalidDurationError","_LuxonError3","ConflictingSpecificationError","_LuxonError4","InvalidUnitError","_LuxonError5","unit","InvalidArgumentError","_LuxonError6","ZoneIsAbstractError","_LuxonError7","n","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","_proto","prototype","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","_createClass","key","get","name","singleton","SystemZone","_Zone","_ref","locale","parseZoneInfo","Date","getTimezoneOffset","type","Intl","DateTimeFormat","resolvedOptions","timeZone","dtfCache","Map","makeDTF","zoneName","dtf","undefined","hour12","era","set","typeToPos","hackyOffset","date","formatted","replace","parsed","exec","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","formatToParts","filled","i","length","_formatted$i","value","pos","isUndefined","parseInt","ianaZoneCache","IANAZone","create","zone","resetCache","clear","isValidSpecifier","isValidZone","e","_this","valid","NaN","isNaN","_ref2","adOrBc","Math","abs","adjustedHour","asUTC","objToLocalTS","millisecond","asTS","over","intlLFCache","getCachedLF","locString","JSON","stringify","ListFormat","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","NumberFormat","intlRelCache","getCachedRTF","_opts","base","cacheKeyOpts","_objectWithoutPropertiesLoose","_excluded","RelativeTimeFormat","sysLocaleCache","systemLocale","intlResolvedOptionsCache","getCachedIntResolvedOptions","weekInfoCache","getCachedWeekInfo","data","Locale","getWeekInfo","weekInfo","_extends","fallbackWeekSettings","parseLocaleString","localeStr","xIndex","indexOf","substring","uIndex","options","selectedStr","smaller","_options","numberingSystem","calendar","intlConfigString","outputCalendar","includes","mapMonths","f","ms","dt","DateTime","utc","push","mapWeekdays","listStuff","loc","englishFn","intlFn","mode","listingMode","supportsFastNumbers","startsWith","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","_excluded2","Object","keys","intlOpts","useGrouping","minimumIntegerDigits","fixed","roundTo","padStart","PolyDateFormatter","originalZone","z","gmtOffset","offsetZ","setZone","plus","minutes","_proto2","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","_proto3","count","English","numeric","firstDay","minimalDays","weekend","fromOpts","weekSettings","defaultToEN","specifiedLocale","Settings","defaultLocale","localeR","numberingSystemR","defaultNumberingSystem","outputCalendarR","defaultOutputCalendar","weekSettingsR","validateWeekSettings","defaultWeekSettings","fromObject","_temp","numbering","_parseLocaleString","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","_proto4","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","months","_this2","monthSpecialCase","formatStr","mapper","extract","dtFormatter","weekdays","_this3","meridiems","_this4","eras","_this5","field","df","results","matching","find","m","toLowerCase","numberFormatter","fastNumbers","relFormatter","listFormatter","getWeekSettings","hasLocaleWeekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","toString","FixedOffsetZone","instance","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","input","defaultZone","isString","lowered","isNumber","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","split","parseDigits","str","code","charCodeAt","search","_numberingSystemsUTF","min","max","digitRegexCache","resetDigitRegexCache","digitRegex","append","ns","appendCache","regex","RegExp","now","twoDigitCutoffYear","throwOnInvalid","resetCaches","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","_uncomputeOrdinal","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","_uncomputeOrdinal2","usesLocalWeekValues","obj","hasLocaleWeekData","localWeekday","localWeekNumber","localWeekYear","hasIsoWeekData","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","o","isDate","maybeArray","thing","Array","isArray","bestBy","arr","by","compare","reduce","best","next","pair","pick","a","k","hasOwnProperty","prop","settings","some","v","from","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","rounding","factor","pow","ceil","trunc","round","RangeError","modMonth","modYear","firstWeekOffset","fwdlw","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","Number","offMin","offMinSigned","is","asNumber","numericValue","isFinite","normalizeObject","normalizer","normalized","u","hours","sign","monthsLong","monthsShort","monthsNarrow","concat","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","narrow","units","years","quarters","weeks","days","seconds","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","_iterator","_createForOfIteratorHelperLoose","_step","done","token","literal","val","macroTokenToFormatOpts","D","Formats","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","c","charAt","test","formatOpts","systemLoc","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","p","signDisplay","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","isValid","meridiem","maybeMacro","slice","quarter","formatDurationFromString","dur","invertLargest","signMode","tokenToField","lildur","info","mapped","inversionFactor","isNegativeDuration","largestUnit","tokens","realTokens","found","collapsed","shiftTo","filter","durationInfo","values","ianaRegex","combineRegexes","_len","regexes","_key","full","source","combineExtractors","_len2","extractors","_key2","ex","mergedVals","mergedZone","cursor","_ex","parse","_len3","patterns","_key3","_i","_patterns","_patterns$_i","extractor","simpleParse","_len4","_key4","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","item","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","conf","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","previousVal","conv","rollUp","removeZeroes","newVals","_Object$entries","entries","_Object$entries$_i","_Symbol$for","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","_parseISODuration","fromISOTime","_parseISOTimeOnly","week","toFormat","fmtOpts","toHuman","showZeros","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","dateTime","toJSON","invalidReason","valueOf","duration","_i2","_orderedUnits","minus","negate","mapUnits","fn","_i3","_Object$keys","mixed","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","lastUnit","_i4","_orderedUnits2","own","ak","negated","_i5","_Object$keys2","removeZeros","eq","v1","v2","_i6","_orderedUnits3","Symbol","for","validateStartEnd","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","_split","startIsValid","endIsValid","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","isBefore","contains","splitAt","dateTimes","sorted","sort","b","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","_intervals$sort$reduc","sofar","final","xor","_Array$prototype","currentCount","ends","time","flattened","difference","toLocaleString","toISODate","dateFormat","_temp2","_ref3","_ref3$separator","separator","mapEndpoints","mapFn","Info","hasDST","proto","isUniversal","isValidIANAZone","_ref$locale","_ref$locObj","locObj","getMinimumDaysInFirstWeek","_ref2$locale","_ref2$locObj","getWeekendWeekdays","_temp3","_ref3$locale","_ref3$locObj","_temp4","_ref4","_ref4$locale","_ref4$numberingSystem","_ref4$locObj","_ref4$outputCalendar","monthsFormat","_temp5","_ref5","_ref5$locale","_ref5$numberingSystem","_ref5$locObj","_ref5$outputCalendar","_temp6","_ref6","_ref6$locale","_ref6$numberingSystem","_ref6$locObj","weekdaysFormat","_temp7","_ref7","_ref7$locale","_ref7$numberingSystem","_ref7$locObj","_temp8","_ref8","_ref8$locale","_temp9","_ref9","_ref9$locale","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","_differs","_differs$_i","differ","_highOrderDiffs","remainingMillis","lowerOrderUnits","_cursor$plus","_Duration$fromMillis","MISSING_FTP","intUnit","post","deser","NBSP","String","fromCharCode","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","partTypeStyleToTokenVal","short","long","dayperiod","dayPeriod","hour24","tokenForPart","resolvedOpts","isSpace","actualType","buildRegex","re","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","Z","q","M","G","y","S","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","TokenParser","disqualifyingUnit","_buildRegex","regexString","explainFromTokens","_match","rawMatches","parser","parseFromTokens","_explainFromTokens","formatter","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","_fixOffset","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","precision","longFormat","extendedZone","showSeconds","ianaName","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","guessOffsetForZone","zoneOffsetTs","offsetGuess","zoneOffsetGuessCache","quickDT","offsetProvis","_objToTS","diffRelative","calendary","lastOpts","argList","args","unchanged","ot","_zone","isLuxonDateTime","_lastOpts","_lastOpts2","fromJSDate","zoneToUse","fromSeconds","_usesLocalWeekValues","tsNow","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","_iterator2","_step2","higherOrderInvalid","gregorian","_objToTS2","tsFinal","offsetFinal","_parseISODate","fromRFC2822","_parseRFC2822Date","fromHTTP","_parseHTTPDate","fromFormat","_opts$locale","_opts$numberingSystem","localeToUse","_parseFromTokens","fromString","fromSQL","_parseSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","expanded","getPossibleOffsets","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","resolvedLocaleOptions","_Formatter$create$res","toLocal","_ref2$keepLocalTime","_ref2$keepCalendarTim","keepCalendarTime","newTS","asObj","_objToTS3","setLocale","_usesLocalWeekValues2","settingWeekStuff","_objToTS4","_ref4$useLocaleWeeks","normalizedUnit","endOf","_this$plus","toLocaleParts","_ref5$format","_ref5$suppressSeconds","_ref5$suppressMillise","_ref5$includeOffset","_ref5$extendedZone","_ref5$precision","ext","_ref6$format","_ref6$precision","toISOWeekDate","_ref7$suppressMillise","_ref7$suppressSeconds","_ref7$includeOffset","_ref7$includePrefix","_ref7$extendedZone","_ref7$format","_ref7$precision","toRFC2822","toHTTP","toSQLDate","toSQLTime","_ref8$includeOffset","_ref8$includeZone","includeZone","_ref8$includeOffsetSp","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","_options$locale","_options$numberingSys","fromStringExplain","buildFormatParser","_options2","_options2$locale","_options2$numberingSy","fromFormatParser","formatParser","_opts2","_opts2$locale","_opts2$numberingSyste","_formatParser$explain","dateTimeish","VERSION"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EAEA;EACA;EACA;EAFA,IAGMA,UAAU,0BAAAC,MAAA,EAAA;IAAAC,cAAA,CAAAF,UAAA,EAAAC,MAAA,CAAA,CAAA;EAAA,EA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OAAO4d,0BAAkC,CAAA;EAC3C,KAAA;;EAEA;EACF;EACA;EACA;EAHE,GAAA,EAAA;MAAA7d,GAAA,EAAA,eAAA;MAAAC,GAAA,EAIA,SAAAA,GAAAA,GAA2B;QACzB,OAAO4d,aAAqB,CAAA;EAC9B,KAAA;;EAEA;EACF;EACA;EACA;EAHE,GAAA,EAAA;MAAA7d,GAAA,EAAA,4BAAA;MAAAC,GAAA,EAIA,SAAAA,GAAAA,GAAwC;QACtC,OAAO4d,0BAAkC,CAAA;EAC3C,KAAA;EAAC,GAAA,CAAA,CAAA,CAAA;EAAA,EAAA,OAAAlW,QAAA,CAAA;EAAA,CAAA,CAnhBAinB,MAAM,CAACC,GAAG,CAAC,4BAA4B,CAAC,EAAA;EAyhBpC,SAASM,gBAAgBA,CAAC8X,WAAW,EAAE;EAC5C,EAAA,IAAIt/B,QAAQ,CAAC25B,UAAU,CAAC2F,WAAW,CAAC,EAAE;EACpC,IAAA,OAAOA,WAAW,CAAA;EACpB,GAAC,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACra,OAAO,IAAI7c,QAAQ,CAACk3B,WAAW,CAACra,OAAO,EAAE,CAAC,EAAE;EAChF,IAAA,OAAOjlB,QAAQ,CAACy3B,UAAU,CAAC6H,WAAW,CAAC,CAAA;KACxC,MAAM,IAAIA,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;EACzD,IAAA,OAAOt/B,QAAQ,CAACmE,UAAU,CAACm7B,WAAW,CAAC,CAAA;EACzC,GAAC,MAAM;EACL,IAAA,MAAM,IAAInqC,oBAAoB,CAAA,6BAAA,GACEmqC,WAAW,GAAa,YAAA,GAAA,OAAOA,WAC/D,CAAC,CAAA;EACH,GAAA;EACF;;AC/hFMC,MAAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/build/cjs-browser/luxon.js b/node_modules/luxon/build/cjs-browser/luxon.js new file mode 100644 index 00000000..679b0ee4 --- /dev/null +++ b/node_modules/luxon/build/cjs-browser/luxon.js @@ -0,0 +1,8739 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } +} +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; +} +function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); +} +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); +} +function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); +} +function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } +} +function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct.bind(); + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); +} +function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} +function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + return _wrapNativeSuper(Class); +} +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; +} +function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); +} +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; +} +function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); +} +function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); +} + +// these aren't really private, but nor are they really useful to document +/** + * @private + */ +var LuxonError = /*#__PURE__*/function (_Error) { + _inheritsLoose(LuxonError, _Error); + function LuxonError() { + return _Error.apply(this, arguments) || this; + } + return LuxonError; +}( /*#__PURE__*/_wrapNativeSuper(Error)); +/** + * @private + */ +var InvalidDateTimeError = /*#__PURE__*/function (_LuxonError) { + _inheritsLoose(InvalidDateTimeError, _LuxonError); + function InvalidDateTimeError(reason) { + return _LuxonError.call(this, "Invalid DateTime: " + reason.toMessage()) || this; + } + return InvalidDateTimeError; +}(LuxonError); + +/** + * @private + */ +var InvalidIntervalError = /*#__PURE__*/function (_LuxonError2) { + _inheritsLoose(InvalidIntervalError, _LuxonError2); + function InvalidIntervalError(reason) { + return _LuxonError2.call(this, "Invalid Interval: " + reason.toMessage()) || this; + } + return InvalidIntervalError; +}(LuxonError); + +/** + * @private + */ +var InvalidDurationError = /*#__PURE__*/function (_LuxonError3) { + _inheritsLoose(InvalidDurationError, _LuxonError3); + function InvalidDurationError(reason) { + return _LuxonError3.call(this, "Invalid Duration: " + reason.toMessage()) || this; + } + return InvalidDurationError; +}(LuxonError); + +/** + * @private + */ +var ConflictingSpecificationError = /*#__PURE__*/function (_LuxonError4) { + _inheritsLoose(ConflictingSpecificationError, _LuxonError4); + function ConflictingSpecificationError() { + return _LuxonError4.apply(this, arguments) || this; + } + return ConflictingSpecificationError; +}(LuxonError); + +/** + * @private + */ +var InvalidUnitError = /*#__PURE__*/function (_LuxonError5) { + _inheritsLoose(InvalidUnitError, _LuxonError5); + function InvalidUnitError(unit) { + return _LuxonError5.call(this, "Invalid unit " + unit) || this; + } + return InvalidUnitError; +}(LuxonError); + +/** + * @private + */ +var InvalidArgumentError = /*#__PURE__*/function (_LuxonError6) { + _inheritsLoose(InvalidArgumentError, _LuxonError6); + function InvalidArgumentError() { + return _LuxonError6.apply(this, arguments) || this; + } + return InvalidArgumentError; +}(LuxonError); + +/** + * @private + */ +var ZoneIsAbstractError = /*#__PURE__*/function (_LuxonError7) { + _inheritsLoose(ZoneIsAbstractError, _LuxonError7); + function ZoneIsAbstractError() { + return _LuxonError7.call(this, "Zone is an abstract class") || this; + } + return ZoneIsAbstractError; +}(LuxonError); + +/** + * @private + */ + +var n = "numeric", + s = "short", + l = "long"; +var DATE_SHORT = { + year: n, + month: n, + day: n +}; +var DATE_MED = { + year: n, + month: s, + day: n +}; +var DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s +}; +var DATE_FULL = { + year: n, + month: l, + day: n +}; +var DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l +}; +var TIME_SIMPLE = { + hour: n, + minute: n +}; +var TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n +}; +var TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s +}; +var TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l +}; +var TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" +}; +var TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" +}; +var TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s +}; +var TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l +}; +var DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n +}; +var DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n +}; +var DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n +}; +var DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n +}; +var DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n +}; +var DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s +}; +var DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s +}; +var DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l +}; +var DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l +}; + +/** + * @interface + */ +var Zone = /*#__PURE__*/function () { + function Zone() {} + var _proto = Zone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */; + _createClass(Zone, [{ + key: "type", + get: + /** + * The type of zone + * @abstract + * @type {string} + */ + function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + }, { + key: "name", + get: function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The IANA name of this zone. + * Defaults to `name` if not overwritten by a subclass. + * @abstract + * @type {string} + */ + }, { + key: "ianaName", + get: function get() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "isValid", + get: function get() { + throw new ZoneIsAbstractError(); + } + }]); + return Zone; +}(); + +var singleton$1 = null; + +/** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ +var SystemZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(SystemZone, _Zone); + function SystemZone() { + return _Zone.apply(this, arguments) || this; + } + var _proto = SystemZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/; + _createClass(SystemZone, [{ + key: "type", + get: /** @override **/ + function get() { + return "system"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "instance", + get: + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + function get() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + }]); + return SystemZone; +}(Zone); + +var dtfCache = new Map(); +function makeDTF(zoneName) { + var dtf = dtfCache.get(zoneName); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zoneName, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + dtfCache.set(zoneName, dtf); + } + return dtf; +} +var typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 +}; +function hackyOffset(dtf, date) { + var formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + fMonth = parsed[1], + fDay = parsed[2], + fYear = parsed[3], + fadOrBc = parsed[4], + fHour = parsed[5], + fMinute = parsed[6], + fSecond = parsed[7]; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; +} +function partsOffset(dtf, date) { + var formatted = dtf.formatToParts(date); + var filled = []; + for (var i = 0; i < formatted.length; i++) { + var _formatted$i = formatted[i], + type = _formatted$i.type, + value = _formatted$i.value; + var pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; +} +var ianaZoneCache = new Map(); +/** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ +var IANAZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(IANAZone, _Zone); + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + IANAZone.create = function create(name) { + var zone = ianaZoneCache.get(name); + if (zone === undefined) { + ianaZoneCache.set(name, zone = new IANAZone(name)); + } + return zone; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */; + IANAZone.resetCache = function resetCache() { + ianaZoneCache.clear(); + dtfCache.clear(); + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead. + * @return {boolean} + */; + IANAZone.isValidSpecifier = function isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */; + IANAZone.isValidZone = function isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + }; + function IANAZone(name) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.zoneName = name; + /** @private **/ + _this.valid = IANAZone.isValidZone(name); + return _this; + } + + /** + * The type of zone. `iana` for all instances of `IANAZone`. + * @override + * @type {string} + */ + var _proto = IANAZone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @override + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale, this.name); + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @override + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + if (!this.valid) return NaN; + var date = new Date(ts); + if (isNaN(date)) return NaN; + var dtf = makeDTF(this.name); + var _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date), + year = _ref2[0], + month = _ref2[1], + day = _ref2[2], + adOrBc = _ref2[3], + hour = _ref2[4], + minute = _ref2[5], + second = _ref2[6]; + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + var adjustedHour = hour === 24 ? 0 : hour; + var asUTC = objToLocalTS({ + year: year, + month: month, + day: day, + hour: adjustedHour, + minute: minute, + second: second, + millisecond: 0 + }); + var asTS = +date; + var over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** + * Return whether this Zone is equal to another zone + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** + * Return whether this Zone is valid. + * @override + * @type {boolean} + */; + _createClass(IANAZone, [{ + key: "type", + get: function get() { + return "iana"; + } + + /** + * The name of this zone (i.e. the IANA zone name). + * @override + * @type {string} + */ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns false for all IANA zones. + * @override + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return this.valid; + } + }]); + return IANAZone; +}(Zone); + +var _excluded = ["base"], + _excluded2 = ["padTo", "floor"]; + +// todo - remap caching + +var intlLFCache = {}; +function getCachedLF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; +} +var intlDTCache = new Map(); +function getCachedDTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlDTCache.get(key); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache.set(key, dtf); + } + return dtf; +} +var intlNumCache = new Map(); +function getCachedINF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var inf = intlNumCache.get(key); + if (inf === undefined) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache.set(key, inf); + } + return inf; +} +var intlRelCache = new Map(); +function getCachedRTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var _opts = opts; + _opts.base; + var cacheKeyOpts = _objectWithoutPropertiesLoose(_opts, _excluded); // exclude `base` from the options + var key = JSON.stringify([locString, cacheKeyOpts]); + var inf = intlRelCache.get(key); + if (inf === undefined) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache.set(key, inf); + } + return inf; +} +var sysLocaleCache = null; +function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } +} +var intlResolvedOptionsCache = new Map(); +function getCachedIntResolvedOptions(locString) { + var opts = intlResolvedOptionsCache.get(locString); + if (opts === undefined) { + opts = new Intl.DateTimeFormat(locString).resolvedOptions(); + intlResolvedOptionsCache.set(locString, opts); + } + return opts; +} +var weekInfoCache = new Map(); +function getCachedWeekInfo(locString) { + var data = weekInfoCache.get(locString); + if (!data) { + var locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86 + if (!("minimalDays" in data)) { + data = _extends({}, fallbackWeekSettings, data); + } + weekInfoCache.set(locString, data); + } + return data; +} +function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + var xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + var uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + var options; + var selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + var smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + var _options = options, + numberingSystem = _options.numberingSystem, + calendar = _options.calendar; + return [selectedStr, numberingSystem, calendar]; + } +} +function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += "-ca-" + outputCalendar; + } + if (numberingSystem) { + localeStr += "-nu-" + numberingSystem; + } + return localeStr; + } else { + return localeStr; + } +} +function mapMonths(f) { + var ms = []; + for (var i = 1; i <= 12; i++) { + var dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; +} +function mapWeekdays(f) { + var ms = []; + for (var i = 1; i <= 7; i++) { + var dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; +} +function listStuff(loc, length, englishFn, intlFn) { + var mode = loc.listingMode(); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } +} +function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || getCachedIntResolvedOptions(loc.locale).numberingSystem === "latn"; + } +} + +/** + * @private + */ +var PolyNumberFormatter = /*#__PURE__*/function () { + function PolyNumberFormatter(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + opts.padTo; + opts.floor; + var otherOpts = _objectWithoutPropertiesLoose(opts, _excluded2); + if (!forceSimple || Object.keys(otherOpts).length > 0) { + var intlOpts = _extends({ + useGrouping: false + }, opts); + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + var _proto = PolyNumberFormatter.prototype; + _proto.format = function format(i) { + if (this.inf) { + var fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + var _fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(_fixed, this.padTo); + } + }; + return PolyNumberFormatter; +}(); +/** + * @private + */ +var PolyDateFormatter = /*#__PURE__*/function () { + function PolyDateFormatter(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + var z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + var gmtOffset = -1 * (dt.offset / 60); + var offsetZ = gmtOffset >= 0 ? "Etc/GMT+" + gmtOffset : "Etc/GMT" + gmtOffset; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + var intlOpts = _extends({}, this.opts); + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + var _proto2 = PolyDateFormatter.prototype; + _proto2.format = function format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts().map(function (_ref) { + var value = _ref.value; + return value; + }).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + }; + _proto2.formatToParts = function formatToParts() { + var _this = this; + var parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map(function (part) { + if (part.type === "timeZoneName") { + var offsetName = _this.originalZone.offsetName(_this.dt.ts, { + locale: _this.dt.locale, + format: _this.opts.timeZoneName + }); + return _extends({}, part, { + value: offsetName + }); + } else { + return part; + } + }); + } + return parts; + }; + _proto2.resolvedOptions = function resolvedOptions() { + return this.dtf.resolvedOptions(); + }; + return PolyDateFormatter; +}(); +/** + * @private + */ +var PolyRelFormatter = /*#__PURE__*/function () { + function PolyRelFormatter(intl, isEnglish, opts) { + this.opts = _extends({ + style: "long" + }, opts); + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + var _proto3 = PolyRelFormatter.prototype; + _proto3.format = function format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + }; + _proto3.formatToParts = function formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + }; + return PolyRelFormatter; +}(); +var fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7] +}; + +/** + * @private + */ +var Locale = /*#__PURE__*/function () { + Locale.fromOpts = function fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.weekSettings, opts.defaultToEN); + }; + Locale.create = function create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN) { + if (defaultToEN === void 0) { + defaultToEN = false; + } + var specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats + var localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + var numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + var outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + var weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + }; + Locale.resetCache = function resetCache() { + sysLocaleCache = null; + intlDTCache.clear(); + intlNumCache.clear(); + intlRelCache.clear(); + intlResolvedOptionsCache.clear(); + weekInfoCache.clear(); + }; + Locale.fromObject = function fromObject(_temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + locale = _ref2.locale, + numberingSystem = _ref2.numberingSystem, + outputCalendar = _ref2.outputCalendar, + weekSettings = _ref2.weekSettings; + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + }; + function Locale(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + var _parseLocaleString = parseLocaleString(locale), + parsedLocale = _parseLocaleString[0], + parsedNumberingSystem = _parseLocaleString[1], + parsedOutputCalendar = _parseLocaleString[2]; + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + var _proto4 = Locale.prototype; + _proto4.listingMode = function listingMode() { + var isActuallyEn = this.isEnglish(); + var hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + }; + _proto4.clone = function clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, validateWeekSettings(alts.weekSettings) || this.weekSettings, alts.defaultToEN || false); + } + }; + _proto4.redefaultToEN = function redefaultToEN(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: true + })); + }; + _proto4.redefaultToSystem = function redefaultToSystem(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: false + })); + }; + _proto4.months = function months$1(length, format) { + var _this2 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, months, function () { + // Workaround for "ja" locale: formatToParts does not label all parts of the month + // as "month" and for this locale there is no difference between "format" and "non-format". + // As such, just use format() instead of formatToParts() and take the whole string + var monthSpecialCase = _this2.intl === "ja" || _this2.intl.startsWith("ja-"); + format &= !monthSpecialCase; + var intl = format ? { + month: length, + day: "numeric" + } : { + month: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this2.monthsCache[formatStr][length]) { + var mapper = !monthSpecialCase ? function (dt) { + return _this2.extract(dt, intl, "month"); + } : function (dt) { + return _this2.dtFormatter(dt, intl).format(); + }; + _this2.monthsCache[formatStr][length] = mapMonths(mapper); + } + return _this2.monthsCache[formatStr][length]; + }); + }; + _proto4.weekdays = function weekdays$1(length, format) { + var _this3 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, weekdays, function () { + var intl = format ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this3.weekdaysCache[formatStr][length]) { + _this3.weekdaysCache[formatStr][length] = mapWeekdays(function (dt) { + return _this3.extract(dt, intl, "weekday"); + }); + } + return _this3.weekdaysCache[formatStr][length]; + }); + }; + _proto4.meridiems = function meridiems$1() { + var _this4 = this; + return listStuff(this, undefined, function () { + return meridiems; + }, function () { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!_this4.meridiemCache) { + var intl = { + hour: "numeric", + hourCycle: "h12" + }; + _this4.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(function (dt) { + return _this4.extract(dt, intl, "dayperiod"); + }); + } + return _this4.meridiemCache; + }); + }; + _proto4.eras = function eras$1(length) { + var _this5 = this; + return listStuff(this, length, eras, function () { + var intl = { + era: length + }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!_this5.eraCache[length]) { + _this5.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(function (dt) { + return _this5.extract(dt, intl, "era"); + }); + } + return _this5.eraCache[length]; + }); + }; + _proto4.extract = function extract(dt, intlOpts, field) { + var df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find(function (m) { + return m.type.toLowerCase() === field; + }); + return matching ? matching.value : null; + }; + _proto4.numberFormatter = function numberFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + }; + _proto4.dtFormatter = function dtFormatter(dt, intlOpts) { + if (intlOpts === void 0) { + intlOpts = {}; + } + return new PolyDateFormatter(dt, this.intl, intlOpts); + }; + _proto4.relFormatter = function relFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + }; + _proto4.listFormatter = function listFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return getCachedLF(this.intl, opts); + }; + _proto4.isEnglish = function isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us"); + }; + _proto4.getWeekSettings = function getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + }; + _proto4.getStartOfWeek = function getStartOfWeek() { + return this.getWeekSettings().firstDay; + }; + _proto4.getMinDaysInFirstWeek = function getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + }; + _proto4.getWeekendDays = function getWeekendDays() { + return this.getWeekSettings().weekend; + }; + _proto4.equals = function equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + }; + _proto4.toString = function toString() { + return "Locale(" + this.locale + ", " + this.numberingSystem + ", " + this.outputCalendar + ")"; + }; + _createClass(Locale, [{ + key: "fastNumbers", + get: function get() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + }]); + return Locale; +}(); + +var singleton = null; + +/** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ +var FixedOffsetZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(FixedOffsetZone, _Zone); + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + FixedOffsetZone.instance = function instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */; + FixedOffsetZone.parseSpecifier = function parseSpecifier(s) { + if (s) { + var r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + }; + function FixedOffsetZone(offset) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.fixed = offset; + return _this; + } + + /** + * The type of zone. `fixed` for all instances of `FixedOffsetZone`. + * @override + * @type {string} + */ + var _proto = FixedOffsetZone.prototype; + /** + * Returns the offset's common name at the specified timestamp. + * + * For fixed offset zones this equals to the zone name. + * @override + */ + _proto.offsetName = function offsetName() { + return this.name; + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.fixed, format); + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns true for all fixed offset zones. + * @override + * @type {boolean} + */; + /** + * Return the offset in minutes for this zone at the specified timestamp. + * + * For fixed offset zones, this is constant and does not depend on a timestamp. + * @override + * @return {number} + */ + _proto.offset = function offset() { + return this.fixed; + } + + /** + * Return whether this Zone is equal to another zone (i.e. also fixed and same offset) + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** + * Return whether this Zone is valid: + * All fixed offset zones are valid. + * @override + * @type {boolean} + */; + _createClass(FixedOffsetZone, [{ + key: "type", + get: function get() { + return "fixed"; + } + + /** + * The name of this zone. + * All fixed zones' names always start with "UTC" (plus optional offset) + * @override + * @type {string} + */ + }, { + key: "name", + get: function get() { + return this.fixed === 0 ? "UTC" : "UTC" + formatOffset(this.fixed, "narrow"); + } + + /** + * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn` + * + * @override + * @type {string} + */ + }, { + key: "ianaName", + get: function get() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return "Etc/GMT" + formatOffset(-this.fixed, "narrow"); + } + } + }, { + key: "isUniversal", + get: function get() { + return true; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "utcInstance", + get: + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + function get() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + }]); + return FixedOffsetZone; +}(Zone); + +/** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ +var InvalidZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(InvalidZone, _Zone); + function InvalidZone(zoneName) { + var _this; + _this = _Zone.call(this) || this; + /** @private */ + _this.zoneName = zoneName; + return _this; + } + + /** @override **/ + var _proto = InvalidZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return null; + } + + /** @override **/; + _proto.formatOffset = function formatOffset() { + return ""; + } + + /** @override **/; + _proto.offset = function offset() { + return NaN; + } + + /** @override **/; + _proto.equals = function equals() { + return false; + } + + /** @override **/; + _createClass(InvalidZone, [{ + key: "type", + get: function get() { + return "invalid"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return false; + } + }]); + return InvalidZone; +}(Zone); + +/** + * @private + */ +function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + var lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone;else if (lowered === "local" || lowered === "system") return SystemZone.instance;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } +} + +var numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d" +}; +var numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881] +}; +var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); +function parseDigits(str) { + var value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (var i = 0; i < str.length; i++) { + var code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (var key in numberingSystemsUTF16) { + var _numberingSystemsUTF = numberingSystemsUTF16[key], + min = _numberingSystemsUTF[0], + max = _numberingSystemsUTF[1]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } +} + +// cache of {numberingSystem: {append: regex}} +var digitRegexCache = new Map(); +function resetDigitRegexCache() { + digitRegexCache.clear(); +} +function digitRegex(_ref, append) { + var numberingSystem = _ref.numberingSystem; + if (append === void 0) { + append = ""; + } + var ns = numberingSystem || "latn"; + var appendCache = digitRegexCache.get(ns); + if (appendCache === undefined) { + appendCache = new Map(); + digitRegexCache.set(ns, appendCache); + } + var regex = appendCache.get(append); + if (regex === undefined) { + regex = new RegExp("" + numberingSystems[ns] + append); + appendCache.set(append, regex); + } + return regex; +} + +var now = function now() { + return Date.now(); + }, + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + +/** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ +var Settings = /*#__PURE__*/function () { + function Settings() {} + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + Settings.resetCaches = function resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + DateTime.resetCache(); + resetDigitRegexCache(); + }; + _createClass(Settings, null, [{ + key: "now", + get: + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + function get() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */, + set: function set(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + }, { + key: "defaultZone", + get: + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + function get() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(zone) { + defaultZone = zone; + } + }, { + key: "defaultLocale", + get: function get() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultNumberingSystem", + get: function get() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultOutputCalendar", + get: function get() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + }, { + key: "defaultWeekSettings", + get: function get() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */, + set: function set(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + */ + }, { + key: "twoDigitCutoffYear", + get: function get() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century + * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */, + set: function set(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + }, { + key: "throwOnInvalid", + get: function get() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */, + set: function set(t) { + throwOnInvalid = t; + } + }]); + return Settings; +}(); + +var Invalid = /*#__PURE__*/function () { + function Invalid(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + var _proto = Invalid.prototype; + _proto.toMessage = function toMessage() { + if (this.explanation) { + return this.reason + ": " + this.explanation; + } else { + return this.reason; + } + }; + return Invalid; +}(); + +var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; +function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", "you specified " + value + " (of type " + typeof value + ") as a " + unit + ", which is invalid"); +} +function dayOfWeek(year, month, day) { + var d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + var js = d.getUTCDay(); + return js === 0 ? 7 : js; +} +function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; +} +function uncomputeOrdinal(year, ordinal) { + var table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex(function (i) { + return i < ordinal; + }), + day = ordinal - table[month0]; + return { + month: month0 + 1, + day: day + }; +} +function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return (isoWeekday - startOfWeek + 7) % 7 + 1; +} + +/** + * @private + */ + +function gregorianToWeek(gregObj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var year = gregObj.year, + month = gregObj.month, + day = gregObj.day, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + var weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return _extends({ + weekYear: weekYear, + weekNumber: weekNumber, + weekday: weekday + }, timeObject(gregObj)); +} +function weekToGregorian(weekData, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekYear = weekData.weekYear, + weekNumber = weekData.weekNumber, + weekday = weekData.weekday, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + var ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal.month, + day = _uncomputeOrdinal.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(weekData)); +} +function gregorianToOrdinal(gregData) { + var year = gregData.year, + month = gregData.month, + day = gregData.day; + var ordinal = computeOrdinal(year, month, day); + return _extends({ + year: year, + ordinal: ordinal + }, timeObject(gregData)); +} +function ordinalToGregorian(ordinalData) { + var year = ordinalData.year, + ordinal = ordinalData.ordinal; + var _uncomputeOrdinal2 = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal2.month, + day = _uncomputeOrdinal2.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(ordinalData)); +} + +/** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ +function usesLocalWeekValues(obj, loc) { + var hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + var hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + if (hasIsoWeekData) { + throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields"); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek() + }; + } else { + return { + minDaysInFirstWeek: 4, + startOfWeek: 1 + }; + } +} +function hasInvalidWeekData(obj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var validYear = isInteger(obj.weekYear), + validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), + validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; +} +function hasInvalidOrdinalData(obj) { + var validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; +} +function hasInvalidGregorianData(obj) { + var validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; +} +function hasInvalidTimeData(obj) { + var hour = obj.hour, + minute = obj.minute, + second = obj.second, + millisecond = obj.millisecond; + var validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; +} + +/** + * @private + */ + +// TYPES + +function isUndefined(o) { + return typeof o === "undefined"; +} +function isNumber(o) { + return typeof o === "number"; +} +function isInteger(o) { + return typeof o === "number" && o % 1 === 0; +} +function isString(o) { + return typeof o === "string"; +} +function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; +} + +// CAPABILITIES + +function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } +} +function hasLocaleWeekInfo() { + try { + return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype); + } catch (e) { + return false; + } +} + +// OBJECTS AND ARRAYS + +function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; +} +function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce(function (best, next) { + var pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; +} +function pick(obj, keys) { + return keys.reduce(function (a, k) { + a[k] = obj[k]; + return a; + }, {}); +} +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} +function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(function (v) { + return !integerBetween(v, 1, 7); + })) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend) + }; + } +} + +// NUMBERS AND STRINGS + +function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; +} + +// x % n but takes the sign of n instead of x +function floorMod(x, n) { + return x - n * Math.floor(x / n); +} +function padStart(input, n) { + if (n === void 0) { + n = 2; + } + var isNeg = input < 0; + var padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; +} +function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } +} +function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } +} +function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + var f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } +} +function roundTo(number, digits, rounding) { + if (rounding === void 0) { + rounding = "round"; + } + var factor = Math.pow(10, digits); + switch (rounding) { + case "expand": + return number > 0 ? Math.ceil(number * factor) / factor : Math.floor(number * factor) / factor; + case "trunc": + return Math.trunc(number * factor) / factor; + case "round": + return Math.round(number * factor) / factor; + case "floor": + return Math.floor(number * factor) / factor; + case "ceil": + return Math.ceil(number * factor) / factor; + default: + throw new RangeError("Value rounding " + rounding + " is out of range"); + } +} + +// DATE BASICS + +function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} +function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; +} +function daysInMonth(year, month) { + var modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } +} + +// convert a calendar object to a local timestamp (epoch, but with the offset baked in) +function objToLocalTS(obj) { + var d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; +} + +// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js +function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + var fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; +} +function weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + var weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; +} +function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; +} + +// PARSING + +function parseZoneInfo(ts, offsetFormat, locale, timeZone) { + if (timeZone === void 0) { + timeZone = null; + } + var date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + var modified = _extends({ + timeZoneName: offsetFormat + }, intlOpts); + var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function (m) { + return m.type.toLowerCase() === "timezonename"; + }); + return parsed ? parsed.value : null; +} + +// signedOffset('-5', '30') -> -330 +function signedOffset(offHourStr, offMinuteStr) { + var offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + var offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; +} + +// COERCION + +function asNumber(value) { + var numericValue = Number(value); + if (typeof value === "boolean" || value === "" || !Number.isFinite(numericValue)) throw new InvalidArgumentError("Invalid unit value " + value); + return numericValue; +} +function normalizeObject(obj, normalizer) { + var normalized = {}; + for (var u in obj) { + if (hasOwnProperty(obj, u)) { + var v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; +} + +/** + * Returns the offset's value as a string + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ +function formatOffset(offset, format) { + var hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + switch (format) { + case "short": + return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2); + case "narrow": + return "" + sign + hours + (minutes > 0 ? ":" + minutes : ""); + case "techie": + return "" + sign + padStart(hours, 2) + padStart(minutes, 2); + default: + throw new RangeError("Value format " + format + " is out of range for property format"); + } +} +function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); +} + +/** + * @private + */ + +var monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; +var monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; +function months(length) { + switch (length) { + case "narrow": + return [].concat(monthsNarrow); + case "short": + return [].concat(monthsShort); + case "long": + return [].concat(monthsLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } +} +var weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; +var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; +var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; +function weekdays(length) { + switch (length) { + case "narrow": + return [].concat(weekdaysNarrow); + case "short": + return [].concat(weekdaysShort); + case "long": + return [].concat(weekdaysLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } +} +var meridiems = ["AM", "PM"]; +var erasLong = ["Before Christ", "Anno Domini"]; +var erasShort = ["BC", "AD"]; +var erasNarrow = ["B", "A"]; +function eras(length) { + switch (length) { + case "narrow": + return [].concat(erasNarrow); + case "short": + return [].concat(erasShort); + case "long": + return [].concat(erasLong); + default: + return null; + } +} +function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; +} +function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; +} +function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; +} +function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; +} +function formatRelativeTime(unit, count, numeric, narrow) { + if (numeric === void 0) { + numeric = "always"; + } + if (narrow === void 0) { + narrow = false; + } + var units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."] + }; + var lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + var isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : "next " + units[unit][0]; + case -1: + return isDay ? "yesterday" : "last " + units[unit][0]; + case 0: + return isDay ? "today" : "this " + units[unit][0]; + } + } + + var isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? fmtValue + " " + fmtUnit + " ago" : "in " + fmtValue + " " + fmtUnit; +} + +function stringifyTokens(splits, tokenToString) { + var s = ""; + for (var _iterator = _createForOfIteratorHelperLoose(splits), _step; !(_step = _iterator()).done;) { + var token = _step.value; + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; +} +var _macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS +}; + +/** + * @private + */ +var Formatter = /*#__PURE__*/function () { + Formatter.create = function create(locale, opts) { + if (opts === void 0) { + opts = {}; + } + return new Formatter(locale, opts); + }; + Formatter.parseFormat = function parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + var current = null, + currentFull = "", + bracketed = false; + var splits = []; + for (var i = 0; i < fmt.length; i++) { + var c = fmt.charAt(i); + if (c === "'") { + // turn '' into a literal signal quote instead of just skipping the empty literal + if (currentFull.length > 0 || bracketed) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull === "" ? "'" : currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + }; + Formatter.macroTokenToFormatOpts = function macroTokenToFormatOpts(token) { + return _macroTokenToFormatOpts[token]; + }; + function Formatter(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + var _proto = Formatter.prototype; + _proto.formatWithSystemDefault = function formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + var df = this.systemLoc.dtFormatter(dt, _extends({}, this.opts, opts)); + return df.format(); + }; + _proto.dtFormatter = function dtFormatter(dt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.loc.dtFormatter(dt, _extends({}, this.opts, opts)); + }; + _proto.formatDateTime = function formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + }; + _proto.formatDateTimeParts = function formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + }; + _proto.formatInterval = function formatInterval(interval, opts) { + var df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + }; + _proto.resolvedOptions = function resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + }; + _proto.num = function num(n, p, signDisplay) { + if (p === void 0) { + p = 0; + } + if (signDisplay === void 0) { + signDisplay = undefined; + } + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + var opts = _extends({}, this.opts); + if (p > 0) { + opts.padTo = p; + } + if (signDisplay) { + opts.signDisplay = signDisplay; + } + return this.loc.numberFormatter(opts).format(n); + }; + _proto.formatDateTimeFromString = function formatDateTimeFromString(dt, fmt) { + var _this = this; + var knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = function string(opts, extract) { + return _this.loc.extract(dt, opts, extract); + }, + formatOffset = function formatOffset(opts) { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = function meridiem() { + return knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"); + }, + month = function month(length, standalone) { + return knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"); + }, + weekday = function weekday(length, standalone) { + return knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"); + }, + maybeMacro = function maybeMacro(token) { + var formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return _this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = function era(length) { + return knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"); + }, + tokenToString = function tokenToString(token) { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return _this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return _this.num(dt.millisecond, 3); + // seconds + case "s": + return _this.num(dt.second); + case "ss": + return _this.num(dt.second, 2); + // fractional seconds + case "uu": + return _this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return _this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return _this.num(dt.minute); + case "mm": + return _this.num(dt.minute, 2); + // hours + case "h": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return _this.num(dt.hour); + case "HH": + return _this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ + format: "narrow", + allowZ: _this.opts.allowZ + }); + case "ZZ": + // like +06:00 + return formatOffset({ + format: "short", + allowZ: _this.opts.allowZ + }); + case "ZZZ": + // like +0600 + return formatOffset({ + format: "techie", + allowZ: _this.opts.allowZ + }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: _this.loc.locale + }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: _this.loc.locale + }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : _this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : _this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return _this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return _this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : _this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : _this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : _this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : _this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : _this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return _this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return _this.num(dt.weekYear, 4); + case "W": + return _this.num(dt.weekNumber); + case "WW": + return _this.num(dt.weekNumber, 2); + case "n": + return _this.num(dt.localWeekNumber); + case "nn": + return _this.num(dt.localWeekNumber, 2); + case "ii": + return _this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return _this.num(dt.localWeekYear, 4); + case "o": + return _this.num(dt.ordinal); + case "ooo": + return _this.num(dt.ordinal, 3); + case "q": + // like 1 + return _this.num(dt.quarter); + case "qq": + // like 01 + return _this.num(dt.quarter, 2); + case "X": + return _this.num(Math.floor(dt.ts / 1000)); + case "x": + return _this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + }; + _proto.formatDurationFromString = function formatDurationFromString(dur, fmt) { + var _this2 = this; + var invertLargest = this.opts.signMode === "negativeLargestOnly" ? -1 : 1; + var tokenToField = function tokenToField(token) { + switch (token[0]) { + case "S": + return "milliseconds"; + case "s": + return "seconds"; + case "m": + return "minutes"; + case "h": + return "hours"; + case "d": + return "days"; + case "w": + return "weeks"; + case "M": + return "months"; + case "y": + return "years"; + default: + return null; + } + }, + tokenToString = function tokenToString(lildur, info) { + return function (token) { + var mapped = tokenToField(token); + if (mapped) { + var inversionFactor = info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1; + var signDisplay; + if (_this2.opts.signMode === "negativeLargestOnly" && mapped !== info.largestUnit) { + signDisplay = "never"; + } else if (_this2.opts.signMode === "all") { + signDisplay = "always"; + } else { + // "auto" and "negative" are the same, but "auto" has better support + signDisplay = "auto"; + } + return _this2.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay); + } else { + return token; + } + }; + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce(function (found, _ref) { + var literal = _ref.literal, + val = _ref.val; + return literal ? found : found.concat(val); + }, []), + collapsed = dur.shiftTo.apply(dur, realTokens.map(tokenToField).filter(function (t) { + return t; + })), + durationInfo = { + isNegativeDuration: collapsed < 0, + // this relies on "collapsed" being based on "shiftTo", which builds up the object + // in order + largestUnit: Object.keys(collapsed.values)[0] + }; + return stringifyTokens(tokens, tokenToString(collapsed, durationInfo)); + }; + return Formatter; +}(); + +/* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + +var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; +function combineRegexes() { + for (var _len = arguments.length, regexes = new Array(_len), _key = 0; _key < _len; _key++) { + regexes[_key] = arguments[_key]; + } + var full = regexes.reduce(function (f, r) { + return f + r.source; + }, ""); + return RegExp("^" + full + "$"); +} +function combineExtractors() { + for (var _len2 = arguments.length, extractors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + extractors[_key2] = arguments[_key2]; + } + return function (m) { + return extractors.reduce(function (_ref, ex) { + var mergedVals = _ref[0], + mergedZone = _ref[1], + cursor = _ref[2]; + var _ex = ex(m, cursor), + val = _ex[0], + zone = _ex[1], + next = _ex[2]; + return [_extends({}, mergedVals, val), zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); + }; +} +function parse(s) { + if (s == null) { + return [null, null]; + } + for (var _len3 = arguments.length, patterns = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + patterns[_key3 - 1] = arguments[_key3]; + } + for (var _i = 0, _patterns = patterns; _i < _patterns.length; _i++) { + var _patterns$_i = _patterns[_i], + regex = _patterns$_i[0], + extractor = _patterns$_i[1]; + var m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; +} +function simpleParse() { + for (var _len4 = arguments.length, keys = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + keys[_key4] = arguments[_key4]; + } + return function (match, cursor) { + var ret = {}; + var i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; +} + +// ISO and SQL parsing +var offsetRegex = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/; +var isoExtendedZone = "(?:" + offsetRegex.source + "?(?:\\[(" + ianaRegex.source + ")\\])?)?"; +var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; +var isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + isoExtendedZone); +var isoTimeExtensionRegex = RegExp("(?:[Tt]" + isoTimeRegex.source + ")?"); +var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; +var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; +var isoOrdinalRegex = /(\d{4})-?(\d{3})/; +var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); +var extractISOOrdinalData = simpleParse("year", "ordinal"); +var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one +var sqlTimeRegex = RegExp(isoTimeBaseRegex.source + " ?(?:" + offsetRegex.source + "|(" + ianaRegex.source + "))?"); +var sqlTimeExtensionRegex = RegExp("(?: " + sqlTimeRegex.source + ")?"); +function int(match, pos, fallback) { + var m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); +} +function extractISOYmd(match, cursor) { + var item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1) + }; + return [item, null, cursor + 3]; +} +function extractISOTime(match, cursor) { + var item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]) + }; + return [item, null, cursor + 4]; +} +function extractISOOffset(match, cursor) { + var local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; +} +function extractIANAZone(match, cursor) { + var zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; +} + +// ISO time parsing + +var isoTimeOnly = RegExp("^T?" + isoTimeBaseRegex.source + "$"); + +// ISO duration parsing + +var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; +function extractISODuration(match) { + var s = match[0], + yearStr = match[1], + monthStr = match[2], + weekStr = match[3], + dayStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + millisecondsStr = match[8]; + var hasNegativePrefix = s[0] === "-"; + var negativeSeconds = secondStr && secondStr[0] === "-"; + var maybeNegate = function maybeNegate(num, force) { + if (force === void 0) { + force = false; + } + return num !== undefined && (force || num && hasNegativePrefix) ? -num : num; + }; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; +} + +// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York +// and not just that we're in -240 *right now*. But since I don't think these are used that often +// I'm just going to ignore that +var obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 +}; +function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; +} + +// RFC 2822/5322 +var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; +function extractRFC2822(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + obsOffset = match[8], + milOffset = match[9], + offHourStr = match[10], + offMinuteStr = match[11], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + var offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset)]; +} +function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); +} + +// http date + +var rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; +function extractRFC1123Or850(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} +function extractASCII(match) { + var weekdayStr = match[1], + monthStr = match[2], + dayStr = match[3], + hourStr = match[4], + minuteStr = match[5], + secondStr = match[6], + yearStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} +var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); +var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); +var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); +var isoTimeCombinedRegex = combineRegexes(isoTimeRegex); +var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); +var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); +var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); +var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + +/* + * @private + */ + +function parseISODate(s) { + return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); +} +function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); +} +function parseHTTPDate(s) { + return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); +} +function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); +} +var extractISOTimeOnly = combineExtractors(extractISOTime); +function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); +} +var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); +var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); +var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); +function parseSQL(s) { + return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); +} + +var INVALID$2 = "Invalid Duration"; + +// unit conversion constants +var lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000 + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000 + }, + hours: { + minutes: 60, + seconds: 60 * 60, + milliseconds: 60 * 60 * 1000 + }, + minutes: { + seconds: 60, + milliseconds: 60 * 1000 + }, + seconds: { + milliseconds: 1000 + } + }, + casualMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000 + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix), + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix); + +// units ordered by size +var orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; +var reverseUnits = orderedUnits$1.slice(0).reverse(); + +// clone really means "create another instance just like this one, but with these changes" +function clone$1(dur, alts, clear) { + if (clear === void 0) { + clear = false; + } + // deep merge for vals + var conf = { + values: clear ? alts.values : _extends({}, dur.values, alts.values || {}), + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); +} +function durationToMillis(matrix, vals) { + var _vals$milliseconds; + var sum = (_vals$milliseconds = vals.milliseconds) != null ? _vals$milliseconds : 0; + for (var _iterator = _createForOfIteratorHelperLoose(reverseUnits.slice(1)), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; +} + +// NB: mutates parameters +function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + var factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + orderedUnits$1.reduceRight(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var previousVal = vals[previous] * factor; + var conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + var rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); +} + +// Remove all properties with a value of 0 from an object +function removeZeroes(vals) { + var newVals = {}; + for (var _i = 0, _Object$entries = Object.entries(vals); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _Object$entries[_i], + key = _Object$entries$_i[0], + value = _Object$entries$_i[1]; + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; +} + +/** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ +var Duration = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Duration(config) { + var accurate = config.conversionAccuracy === "longterm" || false; + var matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + Duration.fromMillis = function fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */; + Duration.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got " + (obj === null ? "null" : typeof obj)); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */; + Duration.fromDurationLike = function fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError("Unknown duration argument " + durationLike + " of type " + typeof durationLike); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */; + Duration.fromISO = function fromISO(text, opts) { + var _parseISODuration = parseISODuration(text), + parsed = _parseISODuration[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */; + Duration.fromISOTime = function fromISOTime(text, opts) { + var _parseISOTimeOnly = parseISOTimeOnly(text), + parsed = _parseISOTimeOnly[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */; + Duration.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid: invalid + }); + } + } + + /** + * @private + */; + Duration.normalizeUnit = function normalizeUnit(unit) { + var normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Duration.isDuration = function isDuration(o) { + return o && o.isLuxonDuration || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */; + var _proto = Duration.prototype; + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat("d s", { signMode: "all" }) //=> "+6 +2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "all" }) //=> "-6 -2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "negativeLargestOnly" }) //=> "-6 2" + * @return {string} + */ + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + var fmtOpts = _extends({}, opts, { + floor: opts.round !== false && opts.floor !== false + }); + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero + * @example + * ```js + * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 mth, 0 wks, 5 hr, 6 min' + * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes' + * ``` + */; + _proto.toHuman = function toHuman(opts) { + var _this = this; + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return INVALID$2; + var showZeros = opts.showZeros !== false; + var l = orderedUnits$1.map(function (unit) { + var val = _this.values[unit]; + if (isUndefined(val) || val === 0 && !showZeros) { + return null; + } + return _this.loc.numberFormatter(_extends({ + style: "unit", + unitDisplay: "long" + }, opts, { + unit: unit.slice(0, -1) + })).format(val); + }).filter(function (n) { + return n; + }); + return this.loc.listFormatter(_extends({ + type: "conjunction", + style: opts.listStyle || "narrow" + }, opts)).format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */; + _proto.toObject = function toObject() { + if (!this.isValid) return {}; + return _extends({}, this.values); + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */; + _proto.toISO = function toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + var s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return null; + var millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + opts = _extends({ + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended" + }, opts, { + includeOffset: false + }); + var dateTime = DateTime.fromMillis(millis, { + zone: "UTC" + }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */; + _proto.toString = function toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Duration { values: " + JSON.stringify(this.values) + " }"; + } else { + return "Duration { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */; + _proto.toMillis = function toMillis() { + if (!this.isValid) return NaN; + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration), + result = {}; + for (var _i2 = 0, _orderedUnits = orderedUnits$1; _i2 < _orderedUnits.length; _i2++) { + var k = _orderedUnits[_i2]; + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */; + _proto.mapUnits = function mapUnits(fn) { + if (!this.isValid) return this; + var result = {}; + for (var _i3 = 0, _Object$keys = Object.keys(this.values); _i3 < _Object$keys.length; _i3++) { + var k = _Object$keys[_i3]; + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */; + _proto.get = function get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var mixed = _extends({}, this.values, normalizeObject(values, Duration.normalizeUnit)); + return clone$1(this, { + values: mixed + }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */; + _proto.reconfigure = function reconfigure(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + locale = _ref.locale, + numberingSystem = _ref.numberingSystem, + conversionAccuracy = _ref.conversionAccuracy, + matrix = _ref.matrix; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem + }); + var opts = { + loc: loc, + matrix: matrix, + conversionAccuracy: conversionAccuracy + }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */; + _proto.as = function as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */; + _proto.normalize = function normalize() { + if (!this.isValid) return this; + var vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */; + _proto.rescale = function rescale() { + if (!this.isValid) return this; + var vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */; + _proto.shiftTo = function shiftTo() { + for (var _len = arguments.length, units = new Array(_len), _key = 0; _key < _len; _key++) { + units[_key] = arguments[_key]; + } + if (!this.isValid) return this; + if (units.length === 0) { + return this; + } + units = units.map(function (u) { + return Duration.normalizeUnit(u); + }); + var built = {}, + accumulated = {}, + vals = this.toObject(); + var lastUnit; + for (var _i4 = 0, _orderedUnits2 = orderedUnits$1; _i4 < _orderedUnits2.length; _i4++) { + var k = _orderedUnits2[_i4]; + if (units.indexOf(k) >= 0) { + lastUnit = k; + var own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (var ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + var i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (var key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + normalizeValues(this.matrix, built); + return clone$1(this, { + values: built + }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */; + _proto.shiftToAll = function shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */; + _proto.negate = function negate() { + if (!this.isValid) return this; + var negated = {}; + for (var _i5 = 0, _Object$keys2 = Object.keys(this.values); _i5 < _Object$keys2.length; _i5++) { + var k = _Object$keys2[_i5]; + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + + /** + * Removes all units with values equal to 0 from this Duration. + * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 } + * @return {Duration} + */; + _proto.removeZeros = function removeZeros() { + if (!this.isValid) return this; + var vals = removeZeroes(this.values); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Get the years. + * @type {number} + */; + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + for (var _i6 = 0, _orderedUnits3 = orderedUnits$1; _i6 < _orderedUnits3.length; _i6++) { + var u = _orderedUnits3[_i6]; + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + }; + _createClass(Duration, [{ + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + }, { + key: "years", + get: function get() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + }, { + key: "quarters", + get: function get() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + }, { + key: "months", + get: function get() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + }, { + key: "weeks", + get: function get() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + }, { + key: "days", + get: function get() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + }, { + key: "hours", + get: function get() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + }, { + key: "minutes", + get: function get() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + }, { + key: "seconds", + get: function get() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + }, { + key: "milliseconds", + get: function get() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Duration; +}(Symbol.for("nodejs.util.inspect.custom")); + +var INVALID$1 = "Invalid Interval"; + +// checks if the start is equal to or before the end +function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid("end before start", "The end of an interval must be after its start, but you had start=" + start.toISO() + " and end=" + end.toISO()); + } else { + return null; + } +} + +/** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ +var Interval = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Interval(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + Interval.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid: invalid + }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */; + Interval.fromDateTimes = function fromDateTimes(start, end) { + var builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + var validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.after = function after(start, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.before = function before(end, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */; + Interval.fromISO = function fromISO(text, opts) { + var _split = (text || "").split("/", 2), + s = _split[0], + e = _split[1]; + if (s && e) { + var start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + var end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + if (startIsValid) { + var dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + var _dur = Duration.fromISO(s, opts); + if (_dur.isValid) { + return Interval.before(end, _dur); + } + } + } + return Interval.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Interval.isInterval = function isInterval(o) { + return o && o.isLuxonInterval || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */; + var _proto = Interval.prototype; + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + _proto.length = function length(unit) { + if (unit === void 0) { + unit = "milliseconds"; + } + return this.isValid ? this.toDuration.apply(this, [unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */; + _proto.count = function count(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (!this.isValid) return NaN; + var start = this.start.startOf(unit, opts); + var end; + if (opts != null && opts.useLocaleWeeks) { + end = this.end.reconfigure({ + locale: start.locale + }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */; + _proto.hasSame = function hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */; + _proto.isEmpty = function isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isAfter = function isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isBefore = function isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.contains = function contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */; + _proto.set = function set(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + start = _ref.start, + end = _ref.end; + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */; + _proto.splitAt = function splitAt() { + var _this = this; + if (!this.isValid) return []; + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + var sorted = dateTimes.map(friendlyDateTime).filter(function (d) { + return _this.contains(d); + }).sort(function (a, b) { + return a.toMillis() - b.toMillis(); + }), + results = []; + var s = this.s, + i = 0; + while (s < this.e) { + var added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */; + _proto.splitBy = function splitBy(duration) { + var dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + var s = this.s, + idx = 1, + next; + var results = []; + while (s < this.e) { + var added = this.start.plus(dur.mapUnits(function (x) { + return x * idx; + })); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */; + _proto.divideEqually = function divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */; + _proto.overlaps = function overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsStart = function abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsEnd = function abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise. + * @param {Interval} other + * @return {boolean} + */; + _proto.engulfs = function engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */; + _proto.intersection = function intersection(other) { + if (!this.isValid) return this; + var s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */; + _proto.union = function union(other) { + if (!this.isValid) return this; + var s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into an equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval + * and ending with the latest. + * + * @param {Array} intervals + * @return {Array} + */; + Interval.merge = function merge(intervals) { + var _intervals$sort$reduc = intervals.sort(function (a, b) { + return a.s - b.s; + }).reduce(function (_ref2, item) { + var sofar = _ref2[0], + current = _ref2[1]; + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]), + found = _intervals$sort$reduc[0], + final = _intervals$sort$reduc[1]; + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.xor = function xor(intervals) { + var _Array$prototype; + var start = null, + currentCount = 0; + var results = [], + ends = intervals.map(function (i) { + return [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]; + }), + flattened = (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, ends), + arr = flattened.sort(function (a, b) { + return a.time - b.time; + }); + for (var _iterator = _createForOfIteratorHelperLoose(arr), _step; !(_step = _iterator()).done;) { + var i = _step.value; + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + start = null; + } + } + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */; + _proto.difference = function difference() { + var _this2 = this; + for (var _len2 = arguments.length, intervals = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + intervals[_key2] = arguments[_key2]; + } + return Interval.xor([this].concat(intervals)).map(function (i) { + return _this2.intersection(i); + }).filter(function (i) { + return i && !i.isEmpty(); + }); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */; + _proto.toString = function toString() { + if (!this.isValid) return INVALID$1; + return "[" + this.s.toISO() + " \u2013 " + this.e.toISO() + ")"; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Interval { start: " + this.s.toISO() + ", end: " + this.e.toISO() + " }"; + } else { + return "Interval { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISO = function toISO(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISO(opts) + "/" + this.e.toISO(opts); + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */; + _proto.toISODate = function toISODate() { + if (!this.isValid) return INVALID$1; + return this.s.toISODate() + "/" + this.e.toISODate(); + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISOTime(opts) + "/" + this.e.toISOTime(opts); + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */; + _proto.toFormat = function toFormat(dateFormat, _temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + _ref3$separator = _ref3.separator, + separator = _ref3$separator === void 0 ? " – " : _ref3$separator; + if (!this.isValid) return INVALID$1; + return "" + this.s.toFormat(dateFormat) + separator + this.e.toFormat(dateFormat); + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */; + _proto.toDuration = function toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */; + _proto.mapEndpoints = function mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + }; + _createClass(Interval, [{ + key: "start", + get: function get() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval. This is the first instant which is not part of the interval + * (Interval is half-open). + * @type {DateTime} + */ + }, { + key: "end", + get: function get() { + return this.isValid ? this.e : null; + } + + /** + * Returns the last DateTime included in the interval (since end is not part of the interval) + * @type {DateTime} + */ + }, { + key: "lastDateTime", + get: function get() { + return this.isValid ? this.e ? this.e.minus(1) : null : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Interval; +}(Symbol.for("nodejs.util.inspect.custom")); + +/** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ +var Info = /*#__PURE__*/function () { + function Info() {} + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + Info.hasDST = function hasDST(zone) { + if (zone === void 0) { + zone = Settings.defaultZone; + } + var proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */; + Info.isValidIANAZone = function isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */; + Info.normalizeZone = function normalizeZone$1(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */; + Info.getStartOfWeek = function getStartOfWeek(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + _ref$locale = _ref.locale, + locale = _ref$locale === void 0 ? null : _ref$locale, + _ref$locObj = _ref.locObj, + locObj = _ref$locObj === void 0 ? null : _ref$locObj; + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */; + Info.getMinimumDaysInFirstWeek = function getMinimumDaysInFirstWeek(_temp2) { + var _ref2 = _temp2 === void 0 ? {} : _temp2, + _ref2$locale = _ref2.locale, + locale = _ref2$locale === void 0 ? null : _ref2$locale, + _ref2$locObj = _ref2.locObj, + locObj = _ref2$locObj === void 0 ? null : _ref2$locObj; + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */; + Info.getWeekendWeekdays = function getWeekendWeekdays(_temp3) { + var _ref3 = _temp3 === void 0 ? {} : _temp3, + _ref3$locale = _ref3.locale, + locale = _ref3$locale === void 0 ? null : _ref3$locale, + _ref3$locObj = _ref3.locObj, + locObj = _ref3$locObj === void 0 ? null : _ref3$locObj; + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */; + Info.months = function months(length, _temp4) { + if (length === void 0) { + length = "long"; + } + var _ref4 = _temp4 === void 0 ? {} : _temp4, + _ref4$locale = _ref4.locale, + locale = _ref4$locale === void 0 ? null : _ref4$locale, + _ref4$numberingSystem = _ref4.numberingSystem, + numberingSystem = _ref4$numberingSystem === void 0 ? null : _ref4$numberingSystem, + _ref4$locObj = _ref4.locObj, + locObj = _ref4$locObj === void 0 ? null : _ref4$locObj, + _ref4$outputCalendar = _ref4.outputCalendar, + outputCalendar = _ref4$outputCalendar === void 0 ? "gregory" : _ref4$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */; + Info.monthsFormat = function monthsFormat(length, _temp5) { + if (length === void 0) { + length = "long"; + } + var _ref5 = _temp5 === void 0 ? {} : _temp5, + _ref5$locale = _ref5.locale, + locale = _ref5$locale === void 0 ? null : _ref5$locale, + _ref5$numberingSystem = _ref5.numberingSystem, + numberingSystem = _ref5$numberingSystem === void 0 ? null : _ref5$numberingSystem, + _ref5$locObj = _ref5.locObj, + locObj = _ref5$locObj === void 0 ? null : _ref5$locObj, + _ref5$outputCalendar = _ref5.outputCalendar, + outputCalendar = _ref5$outputCalendar === void 0 ? "gregory" : _ref5$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */; + Info.weekdays = function weekdays(length, _temp6) { + if (length === void 0) { + length = "long"; + } + var _ref6 = _temp6 === void 0 ? {} : _temp6, + _ref6$locale = _ref6.locale, + locale = _ref6$locale === void 0 ? null : _ref6$locale, + _ref6$numberingSystem = _ref6.numberingSystem, + numberingSystem = _ref6$numberingSystem === void 0 ? null : _ref6$numberingSystem, + _ref6$locObj = _ref6.locObj, + locObj = _ref6$locObj === void 0 ? null : _ref6$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */; + Info.weekdaysFormat = function weekdaysFormat(length, _temp7) { + if (length === void 0) { + length = "long"; + } + var _ref7 = _temp7 === void 0 ? {} : _temp7, + _ref7$locale = _ref7.locale, + locale = _ref7$locale === void 0 ? null : _ref7$locale, + _ref7$numberingSystem = _ref7.numberingSystem, + numberingSystem = _ref7$numberingSystem === void 0 ? null : _ref7$numberingSystem, + _ref7$locObj = _ref7.locObj, + locObj = _ref7$locObj === void 0 ? null : _ref7$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */; + Info.meridiems = function meridiems(_temp8) { + var _ref8 = _temp8 === void 0 ? {} : _temp8, + _ref8$locale = _ref8.locale, + locale = _ref8$locale === void 0 ? null : _ref8$locale; + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */; + Info.eras = function eras(length, _temp9) { + if (length === void 0) { + length = "short"; + } + var _ref9 = _temp9 === void 0 ? {} : _temp9, + _ref9$locale = _ref9.locale, + locale = _ref9$locale === void 0 ? null : _ref9$locale; + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */; + Info.features = function features() { + return { + relative: hasRelative(), + localeWeek: hasLocaleWeekInfo() + }; + }; + return Info; +}(); + +function dayDiff(earlier, later) { + var utcDayStart = function utcDayStart(dt) { + return dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(); + }, + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); +} +function highOrderDiffs(cursor, later, units) { + var differs = [["years", function (a, b) { + return b.year - a.year; + }], ["quarters", function (a, b) { + return b.quarter - a.quarter + (b.year - a.year) * 4; + }], ["months", function (a, b) { + return b.month - a.month + (b.year - a.year) * 12; + }], ["weeks", function (a, b) { + var days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + var results = {}; + var earlier = cursor; + var lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (var _i = 0, _differs = differs; _i < _differs.length; _i++) { + var _differs$_i = _differs[_i], + unit = _differs$_i[0], + differ = _differs$_i[1]; + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; +} +function _diff (earlier, later, units, opts) { + var _highOrderDiffs = highOrderDiffs(earlier, later, units), + cursor = _highOrderDiffs[0], + results = _highOrderDiffs[1], + highWater = _highOrderDiffs[2], + lowestOrder = _highOrderDiffs[3]; + var remainingMillis = later - cursor; + var lowerOrderUnits = units.filter(function (u) { + return ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0; + }); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + var _cursor$plus; + highWater = cursor.plus((_cursor$plus = {}, _cursor$plus[lowestOrder] = 1, _cursor$plus)); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + var duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + var _Duration$fromMillis; + return (_Duration$fromMillis = Duration.fromMillis(remainingMillis, opts)).shiftTo.apply(_Duration$fromMillis, lowerOrderUnits).plus(duration); + } else { + return duration; + } +} + +var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; +function intUnit(regex, post) { + if (post === void 0) { + post = function post(i) { + return i; + }; + } + return { + regex: regex, + deser: function deser(_ref) { + var s = _ref[0]; + return post(parseDigits(s)); + } + }; +} +var NBSP = String.fromCharCode(160); +var spaceOrNBSP = "[ " + NBSP + "]"; +var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); +function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); +} +function stripInsensitivities(s) { + return s.replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); +} +function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: function deser(_ref2) { + var s = _ref2[0]; + return strings.findIndex(function (i) { + return stripInsensitivities(s) === stripInsensitivities(i); + }) + startIndex; + } + }; + } +} +function offset(regex, groups) { + return { + regex: regex, + deser: function deser(_ref3) { + var h = _ref3[1], + m = _ref3[2]; + return signedOffset(h, m); + }, + groups: groups + }; +} +function simple(regex) { + return { + regex: regex, + deser: function deser(_ref4) { + var s = _ref4[0]; + return s; + } + }; +} +function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); +} + +/** + * @param token + * @param {Locale} loc + */ +function unitForToken(token, loc) { + var one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = function literal(t) { + return { + regex: RegExp(escapeToken(t.val)), + deser: function deser(_ref5) { + var s = _ref5[0]; + return s; + }, + literal: true + }; + }, + unitate = function unitate(t) { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(?::(" + two.source + "))?"), 2); + case "ZZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(" + two.source + ")?"), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + var unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; +} +var partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy" + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM" + }, + day: { + numeric: "d", + "2-digit": "dd" + }, + weekday: { + short: "EEE", + long: "EEEE" + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh" + }, + hour24: { + numeric: "H", + "2-digit": "HH" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } +}; +function tokenForPart(part, formatOpts, resolvedOpts) { + var type = part.type, + value = part.value; + if (type === "literal") { + var isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + var style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + var actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + var val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val: val + }; + } + return undefined; +} +function buildRegex(units) { + var re = units.map(function (u) { + return u.regex; + }).reduce(function (f, r) { + return f + "(" + r.source + ")"; + }, ""); + return ["^" + re + "$", units]; +} +function match(input, regex, handlers) { + var matches = input.match(regex); + if (matches) { + var all = {}; + var matchIndex = 1; + for (var i in handlers) { + if (hasOwnProperty(handlers, i)) { + var h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } +} +function dateTimeFromMatches(matches) { + var toField = function toField(token) { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + var zone = null; + var specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + var vals = Object.keys(matches).reduce(function (r, k) { + var f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; +} +var dummyDateTimeCache = null; +function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; +} +function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + var formatOpts = Formatter.macroTokenToFormatOpts(token.val); + var tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(undefined)) { + return token; + } + return tokens; +} +function expandMacroTokens(tokens, locale) { + var _Array$prototype; + return (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, tokens.map(function (t) { + return maybeExpandMacroToken(t, locale); + })); +} + +/** + * @private + */ + +var TokenParser = /*#__PURE__*/function () { + function TokenParser(locale, format) { + this.locale = locale; + this.format = format; + this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale); + this.units = this.tokens.map(function (t) { + return unitForToken(t, locale); + }); + this.disqualifyingUnit = this.units.find(function (t) { + return t.invalidReason; + }); + if (!this.disqualifyingUnit) { + var _buildRegex = buildRegex(this.units), + regexString = _buildRegex[0], + handlers = _buildRegex[1]; + this.regex = RegExp(regexString, "i"); + this.handlers = handlers; + } + } + var _proto = TokenParser.prototype; + _proto.explainFromTokens = function explainFromTokens(input) { + if (!this.isValid) { + return { + input: input, + tokens: this.tokens, + invalidReason: this.invalidReason + }; + } else { + var _match = match(input, this.regex, this.handlers), + rawMatches = _match[0], + matches = _match[1], + _ref6 = matches ? dateTimeFromMatches(matches) : [null, null, undefined], + result = _ref6[0], + zone = _ref6[1], + specificOffset = _ref6[2]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input: input, + tokens: this.tokens, + regex: this.regex, + rawMatches: rawMatches, + matches: matches, + result: result, + zone: zone, + specificOffset: specificOffset + }; + } + }; + _createClass(TokenParser, [{ + key: "isValid", + get: function get() { + return !this.disqualifyingUnit; + } + }, { + key: "invalidReason", + get: function get() { + return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null; + } + }]); + return TokenParser; +}(); +function explainFromTokens(locale, input, format) { + var parser = new TokenParser(locale, format); + return parser.explainFromTokens(input); +} +function parseFromTokens(locale, input, format) { + var _explainFromTokens = explainFromTokens(locale, input, format), + result = _explainFromTokens.result, + zone = _explainFromTokens.zone, + specificOffset = _explainFromTokens.specificOffset, + invalidReason = _explainFromTokens.invalidReason; + return [result, zone, specificOffset, invalidReason]; +} +function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + var formatter = Formatter.create(locale, formatOpts); + var df = formatter.dtFormatter(getDummyDateTime()); + var parts = df.formatToParts(); + var resolvedOpts = df.resolvedOptions(); + return parts.map(function (p) { + return tokenForPart(p, formatOpts, resolvedOpts); + }); +} + +var INVALID = "Invalid DateTime"; +var MAX_DATE = 8.64e15; +function unsupportedZone(zone) { + return new Invalid("unsupported zone", "the zone \"" + zone.name + "\" is not supported"); +} + +// we cache week data on the DT object and this intermediates the cache +/** + * @param {DateTime} dt + */ +function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; +} + +/** + * @param {DateTime} dt + */ +function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek(dt.c, dt.loc.getMinDaysInFirstWeek(), dt.loc.getStartOfWeek()); + } + return dt.localWeekData; +} + +// clone really means, "make a new object with these modifications". all "setters" really use this +// to create a new object while only changing some of the properties +function clone(inst, alts) { + var current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime(_extends({}, current, alts, { + old: current + })); +} + +// find the right offset a given local time. The o input is our guess, which determines which +// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) +function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + var utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + var o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + var o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; +} + +// convert an epoch timestamp into a calendar object with the given offset +function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + var d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; +} + +// convert a calendar object to a epoch timestamp +function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); +} + +// create a new DT instance by adding a duration, adjusting for DSTs +function adjustTime(inst, dur) { + var oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = _extends({}, inst.c, { + year: year, + month: month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }), + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), + localTS = objToLocalTS(c); + var _fixOffset = fixOffset(localTS, oPre, inst.zone), + ts = _fixOffset[0], + o = _fixOffset[1]; + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + return { + ts: ts, + o: o + }; +} + +// helper useful in turning the results of parsing into real dates +// by handling the zone options +function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + var setZone = opts.setZone, + zone = opts.zone; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + var interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, _extends({}, opts, { + zone: interpretationZone, + specificOffset: specificOffset + })); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", "the input \"" + text + "\" can't be parsed as " + format)); + } +} + +// if you want to output a technical format (e.g. RFC 2822), this helper +// helps handle the details +function toTechFormat(dt, format, allowZ) { + if (allowZ === void 0) { + allowZ = true; + } + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ: allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format) : null; +} +function _toISODate(o, extended, precision) { + var longFormat = o.c.year > 9999 || o.c.year < 0; + var c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (precision === "year") return c; + if (extended) { + c += "-"; + c += padStart(o.c.month); + if (precision === "month") return c; + c += "-"; + } else { + c += padStart(o.c.month); + if (precision === "month") return c; + } + c += padStart(o.c.day); + return c; +} +function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision) { + var showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0, + c = ""; + switch (precision) { + case "day": + case "month": + case "year": + break; + default: + c += padStart(o.c.hour); + if (precision === "hour") break; + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += ":"; + c += padStart(o.c.second); + } + } else { + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += padStart(o.c.second); + } + } + if (precision === "second") break; + if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; +} + +// defaults for unspecified units in the supported calendars +var defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + +// Units in the supported calendars, sorted by bigness +var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + +// standardize case and plurality in units +function normalizeUnit(unit) { + var normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal" + }[unit.toLowerCase()]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; +} +function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } +} + +// cache offsets for zones based on the current timestamp when this function is +// first called. When we are handling a datetime from components like (year, +// month, day, hour) in a time zone, we need a guess about what the timezone +// offset is so that we can convert into a UTC timestamp. One way is to find the +// offset of now in the zone. The actual date may have a different offset (for +// example, if we handle a date in June while we're in December in a zone that +// observes DST), but we can check and adjust that. +// +// When handling many dates, calculating the offset for now every time is +// expensive. It's just a guess, so we can cache the offset to use even if we +// are right on a time change boundary (we'll just correct in the other +// direction). Using a timestamp from first read is a slight optimization for +// handling dates close to the current date, since those dates will usually be +// in the same offset (we could set the timestamp statically, instead). We use a +// single timestamp for all zones to make things a bit more predictable. +// +// This is safe for quickDT (used by local() and utc()) because we don't fill in +// higher-order units from tsNow (as we do in fromObject, this requires that +// offset is calculated from tsNow). +/** + * @param {Zone} zone + * @return {number} + */ +function guessOffsetForZone(zone) { + if (zoneOffsetTs === undefined) { + zoneOffsetTs = Settings.now(); + } + + // Do not cache anything but IANA zones, because it is not safe to do so. + // Guessing an offset which is not present in the zone can cause wrong results from fixOffset + if (zone.type !== "iana") { + return zone.offset(zoneOffsetTs); + } + var zoneName = zone.name; + var offsetGuess = zoneOffsetGuessCache.get(zoneName); + if (offsetGuess === undefined) { + offsetGuess = zone.offset(zoneOffsetTs); + zoneOffsetGuessCache.set(zoneName, offsetGuess); + } + return offsetGuess; +} + +// this is a dumbed down version of fromObject() that runs about 60% faster +// but doesn't do any validation, makes a bunch of assumptions about what units +// are present, and so on. +function quickDT(obj, opts) { + var zone = normalizeZone(opts.zone, Settings.defaultZone); + if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } + var loc = Locale.fromObject(opts); + var ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (var _i = 0, _orderedUnits = orderedUnits; _i < _orderedUnits.length; _i++) { + var u = _orderedUnits[_i]; + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + var invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + var offsetProvis = guessOffsetForZone(zone); + var _objToTS = objToTS(obj, offsetProvis, zone); + ts = _objToTS[0]; + o = _objToTS[1]; + } else { + ts = Settings.now(); + } + return new DateTime({ + ts: ts, + zone: zone, + loc: loc, + o: o + }); +} +function diffRelative(start, end, opts) { + var round = isUndefined(opts.round) ? true : opts.round, + rounding = isUndefined(opts.rounding) ? "trunc" : opts.rounding, + format = function format(c, unit) { + c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? "round" : rounding); + var formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = function differ(unit) { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + for (var _iterator = _createForOfIteratorHelperLoose(opts.units), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + var count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); +} +function lastOpts(argList) { + var opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; +} + +/** + * Timestamp to use for cached zone offset guesses (exposed for test) + */ +var zoneOffsetTs; +/** + * Cache for zone offset guesses (exposed for test). + * + * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of + * zone.offset(). + */ +var zoneOffsetGuessCache = new Map(); + +/** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ +var DateTime = /*#__PURE__*/function (_Symbol$for) { + /** + * @access private + */ + function DateTime(config) { + var zone = config.zone || Settings.defaultZone; + var invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + var c = null, + o = null; + if (!invalid) { + var unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + var _ref = [config.old.c, config.old.o]; + c = _ref[0]; + o = _ref[1]; + } else { + // If an offset has been passed and we have not been called from + // clone(), we can trust it and avoid the offset calculation. + var ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + DateTime.now = function now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */; + DateTime.local = function local() { + var _lastOpts = lastOpts(arguments), + opts = _lastOpts[0], + args = _lastOpts[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */; + DateTime.utc = function utc() { + var _lastOpts2 = lastOpts(arguments), + opts = _lastOpts2[0], + args = _lastOpts2[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */; + DateTime.fromJSDate = function fromJSDate(date, options) { + if (options === void 0) { + options = {}; + } + var ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + var zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromMillis = function fromMillis(milliseconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError("fromMillis requires a numerical input, but received a " + typeof milliseconds + " with value " + milliseconds); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromSeconds = function fromSeconds(seconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */; + DateTime.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + obj = obj || {}; + var zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + var loc = Locale.fromObject(opts); + var normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues = usesLocalWeekValues(normalized, loc), + minDaysInFirstWeek = _usesLocalWeekValues.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues.startOfWeek; + var tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + + // configure ourselves to deal with gregorian dates or week stuff + var units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + var foundFirst = false; + for (var _iterator2 = _createForOfIteratorHelperLoose(units), _step2; !(_step2 = _iterator2()).done;) { + var u = _step2.value; + var v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + var higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + var gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, + _objToTS2 = objToTS(gregorian, offsetProvis, zoneToUse), + tsFinal = _objToTS2[0], + offsetFinal = _objToTS2[1], + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc: loc + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", "you can't specify both a weekday of " + normalized.weekday + " and a date of " + inst.toISO()); + } + if (!inst.isValid) { + return DateTime.invalid(inst.invalid); + } + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */; + DateTime.fromISO = function fromISO(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseISODate = parseISODate(text), + vals = _parseISODate[0], + parsedZone = _parseISODate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */; + DateTime.fromRFC2822 = function fromRFC2822(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseRFC2822Date = parseRFC2822Date(text), + vals = _parseRFC2822Date[0], + parsedZone = _parseRFC2822Date[1]; + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */; + DateTime.fromHTTP = function fromHTTP(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseHTTPDate = parseHTTPDate(text), + vals = _parseHTTPDate[0], + parsedZone = _parseHTTPDate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromFormat = function fromFormat(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + var _opts = opts, + _opts$locale = _opts.locale, + locale = _opts$locale === void 0 ? null : _opts$locale, + _opts$numberingSystem = _opts.numberingSystem, + numberingSystem = _opts$numberingSystem === void 0 ? null : _opts$numberingSystem, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }), + _parseFromTokens = parseFromTokens(localeToUse, text, fmt), + vals = _parseFromTokens[0], + parsedZone = _parseFromTokens[1], + specificOffset = _parseFromTokens[2], + invalid = _parseFromTokens[3]; + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, "format " + fmt, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */; + DateTime.fromString = function fromString(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */; + DateTime.fromSQL = function fromSQL(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseSQL = parseSQL(text), + vals = _parseSQL[0], + parsedZone = _parseSQL[1]; + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */; + DateTime.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid: invalid + }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + DateTime.isDateTime = function isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */; + DateTime.parseFormatForOpts = function parseFormatForOpts(formatOpts, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map(function (t) { + return t ? t.val : null; + }).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */; + DateTime.expandFormat = function expandFormat(fmt, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map(function (t) { + return t.val; + }).join(""); + }; + DateTime.resetCache = function resetCache() { + zoneOffsetTs = undefined; + zoneOffsetGuessCache.clear(); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */; + var _proto = DateTime.prototype; + _proto.get = function get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */; + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + _proto.getPossibleOffsets = function getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + var dayMs = 86400000; + var minuteMs = 60000; + var localTS = objToLocalTS(this.c); + var oEarlier = this.zone.offset(localTS - dayMs); + var oLater = this.zone.offset(localTS + dayMs); + var o1 = this.zone.offset(localTS - oEarlier * minuteMs); + var o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + var ts1 = localTS - o1 * minuteMs; + var ts2 = localTS - o2 * minuteMs; + var c1 = tsToObj(ts1, o1); + var c2 = tsToObj(ts2, o2); + if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { + return [clone(this, { + ts: ts1 + }), clone(this, { + ts: ts2 + })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */; + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + _proto.resolvedLocaleOptions = function resolvedLocaleOptions(opts) { + if (opts === void 0) { + opts = {}; + } + var _Formatter$create$res = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this), + locale = _Formatter$create$res.locale, + numberingSystem = _Formatter$create$res.numberingSystem, + calendar = _Formatter$create$res.calendar; + return { + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: calendar + }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */; + _proto.toUTC = function toUTC(offset, opts) { + if (offset === void 0) { + offset = 0; + } + if (opts === void 0) { + opts = {}; + } + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */; + _proto.toLocal = function toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */; + _proto.setZone = function setZone(zone, _temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + _ref2$keepLocalTime = _ref2.keepLocalTime, + keepLocalTime = _ref2$keepLocalTime === void 0 ? false : _ref2$keepLocalTime, + _ref2$keepCalendarTim = _ref2.keepCalendarTime, + keepCalendarTime = _ref2$keepCalendarTim === void 0 ? false : _ref2$keepCalendarTim; + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + var newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + var offsetGuess = zone.offset(this.ts); + var asObj = this.toObject(); + var _objToTS3 = objToTS(asObj, offsetGuess, zone); + newTS = _objToTS3[0]; + } + return clone(this, { + ts: newTS, + zone: zone + }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */; + _proto.reconfigure = function reconfigure(_temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + locale = _ref3.locale, + numberingSystem = _ref3.numberingSystem, + outputCalendar = _ref3.outputCalendar; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: outputCalendar + }); + return clone(this, { + loc: loc + }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */; + _proto.setLocale = function setLocale(locale) { + return this.reconfigure({ + locale: locale + }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues2 = usesLocalWeekValues(normalized, this.loc), + minDaysInFirstWeek = _usesLocalWeekValues2.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues2.startOfWeek; + var settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var mixed; + if (settingWeekStuff) { + mixed = weekToGregorian(_extends({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian(_extends({}, gregorianToOrdinal(this.c), normalized)); + } else { + mixed = _extends({}, this.toObject(), normalized); + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + var _objToTS4 = objToTS(mixed, this.o, this.zone), + ts = _objToTS4[0], + o = _objToTS4[1]; + return clone(this, { + ts: ts, + o: o + }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */; + _proto.startOf = function startOf(unit, _temp3) { + var _ref4 = _temp3 === void 0 ? {} : _temp3, + _ref4$useLocaleWeeks = _ref4.useLocaleWeeks, + useLocaleWeeks = _ref4$useLocaleWeeks === void 0 ? false : _ref4$useLocaleWeeks; + if (!this.isValid) return this; + var o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + var startOfWeek = this.loc.getStartOfWeek(); + var weekday = this.weekday; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + if (normalizedUnit === "quarters") { + var q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */; + _proto.endOf = function endOf(unit, opts) { + var _this$plus; + return this.isValid ? this.plus((_this$plus = {}, _this$plus[unit] = 1, _this$plus)).startOf(unit, opts).minus(1) : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */; + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */; + _proto.toLocaleParts = function toLocaleParts(opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z' + * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z' + * @return {string|null} + */; + _proto.toISO = function toISO(_temp4) { + var _ref5 = _temp4 === void 0 ? {} : _temp4, + _ref5$format = _ref5.format, + format = _ref5$format === void 0 ? "extended" : _ref5$format, + _ref5$suppressSeconds = _ref5.suppressSeconds, + suppressSeconds = _ref5$suppressSeconds === void 0 ? false : _ref5$suppressSeconds, + _ref5$suppressMillise = _ref5.suppressMilliseconds, + suppressMilliseconds = _ref5$suppressMillise === void 0 ? false : _ref5$suppressMillise, + _ref5$includeOffset = _ref5.includeOffset, + includeOffset = _ref5$includeOffset === void 0 ? true : _ref5$includeOffset, + _ref5$extendedZone = _ref5.extendedZone, + extendedZone = _ref5$extendedZone === void 0 ? false : _ref5$extendedZone, + _ref5$precision = _ref5.precision, + precision = _ref5$precision === void 0 ? "milliseconds" : _ref5$precision; + if (!this.isValid) { + return null; + } + precision = normalizeUnit(precision); + var ext = format === "extended"; + var c = _toISODate(this, ext, precision); + if (orderedUnits.indexOf(precision) >= 3) c += "T"; + c += _toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'. + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05' + * @return {string|null} + */; + _proto.toISODate = function toISODate(_temp5) { + var _ref6 = _temp5 === void 0 ? {} : _temp5, + _ref6$format = _ref6.format, + format = _ref6$format === void 0 ? "extended" : _ref6$format, + _ref6$precision = _ref6.precision, + precision = _ref6$precision === void 0 ? "day" : _ref6$precision; + if (!this.isValid) { + return null; + } + return _toISODate(this, format === "extended", normalizeUnit(precision)); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */; + _proto.toISOWeekDate = function toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z' + * @return {string} + */; + _proto.toISOTime = function toISOTime(_temp6) { + var _ref7 = _temp6 === void 0 ? {} : _temp6, + _ref7$suppressMillise = _ref7.suppressMilliseconds, + suppressMilliseconds = _ref7$suppressMillise === void 0 ? false : _ref7$suppressMillise, + _ref7$suppressSeconds = _ref7.suppressSeconds, + suppressSeconds = _ref7$suppressSeconds === void 0 ? false : _ref7$suppressSeconds, + _ref7$includeOffset = _ref7.includeOffset, + includeOffset = _ref7$includeOffset === void 0 ? true : _ref7$includeOffset, + _ref7$includePrefix = _ref7.includePrefix, + includePrefix = _ref7$includePrefix === void 0 ? false : _ref7$includePrefix, + _ref7$extendedZone = _ref7.extendedZone, + extendedZone = _ref7$extendedZone === void 0 ? false : _ref7$extendedZone, + _ref7$format = _ref7.format, + format = _ref7$format === void 0 ? "extended" : _ref7$format, + _ref7$precision = _ref7.precision, + precision = _ref7$precision === void 0 ? "milliseconds" : _ref7$precision; + if (!this.isValid) { + return null; + } + precision = normalizeUnit(precision); + var c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? "T" : ""; + return c + _toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */; + _proto.toRFC2822 = function toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */; + _proto.toHTTP = function toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string|null} + */; + _proto.toSQLDate = function toSQLDate() { + if (!this.isValid) { + return null; + } + return _toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */; + _proto.toSQLTime = function toSQLTime(_temp7) { + var _ref8 = _temp7 === void 0 ? {} : _temp7, + _ref8$includeOffset = _ref8.includeOffset, + includeOffset = _ref8$includeOffset === void 0 ? true : _ref8$includeOffset, + _ref8$includeZone = _ref8.includeZone, + includeZone = _ref8$includeZone === void 0 ? false : _ref8$includeZone, + _ref8$includeOffsetSp = _ref8.includeOffsetSpace, + includeOffsetSpace = _ref8$includeOffsetSp === void 0 ? true : _ref8$includeOffsetSp; + var fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */; + _proto.toSQL = function toSQL(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) { + return null; + } + return this.toSQLDate() + " " + this.toSQLTime(opts); + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */; + _proto.toString = function toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "DateTime { ts: " + this.toISO() + ", zone: " + this.zone.name + ", locale: " + this.locale + " }"; + } else { + return "DateTime { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */; + _proto.toMillis = function toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime. + * @return {number} + */; + _proto.toSeconds = function toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */; + _proto.toUnixInteger = function toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */; + _proto.toBSON = function toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */; + _proto.toObject = function toObject(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return {}; + var base = _extends({}, this.c); + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */; + _proto.toJSDate = function toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */; + _proto.diff = function diff(otherDateTime, unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + var durOpts = _extends({ + locale: this.locale, + numberingSystem: this.numberingSystem + }, opts); + var units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = _diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */; + _proto.diffNow = function diffNow(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval|DateTime} + */; + _proto.until = function until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */; + _proto.hasSame = function hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + var inputMs = otherDateTime.valueOf(); + var adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */; + _proto.equals = function equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {string} [options.rounding="trunc"] - rounding method to use when rounding the numbers in the output. Can be "trunc" (toward zero), "expand" (away from zero), "round", "floor", or "ceil". + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */; + _proto.toRelative = function toRelative(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + var base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), + padding = options.padding ? this < base ? -options.padding : options.padding : 0; + var units = ["years", "months", "days", "hours", "minutes", "seconds"]; + var unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), _extends({}, options, { + numeric: "always", + units: units, + unit: unit + })); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */; + _proto.toRelativeCalendar = function toRelativeCalendar(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, _extends({}, options, { + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + })); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */; + DateTime.min = function min() { + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */; + DateTime.max = function max() { + for (var _len2 = arguments.length, dateTimes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + dateTimes[_key2] = arguments[_key2]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */; + DateTime.fromFormatExplain = function fromFormatExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + var _options = options, + _options$locale = _options.locale, + locale = _options$locale === void 0 ? null : _options$locale, + _options$numberingSys = _options.numberingSystem, + numberingSystem = _options$numberingSys === void 0 ? null : _options$numberingSys, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */; + DateTime.fromStringExplain = function fromStringExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + return DateTime.fromFormatExplain(text, fmt, options); + } + + /** + * Build a parser for `fmt` using the given locale. This parser can be passed + * to {@link DateTime.fromFormatParser} to a parse a date in this format. This + * can be used to optimize cases where many dates need to be parsed in a + * specific format. + * + * @param {String} fmt - the format the string is expected to be in (see + * description) + * @param {Object} options - options used to set locale and numberingSystem + * for parser + * @returns {TokenParser} - opaque object to be used + */; + DateTime.buildFormatParser = function buildFormatParser(fmt, options) { + if (options === void 0) { + options = {}; + } + var _options2 = options, + _options2$locale = _options2.locale, + locale = _options2$locale === void 0 ? null : _options2$locale, + _options2$numberingSy = _options2.numberingSystem, + numberingSystem = _options2$numberingSy === void 0 ? null : _options2$numberingSy, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return new TokenParser(localeToUse, fmt); + } + + /** + * Create a DateTime from an input string and format parser. + * + * The format parser must have been created with the same locale as this call. + * + * @param {String} text - the string to parse + * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser} + * @param {Object} opts - options taken by fromFormat() + * @returns {DateTime} + */; + DateTime.fromFormatParser = function fromFormatParser(text, formatParser, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(formatParser)) { + throw new InvalidArgumentError("fromFormatParser requires an input string and a format parser"); + } + var _opts2 = opts, + _opts2$locale = _opts2.locale, + locale = _opts2$locale === void 0 ? null : _opts2$locale, + _opts2$numberingSyste = _opts2.numberingSystem, + numberingSystem = _opts2$numberingSyste === void 0 ? null : _opts2$numberingSyste, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + if (!localeToUse.equals(formatParser.locale)) { + throw new InvalidArgumentError("fromFormatParser called with a locale of " + localeToUse + ", " + ("but the format parser was created for " + formatParser.locale)); + } + var _formatParser$explain = formatParser.explainFromTokens(text), + result = _formatParser$explain.result, + zone = _formatParser$explain.zone, + specificOffset = _formatParser$explain.specificOffset, + invalidReason = _formatParser$explain.invalidReason; + if (invalidReason) { + return DateTime.invalid(invalidReason); + } else { + return parseDataToDateTime(result, zone, opts, "format " + formatParser.format, text, specificOffset); + } + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */; + _createClass(DateTime, [{ + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "outputCalendar", + get: function get() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + }, { + key: "zone", + get: function get() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + }, { + key: "zoneName", + get: function get() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + }, { + key: "year", + get: function get() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + }, { + key: "quarter", + get: function get() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + }, { + key: "month", + get: function get() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + }, { + key: "day", + get: function get() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + }, { + key: "hour", + get: function get() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + }, { + key: "minute", + get: function get() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + }, { + key: "second", + get: function get() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + }, { + key: "millisecond", + get: function get() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + }, { + key: "weekYear", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + }, { + key: "weekNumber", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + }, { + key: "weekday", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + }, { + key: "isWeekend", + get: function get() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + }, { + key: "localWeekday", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + }, { + key: "localWeekNumber", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + }, { + key: "localWeekYear", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + }, { + key: "ordinal", + get: function get() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + }, { + key: "monthShort", + get: function get() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + }, { + key: "monthLong", + get: function get() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + }, { + key: "weekdayShort", + get: function get() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + }, { + key: "weekdayLong", + get: function get() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + }, { + key: "offset", + get: function get() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameShort", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameLong", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + }, { + key: "isOffsetFixed", + get: function get() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + }, { + key: "isInDST", + get: function get() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + }, { + key: "isInLeapYear", + get: function get() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + }, { + key: "daysInMonth", + get: function get() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + }, { + key: "daysInYear", + get: function get() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + }, { + key: "weeksInWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + }, { + key: "weeksInLocalWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN; + } + }], [{ + key: "DATE_SHORT", + get: function get() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED", + get: function get() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED_WITH_WEEKDAY", + get: function get() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_FULL", + get: function get() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_HUGE", + get: function get() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_SIMPLE", + get: function get() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SECONDS", + get: function get() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SHORT_OFFSET", + get: function get() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_LONG_OFFSET", + get: function get() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_SIMPLE", + get: function get() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SECONDS", + get: function get() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SHORT_OFFSET", + get: function get() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_LONG_OFFSET", + get: function get() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT", + get: function get() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT_WITH_SECONDS", + get: function get() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED", + get: function get() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_SECONDS", + get: function get() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_WEEKDAY", + get: function get() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL", + get: function get() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL_WITH_SECONDS", + get: function get() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE", + get: function get() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE_WITH_SECONDS", + get: function get() { + return DATETIME_HUGE_WITH_SECONDS; + } + }]); + return DateTime; +}(Symbol.for("nodejs.util.inspect.custom")); +function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError("Unknown datetime argument: " + dateTimeish + ", of type " + typeof dateTimeish); + } +} + +var VERSION = "3.7.2"; + +exports.DateTime = DateTime; +exports.Duration = Duration; +exports.FixedOffsetZone = FixedOffsetZone; +exports.IANAZone = IANAZone; +exports.Info = Info; +exports.Interval = Interval; +exports.InvalidZone = InvalidZone; +exports.Settings = Settings; +exports.SystemZone = SystemZone; +exports.VERSION = VERSION; +exports.Zone = Zone; +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/cjs-browser/luxon.js.map b/node_modules/luxon/build/cjs-browser/luxon.js.map new file mode 100644 index 00000000..e965cb94 --- /dev/null +++ b/node_modules/luxon/build/cjs-browser/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/impl/digits.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nconst dtfCache = new Map();\nfunction makeDTF(zoneName) {\n let dtf = dtfCache.get(zoneName);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zoneName,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n dtfCache.set(zoneName, dtf);\n }\n return dtf;\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nconst ianaZoneCache = new Map();\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n let zone = ianaZoneCache.get(name);\n if (zone === undefined) {\n ianaZoneCache.set(name, (zone = new IANAZone(name)));\n }\n return zone;\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache.clear();\n dtfCache.clear();\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n if (!this.valid) return NaN;\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nconst intlDTCache = new Map();\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache.get(key);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache.set(key, dtf);\n }\n return dtf;\n}\n\nconst intlNumCache = new Map();\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache.get(key);\n if (inf === undefined) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache.set(key, inf);\n }\n return inf;\n}\n\nconst intlRelCache = new Map();\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache.get(key);\n if (inf === undefined) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache.set(key, inf);\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nconst intlResolvedOptionsCache = new Map();\nfunction getCachedIntResolvedOptions(locString) {\n let opts = intlResolvedOptionsCache.get(locString);\n if (opts === undefined) {\n opts = new Intl.DateTimeFormat(locString).resolvedOptions();\n intlResolvedOptionsCache.set(locString, opts);\n }\n return opts;\n}\n\nconst weekInfoCache = new Map();\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache.get(locString);\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86\n if (!(\"minimalDays\" in data)) {\n data = { ...fallbackWeekSettings, ...data };\n }\n weekInfoCache.set(locString, data);\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n getCachedIntResolvedOptions(loc.locale).numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache.clear();\n intlNumCache.clear();\n intlRelCache.clear();\n intlResolvedOptionsCache.clear();\n weekInfoCache.clear();\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n // Workaround for \"ja\" locale: formatToParts does not label all parts of the month\n // as \"month\" and for this locale there is no difference between \"format\" and \"non-format\".\n // As such, just use format() instead of formatToParts() and take the whole string\n const monthSpecialCase = this.intl === \"ja\" || this.intl.startsWith(\"ja-\");\n format &= !monthSpecialCase;\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n const mapper = !monthSpecialCase\n ? (dt) => this.extract(dt, intl, \"month\")\n : (dt) => this.dtFormatter(dt, intl).format();\n this.monthsCache[formatStr][length] = mapMonths(mapper);\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n getCachedIntResolvedOptions(this.intl).locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nconst digitRegexCache = new Map();\nexport function resetDigitRegexCache() {\n digitRegexCache.clear();\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n let appendCache = digitRegexCache.get(ns);\n if (appendCache === undefined) {\n appendCache = new Map();\n digitRegexCache.set(ns, appendCache);\n }\n let regex = appendCache.get(append);\n if (regex === undefined) {\n regex = new RegExp(`${numberingSystems[ns]}${append}`);\n appendCache.set(append, regex);\n }\n\n return regex;\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, rounding = \"round\") {\n const factor = 10 ** digits;\n switch (rounding) {\n case \"expand\":\n return number > 0\n ? Math.ceil(number * factor) / factor\n : Math.floor(number * factor) / factor;\n case \"trunc\":\n return Math.trunc(number * factor) / factor;\n case \"round\":\n return Math.round(number * factor) / factor;\n case \"floor\":\n return Math.floor(number * factor) / factor;\n case \"ceil\":\n return Math.ceil(number * factor) / factor;\n default:\n throw new RangeError(`Value rounding ${rounding} is out of range`);\n }\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || !Number.isFinite(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n // turn '' into a literal signal quote instead of just skipping the empty literal\n if (currentFull.length > 0 || bracketed) {\n splits.push({\n literal: bracketed || /^\\s+$/.test(currentFull),\n val: currentFull === \"\" ? \"'\" : currentFull,\n });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0, signDisplay = undefined) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n if (signDisplay) {\n opts.signDisplay = signDisplay;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const invertLargest = this.opts.signMode === \"negativeLargestOnly\" ? -1 : 1;\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"milliseconds\";\n case \"s\":\n return \"seconds\";\n case \"m\":\n return \"minutes\";\n case \"h\":\n return \"hours\";\n case \"d\":\n return \"days\";\n case \"w\":\n return \"weeks\";\n case \"M\":\n return \"months\";\n case \"y\":\n return \"years\";\n default:\n return null;\n }\n },\n tokenToString = (lildur, info) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n const inversionFactor =\n info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1;\n let signDisplay;\n if (this.opts.signMode === \"negativeLargestOnly\" && mapped !== info.largestUnit) {\n signDisplay = \"never\";\n } else if (this.opts.signMode === \"all\") {\n signDisplay = \"always\";\n } else {\n // \"auto\" and \"negative\" are the same, but \"auto\" has better support\n signDisplay = \"auto\";\n }\n return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)),\n durationInfo = {\n isNegativeDuration: collapsed < 0,\n // this relies on \"collapsed\" being based on \"shiftTo\", which builds up the object\n // in order\n largestUnit: Object.keys(collapsed.values)[0],\n };\n return stringifyTokens(tokens, tokenToString(collapsed, durationInfo));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:([Zz])|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"+6 +2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"-6 -2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"negativeLargestOnly\" }) //=> \"-6 2\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero\n * @example\n * ```js\n * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 mth, 0 wks, 5 hr, 6 min'\n * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const showZeros = opts.showZeros !== false;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val) || (val === 0 && !showZeros)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Removes all units with values equal to 0 from this Duration.\n * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 }\n * @return {Duration}\n */\n removeZeros() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.values);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval. This is the first instant which is not part of the interval\n * (Interval is half-open).\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns the last DateTime included in the interval (since end is not part of the interval)\n * @type {DateTime}\n */\n get lastDateTime() {\n return this.isValid ? (this.e ? this.e.minus(1) : null) : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into an equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval\n * and ending with the latest.\n *\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended, precision) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n if (precision === \"year\") return c;\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n c += \"-\";\n } else {\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n }\n c += padStart(o.c.day);\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n) {\n let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0,\n c = \"\";\n switch (precision) {\n case \"day\":\n case \"month\":\n case \"year\":\n break;\n default:\n c += padStart(o.c.hour);\n if (precision === \"hour\") break;\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += \":\";\n c += padStart(o.c.second);\n }\n } else {\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += padStart(o.c.second);\n }\n }\n if (precision === \"second\") break;\n if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\n/**\n * @param {Zone} zone\n * @return {number}\n */\nfunction guessOffsetForZone(zone) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n // Do not cache anything but IANA zones, because it is not safe to do so.\n // Guessing an offset which is not present in the zone can cause wrong results from fixOffset\n if (zone.type !== \"iana\") {\n return zone.offset(zoneOffsetTs);\n }\n const zoneName = zone.name;\n let offsetGuess = zoneOffsetGuessCache.get(zoneName);\n if (offsetGuess === undefined) {\n offsetGuess = zone.offset(zoneOffsetTs);\n zoneOffsetGuessCache.set(zoneName, offsetGuess);\n }\n return offsetGuess;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n rounding = isUndefined(opts.rounding) ? \"trunc\" : opts.rounding,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? \"round\" : rounding);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nconst zoneOffsetGuessCache = new Map();\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache.clear();\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z'\n * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z'\n * @return {string|null}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext, precision);\n if (orderedUnits.indexOf(precision) >= 3) c += \"T\";\n c += toISOTime(\n this,\n ext,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n );\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'.\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05'\n * @return {string|null}\n */\n toISODate({ format = \"extended\", precision = \"day\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, format === \"extended\", normalizeUnit(precision));\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string|null}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval|DateTime}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {string} [options.rounding=\"trunc\"] - rounding method to use when rounding the numbers in the output. Can be \"trunc\" (toward zero), \"expand\" (away from zero), \"round\", \"floor\", or \"ceil\".\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.7.2\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["LuxonError","_Error","_inheritsLoose","apply","arguments","_wrapNativeSuper","Error","InvalidDateTimeError","_LuxonError","reason","call","toMessage","InvalidIntervalError","_LuxonError2","InvalidDurationError","_LuxonError3","ConflictingSpecificationError","_LuxonError4","InvalidUnitError","_LuxonError5","unit","InvalidArgumentError","_LuxonError6","ZoneIsAbstractError","_LuxonError7","n","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","_proto","prototype","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","_createClass","key","get","name","singleton","SystemZone","_Zone","_ref","locale","parseZoneInfo","Date","getTimezoneOffset","type","Intl","DateTimeFormat","resolvedOptions","timeZone","dtfCache","Map","makeDTF","zoneName","dtf","undefined","hour12","era","set","typeToPos","hackyOffset","date","formatted","replace","parsed","exec","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","formatToParts","filled","i","length","_formatted$i","value","pos","isUndefined","parseInt","ianaZoneCache","IANAZone","create","zone","resetCache","clear","isValidSpecifier","isValidZone","e","_this","valid","NaN","isNaN","_ref2","adOrBc","Math","abs","adjustedHour","asUTC","objToLocalTS","millisecond","asTS","over","intlLFCache","getCachedLF","locString","JSON","stringify","ListFormat","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","NumberFormat","intlRelCache","getCachedRTF","_opts","base","cacheKeyOpts","_objectWithoutPropertiesLoose","_excluded","RelativeTimeFormat","sysLocaleCache","systemLocale","intlResolvedOptionsCache","getCachedIntResolvedOptions","weekInfoCache","getCachedWeekInfo","data","Locale","getWeekInfo","weekInfo","_extends","fallbackWeekSettings","parseLocaleString","localeStr","xIndex","indexOf","substring","uIndex","options","selectedStr","smaller","_options","numberingSystem","calendar","intlConfigString","outputCalendar","includes","mapMonths","f","ms","dt","DateTime","utc","push","mapWeekdays","listStuff","loc","englishFn","intlFn","mode","listingMode","supportsFastNumbers","startsWith","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","_excluded2","Object","keys","intlOpts","useGrouping","minimumIntegerDigits","fixed","roundTo","padStart","PolyDateFormatter","originalZone","z","gmtOffset","offsetZ","setZone","plus","minutes","_proto2","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","_proto3","count","English","numeric","firstDay","minimalDays","weekend","fromOpts","weekSettings","defaultToEN","specifiedLocale","Settings","defaultLocale","localeR","numberingSystemR","defaultNumberingSystem","outputCalendarR","defaultOutputCalendar","weekSettingsR","validateWeekSettings","defaultWeekSettings","fromObject","_temp","numbering","_parseLocaleString","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","_proto4","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","months","_this2","monthSpecialCase","formatStr","mapper","extract","dtFormatter","weekdays","_this3","meridiems","_this4","eras","_this5","field","df","results","matching","find","m","toLowerCase","numberFormatter","fastNumbers","relFormatter","listFormatter","getWeekSettings","hasLocaleWeekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","toString","FixedOffsetZone","instance","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","input","defaultZone","isString","lowered","isNumber","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","split","parseDigits","str","code","charCodeAt","search","_numberingSystemsUTF","min","max","digitRegexCache","resetDigitRegexCache","digitRegex","append","ns","appendCache","regex","RegExp","now","twoDigitCutoffYear","throwOnInvalid","resetCaches","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","_uncomputeOrdinal","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","_uncomputeOrdinal2","usesLocalWeekValues","obj","hasLocaleWeekData","localWeekday","localWeekNumber","localWeekYear","hasIsoWeekData","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","o","isDate","maybeArray","thing","Array","isArray","bestBy","arr","by","compare","reduce","best","next","pair","pick","a","k","hasOwnProperty","prop","settings","some","v","from","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","rounding","factor","pow","ceil","trunc","round","RangeError","modMonth","modYear","firstWeekOffset","fwdlw","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","Number","offMin","offMinSigned","is","asNumber","numericValue","isFinite","normalizeObject","normalizer","normalized","u","hours","sign","monthsLong","monthsShort","monthsNarrow","concat","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","narrow","units","years","quarters","weeks","days","seconds","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","_iterator","_createForOfIteratorHelperLoose","_step","done","token","literal","val","macroTokenToFormatOpts","D","Formats","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","c","charAt","test","formatOpts","systemLoc","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","p","signDisplay","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","isValid","meridiem","maybeMacro","slice","quarter","formatDurationFromString","dur","invertLargest","signMode","tokenToField","lildur","info","mapped","inversionFactor","isNegativeDuration","largestUnit","tokens","realTokens","found","collapsed","shiftTo","filter","durationInfo","values","ianaRegex","combineRegexes","_len","regexes","_key","full","source","combineExtractors","_len2","extractors","_key2","ex","mergedVals","mergedZone","cursor","_ex","parse","_len3","patterns","_key3","_i","_patterns","_patterns$_i","extractor","simpleParse","_len4","_key4","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","item","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","conf","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","previousVal","conv","rollUp","removeZeroes","newVals","_Object$entries","entries","_Object$entries$_i","_Symbol$for","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","_parseISODuration","fromISOTime","_parseISOTimeOnly","week","toFormat","fmtOpts","toHuman","showZeros","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","dateTime","toJSON","invalidReason","valueOf","duration","_i2","_orderedUnits","minus","negate","mapUnits","fn","_i3","_Object$keys","mixed","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","lastUnit","_i4","_orderedUnits2","own","ak","negated","_i5","_Object$keys2","removeZeros","eq","v1","v2","_i6","_orderedUnits3","Symbol","for","validateStartEnd","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","_split","startIsValid","endIsValid","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","isBefore","contains","splitAt","dateTimes","sorted","sort","b","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","_intervals$sort$reduc","sofar","final","xor","_Array$prototype","currentCount","ends","time","flattened","difference","toLocaleString","toISODate","dateFormat","_temp2","_ref3","_ref3$separator","separator","mapEndpoints","mapFn","Info","hasDST","proto","isUniversal","isValidIANAZone","_ref$locale","_ref$locObj","locObj","getMinimumDaysInFirstWeek","_ref2$locale","_ref2$locObj","getWeekendWeekdays","_temp3","_ref3$locale","_ref3$locObj","_temp4","_ref4","_ref4$locale","_ref4$numberingSystem","_ref4$locObj","_ref4$outputCalendar","monthsFormat","_temp5","_ref5","_ref5$locale","_ref5$numberingSystem","_ref5$locObj","_ref5$outputCalendar","_temp6","_ref6","_ref6$locale","_ref6$numberingSystem","_ref6$locObj","weekdaysFormat","_temp7","_ref7","_ref7$locale","_ref7$numberingSystem","_ref7$locObj","_temp8","_ref8","_ref8$locale","_temp9","_ref9","_ref9$locale","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","_differs","_differs$_i","differ","_highOrderDiffs","remainingMillis","lowerOrderUnits","_cursor$plus","_Duration$fromMillis","MISSING_FTP","intUnit","post","deser","NBSP","String","fromCharCode","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","partTypeStyleToTokenVal","short","long","dayperiod","dayPeriod","hour24","tokenForPart","resolvedOpts","isSpace","actualType","buildRegex","re","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","Z","q","M","G","y","S","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","TokenParser","disqualifyingUnit","_buildRegex","regexString","explainFromTokens","_match","rawMatches","parser","parseFromTokens","_explainFromTokens","formatter","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","_fixOffset","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","precision","longFormat","extendedZone","showSeconds","ianaName","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","guessOffsetForZone","zoneOffsetTs","offsetGuess","zoneOffsetGuessCache","quickDT","offsetProvis","_objToTS","diffRelative","calendary","lastOpts","argList","args","unchanged","ot","_zone","isLuxonDateTime","_lastOpts","_lastOpts2","fromJSDate","zoneToUse","fromSeconds","_usesLocalWeekValues","tsNow","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","_iterator2","_step2","higherOrderInvalid","gregorian","_objToTS2","tsFinal","offsetFinal","_parseISODate","fromRFC2822","_parseRFC2822Date","fromHTTP","_parseHTTPDate","fromFormat","_opts$locale","_opts$numberingSystem","localeToUse","_parseFromTokens","fromString","fromSQL","_parseSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","expanded","getPossibleOffsets","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","resolvedLocaleOptions","_Formatter$create$res","toLocal","_ref2$keepLocalTime","_ref2$keepCalendarTim","keepCalendarTime","newTS","asObj","_objToTS3","setLocale","_usesLocalWeekValues2","settingWeekStuff","_objToTS4","_ref4$useLocaleWeeks","normalizedUnit","endOf","_this$plus","toLocaleParts","_ref5$format","_ref5$suppressSeconds","_ref5$suppressMillise","_ref5$includeOffset","_ref5$extendedZone","_ref5$precision","ext","_ref6$format","_ref6$precision","toISOWeekDate","_ref7$suppressMillise","_ref7$suppressSeconds","_ref7$includeOffset","_ref7$includePrefix","_ref7$extendedZone","_ref7$format","_ref7$precision","toRFC2822","toHTTP","toSQLDate","toSQLTime","_ref8$includeOffset","_ref8$includeZone","includeZone","_ref8$includeOffsetSp","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","_options$locale","_options$numberingSys","fromStringExplain","buildFormatParser","_options2","_options2$locale","_options2$numberingSy","fromFormatParser","formatParser","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,QAAQ,EAAE;AACzD,IAAA,OAAOt/B,QAAQ,CAACmE,UAAU,CAACm7B,WAAW,CAAC,CAAA;AACzC,GAAC,MAAM;AACL,IAAA,MAAM,IAAInqC,oBAAoB,CAAA,6BAAA,GACEmqC,WAAW,GAAa,YAAA,GAAA,OAAOA,WAC/D,CAAC,CAAA;AACH,GAAA;AACF;;AC/hFMC,IAAAA,OAAO,GAAG;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/build/es6/luxon.mjs b/node_modules/luxon/build/es6/luxon.mjs new file mode 100644 index 00000000..06e1d6cb --- /dev/null +++ b/node_modules/luxon/build/es6/luxon.mjs @@ -0,0 +1,8133 @@ +// these aren't really private, but nor are they really useful to document + +/** + * @private + */ +class LuxonError extends Error {} + +/** + * @private + */ +class InvalidDateTimeError extends LuxonError { + constructor(reason) { + super(`Invalid DateTime: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class InvalidIntervalError extends LuxonError { + constructor(reason) { + super(`Invalid Interval: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class InvalidDurationError extends LuxonError { + constructor(reason) { + super(`Invalid Duration: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class ConflictingSpecificationError extends LuxonError {} + +/** + * @private + */ +class InvalidUnitError extends LuxonError { + constructor(unit) { + super(`Invalid unit ${unit}`); + } +} + +/** + * @private + */ +class InvalidArgumentError extends LuxonError {} + +/** + * @private + */ +class ZoneIsAbstractError extends LuxonError { + constructor() { + super("Zone is an abstract class"); + } +} + +/** + * @private + */ + +const n = "numeric", + s = "short", + l = "long"; + +const DATE_SHORT = { + year: n, + month: n, + day: n, +}; + +const DATE_MED = { + year: n, + month: s, + day: n, +}; + +const DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, +}; + +const DATE_FULL = { + year: n, + month: l, + day: n, +}; + +const DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l, +}; + +const TIME_SIMPLE = { + hour: n, + minute: n, +}; + +const TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n, +}; + +const TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s, +}; + +const TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l, +}; + +const TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23", +}; + +const TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", +}; + +const TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s, +}; + +const TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l, +}; + +const DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n, +}; + +const DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n, +}; + +const DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n, +}; + +const DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n, +}; + +const DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n, +}; + +const DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s, +}; + +const DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s, +}; + +const DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l, +}; + +const DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l, +}; + +/** + * @interface + */ +class Zone { + /** + * The type of zone + * @abstract + * @type {string} + */ + get type() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + get name() { + throw new ZoneIsAbstractError(); + } + + /** + * The IANA name of this zone. + * Defaults to `name` if not overwritten by a subclass. + * @abstract + * @type {string} + */ + get ianaName() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + get isUniversal() { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */ + offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */ + get isValid() { + throw new ZoneIsAbstractError(); + } +} + +let singleton$1 = null; + +/** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ +class SystemZone extends Zone { + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + static get instance() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + + /** @override **/ + get type() { + return "system"; + } + + /** @override **/ + get name() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName(ts, { format, locale }) { + return parseZoneInfo(ts, format, locale); + } + + /** @override **/ + formatOffset(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/ + offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/ + equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/ + get isValid() { + return true; + } +} + +const dtfCache = new Map(); +function makeDTF(zoneName) { + let dtf = dtfCache.get(zoneName); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zoneName, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short", + }); + dtfCache.set(zoneName, dtf); + } + return dtf; +} + +const typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6, +}; + +function hackyOffset(dtf, date) { + const formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; +} + +function partsOffset(dtf, date) { + const formatted = dtf.formatToParts(date); + const filled = []; + for (let i = 0; i < formatted.length; i++) { + const { type, value } = formatted[i]; + const pos = typeToPos[type]; + + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; +} + +const ianaZoneCache = new Map(); +/** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ +class IANAZone extends Zone { + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + static create(name) { + let zone = ianaZoneCache.get(name); + if (zone === undefined) { + ianaZoneCache.set(name, (zone = new IANAZone(name))); + } + return zone; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCache() { + ianaZoneCache.clear(); + dtfCache.clear(); + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead. + * @return {boolean} + */ + static isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */ + static isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { timeZone: zone }).format(); + return true; + } catch (e) { + return false; + } + } + + constructor(name) { + super(); + /** @private **/ + this.zoneName = name; + /** @private **/ + this.valid = IANAZone.isValidZone(name); + } + + /** + * The type of zone. `iana` for all instances of `IANAZone`. + * @override + * @type {string} + */ + get type() { + return "iana"; + } + + /** + * The name of this zone (i.e. the IANA zone name). + * @override + * @type {string} + */ + get name() { + return this.zoneName; + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns false for all IANA zones. + * @override + * @type {boolean} + */ + get isUniversal() { + return false; + } + + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @override + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + offsetName(ts, { format, locale }) { + return parseZoneInfo(ts, format, locale, this.name); + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @override + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */ + offset(ts) { + if (!this.valid) return NaN; + const date = new Date(ts); + + if (isNaN(date)) return NaN; + + const dtf = makeDTF(this.name); + let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts + ? partsOffset(dtf, date) + : hackyOffset(dtf, date); + + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + const adjustedHour = hour === 24 ? 0 : hour; + + const asUTC = objToLocalTS({ + year, + month, + day, + hour: adjustedHour, + minute, + second, + millisecond: 0, + }); + + let asTS = +date; + const over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** + * Return whether this Zone is equal to another zone + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** + * Return whether this Zone is valid. + * @override + * @type {boolean} + */ + get isValid() { + return this.valid; + } +} + +// todo - remap caching + +let intlLFCache = {}; +function getCachedLF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; +} + +const intlDTCache = new Map(); +function getCachedDTF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlDTCache.get(key); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache.set(key, dtf); + } + return dtf; +} + +const intlNumCache = new Map(); +function getCachedINF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let inf = intlNumCache.get(key); + if (inf === undefined) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache.set(key, inf); + } + return inf; +} + +const intlRelCache = new Map(); +function getCachedRTF(locString, opts = {}) { + const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options + const key = JSON.stringify([locString, cacheKeyOpts]); + let inf = intlRelCache.get(key); + if (inf === undefined) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache.set(key, inf); + } + return inf; +} + +let sysLocaleCache = null; +function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } +} + +const intlResolvedOptionsCache = new Map(); +function getCachedIntResolvedOptions(locString) { + let opts = intlResolvedOptionsCache.get(locString); + if (opts === undefined) { + opts = new Intl.DateTimeFormat(locString).resolvedOptions(); + intlResolvedOptionsCache.set(locString, opts); + } + return opts; +} + +const weekInfoCache = new Map(); +function getCachedWeekInfo(locString) { + let data = weekInfoCache.get(locString); + if (!data) { + const locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86 + if (!("minimalDays" in data)) { + data = { ...fallbackWeekSettings, ...data }; + } + weekInfoCache.set(locString, data); + } + return data; +} + +function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + const xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + + const uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + let options; + let selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + const smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + + const { numberingSystem, calendar } = options; + return [selectedStr, numberingSystem, calendar]; + } +} + +function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + + if (outputCalendar) { + localeStr += `-ca-${outputCalendar}`; + } + + if (numberingSystem) { + localeStr += `-nu-${numberingSystem}`; + } + return localeStr; + } else { + return localeStr; + } +} + +function mapMonths(f) { + const ms = []; + for (let i = 1; i <= 12; i++) { + const dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; +} + +function mapWeekdays(f) { + const ms = []; + for (let i = 1; i <= 7; i++) { + const dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; +} + +function listStuff(loc, length, englishFn, intlFn) { + const mode = loc.listingMode(); + + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } +} + +function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return ( + loc.numberingSystem === "latn" || + !loc.locale || + loc.locale.startsWith("en") || + getCachedIntResolvedOptions(loc.locale).numberingSystem === "latn" + ); + } +} + +/** + * @private + */ + +class PolyNumberFormatter { + constructor(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + + const { padTo, floor, ...otherOpts } = opts; + + if (!forceSimple || Object.keys(otherOpts).length > 0) { + const intlOpts = { useGrouping: false, ...opts }; + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + + format(i) { + if (this.inf) { + const fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + const fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(fixed, this.padTo); + } + } +} + +/** + * @private + */ + +class PolyDateFormatter { + constructor(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + + let z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + const gmtOffset = -1 * (dt.offset / 60); + const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ minutes: dt.offset }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ minutes: dt.offset }); + this.originalZone = dt.zone; + } + + const intlOpts = { ...this.opts }; + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + + format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts() + .map(({ value }) => value) + .join(""); + } + return this.dtf.format(this.dt.toJSDate()); + } + + formatToParts() { + const parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map((part) => { + if (part.type === "timeZoneName") { + const offsetName = this.originalZone.offsetName(this.dt.ts, { + locale: this.dt.locale, + format: this.opts.timeZoneName, + }); + return { + ...part, + value: offsetName, + }; + } else { + return part; + } + }); + } + return parts; + } + + resolvedOptions() { + return this.dtf.resolvedOptions(); + } +} + +/** + * @private + */ +class PolyRelFormatter { + constructor(intl, isEnglish, opts) { + this.opts = { style: "long", ...opts }; + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + + format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + } + + formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + } +} + +const fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7], +}; + +/** + * @private + */ +class Locale { + static fromOpts(opts) { + return Locale.create( + opts.locale, + opts.numberingSystem, + opts.outputCalendar, + opts.weekSettings, + opts.defaultToEN + ); + } + + static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) { + const specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats + const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + } + + static resetCache() { + sysLocaleCache = null; + intlDTCache.clear(); + intlNumCache.clear(); + intlRelCache.clear(); + intlResolvedOptionsCache.clear(); + weekInfoCache.clear(); + } + + static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) { + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + } + + constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale); + + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + + this.weekdaysCache = { format: {}, standalone: {} }; + this.monthsCache = { format: {}, standalone: {} }; + this.meridiemCache = null; + this.eraCache = {}; + + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + + get fastNumbers() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + + return this.fastNumbersCached; + } + + listingMode() { + const isActuallyEn = this.isEnglish(); + const hasNoWeirdness = + (this.numberingSystem === null || this.numberingSystem === "latn") && + (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + } + + clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create( + alts.locale || this.specifiedLocale, + alts.numberingSystem || this.numberingSystem, + alts.outputCalendar || this.outputCalendar, + validateWeekSettings(alts.weekSettings) || this.weekSettings, + alts.defaultToEN || false + ); + } + } + + redefaultToEN(alts = {}) { + return this.clone({ ...alts, defaultToEN: true }); + } + + redefaultToSystem(alts = {}) { + return this.clone({ ...alts, defaultToEN: false }); + } + + months(length, format = false) { + return listStuff(this, length, months, () => { + // Workaround for "ja" locale: formatToParts does not label all parts of the month + // as "month" and for this locale there is no difference between "format" and "non-format". + // As such, just use format() instead of formatToParts() and take the whole string + const monthSpecialCase = this.intl === "ja" || this.intl.startsWith("ja-"); + format &= !monthSpecialCase; + const intl = format ? { month: length, day: "numeric" } : { month: length }, + formatStr = format ? "format" : "standalone"; + if (!this.monthsCache[formatStr][length]) { + const mapper = !monthSpecialCase + ? (dt) => this.extract(dt, intl, "month") + : (dt) => this.dtFormatter(dt, intl).format(); + this.monthsCache[formatStr][length] = mapMonths(mapper); + } + return this.monthsCache[formatStr][length]; + }); + } + + weekdays(length, format = false) { + return listStuff(this, length, weekdays, () => { + const intl = format + ? { weekday: length, year: "numeric", month: "long", day: "numeric" } + : { weekday: length }, + formatStr = format ? "format" : "standalone"; + if (!this.weekdaysCache[formatStr][length]) { + this.weekdaysCache[formatStr][length] = mapWeekdays((dt) => + this.extract(dt, intl, "weekday") + ); + } + return this.weekdaysCache[formatStr][length]; + }); + } + + meridiems() { + return listStuff( + this, + undefined, + () => meridiems, + () => { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!this.meridiemCache) { + const intl = { hour: "numeric", hourCycle: "h12" }; + this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map( + (dt) => this.extract(dt, intl, "dayperiod") + ); + } + + return this.meridiemCache; + } + ); + } + + eras(length) { + return listStuff(this, length, eras, () => { + const intl = { era: length }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!this.eraCache[length]) { + this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) => + this.extract(dt, intl, "era") + ); + } + + return this.eraCache[length]; + }); + } + + extract(dt, intlOpts, field) { + const df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find((m) => m.type.toLowerCase() === field); + return matching ? matching.value : null; + } + + numberFormatter(opts = {}) { + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + } + + dtFormatter(dt, intlOpts = {}) { + return new PolyDateFormatter(dt, this.intl, intlOpts); + } + + relFormatter(opts = {}) { + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + } + + listFormatter(opts = {}) { + return getCachedLF(this.intl, opts); + } + + isEnglish() { + return ( + this.locale === "en" || + this.locale.toLowerCase() === "en-us" || + getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us") + ); + } + + getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + } + + getStartOfWeek() { + return this.getWeekSettings().firstDay; + } + + getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + } + + getWeekendDays() { + return this.getWeekSettings().weekend; + } + + equals(other) { + return ( + this.locale === other.locale && + this.numberingSystem === other.numberingSystem && + this.outputCalendar === other.outputCalendar + ); + } + + toString() { + return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`; + } +} + +let singleton = null; + +/** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ +class FixedOffsetZone extends Zone { + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + static get utcInstance() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + static instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */ + static parseSpecifier(s) { + if (s) { + const r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + } + + constructor(offset) { + super(); + /** @private **/ + this.fixed = offset; + } + + /** + * The type of zone. `fixed` for all instances of `FixedOffsetZone`. + * @override + * @type {string} + */ + get type() { + return "fixed"; + } + + /** + * The name of this zone. + * All fixed zones' names always start with "UTC" (plus optional offset) + * @override + * @type {string} + */ + get name() { + return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`; + } + + /** + * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn` + * + * @override + * @type {string} + */ + get ianaName() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`; + } + } + + /** + * Returns the offset's common name at the specified timestamp. + * + * For fixed offset zones this equals to the zone name. + * @override + */ + offsetName() { + return this.name; + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format) { + return formatOffset(this.fixed, format); + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns true for all fixed offset zones. + * @override + * @type {boolean} + */ + get isUniversal() { + return true; + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * + * For fixed offset zones, this is constant and does not depend on a timestamp. + * @override + * @return {number} + */ + offset() { + return this.fixed; + } + + /** + * Return whether this Zone is equal to another zone (i.e. also fixed and same offset) + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** + * Return whether this Zone is valid: + * All fixed offset zones are valid. + * @override + * @type {boolean} + */ + get isValid() { + return true; + } +} + +/** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ +class InvalidZone extends Zone { + constructor(zoneName) { + super(); + /** @private */ + this.zoneName = zoneName; + } + + /** @override **/ + get type() { + return "invalid"; + } + + /** @override **/ + get name() { + return this.zoneName; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName() { + return null; + } + + /** @override **/ + formatOffset() { + return ""; + } + + /** @override **/ + offset() { + return NaN; + } + + /** @override **/ + equals() { + return false; + } + + /** @override **/ + get isValid() { + return false; + } +} + +/** + * @private + */ + +function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + const lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone; + else if (lowered === "local" || lowered === "system") return SystemZone.instance; + else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance; + else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } +} + +const numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d", +}; + +const numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881], +}; + +const hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); + +function parseDigits(str) { + let value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (const key in numberingSystemsUTF16) { + const [min, max] = numberingSystemsUTF16[key]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } +} + +// cache of {numberingSystem: {append: regex}} +const digitRegexCache = new Map(); +function resetDigitRegexCache() { + digitRegexCache.clear(); +} + +function digitRegex({ numberingSystem }, append = "") { + const ns = numberingSystem || "latn"; + + let appendCache = digitRegexCache.get(ns); + if (appendCache === undefined) { + appendCache = new Map(); + digitRegexCache.set(ns, appendCache); + } + let regex = appendCache.get(append); + if (regex === undefined) { + regex = new RegExp(`${numberingSystems[ns]}${append}`); + appendCache.set(append, regex); + } + + return regex; +} + +let now = () => Date.now(), + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + +/** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ +class Settings { + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + static get now() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */ + static set now(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + static set defaultZone(zone) { + defaultZone = zone; + } + + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + static get defaultZone() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultLocale() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultLocale(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultNumberingSystem() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultNumberingSystem(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultOutputCalendar() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultOutputCalendar(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + static get defaultWeekSettings() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */ + static set defaultWeekSettings(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + */ + static get twoDigitCutoffYear() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century + * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */ + static set twoDigitCutoffYear(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static get throwOnInvalid() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static set throwOnInvalid(t) { + throwOnInvalid = t; + } + + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + DateTime.resetCache(); + resetDigitRegexCache(); + } +} + +class Invalid { + constructor(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + + toMessage() { + if (this.explanation) { + return `${this.reason}: ${this.explanation}`; + } else { + return this.reason; + } + } +} + +const nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; + +function unitOutOfRange(unit, value) { + return new Invalid( + "unit out of range", + `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid` + ); +} + +function dayOfWeek(year, month, day) { + const d = new Date(Date.UTC(year, month - 1, day)); + + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + + const js = d.getUTCDay(); + + return js === 0 ? 7 : js; +} + +function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; +} + +function uncomputeOrdinal(year, ordinal) { + const table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex((i) => i < ordinal), + day = ordinal - table[month0]; + return { month: month0 + 1, day }; +} + +function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return ((isoWeekday - startOfWeek + 7) % 7) + 1; +} + +/** + * @private + */ + +function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) { + const { year, month, day } = gregObj, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + + let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + + return { weekYear, weekNumber, weekday, ...timeObject(gregObj) }; +} + +function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) { + const { weekYear, weekNumber, weekday } = weekData, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + + let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + + const { month, day } = uncomputeOrdinal(year, ordinal); + return { year, month, day, ...timeObject(weekData) }; +} + +function gregorianToOrdinal(gregData) { + const { year, month, day } = gregData; + const ordinal = computeOrdinal(year, month, day); + return { year, ordinal, ...timeObject(gregData) }; +} + +function ordinalToGregorian(ordinalData) { + const { year, ordinal } = ordinalData; + const { month, day } = uncomputeOrdinal(year, ordinal); + return { year, month, day, ...timeObject(ordinalData) }; +} + +/** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ +function usesLocalWeekValues(obj, loc) { + const hasLocaleWeekData = + !isUndefined(obj.localWeekday) || + !isUndefined(obj.localWeekNumber) || + !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + const hasIsoWeekData = + !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + + if (hasIsoWeekData) { + throw new ConflictingSpecificationError( + "Cannot mix locale-based week fields with ISO-based week fields" + ); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek(), + }; + } else { + return { minDaysInFirstWeek: 4, startOfWeek: 1 }; + } +} + +function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) { + const validYear = isInteger(obj.weekYear), + validWeek = integerBetween( + obj.weekNumber, + 1, + weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek) + ), + validWeekday = integerBetween(obj.weekday, 1, 7); + + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; +} + +function hasInvalidOrdinalData(obj) { + const validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; +} + +function hasInvalidGregorianData(obj) { + const validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; +} + +function hasInvalidTimeData(obj) { + const { hour, minute, second, millisecond } = obj; + const validHour = + integerBetween(hour, 0, 23) || + (hour === 24 && minute === 0 && second === 0 && millisecond === 0), + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; +} + +/* + This is just a junk drawer, containing anything used across multiple classes. + Because Luxon is small(ish), this should stay small and we won't worry about splitting + it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area. +*/ + +/** + * @private + */ + +// TYPES + +function isUndefined(o) { + return typeof o === "undefined"; +} + +function isNumber(o) { + return typeof o === "number"; +} + +function isInteger(o) { + return typeof o === "number" && o % 1 === 0; +} + +function isString(o) { + return typeof o === "string"; +} + +function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; +} + +// CAPABILITIES + +function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } +} + +function hasLocaleWeekInfo() { + try { + return ( + typeof Intl !== "undefined" && + !!Intl.Locale && + ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype) + ); + } catch (e) { + return false; + } +} + +// OBJECTS AND ARRAYS + +function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; +} + +function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce((best, next) => { + const pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; +} + +function pick(obj, keys) { + return keys.reduce((a, k) => { + a[k] = obj[k]; + return a; + }, {}); +} + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if ( + !integerBetween(settings.firstDay, 1, 7) || + !integerBetween(settings.minimalDays, 1, 7) || + !Array.isArray(settings.weekend) || + settings.weekend.some((v) => !integerBetween(v, 1, 7)) + ) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend), + }; + } +} + +// NUMBERS AND STRINGS + +function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; +} + +// x % n but takes the sign of n instead of x +function floorMod(x, n) { + return x - n * Math.floor(x / n); +} + +function padStart(input, n = 2) { + const isNeg = input < 0; + let padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; +} + +function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } +} + +function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } +} + +function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + const f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } +} + +function roundTo(number, digits, rounding = "round") { + const factor = 10 ** digits; + switch (rounding) { + case "expand": + return number > 0 + ? Math.ceil(number * factor) / factor + : Math.floor(number * factor) / factor; + case "trunc": + return Math.trunc(number * factor) / factor; + case "round": + return Math.round(number * factor) / factor; + case "floor": + return Math.floor(number * factor) / factor; + case "ceil": + return Math.ceil(number * factor) / factor; + default: + throw new RangeError(`Value rounding ${rounding} is out of range`); + } +} + +// DATE BASICS + +function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} + +function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; +} + +function daysInMonth(year, month) { + const modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } +} + +// convert a calendar object to a local timestamp (epoch, but with the offset baked in) +function objToLocalTS(obj) { + let d = Date.UTC( + obj.year, + obj.month - 1, + obj.day, + obj.hour, + obj.minute, + obj.second, + obj.millisecond + ); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; +} + +// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js +function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; +} + +function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) { + const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; +} + +function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; +} + +// PARSING + +function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) { + const date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + }; + + if (timeZone) { + intlOpts.timeZone = timeZone; + } + + const modified = { timeZoneName: offsetFormat, ...intlOpts }; + + const parsed = new Intl.DateTimeFormat(locale, modified) + .formatToParts(date) + .find((m) => m.type.toLowerCase() === "timezonename"); + return parsed ? parsed.value : null; +} + +// signedOffset('-5', '30') -> -330 +function signedOffset(offHourStr, offMinuteStr) { + let offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + + const offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; +} + +// COERCION + +function asNumber(value) { + const numericValue = Number(value); + if (typeof value === "boolean" || value === "" || !Number.isFinite(numericValue)) + throw new InvalidArgumentError(`Invalid unit value ${value}`); + return numericValue; +} + +function normalizeObject(obj, normalizer) { + const normalized = {}; + for (const u in obj) { + if (hasOwnProperty(obj, u)) { + const v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; +} + +/** + * Returns the offset's value as a string + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ +function formatOffset(offset, format) { + const hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + + switch (format) { + case "short": + return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`; + case "narrow": + return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`; + case "techie": + return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`; + default: + throw new RangeError(`Value format ${format} is out of range for property format`); + } +} + +function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); +} + +/** + * @private + */ + +const monthsLong = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", +]; + +const monthsShort = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", +]; + +const monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; + +function months(length) { + switch (length) { + case "narrow": + return [...monthsNarrow]; + case "short": + return [...monthsShort]; + case "long": + return [...monthsLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } +} + +const weekdaysLong = [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday", +]; + +const weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; + +const weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; + +function weekdays(length) { + switch (length) { + case "narrow": + return [...weekdaysNarrow]; + case "short": + return [...weekdaysShort]; + case "long": + return [...weekdaysLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } +} + +const meridiems = ["AM", "PM"]; + +const erasLong = ["Before Christ", "Anno Domini"]; + +const erasShort = ["BC", "AD"]; + +const erasNarrow = ["B", "A"]; + +function eras(length) { + switch (length) { + case "narrow": + return [...erasNarrow]; + case "short": + return [...erasShort]; + case "long": + return [...erasLong]; + default: + return null; + } +} + +function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; +} + +function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; +} + +function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; +} + +function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; +} + +function formatRelativeTime(unit, count, numeric = "always", narrow = false) { + const units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."], + }; + + const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + + if (numeric === "auto" && lastable) { + const isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : `next ${units[unit][0]}`; + case -1: + return isDay ? "yesterday" : `last ${units[unit][0]}`; + case 0: + return isDay ? "today" : `this ${units[unit][0]}`; + } + } + + const isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow + ? singular + ? lilUnits[1] + : lilUnits[2] || lilUnits[1] + : singular + ? units[unit][0] + : unit; + return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`; +} + +function stringifyTokens(splits, tokenToString) { + let s = ""; + for (const token of splits) { + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; +} + +const macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS, +}; + +/** + * @private + */ + +class Formatter { + static create(locale, opts = {}) { + return new Formatter(locale, opts); + } + + static parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + let current = null, + currentFull = "", + bracketed = false; + const splits = []; + for (let i = 0; i < fmt.length; i++) { + const c = fmt.charAt(i); + if (c === "'") { + // turn '' into a literal signal quote instead of just skipping the empty literal + if (currentFull.length > 0 || bracketed) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull === "" ? "'" : currentFull, + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ literal: /^\s+$/.test(currentFull), val: currentFull }); + } + currentFull = c; + current = c; + } + } + + if (currentFull.length > 0) { + splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull }); + } + + return splits; + } + + static macroTokenToFormatOpts(token) { + return macroTokenToFormatOpts[token]; + } + + constructor(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + + formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts }); + return df.format(); + } + + dtFormatter(dt, opts = {}) { + return this.loc.dtFormatter(dt, { ...this.opts, ...opts }); + } + + formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + } + + formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + } + + formatInterval(interval, opts) { + const df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + } + + resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + } + + num(n, p = 0, signDisplay = undefined) { + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + + const opts = { ...this.opts }; + + if (p > 0) { + opts.padTo = p; + } + if (signDisplay) { + opts.signDisplay = signDisplay; + } + + return this.loc.numberFormatter(opts).format(n); + } + + formatDateTimeFromString(dt, fmt) { + const knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = (opts, extract) => this.loc.extract(dt, opts, extract), + formatOffset = (opts) => { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = () => + knownEnglish + ? meridiemForDateTime(dt) + : string({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), + month = (length, standalone) => + knownEnglish + ? monthForDateTime(dt, length) + : string(standalone ? { month: length } : { month: length, day: "numeric" }, "month"), + weekday = (length, standalone) => + knownEnglish + ? weekdayForDateTime(dt, length) + : string( + standalone ? { weekday: length } : { weekday: length, month: "long", day: "numeric" }, + "weekday" + ), + maybeMacro = (token) => { + const formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = (length) => + knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, "era"), + tokenToString = (token) => { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return this.num(dt.millisecond, 3); + // seconds + case "s": + return this.num(dt.second); + case "ss": + return this.num(dt.second, 2); + // fractional seconds + case "uu": + return this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return this.num(dt.minute); + case "mm": + return this.num(dt.minute, 2); + // hours + case "h": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return this.num(dt.hour); + case "HH": + return this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ format: "narrow", allowZ: this.opts.allowZ }); + case "ZZ": + // like +06:00 + return formatOffset({ format: "short", allowZ: this.opts.allowZ }); + case "ZZZ": + // like +0600 + return formatOffset({ format: "techie", allowZ: this.opts.allowZ }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ day: "numeric" }, "day") : this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ day: "2-digit" }, "day") : this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter + ? string({ month: "numeric", day: "numeric" }, "month") + : this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter + ? string({ month: "2-digit", day: "numeric" }, "month") + : this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter + ? string({ month: "numeric" }, "month") + : this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter + ? string({ month: "2-digit" }, "month") + : this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter + ? string({ year: "2-digit" }, "year") + : this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter + ? string({ year: "numeric" }, "year") + : this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter + ? string({ year: "numeric" }, "year") + : this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return this.num(dt.weekYear, 4); + case "W": + return this.num(dt.weekNumber); + case "WW": + return this.num(dt.weekNumber, 2); + case "n": + return this.num(dt.localWeekNumber); + case "nn": + return this.num(dt.localWeekNumber, 2); + case "ii": + return this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return this.num(dt.localWeekYear, 4); + case "o": + return this.num(dt.ordinal); + case "ooo": + return this.num(dt.ordinal, 3); + case "q": + // like 1 + return this.num(dt.quarter); + case "qq": + // like 01 + return this.num(dt.quarter, 2); + case "X": + return this.num(Math.floor(dt.ts / 1000)); + case "x": + return this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + } + + formatDurationFromString(dur, fmt) { + const invertLargest = this.opts.signMode === "negativeLargestOnly" ? -1 : 1; + const tokenToField = (token) => { + switch (token[0]) { + case "S": + return "milliseconds"; + case "s": + return "seconds"; + case "m": + return "minutes"; + case "h": + return "hours"; + case "d": + return "days"; + case "w": + return "weeks"; + case "M": + return "months"; + case "y": + return "years"; + default: + return null; + } + }, + tokenToString = (lildur, info) => (token) => { + const mapped = tokenToField(token); + if (mapped) { + const inversionFactor = + info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1; + let signDisplay; + if (this.opts.signMode === "negativeLargestOnly" && mapped !== info.largestUnit) { + signDisplay = "never"; + } else if (this.opts.signMode === "all") { + signDisplay = "always"; + } else { + // "auto" and "negative" are the same, but "auto" has better support + signDisplay = "auto"; + } + return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay); + } else { + return token; + } + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce( + (found, { literal, val }) => (literal ? found : found.concat(val)), + [] + ), + collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)), + durationInfo = { + isNegativeDuration: collapsed < 0, + // this relies on "collapsed" being based on "shiftTo", which builds up the object + // in order + largestUnit: Object.keys(collapsed.values)[0], + }; + return stringifyTokens(tokens, tokenToString(collapsed, durationInfo)); + } +} + +/* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + +const ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; + +function combineRegexes(...regexes) { + const full = regexes.reduce((f, r) => f + r.source, ""); + return RegExp(`^${full}$`); +} + +function combineExtractors(...extractors) { + return (m) => + extractors + .reduce( + ([mergedVals, mergedZone, cursor], ex) => { + const [val, zone, next] = ex(m, cursor); + return [{ ...mergedVals, ...val }, zone || mergedZone, next]; + }, + [{}, null, 1] + ) + .slice(0, 2); +} + +function parse(s, ...patterns) { + if (s == null) { + return [null, null]; + } + + for (const [regex, extractor] of patterns) { + const m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; +} + +function simpleParse(...keys) { + return (match, cursor) => { + const ret = {}; + let i; + + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; +} + +// ISO and SQL parsing +const offsetRegex = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/; +const isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`; +const isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; +const isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`); +const isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`); +const isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; +const isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; +const isoOrdinalRegex = /(\d{4})-?(\d{3})/; +const extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); +const extractISOOrdinalData = simpleParse("year", "ordinal"); +const sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one +const sqlTimeRegex = RegExp( + `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?` +); +const sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`); + +function int(match, pos, fallback) { + const m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); +} + +function extractISOYmd(match, cursor) { + const item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1), + }; + + return [item, null, cursor + 3]; +} + +function extractISOTime(match, cursor) { + const item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]), + }; + + return [item, null, cursor + 4]; +} + +function extractISOOffset(match, cursor) { + const local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; +} + +function extractIANAZone(match, cursor) { + const zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; +} + +// ISO time parsing + +const isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`); + +// ISO duration parsing + +const isoDuration = + /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; + +function extractISODuration(match) { + const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = + match; + + const hasNegativePrefix = s[0] === "-"; + const negativeSeconds = secondStr && secondStr[0] === "-"; + + const maybeNegate = (num, force = false) => + num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num; + + return [ + { + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds), + }, + ]; +} + +// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York +// and not just that we're in -240 *right now*. But since I don't think these are used that often +// I'm just going to ignore that +const obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60, +}; + +function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + const result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr), + }; + + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = + weekdayStr.length > 3 + ? weekdaysLong.indexOf(weekdayStr) + 1 + : weekdaysShort.indexOf(weekdayStr) + 1; + } + + return result; +} + +// RFC 2822/5322 +const rfc2822 = + /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; + +function extractRFC2822(match) { + const [ + , + weekdayStr, + dayStr, + monthStr, + yearStr, + hourStr, + minuteStr, + secondStr, + obsOffset, + milOffset, + offHourStr, + offMinuteStr, + ] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + + let offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + + return [result, new FixedOffsetZone(offset)]; +} + +function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s + .replace(/\([^()]*\)|[\n\t]/g, " ") + .replace(/(\s\s+)/g, " ") + .trim(); +} + +// http date + +const rfc1123 = + /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = + /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = + /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; + +function extractRFC1123Or850(match) { + const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} + +function extractASCII(match) { + const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} + +const isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); +const isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); +const isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); +const isoTimeCombinedRegex = combineRegexes(isoTimeRegex); + +const extractISOYmdTimeAndOffset = combineExtractors( + extractISOYmd, + extractISOTime, + extractISOOffset, + extractIANAZone +); +const extractISOWeekTimeAndOffset = combineExtractors( + extractISOWeekData, + extractISOTime, + extractISOOffset, + extractIANAZone +); +const extractISOOrdinalDateAndTime = combineExtractors( + extractISOOrdinalData, + extractISOTime, + extractISOOffset, + extractIANAZone +); +const extractISOTimeAndOffset = combineExtractors( + extractISOTime, + extractISOOffset, + extractIANAZone +); + +/* + * @private + */ + +function parseISODate(s) { + return parse( + s, + [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], + [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], + [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], + [isoTimeCombinedRegex, extractISOTimeAndOffset] + ); +} + +function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); +} + +function parseHTTPDate(s) { + return parse( + s, + [rfc1123, extractRFC1123Or850], + [rfc850, extractRFC1123Or850], + [ascii, extractASCII] + ); +} + +function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); +} + +const extractISOTimeOnly = combineExtractors(extractISOTime); + +function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); +} + +const sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); +const sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); + +const extractISOTimeOffsetAndIANAZone = combineExtractors( + extractISOTime, + extractISOOffset, + extractIANAZone +); + +function parseSQL(s) { + return parse( + s, + [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], + [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone] + ); +} + +const INVALID$2 = "Invalid Duration"; + +// unit conversion constants +const lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000, + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000, + }, + hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 }, + minutes: { seconds: 60, milliseconds: 60 * 1000 }, + seconds: { milliseconds: 1000 }, + }, + casualMatrix = { + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000, + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000, + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000, + }, + + ...lowOrderMatrix, + }, + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = { + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000, + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: (daysInYearAccurate * 24) / 4, + minutes: (daysInYearAccurate * 24 * 60) / 4, + seconds: (daysInYearAccurate * 24 * 60 * 60) / 4, + milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4, + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000, + }, + ...lowOrderMatrix, + }; + +// units ordered by size +const orderedUnits$1 = [ + "years", + "quarters", + "months", + "weeks", + "days", + "hours", + "minutes", + "seconds", + "milliseconds", +]; + +const reverseUnits = orderedUnits$1.slice(0).reverse(); + +// clone really means "create another instance just like this one, but with these changes" +function clone$1(dur, alts, clear = false) { + // deep merge for vals + const conf = { + values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) }, + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix, + }; + return new Duration(conf); +} + +function durationToMillis(matrix, vals) { + let sum = vals.milliseconds ?? 0; + for (const unit of reverseUnits.slice(1)) { + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; +} + +// NB: mutates parameters +function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + + orderedUnits$1.reduceRight((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + const previousVal = vals[previous] * factor; + const conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + const rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + const fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); +} + +// Remove all properties with a value of 0 from an object +function removeZeroes(vals) { + const newVals = {}; + for (const [key, value] of Object.entries(vals)) { + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; +} + +/** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ +class Duration { + /** + * @private + */ + constructor(config) { + const accurate = config.conversionAccuracy === "longterm" || false; + let matrix = accurate ? accurateMatrix : casualMatrix; + + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + static fromMillis(count, opts) { + return Duration.fromObject({ milliseconds: count }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */ + static fromObject(obj, opts = {}) { + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError( + `Duration.fromObject: argument expected to be an object, got ${ + obj === null ? "null" : typeof obj + }` + ); + } + + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix, + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */ + static fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError( + `Unknown duration argument ${durationLike} of type ${typeof durationLike}` + ); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */ + static fromISO(text, opts) { + const [parsed] = parseISODuration(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */ + static fromISOTime(text, opts) { + const [parsed] = parseISOTimeOnly(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ invalid }); + } + } + + /** + * @private + */ + static normalizeUnit(unit) { + const normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds", + }[unit ? unit.toLowerCase() : unit]; + + if (!normalized) throw new InvalidUnitError(unit); + + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDuration(o) { + return (o && o.isLuxonDuration) || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat("d s", { signMode: "all" }) //=> "+6 +2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "all" }) //=> "-6 -2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "negativeLargestOnly" }) //=> "-6 2" + * @return {string} + */ + toFormat(fmt, opts = {}) { + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + const fmtOpts = { + ...opts, + floor: opts.round !== false && opts.floor !== false, + }; + return this.isValid + ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) + : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero + * @example + * ```js + * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 mth, 0 wks, 5 hr, 6 min' + * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes' + * ``` + */ + toHuman(opts = {}) { + if (!this.isValid) return INVALID$2; + + const showZeros = opts.showZeros !== false; + + const l = orderedUnits$1 + .map((unit) => { + const val = this.values[unit]; + if (isUndefined(val) || (val === 0 && !showZeros)) { + return null; + } + return this.loc + .numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit.slice(0, -1) }) + .format(val); + }) + .filter((n) => n); + + return this.loc + .listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts }) + .format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */ + toObject() { + if (!this.isValid) return {}; + return { ...this.values }; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */ + toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + + let s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) + s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */ + toISOTime(opts = {}) { + if (!this.isValid) return null; + + const millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + + opts = { + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended", + ...opts, + includeOffset: false, + }; + + const dateTime = DateTime.fromMillis(millis, { zone: "UTC" }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */ + toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `Duration { values: ${JSON.stringify(this.values)} }`; + } else { + return `Duration { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */ + toMillis() { + if (!this.isValid) return NaN; + + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + plus(duration) { + if (!this.isValid) return this; + + const dur = Duration.fromDurationLike(duration), + result = {}; + + for (const k of orderedUnits$1) { + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + + return clone$1(this, { values: result }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + minus(duration) { + if (!this.isValid) return this; + + const dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */ + mapUnits(fn) { + if (!this.isValid) return this; + const result = {}; + for (const k of Object.keys(this.values)) { + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { values: result }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */ + get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */ + set(values) { + if (!this.isValid) return this; + + const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) }; + return clone$1(this, { values: mixed }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */ + reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) { + const loc = this.loc.clone({ locale, numberingSystem }); + const opts = { loc, matrix, conversionAccuracy }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */ + as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */ + normalize() { + if (!this.isValid) return this; + const vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { values: vals }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */ + rescale() { + if (!this.isValid) return this; + const vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { values: vals }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */ + shiftTo(...units) { + if (!this.isValid) return this; + + if (units.length === 0) { + return this; + } + + units = units.map((u) => Duration.normalizeUnit(u)); + + const built = {}, + accumulated = {}, + vals = this.toObject(); + let lastUnit; + + for (const k of orderedUnits$1) { + if (units.indexOf(k) >= 0) { + lastUnit = k; + + let own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (const ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + const i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (const key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += + key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + + normalizeValues(this.matrix, built); + return clone$1(this, { values: built }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */ + shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo( + "years", + "months", + "weeks", + "days", + "hours", + "minutes", + "seconds", + "milliseconds" + ); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */ + negate() { + if (!this.isValid) return this; + const negated = {}; + for (const k of Object.keys(this.values)) { + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { values: negated }, true); + } + + /** + * Removes all units with values equal to 0 from this Duration. + * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 } + * @return {Duration} + */ + removeZeros() { + if (!this.isValid) return this; + const vals = removeZeroes(this.values); + return clone$1(this, { values: vals }, true); + } + + /** + * Get the years. + * @type {number} + */ + get years() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + get quarters() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + get months() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + get weeks() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + get days() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + get hours() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + get minutes() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + get seconds() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + get milliseconds() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + get isValid() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + + if (!this.loc.equals(other.loc)) { + return false; + } + + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + + for (const u of orderedUnits$1) { + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + } +} + +const INVALID$1 = "Invalid Interval"; + +// checks if the start is equal to or before the end +function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid( + "end before start", + `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}` + ); + } else { + return null; + } +} + +/** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ +class Interval { + /** + * @private + */ + constructor(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ invalid }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */ + static fromDateTimes(start, end) { + const builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + + const validateError = validateStartEnd(builtStart, builtEnd); + + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd, + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static after(start, duration) { + const dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static before(end, duration) { + const dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */ + static fromISO(text, opts) { + const [s, e] = (text || "").split("/", 2); + if (s && e) { + let start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + + let end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + + if (startIsValid) { + const dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + const dur = Duration.fromISO(s, opts); + if (dur.isValid) { + return Interval.before(end, dur); + } + } + } + return Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isInterval(o) { + return (o && o.isLuxonInterval) || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */ + get start() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval. This is the first instant which is not part of the interval + * (Interval is half-open). + * @type {DateTime} + */ + get end() { + return this.isValid ? this.e : null; + } + + /** + * Returns the last DateTime included in the interval (since end is not part of the interval) + * @type {DateTime} + */ + get lastDateTime() { + return this.isValid ? (this.e ? this.e.minus(1) : null) : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + get isValid() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + length(unit = "milliseconds") { + return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */ + count(unit = "milliseconds", opts) { + if (!this.isValid) return NaN; + const start = this.start.startOf(unit, opts); + let end; + if (opts?.useLocaleWeeks) { + end = this.end.reconfigure({ locale: start.locale }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */ + hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */ + isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */ + set({ start, end } = {}) { + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */ + splitAt(...dateTimes) { + if (!this.isValid) return []; + const sorted = dateTimes + .map(friendlyDateTime) + .filter((d) => this.contains(d)) + .sort((a, b) => a.toMillis() - b.toMillis()), + results = []; + let { s } = this, + i = 0; + + while (s < this.e) { + const added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */ + splitBy(duration) { + const dur = Duration.fromDurationLike(duration); + + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + + let { s } = this, + idx = 1, + next; + + const results = []; + while (s < this.e) { + const added = this.start.plus(dur.mapUnits((x) => x * idx)); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */ + divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */ + overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */ + abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */ + abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise. + * @param {Interval} other + * @return {boolean} + */ + engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */ + intersection(other) { + if (!this.isValid) return this; + const s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */ + union(other) { + if (!this.isValid) return this; + const s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into an equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval + * and ending with the latest. + * + * @param {Array} intervals + * @return {Array} + */ + static merge(intervals) { + const [found, final] = intervals + .sort((a, b) => a.s - b.s) + .reduce( + ([sofar, current], item) => { + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, + [[], null] + ); + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */ + static xor(intervals) { + let start = null, + currentCount = 0; + const results = [], + ends = intervals.map((i) => [ + { time: i.s, type: "s" }, + { time: i.e, type: "e" }, + ]), + flattened = Array.prototype.concat(...ends), + arr = flattened.sort((a, b) => a.time - b.time); + + for (const i of arr) { + currentCount += i.type === "s" ? 1 : -1; + + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + + start = null; + } + } + + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */ + difference(...intervals) { + return Interval.xor([this].concat(intervals)) + .map((i) => this.intersection(i)) + .filter((i) => i && !i.isEmpty()); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */ + toString() { + if (!this.isValid) return INVALID$1; + return `[${this.s.toISO()} – ${this.e.toISO()})`; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`; + } else { + return `Interval { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid + ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) + : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISO(opts) { + if (!this.isValid) return INVALID$1; + return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`; + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */ + toISODate() { + if (!this.isValid) return INVALID$1; + return `${this.s.toISODate()}/${this.e.toISODate()}`; + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */ + toFormat(dateFormat, { separator = " – " } = {}) { + if (!this.isValid) return INVALID$1; + return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */ + toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */ + mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + } +} + +/** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ +class Info { + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + static hasDST(zone = Settings.defaultZone) { + const proto = DateTime.now().setZone(zone).set({ month: 12 }); + + return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */ + static isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */ + static normalizeZone(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */ + static getStartOfWeek({ locale = null, locObj = null } = {}) { + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */ + static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) { + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */ + static getWeekendWeekdays({ locale = null, locObj = null } = {}) { + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */ + static months( + length = "long", + { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {} + ) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */ + static monthsFormat( + length = "long", + { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {} + ) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */ + static weekdays(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */ + static weekdaysFormat( + length = "long", + { locale = null, numberingSystem = null, locObj = null } = {} + ) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */ + static meridiems({ locale = null } = {}) { + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */ + static eras(length = "short", { locale = null } = {}) { + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */ + static features() { + return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() }; + } +} + +function dayDiff(earlier, later) { + const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf("day").valueOf(), + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); +} + +function highOrderDiffs(cursor, later, units) { + const differs = [ + ["years", (a, b) => b.year - a.year], + ["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4], + ["months", (a, b) => b.month - a.month + (b.year - a.year) * 12], + [ + "weeks", + (a, b) => { + const days = dayDiff(a, b); + return (days - (days % 7)) / 7; + }, + ], + ["days", dayDiff], + ]; + + const results = {}; + const earlier = cursor; + let lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (const [unit, differ] of differs) { + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + + return [cursor, results, highWater, lowestOrder]; +} + +function diff (earlier, later, units, opts) { + let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units); + + const remainingMillis = later - cursor; + + const lowerOrderUnits = units.filter( + (u) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0 + ); + + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + highWater = cursor.plus({ [lowestOrder]: 1 }); + } + + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + + const duration = Duration.fromObject(results, opts); + + if (lowerOrderUnits.length > 0) { + return Duration.fromMillis(remainingMillis, opts) + .shiftTo(...lowerOrderUnits) + .plus(duration); + } else { + return duration; + } +} + +const MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; + +function intUnit(regex, post = (i) => i) { + return { regex, deser: ([s]) => post(parseDigits(s)) }; +} + +const NBSP = String.fromCharCode(160); +const spaceOrNBSP = `[ ${NBSP}]`; +const spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); + +function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); +} + +function stripInsensitivities(s) { + return s + .replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); +} + +function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: ([s]) => + strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex, + }; + } +} + +function offset(regex, groups) { + return { regex, deser: ([, h, m]) => signedOffset(h, m), groups }; +} + +function simple(regex) { + return { regex, deser: ([s]) => s }; +} + +function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); +} + +/** + * @param token + * @param {Locale} loc + */ +function unitForToken(token, loc) { + const one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }), + unitate = (t) => { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2); + case "ZZZ": + return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + + const unit = unitate(token) || { + invalidReason: MISSING_FTP, + }; + + unit.token = token; + + return unit; +} + +const partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy", + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM", + }, + day: { + numeric: "d", + "2-digit": "dd", + }, + weekday: { + short: "EEE", + long: "EEEE", + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh", + }, + hour24: { + numeric: "H", + "2-digit": "HH", + }, + minute: { + numeric: "m", + "2-digit": "mm", + }, + second: { + numeric: "s", + "2-digit": "ss", + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ", + }, +}; + +function tokenForPart(part, formatOpts, resolvedOpts) { + const { type, value } = part; + + if (type === "literal") { + const isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value, + }; + } + + const style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + let actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + let val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + + if (val) { + return { + literal: false, + val, + }; + } + + return undefined; +} + +function buildRegex(units) { + const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, ""); + return [`^${re}$`, units]; +} + +function match(input, regex, handlers) { + const matches = input.match(regex); + + if (matches) { + const all = {}; + let matchIndex = 1; + for (const i in handlers) { + if (hasOwnProperty(handlers, i)) { + const h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } +} + +function dateTimeFromMatches(matches) { + const toField = (token) => { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + + let zone = null; + let specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + + const vals = Object.keys(matches).reduce((r, k) => { + const f = toField(k); + if (f) { + r[f] = matches[k]; + } + + return r; + }, {}); + + return [vals, zone, specificOffset]; +} + +let dummyDateTimeCache = null; + +function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + + return dummyDateTimeCache; +} + +function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + + const formatOpts = Formatter.macroTokenToFormatOpts(token.val); + const tokens = formatOptsToTokens(formatOpts, locale); + + if (tokens == null || tokens.includes(undefined)) { + return token; + } + + return tokens; +} + +function expandMacroTokens(tokens, locale) { + return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale))); +} + +/** + * @private + */ + +class TokenParser { + constructor(locale, format) { + this.locale = locale; + this.format = format; + this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale); + this.units = this.tokens.map((t) => unitForToken(t, locale)); + this.disqualifyingUnit = this.units.find((t) => t.invalidReason); + + if (!this.disqualifyingUnit) { + const [regexString, handlers] = buildRegex(this.units); + this.regex = RegExp(regexString, "i"); + this.handlers = handlers; + } + } + + explainFromTokens(input) { + if (!this.isValid) { + return { input, tokens: this.tokens, invalidReason: this.invalidReason }; + } else { + const [rawMatches, matches] = match(input, this.regex, this.handlers), + [result, zone, specificOffset] = matches + ? dateTimeFromMatches(matches) + : [null, null, undefined]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError( + "Can't include meridiem when specifying 24-hour format" + ); + } + return { + input, + tokens: this.tokens, + regex: this.regex, + rawMatches, + matches, + result, + zone, + specificOffset, + }; + } + } + + get isValid() { + return !this.disqualifyingUnit; + } + + get invalidReason() { + return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null; + } +} + +function explainFromTokens(locale, input, format) { + const parser = new TokenParser(locale, format); + return parser.explainFromTokens(input); +} + +function parseFromTokens(locale, input, format) { + const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format); + return [result, zone, specificOffset, invalidReason]; +} + +function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + + const formatter = Formatter.create(locale, formatOpts); + const df = formatter.dtFormatter(getDummyDateTime()); + const parts = df.formatToParts(); + const resolvedOpts = df.resolvedOptions(); + return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts)); +} + +const INVALID = "Invalid DateTime"; +const MAX_DATE = 8.64e15; + +function unsupportedZone(zone) { + return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`); +} + +// we cache week data on the DT object and this intermediates the cache +/** + * @param {DateTime} dt + */ +function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; +} + +/** + * @param {DateTime} dt + */ +function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek( + dt.c, + dt.loc.getMinDaysInFirstWeek(), + dt.loc.getStartOfWeek() + ); + } + return dt.localWeekData; +} + +// clone really means, "make a new object with these modifications". all "setters" really use this +// to create a new object while only changing some of the properties +function clone(inst, alts) { + const current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid, + }; + return new DateTime({ ...current, ...alts, old: current }); +} + +// find the right offset a given local time. The o input is our guess, which determines which +// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) +function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + let utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + const o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + const o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; +} + +// convert an epoch timestamp into a calendar object with the given offset +function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + + const d = new Date(ts); + + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds(), + }; +} + +// convert a calendar object to a epoch timestamp +function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); +} + +// create a new DT instance by adding a duration, adjusting for DSTs +function adjustTime(inst, dur) { + const oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = { + ...inst.c, + year, + month, + day: + Math.min(inst.c.day, daysInMonth(year, month)) + + Math.trunc(dur.days) + + Math.trunc(dur.weeks) * 7, + }, + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds, + }).as("milliseconds"), + localTS = objToLocalTS(c); + + let [ts, o] = fixOffset(localTS, oPre, inst.zone); + + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + + return { ts, o }; +} + +// helper useful in turning the results of parsing into real dates +// by handling the zone options +function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + const { setZone, zone } = opts; + if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) { + const interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, { + ...opts, + zone: interpretationZone, + specificOffset, + }); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid( + new Invalid("unparsable", `the input "${text}" can't be parsed as ${format}`) + ); + } +} + +// if you want to output a technical format (e.g. RFC 2822), this helper +// helps handle the details +function toTechFormat(dt, format, allowZ = true) { + return dt.isValid + ? Formatter.create(Locale.create("en-US"), { + allowZ, + forceSimple: true, + }).formatDateTimeFromString(dt, format) + : null; +} + +function toISODate(o, extended, precision) { + const longFormat = o.c.year > 9999 || o.c.year < 0; + let c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (precision === "year") return c; + if (extended) { + c += "-"; + c += padStart(o.c.month); + if (precision === "month") return c; + c += "-"; + } else { + c += padStart(o.c.month); + if (precision === "month") return c; + } + c += padStart(o.c.day); + return c; +} + +function toISOTime( + o, + extended, + suppressSeconds, + suppressMilliseconds, + includeOffset, + extendedZone, + precision +) { + let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0, + c = ""; + switch (precision) { + case "day": + case "month": + case "year": + break; + default: + c += padStart(o.c.hour); + if (precision === "hour") break; + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += ":"; + c += padStart(o.c.second); + } + } else { + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += padStart(o.c.second); + } + } + if (precision === "second") break; + if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; +} + +// defaults for unspecified units in the supported calendars +const defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0, + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0, + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0, + }; + +// Units in the supported calendars, sorted by bigness +const orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = [ + "weekYear", + "weekNumber", + "weekday", + "hour", + "minute", + "second", + "millisecond", + ], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + +// standardize case and plurality in units +function normalizeUnit(unit) { + const normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal", + }[unit.toLowerCase()]; + + if (!normalized) throw new InvalidUnitError(unit); + + return normalized; +} + +function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } +} + +// cache offsets for zones based on the current timestamp when this function is +// first called. When we are handling a datetime from components like (year, +// month, day, hour) in a time zone, we need a guess about what the timezone +// offset is so that we can convert into a UTC timestamp. One way is to find the +// offset of now in the zone. The actual date may have a different offset (for +// example, if we handle a date in June while we're in December in a zone that +// observes DST), but we can check and adjust that. +// +// When handling many dates, calculating the offset for now every time is +// expensive. It's just a guess, so we can cache the offset to use even if we +// are right on a time change boundary (we'll just correct in the other +// direction). Using a timestamp from first read is a slight optimization for +// handling dates close to the current date, since those dates will usually be +// in the same offset (we could set the timestamp statically, instead). We use a +// single timestamp for all zones to make things a bit more predictable. +// +// This is safe for quickDT (used by local() and utc()) because we don't fill in +// higher-order units from tsNow (as we do in fromObject, this requires that +// offset is calculated from tsNow). +/** + * @param {Zone} zone + * @return {number} + */ +function guessOffsetForZone(zone) { + if (zoneOffsetTs === undefined) { + zoneOffsetTs = Settings.now(); + } + + // Do not cache anything but IANA zones, because it is not safe to do so. + // Guessing an offset which is not present in the zone can cause wrong results from fixOffset + if (zone.type !== "iana") { + return zone.offset(zoneOffsetTs); + } + const zoneName = zone.name; + let offsetGuess = zoneOffsetGuessCache.get(zoneName); + if (offsetGuess === undefined) { + offsetGuess = zone.offset(zoneOffsetTs); + zoneOffsetGuessCache.set(zoneName, offsetGuess); + } + return offsetGuess; +} + +// this is a dumbed down version of fromObject() that runs about 60% faster +// but doesn't do any validation, makes a bunch of assumptions about what units +// are present, and so on. +function quickDT(obj, opts) { + const zone = normalizeZone(opts.zone, Settings.defaultZone); + if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } + + const loc = Locale.fromObject(opts); + + let ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (const u of orderedUnits) { + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + + const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + + const offsetProvis = guessOffsetForZone(zone); + [ts, o] = objToTS(obj, offsetProvis, zone); + } else { + ts = Settings.now(); + } + + return new DateTime({ ts, zone, loc, o }); +} + +function diffRelative(start, end, opts) { + const round = isUndefined(opts.round) ? true : opts.round, + rounding = isUndefined(opts.rounding) ? "trunc" : opts.rounding, + format = (c, unit) => { + c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? "round" : rounding); + const formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = (unit) => { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + + for (const unit of opts.units) { + const count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); +} + +function lastOpts(argList) { + let opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; +} + +/** + * Timestamp to use for cached zone offset guesses (exposed for test) + */ +let zoneOffsetTs; +/** + * Cache for zone offset guesses (exposed for test). + * + * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of + * zone.offset(). + */ +const zoneOffsetGuessCache = new Map(); + +/** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ +class DateTime { + /** + * @access private + */ + constructor(config) { + const zone = config.zone || Settings.defaultZone; + + let invalid = + config.invalid || + (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || + (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + + let c = null, + o = null; + if (!invalid) { + const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + + if (unchanged) { + [c, o] = [config.old.c, config.old.o]; + } else { + // If an offset has been passed and we have not been called from + // clone(), we can trust it and avoid the offset calculation. + const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + static now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */ + static local() { + const [opts, args] = lastOpts(arguments), + [year, month, day, hour, minute, second, millisecond] = args; + return quickDT({ year, month, day, hour, minute, second, millisecond }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */ + static utc() { + const [opts, args] = lastOpts(arguments), + [year, month, day, hour, minute, second, millisecond] = args; + + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ year, month, day, hour, minute, second, millisecond }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */ + static fromJSDate(date, options = {}) { + const ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + + const zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options), + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromMillis(milliseconds, options = {}) { + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError( + `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}` + ); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options), + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromSeconds(seconds, options = {}) { + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options), + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */ + static fromObject(obj, opts = {}) { + obj = obj || {}; + const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + + const loc = Locale.fromObject(opts); + const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc); + + const tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) + ? opts.specificOffset + : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError( + "Can't mix weekYear/weekNumber units with year/month/day or ordinals" + ); + } + + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + + const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor); + + // configure ourselves to deal with gregorian dates or week stuff + let units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + let foundFirst = false; + for (const u of units) { + const v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + const higherOrderInvalid = useWeekData + ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) + : containsOrdinal + ? hasInvalidOrdinalData(normalized) + : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + const gregorian = useWeekData + ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) + : containsOrdinal + ? ordinalToGregorian(normalized) + : normalized, + [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc, + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid( + "mismatched weekday", + `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}` + ); + } + + if (!inst.isValid) { + return DateTime.invalid(inst.invalid); + } + + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */ + static fromISO(text, opts = {}) { + const [vals, parsedZone] = parseISODate(text); + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */ + static fromRFC2822(text, opts = {}) { + const [vals, parsedZone] = parseRFC2822Date(text); + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */ + static fromHTTP(text, opts = {}) { + const [vals, parsedZone] = parseHTTPDate(text); + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromFormat(text, fmt, opts = {}) { + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + + const { locale = null, numberingSystem = null } = opts, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true, + }), + [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt); + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */ + static fromString(text, fmt, opts = {}) { + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */ + static fromSQL(text, opts = {}) { + const [vals, parsedZone] = parseSQL(text); + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ invalid }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDateTime(o) { + return (o && o.isLuxonDateTime) || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */ + static parseFormatForOpts(formatOpts, localeOpts = {}) { + const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */ + static expandFormat(fmt, localeOpts = {}) { + const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map((t) => t.val).join(""); + } + + static resetCache() { + zoneOffsetTs = undefined; + zoneOffsetGuessCache.clear(); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */ + get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */ + get isValid() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + get outputCalendar() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + get zone() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + get zoneName() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + get year() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + get quarter() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + get month() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + get day() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + get hour() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + get minute() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + get second() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + get millisecond() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + get weekYear() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + get weekNumber() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + get weekday() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + get isWeekend() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + get localWeekday() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + get localWeekNumber() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + get localWeekYear() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + get ordinal() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + get monthShort() { + return this.isValid ? Info.months("short", { locObj: this.loc })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + get monthLong() { + return this.isValid ? Info.months("long", { locObj: this.loc })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + get weekdayShort() { + return this.isValid ? Info.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + get weekdayLong() { + return this.isValid ? Info.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + get offset() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameShort() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale, + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameLong() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale, + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + get isOffsetFixed() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + get isInDST() { + if (this.isOffsetFixed) { + return false; + } else { + return ( + this.offset > this.set({ month: 1, day: 1 }).offset || + this.offset > this.set({ month: 5 }).offset + ); + } + } + + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + const dayMs = 86400000; + const minuteMs = 60000; + const localTS = objToLocalTS(this.c); + const oEarlier = this.zone.offset(localTS - dayMs); + const oLater = this.zone.offset(localTS + dayMs); + + const o1 = this.zone.offset(localTS - oEarlier * minuteMs); + const o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + const ts1 = localTS - o1 * minuteMs; + const ts2 = localTS - o2 * minuteMs; + const c1 = tsToObj(ts1, o1); + const c2 = tsToObj(ts2, o2); + if ( + c1.hour === c2.hour && + c1.minute === c2.minute && + c1.second === c2.second && + c1.millisecond === c2.millisecond + ) { + return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */ + get isInLeapYear() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + get daysInMonth() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + get daysInYear() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + get weeksInWeekYear() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + get weeksInLocalWeekYear() { + return this.isValid + ? weeksInWeekYear( + this.localWeekYear, + this.loc.getMinDaysInFirstWeek(), + this.loc.getStartOfWeek() + ) + : NaN; + } + + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + resolvedLocaleOptions(opts = {}) { + const { locale, numberingSystem, calendar } = Formatter.create( + this.loc.clone(opts), + opts + ).resolvedOptions(this); + return { locale, numberingSystem, outputCalendar: calendar }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */ + toUTC(offset = 0, opts = {}) { + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */ + toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */ + setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) { + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + let newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + const offsetGuess = zone.offset(this.ts); + const asObj = this.toObject(); + [newTS] = objToTS(asObj, offsetGuess, zone); + } + return clone(this, { ts: newTS, zone }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */ + reconfigure({ locale, numberingSystem, outputCalendar } = {}) { + const loc = this.loc.clone({ locale, numberingSystem, outputCalendar }); + return clone(this, { loc }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */ + setLocale(locale) { + return this.reconfigure({ locale }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */ + set(values) { + if (!this.isValid) return this; + + const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc); + + const settingWeekStuff = + !isUndefined(normalized.weekYear) || + !isUndefined(normalized.weekNumber) || + !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError( + "Can't mix weekYear/weekNumber units with year/month/day or ordinals" + ); + } + + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + + let mixed; + if (settingWeekStuff) { + mixed = weekToGregorian( + { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized }, + minDaysInFirstWeek, + startOfWeek + ); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized }); + } else { + mixed = { ...this.toObject(), ...normalized }; + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + + const [ts, o] = objToTS(mixed, this.o, this.zone); + return clone(this, { ts, o }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */ + plus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */ + minus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */ + startOf(unit, { useLocaleWeeks = false } = {}) { + if (!this.isValid) return this; + + const o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + const startOfWeek = this.loc.getStartOfWeek(); + const { weekday } = this; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + + if (normalizedUnit === "quarters") { + const q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */ + endOf(unit, opts) { + return this.isValid + ? this.plus({ [unit]: 1 }) + .startOf(unit, opts) + .minus(1) + : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */ + toFormat(fmt, opts = {}) { + return this.isValid + ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) + : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid + ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) + : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */ + toLocaleParts(opts = {}) { + return this.isValid + ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) + : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z' + * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z' + * @return {string|null} + */ + toISO({ + format = "extended", + suppressSeconds = false, + suppressMilliseconds = false, + includeOffset = true, + extendedZone = false, + precision = "milliseconds", + } = {}) { + if (!this.isValid) { + return null; + } + + precision = normalizeUnit(precision); + const ext = format === "extended"; + + let c = toISODate(this, ext, precision); + if (orderedUnits.indexOf(precision) >= 3) c += "T"; + c += toISOTime( + this, + ext, + suppressSeconds, + suppressMilliseconds, + includeOffset, + extendedZone, + precision + ); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'. + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05' + * @return {string|null} + */ + toISODate({ format = "extended", precision = "day" } = {}) { + if (!this.isValid) { + return null; + } + return toISODate(this, format === "extended", normalizeUnit(precision)); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */ + toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z' + * @return {string} + */ + toISOTime({ + suppressMilliseconds = false, + suppressSeconds = false, + includeOffset = true, + includePrefix = false, + extendedZone = false, + format = "extended", + precision = "milliseconds", + } = {}) { + if (!this.isValid) { + return null; + } + + precision = normalizeUnit(precision); + let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? "T" : ""; + return ( + c + + toISOTime( + this, + format === "extended", + suppressSeconds, + suppressMilliseconds, + includeOffset, + extendedZone, + precision + ) + ); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */ + toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */ + toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string|null} + */ + toSQLDate() { + if (!this.isValid) { + return null; + } + return toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */ + toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) { + let fmt = "HH:mm:ss.SSS"; + + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */ + toSQL(opts = {}) { + if (!this.isValid) { + return null; + } + + return `${this.toSQLDate()} ${this.toSQLTime(opts)}`; + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */ + toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`; + } else { + return `DateTime { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */ + toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime. + * @return {number} + */ + toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */ + toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */ + toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */ + toObject(opts = {}) { + if (!this.isValid) return {}; + + const base = { ...this.c }; + + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */ + toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */ + diff(otherDateTime, unit = "milliseconds", opts = {}) { + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + + const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts }; + + const units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = diff(earlier, later, units, durOpts); + + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + diffNow(unit = "milliseconds", opts = {}) { + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval|DateTime} + */ + until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */ + hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + + const inputMs = otherDateTime.valueOf(); + const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true }); + return ( + adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts) + ); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */ + equals(other) { + return ( + this.isValid && + other.isValid && + this.valueOf() === other.valueOf() && + this.zone.equals(other.zone) && + this.loc.equals(other.loc) + ); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {string} [options.rounding="trunc"] - rounding method to use when rounding the numbers in the output. Can be "trunc" (toward zero), "expand" (away from zero), "round", "floor", or "ceil". + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */ + toRelative(options = {}) { + if (!this.isValid) return null; + const base = options.base || DateTime.fromObject({}, { zone: this.zone }), + padding = options.padding ? (this < base ? -options.padding : options.padding) : 0; + let units = ["years", "months", "days", "hours", "minutes", "seconds"]; + let unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), { + ...options, + numeric: "always", + units, + unit, + }); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */ + toRelativeCalendar(options = {}) { + if (!this.isValid) return null; + + return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, { + ...options, + numeric: "auto", + units: ["years", "months", "days"], + calendary: true, + }); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */ + static min(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, (i) => i.valueOf(), Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */ + static max(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, (i) => i.valueOf(), Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */ + static fromFormatExplain(text, fmt, options = {}) { + const { locale = null, numberingSystem = null } = options, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true, + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */ + static fromStringExplain(text, fmt, options = {}) { + return DateTime.fromFormatExplain(text, fmt, options); + } + + /** + * Build a parser for `fmt` using the given locale. This parser can be passed + * to {@link DateTime.fromFormatParser} to a parse a date in this format. This + * can be used to optimize cases where many dates need to be parsed in a + * specific format. + * + * @param {String} fmt - the format the string is expected to be in (see + * description) + * @param {Object} options - options used to set locale and numberingSystem + * for parser + * @returns {TokenParser} - opaque object to be used + */ + static buildFormatParser(fmt, options = {}) { + const { locale = null, numberingSystem = null } = options, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true, + }); + return new TokenParser(localeToUse, fmt); + } + + /** + * Create a DateTime from an input string and format parser. + * + * The format parser must have been created with the same locale as this call. + * + * @param {String} text - the string to parse + * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser} + * @param {Object} opts - options taken by fromFormat() + * @returns {DateTime} + */ + static fromFormatParser(text, formatParser, opts = {}) { + if (isUndefined(text) || isUndefined(formatParser)) { + throw new InvalidArgumentError( + "fromFormatParser requires an input string and a format parser" + ); + } + const { locale = null, numberingSystem = null } = opts, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true, + }); + + if (!localeToUse.equals(formatParser.locale)) { + throw new InvalidArgumentError( + `fromFormatParser called with a locale of ${localeToUse}, ` + + `but the format parser was created for ${formatParser.locale}` + ); + } + + const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text); + + if (invalidReason) { + return DateTime.invalid(invalidReason); + } else { + return parseDataToDateTime( + result, + zone, + opts, + `format ${formatParser.format}`, + text, + specificOffset + ); + } + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */ + static get DATE_SHORT() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED_WITH_WEEKDAY() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + static get DATE_FULL() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + static get DATE_HUGE() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_SIMPLE() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SECONDS() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SHORT_OFFSET() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_LONG_OFFSET() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + static get TIME_24_SIMPLE() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SECONDS() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SHORT_OFFSET() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_LONG_OFFSET() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT_WITH_SECONDS() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_SECONDS() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_WEEKDAY() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL_WITH_SECONDS() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE_WITH_SECONDS() { + return DATETIME_HUGE_WITH_SECONDS; + } +} + +/** + * @private + */ +function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError( + `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}` + ); + } +} + +const VERSION = "3.7.2"; + +export { DateTime, Duration, FixedOffsetZone, IANAZone, Info, Interval, InvalidZone, Settings, SystemZone, VERSION, Zone }; +//# sourceMappingURL=luxon.mjs.map diff --git a/node_modules/luxon/build/es6/luxon.mjs.map b/node_modules/luxon/build/es6/luxon.mjs.map new file mode 100644 index 00000000..68f1cf70 --- /dev/null +++ b/node_modules/luxon/build/es6/luxon.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.mjs","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/impl/digits.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nconst dtfCache = new Map();\nfunction makeDTF(zoneName) {\n let dtf = dtfCache.get(zoneName);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zoneName,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n dtfCache.set(zoneName, dtf);\n }\n return dtf;\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nconst ianaZoneCache = new Map();\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n let zone = ianaZoneCache.get(name);\n if (zone === undefined) {\n ianaZoneCache.set(name, (zone = new IANAZone(name)));\n }\n return zone;\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache.clear();\n dtfCache.clear();\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n if (!this.valid) return NaN;\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nconst intlDTCache = new Map();\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache.get(key);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache.set(key, dtf);\n }\n return dtf;\n}\n\nconst intlNumCache = new Map();\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache.get(key);\n if (inf === undefined) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache.set(key, inf);\n }\n return inf;\n}\n\nconst intlRelCache = new Map();\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache.get(key);\n if (inf === undefined) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache.set(key, inf);\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nconst intlResolvedOptionsCache = new Map();\nfunction getCachedIntResolvedOptions(locString) {\n let opts = intlResolvedOptionsCache.get(locString);\n if (opts === undefined) {\n opts = new Intl.DateTimeFormat(locString).resolvedOptions();\n intlResolvedOptionsCache.set(locString, opts);\n }\n return opts;\n}\n\nconst weekInfoCache = new Map();\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache.get(locString);\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86\n if (!(\"minimalDays\" in data)) {\n data = { ...fallbackWeekSettings, ...data };\n }\n weekInfoCache.set(locString, data);\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n getCachedIntResolvedOptions(loc.locale).numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache.clear();\n intlNumCache.clear();\n intlRelCache.clear();\n intlResolvedOptionsCache.clear();\n weekInfoCache.clear();\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n // Workaround for \"ja\" locale: formatToParts does not label all parts of the month\n // as \"month\" and for this locale there is no difference between \"format\" and \"non-format\".\n // As such, just use format() instead of formatToParts() and take the whole string\n const monthSpecialCase = this.intl === \"ja\" || this.intl.startsWith(\"ja-\");\n format &= !monthSpecialCase;\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n const mapper = !monthSpecialCase\n ? (dt) => this.extract(dt, intl, \"month\")\n : (dt) => this.dtFormatter(dt, intl).format();\n this.monthsCache[formatStr][length] = mapMonths(mapper);\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n getCachedIntResolvedOptions(this.intl).locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nconst digitRegexCache = new Map();\nexport function resetDigitRegexCache() {\n digitRegexCache.clear();\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n let appendCache = digitRegexCache.get(ns);\n if (appendCache === undefined) {\n appendCache = new Map();\n digitRegexCache.set(ns, appendCache);\n }\n let regex = appendCache.get(append);\n if (regex === undefined) {\n regex = new RegExp(`${numberingSystems[ns]}${append}`);\n appendCache.set(append, regex);\n }\n\n return regex;\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, rounding = \"round\") {\n const factor = 10 ** digits;\n switch (rounding) {\n case \"expand\":\n return number > 0\n ? Math.ceil(number * factor) / factor\n : Math.floor(number * factor) / factor;\n case \"trunc\":\n return Math.trunc(number * factor) / factor;\n case \"round\":\n return Math.round(number * factor) / factor;\n case \"floor\":\n return Math.floor(number * factor) / factor;\n case \"ceil\":\n return Math.ceil(number * factor) / factor;\n default:\n throw new RangeError(`Value rounding ${rounding} is out of range`);\n }\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || !Number.isFinite(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n // turn '' into a literal signal quote instead of just skipping the empty literal\n if (currentFull.length > 0 || bracketed) {\n splits.push({\n literal: bracketed || /^\\s+$/.test(currentFull),\n val: currentFull === \"\" ? \"'\" : currentFull,\n });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0, signDisplay = undefined) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n if (signDisplay) {\n opts.signDisplay = signDisplay;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const invertLargest = this.opts.signMode === \"negativeLargestOnly\" ? -1 : 1;\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"milliseconds\";\n case \"s\":\n return \"seconds\";\n case \"m\":\n return \"minutes\";\n case \"h\":\n return \"hours\";\n case \"d\":\n return \"days\";\n case \"w\":\n return \"weeks\";\n case \"M\":\n return \"months\";\n case \"y\":\n return \"years\";\n default:\n return null;\n }\n },\n tokenToString = (lildur, info) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n const inversionFactor =\n info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1;\n let signDisplay;\n if (this.opts.signMode === \"negativeLargestOnly\" && mapped !== info.largestUnit) {\n signDisplay = \"never\";\n } else if (this.opts.signMode === \"all\") {\n signDisplay = \"always\";\n } else {\n // \"auto\" and \"negative\" are the same, but \"auto\" has better support\n signDisplay = \"auto\";\n }\n return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)),\n durationInfo = {\n isNegativeDuration: collapsed < 0,\n // this relies on \"collapsed\" being based on \"shiftTo\", which builds up the object\n // in order\n largestUnit: Object.keys(collapsed.values)[0],\n };\n return stringifyTokens(tokens, tokenToString(collapsed, durationInfo));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:([Zz])|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"+6 +2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"-6 -2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"negativeLargestOnly\" }) //=> \"-6 2\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero\n * @example\n * ```js\n * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 mth, 0 wks, 5 hr, 6 min'\n * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const showZeros = opts.showZeros !== false;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val) || (val === 0 && !showZeros)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Removes all units with values equal to 0 from this Duration.\n * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 }\n * @return {Duration}\n */\n removeZeros() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.values);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval. This is the first instant which is not part of the interval\n * (Interval is half-open).\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns the last DateTime included in the interval (since end is not part of the interval)\n * @type {DateTime}\n */\n get lastDateTime() {\n return this.isValid ? (this.e ? this.e.minus(1) : null) : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into an equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval\n * and ending with the latest.\n *\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended, precision) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n if (precision === \"year\") return c;\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n c += \"-\";\n } else {\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n }\n c += padStart(o.c.day);\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n) {\n let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0,\n c = \"\";\n switch (precision) {\n case \"day\":\n case \"month\":\n case \"year\":\n break;\n default:\n c += padStart(o.c.hour);\n if (precision === \"hour\") break;\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += \":\";\n c += padStart(o.c.second);\n }\n } else {\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += padStart(o.c.second);\n }\n }\n if (precision === \"second\") break;\n if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\n/**\n * @param {Zone} zone\n * @return {number}\n */\nfunction guessOffsetForZone(zone) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n // Do not cache anything but IANA zones, because it is not safe to do so.\n // Guessing an offset which is not present in the zone can cause wrong results from fixOffset\n if (zone.type !== \"iana\") {\n return zone.offset(zoneOffsetTs);\n }\n const zoneName = zone.name;\n let offsetGuess = zoneOffsetGuessCache.get(zoneName);\n if (offsetGuess === undefined) {\n offsetGuess = zone.offset(zoneOffsetTs);\n zoneOffsetGuessCache.set(zoneName, offsetGuess);\n }\n return offsetGuess;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n rounding = isUndefined(opts.rounding) ? \"trunc\" : opts.rounding,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? \"round\" : rounding);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nconst zoneOffsetGuessCache = new Map();\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache.clear();\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z'\n * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z'\n * @return {string|null}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext, precision);\n if (orderedUnits.indexOf(precision) >= 3) c += \"T\";\n c += toISOTime(\n this,\n ext,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n );\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'.\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05'\n * @return {string|null}\n */\n toISODate({ format = \"extended\", precision = \"day\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, format === \"extended\", normalizeUnit(precision));\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string|null}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval|DateTime}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {string} [options.rounding=\"trunc\"] - rounding method to use when rounding the numbers in the output. Can be \"trunc\" (toward zero), \"expand\" (away from zero), \"round\", \"floor\", or \"ceil\".\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.7.2\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["singleton","English.formatRelativeTime","English.months","English.weekdays","English.meridiems","English.eras","Formats.DATE_SHORT","Formats.DATE_MED","Formats.DATE_FULL","Formats.DATE_HUGE","Formats.TIME_SIMPLE","Formats.TIME_WITH_SECONDS","Formats.TIME_WITH_SHORT_OFFSET","Formats.TIME_WITH_LONG_OFFSET","Formats.TIME_24_SIMPLE","Formats.TIME_24_WITH_SECONDS","Formats.TIME_24_WITH_SHORT_OFFSET","Formats.TIME_24_WITH_LONG_OFFSET","Formats.DATETIME_SHORT","Formats.DATETIME_MED","Formats.DATETIME_FULL","Formats.DATETIME_HUGE","Formats.DATETIME_SHORT_WITH_SECONDS","Formats.DATETIME_MED_WITH_SECONDS","Formats.DATETIME_FULL_WITH_SECONDS","Formats.DATETIME_HUGE_WITH_SECONDS","English.meridiemForDateTime","English.monthForDateTime","English.weekdayForDateTime","English.eraForDateTime","English.monthsShort","English.weekdaysLong","English.weekdaysShort","INVALID","orderedUnits","clone","Formats.DATE_MED_WITH_WEEKDAY","Formats.DATETIME_MED_WITH_WEEKDAY"],"mappings":"AAAA;AACA;AACA;AACA;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C,CAAC;AAC7C,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,aAAa,GAAG;AAC7B,IAAI,OAAOjB,aAAqB,CAAC;AACjC,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,0BAA0B,GAAG;AAC1C,IAAI,OAAOI,0BAAkC,CAAC;AAC9C,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,aAAa,GAAG;AAC7B,IAAI,OAAOH,aAAqB,CAAC;AACjC,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,0BAA0B,GAAG;AAC1C,IAAI,OAAOI,0BAAkC,CAAC;AAC9C,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,WAAW,EAAE;AAC9C,EAAE,IAAI,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;AACxC,IAAI,OAAO,WAAW,CAAC;AACvB,GAAG,MAAM,IAAI,WAAW,IAAI,WAAW,CAAC,OAAO,IAAI,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,EAAE;AACpF,IAAI,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC5C,GAAG,MAAM,IAAI,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;AAC7D,IAAI,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAC5C,GAAG,MAAM;AACT,IAAI,MAAM,IAAI,oBAAoB;AAClC,MAAM,CAAC,2BAA2B,EAAE,WAAW,CAAC,UAAU,EAAE,OAAO,WAAW,CAAC,CAAC;AAChF,KAAK,CAAC;AACN,GAAG;AACH;;AC/hFK,MAAC,OAAO,GAAG;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/build/global/luxon.js b/node_modules/luxon/build/global/luxon.js new file mode 100644 index 00000000..7d059e1b --- /dev/null +++ b/node_modules/luxon/build/global/luxon.js @@ -0,0 +1,8744 @@ +var luxon = (function (exports) { + 'use strict'; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return _extends.apply(this, arguments); + } + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + _setPrototypeOf(subClass, superClass); + } + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } + } + function _construct(Parent, args, Class) { + if (_isNativeReflectConstruct()) { + _construct = Reflect.construct.bind(); + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + return _construct.apply(null, arguments); + } + function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } + function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_isNativeFunction(Class)) return Class; + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() { + return _construct(Class, arguments, _getPrototypeOf(this).constructor); + } + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _setPrototypeOf(Wrapper, Class); + }; + return _wrapNativeSuper(Class); + } + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; + } + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + return arr2; + } + function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + + // these aren't really private, but nor are they really useful to document + /** + * @private + */ + var LuxonError = /*#__PURE__*/function (_Error) { + _inheritsLoose(LuxonError, _Error); + function LuxonError() { + return _Error.apply(this, arguments) || this; + } + return LuxonError; + }( /*#__PURE__*/_wrapNativeSuper(Error)); + /** + * @private + */ + var InvalidDateTimeError = /*#__PURE__*/function (_LuxonError) { + _inheritsLoose(InvalidDateTimeError, _LuxonError); + function InvalidDateTimeError(reason) { + return _LuxonError.call(this, "Invalid DateTime: " + reason.toMessage()) || this; + } + return InvalidDateTimeError; + }(LuxonError); + + /** + * @private + */ + var InvalidIntervalError = /*#__PURE__*/function (_LuxonError2) { + _inheritsLoose(InvalidIntervalError, _LuxonError2); + function InvalidIntervalError(reason) { + return _LuxonError2.call(this, "Invalid Interval: " + reason.toMessage()) || this; + } + return InvalidIntervalError; + }(LuxonError); + + /** + * @private + */ + var InvalidDurationError = /*#__PURE__*/function (_LuxonError3) { + _inheritsLoose(InvalidDurationError, _LuxonError3); + function InvalidDurationError(reason) { + return _LuxonError3.call(this, "Invalid Duration: " + reason.toMessage()) || this; + } + return InvalidDurationError; + }(LuxonError); + + /** + * @private + */ + var ConflictingSpecificationError = /*#__PURE__*/function (_LuxonError4) { + _inheritsLoose(ConflictingSpecificationError, _LuxonError4); + function ConflictingSpecificationError() { + return _LuxonError4.apply(this, arguments) || this; + } + return ConflictingSpecificationError; + }(LuxonError); + + /** + * @private + */ + var InvalidUnitError = /*#__PURE__*/function (_LuxonError5) { + _inheritsLoose(InvalidUnitError, _LuxonError5); + function InvalidUnitError(unit) { + return _LuxonError5.call(this, "Invalid unit " + unit) || this; + } + return InvalidUnitError; + }(LuxonError); + + /** + * @private + */ + var InvalidArgumentError = /*#__PURE__*/function (_LuxonError6) { + _inheritsLoose(InvalidArgumentError, _LuxonError6); + function InvalidArgumentError() { + return _LuxonError6.apply(this, arguments) || this; + } + return InvalidArgumentError; + }(LuxonError); + + /** + * @private + */ + var ZoneIsAbstractError = /*#__PURE__*/function (_LuxonError7) { + _inheritsLoose(ZoneIsAbstractError, _LuxonError7); + function ZoneIsAbstractError() { + return _LuxonError7.call(this, "Zone is an abstract class") || this; + } + return ZoneIsAbstractError; + }(LuxonError); + + /** + * @private + */ + + var n = "numeric", + s = "short", + l = "long"; + var DATE_SHORT = { + year: n, + month: n, + day: n + }; + var DATE_MED = { + year: n, + month: s, + day: n + }; + var DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s + }; + var DATE_FULL = { + year: n, + month: l, + day: n + }; + var DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l + }; + var TIME_SIMPLE = { + hour: n, + minute: n + }; + var TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n + }; + var TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + var TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" + }; + var TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s + }; + var TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l + }; + var DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n + }; + var DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n + }; + var DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n + }; + var DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n + }; + var DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s + }; + var DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s + }; + var DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l + }; + var DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l + }; + + /** + * @interface + */ + var Zone = /*#__PURE__*/function () { + function Zone() {} + var _proto = Zone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */; + _createClass(Zone, [{ + key: "type", + get: + /** + * The type of zone + * @abstract + * @type {string} + */ + function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + }, { + key: "name", + get: function get() { + throw new ZoneIsAbstractError(); + } + + /** + * The IANA name of this zone. + * Defaults to `name` if not overwritten by a subclass. + * @abstract + * @type {string} + */ + }, { + key: "ianaName", + get: function get() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + throw new ZoneIsAbstractError(); + } + }, { + key: "isValid", + get: function get() { + throw new ZoneIsAbstractError(); + } + }]); + return Zone; + }(); + + var singleton$1 = null; + + /** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ + var SystemZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(SystemZone, _Zone); + function SystemZone() { + return _Zone.apply(this, arguments) || this; + } + var _proto = SystemZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale); + } + + /** @override **/; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/; + _proto.offset = function offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/; + _proto.equals = function equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/; + _createClass(SystemZone, [{ + key: "type", + get: /** @override **/ + function get() { + return "system"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "instance", + get: + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + function get() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + }]); + return SystemZone; + }(Zone); + + var dtfCache = new Map(); + function makeDTF(zoneName) { + var dtf = dtfCache.get(zoneName); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zoneName, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + dtfCache.set(zoneName, dtf); + } + return dtf; + } + var typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 + }; + function hackyOffset(dtf, date) { + var formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + fMonth = parsed[1], + fDay = parsed[2], + fYear = parsed[3], + fadOrBc = parsed[4], + fHour = parsed[5], + fMinute = parsed[6], + fSecond = parsed[7]; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; + } + function partsOffset(dtf, date) { + var formatted = dtf.formatToParts(date); + var filled = []; + for (var i = 0; i < formatted.length; i++) { + var _formatted$i = formatted[i], + type = _formatted$i.type, + value = _formatted$i.value; + var pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; + } + var ianaZoneCache = new Map(); + /** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ + var IANAZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(IANAZone, _Zone); + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + IANAZone.create = function create(name) { + var zone = ianaZoneCache.get(name); + if (zone === undefined) { + ianaZoneCache.set(name, zone = new IANAZone(name)); + } + return zone; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */; + IANAZone.resetCache = function resetCache() { + ianaZoneCache.clear(); + dtfCache.clear(); + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead. + * @return {boolean} + */; + IANAZone.isValidSpecifier = function isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */; + IANAZone.isValidZone = function isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + }; + function IANAZone(name) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.zoneName = name; + /** @private **/ + _this.valid = IANAZone.isValidZone(name); + return _this; + } + + /** + * The type of zone. `iana` for all instances of `IANAZone`. + * @override + * @type {string} + */ + var _proto = IANAZone.prototype; + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @override + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + _proto.offsetName = function offsetName(ts, _ref) { + var format = _ref.format, + locale = _ref.locale; + return parseZoneInfo(ts, format, locale, this.name); + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @override + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */; + _proto.offset = function offset(ts) { + if (!this.valid) return NaN; + var date = new Date(ts); + if (isNaN(date)) return NaN; + var dtf = makeDTF(this.name); + var _ref2 = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date), + year = _ref2[0], + month = _ref2[1], + day = _ref2[2], + adOrBc = _ref2[3], + hour = _ref2[4], + minute = _ref2[5], + second = _ref2[6]; + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + var adjustedHour = hour === 24 ? 0 : hour; + var asUTC = objToLocalTS({ + year: year, + month: month, + day: day, + hour: adjustedHour, + minute: minute, + second: second, + millisecond: 0 + }); + var asTS = +date; + var over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** + * Return whether this Zone is equal to another zone + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** + * Return whether this Zone is valid. + * @override + * @type {boolean} + */; + _createClass(IANAZone, [{ + key: "type", + get: function get() { + return "iana"; + } + + /** + * The name of this zone (i.e. the IANA zone name). + * @override + * @type {string} + */ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns false for all IANA zones. + * @override + * @type {boolean} + */ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return this.valid; + } + }]); + return IANAZone; + }(Zone); + + var _excluded = ["base"], + _excluded2 = ["padTo", "floor"]; + + // todo - remap caching + + var intlLFCache = {}; + function getCachedLF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; + } + var intlDTCache = new Map(); + function getCachedDTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var dtf = intlDTCache.get(key); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache.set(key, dtf); + } + return dtf; + } + var intlNumCache = new Map(); + function getCachedINF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var key = JSON.stringify([locString, opts]); + var inf = intlNumCache.get(key); + if (inf === undefined) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache.set(key, inf); + } + return inf; + } + var intlRelCache = new Map(); + function getCachedRTF(locString, opts) { + if (opts === void 0) { + opts = {}; + } + var _opts = opts; + _opts.base; + var cacheKeyOpts = _objectWithoutPropertiesLoose(_opts, _excluded); // exclude `base` from the options + var key = JSON.stringify([locString, cacheKeyOpts]); + var inf = intlRelCache.get(key); + if (inf === undefined) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache.set(key, inf); + } + return inf; + } + var sysLocaleCache = null; + function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } + } + var intlResolvedOptionsCache = new Map(); + function getCachedIntResolvedOptions(locString) { + var opts = intlResolvedOptionsCache.get(locString); + if (opts === undefined) { + opts = new Intl.DateTimeFormat(locString).resolvedOptions(); + intlResolvedOptionsCache.set(locString, opts); + } + return opts; + } + var weekInfoCache = new Map(); + function getCachedWeekInfo(locString) { + var data = weekInfoCache.get(locString); + if (!data) { + var locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86 + if (!("minimalDays" in data)) { + data = _extends({}, fallbackWeekSettings, data); + } + weekInfoCache.set(locString, data); + } + return data; + } + function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + var xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + var uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + var options; + var selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + var smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + var _options = options, + numberingSystem = _options.numberingSystem, + calendar = _options.calendar; + return [selectedStr, numberingSystem, calendar]; + } + } + function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += "-ca-" + outputCalendar; + } + if (numberingSystem) { + localeStr += "-nu-" + numberingSystem; + } + return localeStr; + } else { + return localeStr; + } + } + function mapMonths(f) { + var ms = []; + for (var i = 1; i <= 12; i++) { + var dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; + } + function mapWeekdays(f) { + var ms = []; + for (var i = 1; i <= 7; i++) { + var dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; + } + function listStuff(loc, length, englishFn, intlFn) { + var mode = loc.listingMode(); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } + } + function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || getCachedIntResolvedOptions(loc.locale).numberingSystem === "latn"; + } + } + + /** + * @private + */ + var PolyNumberFormatter = /*#__PURE__*/function () { + function PolyNumberFormatter(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + opts.padTo; + opts.floor; + var otherOpts = _objectWithoutPropertiesLoose(opts, _excluded2); + if (!forceSimple || Object.keys(otherOpts).length > 0) { + var intlOpts = _extends({ + useGrouping: false + }, opts); + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + var _proto = PolyNumberFormatter.prototype; + _proto.format = function format(i) { + if (this.inf) { + var fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + var _fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(_fixed, this.padTo); + } + }; + return PolyNumberFormatter; + }(); + /** + * @private + */ + var PolyDateFormatter = /*#__PURE__*/function () { + function PolyDateFormatter(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + var z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + var gmtOffset = -1 * (dt.offset / 60); + var offsetZ = gmtOffset >= 0 ? "Etc/GMT+" + gmtOffset : "Etc/GMT" + gmtOffset; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + var intlOpts = _extends({}, this.opts); + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + var _proto2 = PolyDateFormatter.prototype; + _proto2.format = function format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts().map(function (_ref) { + var value = _ref.value; + return value; + }).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + }; + _proto2.formatToParts = function formatToParts() { + var _this = this; + var parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map(function (part) { + if (part.type === "timeZoneName") { + var offsetName = _this.originalZone.offsetName(_this.dt.ts, { + locale: _this.dt.locale, + format: _this.opts.timeZoneName + }); + return _extends({}, part, { + value: offsetName + }); + } else { + return part; + } + }); + } + return parts; + }; + _proto2.resolvedOptions = function resolvedOptions() { + return this.dtf.resolvedOptions(); + }; + return PolyDateFormatter; + }(); + /** + * @private + */ + var PolyRelFormatter = /*#__PURE__*/function () { + function PolyRelFormatter(intl, isEnglish, opts) { + this.opts = _extends({ + style: "long" + }, opts); + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + var _proto3 = PolyRelFormatter.prototype; + _proto3.format = function format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + }; + _proto3.formatToParts = function formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + }; + return PolyRelFormatter; + }(); + var fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7] + }; + + /** + * @private + */ + var Locale = /*#__PURE__*/function () { + Locale.fromOpts = function fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.weekSettings, opts.defaultToEN); + }; + Locale.create = function create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN) { + if (defaultToEN === void 0) { + defaultToEN = false; + } + var specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats + var localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + var numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + var outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + var weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + }; + Locale.resetCache = function resetCache() { + sysLocaleCache = null; + intlDTCache.clear(); + intlNumCache.clear(); + intlRelCache.clear(); + intlResolvedOptionsCache.clear(); + weekInfoCache.clear(); + }; + Locale.fromObject = function fromObject(_temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + locale = _ref2.locale, + numberingSystem = _ref2.numberingSystem, + outputCalendar = _ref2.outputCalendar, + weekSettings = _ref2.weekSettings; + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + }; + function Locale(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + var _parseLocaleString = parseLocaleString(locale), + parsedLocale = _parseLocaleString[0], + parsedNumberingSystem = _parseLocaleString[1], + parsedOutputCalendar = _parseLocaleString[2]; + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + var _proto4 = Locale.prototype; + _proto4.listingMode = function listingMode() { + var isActuallyEn = this.isEnglish(); + var hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + }; + _proto4.clone = function clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, validateWeekSettings(alts.weekSettings) || this.weekSettings, alts.defaultToEN || false); + } + }; + _proto4.redefaultToEN = function redefaultToEN(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: true + })); + }; + _proto4.redefaultToSystem = function redefaultToSystem(alts) { + if (alts === void 0) { + alts = {}; + } + return this.clone(_extends({}, alts, { + defaultToEN: false + })); + }; + _proto4.months = function months$1(length, format) { + var _this2 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, months, function () { + // Workaround for "ja" locale: formatToParts does not label all parts of the month + // as "month" and for this locale there is no difference between "format" and "non-format". + // As such, just use format() instead of formatToParts() and take the whole string + var monthSpecialCase = _this2.intl === "ja" || _this2.intl.startsWith("ja-"); + format &= !monthSpecialCase; + var intl = format ? { + month: length, + day: "numeric" + } : { + month: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this2.monthsCache[formatStr][length]) { + var mapper = !monthSpecialCase ? function (dt) { + return _this2.extract(dt, intl, "month"); + } : function (dt) { + return _this2.dtFormatter(dt, intl).format(); + }; + _this2.monthsCache[formatStr][length] = mapMonths(mapper); + } + return _this2.monthsCache[formatStr][length]; + }); + }; + _proto4.weekdays = function weekdays$1(length, format) { + var _this3 = this; + if (format === void 0) { + format = false; + } + return listStuff(this, length, weekdays, function () { + var intl = format ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, + formatStr = format ? "format" : "standalone"; + if (!_this3.weekdaysCache[formatStr][length]) { + _this3.weekdaysCache[formatStr][length] = mapWeekdays(function (dt) { + return _this3.extract(dt, intl, "weekday"); + }); + } + return _this3.weekdaysCache[formatStr][length]; + }); + }; + _proto4.meridiems = function meridiems$1() { + var _this4 = this; + return listStuff(this, undefined, function () { + return meridiems; + }, function () { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!_this4.meridiemCache) { + var intl = { + hour: "numeric", + hourCycle: "h12" + }; + _this4.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(function (dt) { + return _this4.extract(dt, intl, "dayperiod"); + }); + } + return _this4.meridiemCache; + }); + }; + _proto4.eras = function eras$1(length) { + var _this5 = this; + return listStuff(this, length, eras, function () { + var intl = { + era: length + }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!_this5.eraCache[length]) { + _this5.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(function (dt) { + return _this5.extract(dt, intl, "era"); + }); + } + return _this5.eraCache[length]; + }); + }; + _proto4.extract = function extract(dt, intlOpts, field) { + var df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find(function (m) { + return m.type.toLowerCase() === field; + }); + return matching ? matching.value : null; + }; + _proto4.numberFormatter = function numberFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + }; + _proto4.dtFormatter = function dtFormatter(dt, intlOpts) { + if (intlOpts === void 0) { + intlOpts = {}; + } + return new PolyDateFormatter(dt, this.intl, intlOpts); + }; + _proto4.relFormatter = function relFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + }; + _proto4.listFormatter = function listFormatter(opts) { + if (opts === void 0) { + opts = {}; + } + return getCachedLF(this.intl, opts); + }; + _proto4.isEnglish = function isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us"); + }; + _proto4.getWeekSettings = function getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + }; + _proto4.getStartOfWeek = function getStartOfWeek() { + return this.getWeekSettings().firstDay; + }; + _proto4.getMinDaysInFirstWeek = function getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + }; + _proto4.getWeekendDays = function getWeekendDays() { + return this.getWeekSettings().weekend; + }; + _proto4.equals = function equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + }; + _proto4.toString = function toString() { + return "Locale(" + this.locale + ", " + this.numberingSystem + ", " + this.outputCalendar + ")"; + }; + _createClass(Locale, [{ + key: "fastNumbers", + get: function get() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + }]); + return Locale; + }(); + + var singleton = null; + + /** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ + var FixedOffsetZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(FixedOffsetZone, _Zone); + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + FixedOffsetZone.instance = function instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */; + FixedOffsetZone.parseSpecifier = function parseSpecifier(s) { + if (s) { + var r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + }; + function FixedOffsetZone(offset) { + var _this; + _this = _Zone.call(this) || this; + /** @private **/ + _this.fixed = offset; + return _this; + } + + /** + * The type of zone. `fixed` for all instances of `FixedOffsetZone`. + * @override + * @type {string} + */ + var _proto = FixedOffsetZone.prototype; + /** + * Returns the offset's common name at the specified timestamp. + * + * For fixed offset zones this equals to the zone name. + * @override + */ + _proto.offsetName = function offsetName() { + return this.name; + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */; + _proto.formatOffset = function formatOffset$1(ts, format) { + return formatOffset(this.fixed, format); + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns true for all fixed offset zones. + * @override + * @type {boolean} + */; + /** + * Return the offset in minutes for this zone at the specified timestamp. + * + * For fixed offset zones, this is constant and does not depend on a timestamp. + * @override + * @return {number} + */ + _proto.offset = function offset() { + return this.fixed; + } + + /** + * Return whether this Zone is equal to another zone (i.e. also fixed and same offset) + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */; + _proto.equals = function equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** + * Return whether this Zone is valid: + * All fixed offset zones are valid. + * @override + * @type {boolean} + */; + _createClass(FixedOffsetZone, [{ + key: "type", + get: function get() { + return "fixed"; + } + + /** + * The name of this zone. + * All fixed zones' names always start with "UTC" (plus optional offset) + * @override + * @type {string} + */ + }, { + key: "name", + get: function get() { + return this.fixed === 0 ? "UTC" : "UTC" + formatOffset(this.fixed, "narrow"); + } + + /** + * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn` + * + * @override + * @type {string} + */ + }, { + key: "ianaName", + get: function get() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return "Etc/GMT" + formatOffset(-this.fixed, "narrow"); + } + } + }, { + key: "isUniversal", + get: function get() { + return true; + } + }, { + key: "isValid", + get: function get() { + return true; + } + }], [{ + key: "utcInstance", + get: + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + function get() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + }]); + return FixedOffsetZone; + }(Zone); + + /** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ + var InvalidZone = /*#__PURE__*/function (_Zone) { + _inheritsLoose(InvalidZone, _Zone); + function InvalidZone(zoneName) { + var _this; + _this = _Zone.call(this) || this; + /** @private */ + _this.zoneName = zoneName; + return _this; + } + + /** @override **/ + var _proto = InvalidZone.prototype; + /** @override **/ + _proto.offsetName = function offsetName() { + return null; + } + + /** @override **/; + _proto.formatOffset = function formatOffset() { + return ""; + } + + /** @override **/; + _proto.offset = function offset() { + return NaN; + } + + /** @override **/; + _proto.equals = function equals() { + return false; + } + + /** @override **/; + _createClass(InvalidZone, [{ + key: "type", + get: function get() { + return "invalid"; + } + + /** @override **/ + }, { + key: "name", + get: function get() { + return this.zoneName; + } + + /** @override **/ + }, { + key: "isUniversal", + get: function get() { + return false; + } + }, { + key: "isValid", + get: function get() { + return false; + } + }]); + return InvalidZone; + }(Zone); + + /** + * @private + */ + function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + var lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone;else if (lowered === "local" || lowered === "system") return SystemZone.instance;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } + } + + var numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d" + }; + var numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881] + }; + var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); + function parseDigits(str) { + var value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (var i = 0; i < str.length; i++) { + var code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (var key in numberingSystemsUTF16) { + var _numberingSystemsUTF = numberingSystemsUTF16[key], + min = _numberingSystemsUTF[0], + max = _numberingSystemsUTF[1]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } + } + + // cache of {numberingSystem: {append: regex}} + var digitRegexCache = new Map(); + function resetDigitRegexCache() { + digitRegexCache.clear(); + } + function digitRegex(_ref, append) { + var numberingSystem = _ref.numberingSystem; + if (append === void 0) { + append = ""; + } + var ns = numberingSystem || "latn"; + var appendCache = digitRegexCache.get(ns); + if (appendCache === undefined) { + appendCache = new Map(); + digitRegexCache.set(ns, appendCache); + } + var regex = appendCache.get(append); + if (regex === undefined) { + regex = new RegExp("" + numberingSystems[ns] + append); + appendCache.set(append, regex); + } + return regex; + } + + var now = function now() { + return Date.now(); + }, + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + + /** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ + var Settings = /*#__PURE__*/function () { + function Settings() {} + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + Settings.resetCaches = function resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + DateTime.resetCache(); + resetDigitRegexCache(); + }; + _createClass(Settings, null, [{ + key: "now", + get: + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + function get() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */, + set: function set(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + }, { + key: "defaultZone", + get: + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + function get() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(zone) { + defaultZone = zone; + } + }, { + key: "defaultLocale", + get: function get() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultNumberingSystem", + get: function get() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + }, { + key: "defaultOutputCalendar", + get: function get() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */, + set: function set(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + }, { + key: "defaultWeekSettings", + get: function get() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */, + set: function set(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + */ + }, { + key: "twoDigitCutoffYear", + get: function get() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century + * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */, + set: function set(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + }, { + key: "throwOnInvalid", + get: function get() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */, + set: function set(t) { + throwOnInvalid = t; + } + }]); + return Settings; + }(); + + var Invalid = /*#__PURE__*/function () { + function Invalid(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + var _proto = Invalid.prototype; + _proto.toMessage = function toMessage() { + if (this.explanation) { + return this.reason + ": " + this.explanation; + } else { + return this.reason; + } + }; + return Invalid; + }(); + + var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; + function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", "you specified " + value + " (of type " + typeof value + ") as a " + unit + ", which is invalid"); + } + function dayOfWeek(year, month, day) { + var d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + var js = d.getUTCDay(); + return js === 0 ? 7 : js; + } + function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; + } + function uncomputeOrdinal(year, ordinal) { + var table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex(function (i) { + return i < ordinal; + }), + day = ordinal - table[month0]; + return { + month: month0 + 1, + day: day + }; + } + function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return (isoWeekday - startOfWeek + 7) % 7 + 1; + } + + /** + * @private + */ + + function gregorianToWeek(gregObj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var year = gregObj.year, + month = gregObj.month, + day = gregObj.day, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + var weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return _extends({ + weekYear: weekYear, + weekNumber: weekNumber, + weekday: weekday + }, timeObject(gregObj)); + } + function weekToGregorian(weekData, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekYear = weekData.weekYear, + weekNumber = weekData.weekNumber, + weekday = weekData.weekday, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + var ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + var _uncomputeOrdinal = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal.month, + day = _uncomputeOrdinal.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(weekData)); + } + function gregorianToOrdinal(gregData) { + var year = gregData.year, + month = gregData.month, + day = gregData.day; + var ordinal = computeOrdinal(year, month, day); + return _extends({ + year: year, + ordinal: ordinal + }, timeObject(gregData)); + } + function ordinalToGregorian(ordinalData) { + var year = ordinalData.year, + ordinal = ordinalData.ordinal; + var _uncomputeOrdinal2 = uncomputeOrdinal(year, ordinal), + month = _uncomputeOrdinal2.month, + day = _uncomputeOrdinal2.day; + return _extends({ + year: year, + month: month, + day: day + }, timeObject(ordinalData)); + } + + /** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ + function usesLocalWeekValues(obj, loc) { + var hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + var hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + if (hasIsoWeekData) { + throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields"); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek() + }; + } else { + return { + minDaysInFirstWeek: 4, + startOfWeek: 1 + }; + } + } + function hasInvalidWeekData(obj, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var validYear = isInteger(obj.weekYear), + validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), + validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; + } + function hasInvalidOrdinalData(obj) { + var validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; + } + function hasInvalidGregorianData(obj) { + var validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; + } + function hasInvalidTimeData(obj) { + var hour = obj.hour, + minute = obj.minute, + second = obj.second, + millisecond = obj.millisecond; + var validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; + } + + /** + * @private + */ + + // TYPES + + function isUndefined(o) { + return typeof o === "undefined"; + } + function isNumber(o) { + return typeof o === "number"; + } + function isInteger(o) { + return typeof o === "number" && o % 1 === 0; + } + function isString(o) { + return typeof o === "string"; + } + function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; + } + + // CAPABILITIES + + function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } + } + function hasLocaleWeekInfo() { + try { + return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype); + } catch (e) { + return false; + } + } + + // OBJECTS AND ARRAYS + + function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; + } + function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce(function (best, next) { + var pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; + } + function pick(obj, keys) { + return keys.reduce(function (a, k) { + a[k] = obj[k]; + return a; + }, {}); + } + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(function (v) { + return !integerBetween(v, 1, 7); + })) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend) + }; + } + } + + // NUMBERS AND STRINGS + + function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; + } + + // x % n but takes the sign of n instead of x + function floorMod(x, n) { + return x - n * Math.floor(x / n); + } + function padStart(input, n) { + if (n === void 0) { + n = 2; + } + var isNeg = input < 0; + var padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; + } + function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } + } + function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } + } + function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + var f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } + } + function roundTo(number, digits, rounding) { + if (rounding === void 0) { + rounding = "round"; + } + var factor = Math.pow(10, digits); + switch (rounding) { + case "expand": + return number > 0 ? Math.ceil(number * factor) / factor : Math.floor(number * factor) / factor; + case "trunc": + return Math.trunc(number * factor) / factor; + case "round": + return Math.round(number * factor) / factor; + case "floor": + return Math.floor(number * factor) / factor; + case "ceil": + return Math.ceil(number * factor) / factor; + default: + throw new RangeError("Value rounding " + rounding + " is out of range"); + } + } + + // DATE BASICS + + function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); + } + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + function daysInMonth(year, month) { + var modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } + } + + // convert a calendar object to a local timestamp (epoch, but with the offset baked in) + function objToLocalTS(obj) { + var d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; + } + + // adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js + function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + var fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; + } + function weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek) { + if (minDaysInFirstWeek === void 0) { + minDaysInFirstWeek = 4; + } + if (startOfWeek === void 0) { + startOfWeek = 1; + } + var weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + var weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; + } + function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; + } + + // PARSING + + function parseZoneInfo(ts, offsetFormat, locale, timeZone) { + if (timeZone === void 0) { + timeZone = null; + } + var date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + var modified = _extends({ + timeZoneName: offsetFormat + }, intlOpts); + var parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(function (m) { + return m.type.toLowerCase() === "timezonename"; + }); + return parsed ? parsed.value : null; + } + + // signedOffset('-5', '30') -> -330 + function signedOffset(offHourStr, offMinuteStr) { + var offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + var offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; + } + + // COERCION + + function asNumber(value) { + var numericValue = Number(value); + if (typeof value === "boolean" || value === "" || !Number.isFinite(numericValue)) throw new InvalidArgumentError("Invalid unit value " + value); + return numericValue; + } + function normalizeObject(obj, normalizer) { + var normalized = {}; + for (var u in obj) { + if (hasOwnProperty(obj, u)) { + var v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; + } + + /** + * Returns the offset's value as a string + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + function formatOffset(offset, format) { + var hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + switch (format) { + case "short": + return "" + sign + padStart(hours, 2) + ":" + padStart(minutes, 2); + case "narrow": + return "" + sign + hours + (minutes > 0 ? ":" + minutes : ""); + case "techie": + return "" + sign + padStart(hours, 2) + padStart(minutes, 2); + default: + throw new RangeError("Value format " + format + " is out of range for property format"); + } + } + function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); + } + + /** + * @private + */ + + var monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + var monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; + function months(length) { + switch (length) { + case "narrow": + return [].concat(monthsNarrow); + case "short": + return [].concat(monthsShort); + case "long": + return [].concat(monthsLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } + } + var weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; + var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; + var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; + function weekdays(length) { + switch (length) { + case "narrow": + return [].concat(weekdaysNarrow); + case "short": + return [].concat(weekdaysShort); + case "long": + return [].concat(weekdaysLong); + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } + } + var meridiems = ["AM", "PM"]; + var erasLong = ["Before Christ", "Anno Domini"]; + var erasShort = ["BC", "AD"]; + var erasNarrow = ["B", "A"]; + function eras(length) { + switch (length) { + case "narrow": + return [].concat(erasNarrow); + case "short": + return [].concat(erasShort); + case "long": + return [].concat(erasLong); + default: + return null; + } + } + function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; + } + function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; + } + function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; + } + function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; + } + function formatRelativeTime(unit, count, numeric, narrow) { + if (numeric === void 0) { + numeric = "always"; + } + if (narrow === void 0) { + narrow = false; + } + var units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."] + }; + var lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + var isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : "next " + units[unit][0]; + case -1: + return isDay ? "yesterday" : "last " + units[unit][0]; + case 0: + return isDay ? "today" : "this " + units[unit][0]; + } + } + + var isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? fmtValue + " " + fmtUnit + " ago" : "in " + fmtValue + " " + fmtUnit; + } + + function stringifyTokens(splits, tokenToString) { + var s = ""; + for (var _iterator = _createForOfIteratorHelperLoose(splits), _step; !(_step = _iterator()).done;) { + var token = _step.value; + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; + } + var _macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS + }; + + /** + * @private + */ + var Formatter = /*#__PURE__*/function () { + Formatter.create = function create(locale, opts) { + if (opts === void 0) { + opts = {}; + } + return new Formatter(locale, opts); + }; + Formatter.parseFormat = function parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + var current = null, + currentFull = "", + bracketed = false; + var splits = []; + for (var i = 0; i < fmt.length; i++) { + var c = fmt.charAt(i); + if (c === "'") { + // turn '' into a literal signal quote instead of just skipping the empty literal + if (currentFull.length > 0 || bracketed) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull === "" ? "'" : currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + }; + Formatter.macroTokenToFormatOpts = function macroTokenToFormatOpts(token) { + return _macroTokenToFormatOpts[token]; + }; + function Formatter(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + var _proto = Formatter.prototype; + _proto.formatWithSystemDefault = function formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + var df = this.systemLoc.dtFormatter(dt, _extends({}, this.opts, opts)); + return df.format(); + }; + _proto.dtFormatter = function dtFormatter(dt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.loc.dtFormatter(dt, _extends({}, this.opts, opts)); + }; + _proto.formatDateTime = function formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + }; + _proto.formatDateTimeParts = function formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + }; + _proto.formatInterval = function formatInterval(interval, opts) { + var df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + }; + _proto.resolvedOptions = function resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + }; + _proto.num = function num(n, p, signDisplay) { + if (p === void 0) { + p = 0; + } + if (signDisplay === void 0) { + signDisplay = undefined; + } + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + var opts = _extends({}, this.opts); + if (p > 0) { + opts.padTo = p; + } + if (signDisplay) { + opts.signDisplay = signDisplay; + } + return this.loc.numberFormatter(opts).format(n); + }; + _proto.formatDateTimeFromString = function formatDateTimeFromString(dt, fmt) { + var _this = this; + var knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = function string(opts, extract) { + return _this.loc.extract(dt, opts, extract); + }, + formatOffset = function formatOffset(opts) { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = function meridiem() { + return knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"); + }, + month = function month(length, standalone) { + return knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"); + }, + weekday = function weekday(length, standalone) { + return knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"); + }, + maybeMacro = function maybeMacro(token) { + var formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return _this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = function era(length) { + return knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"); + }, + tokenToString = function tokenToString(token) { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return _this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return _this.num(dt.millisecond, 3); + // seconds + case "s": + return _this.num(dt.second); + case "ss": + return _this.num(dt.second, 2); + // fractional seconds + case "uu": + return _this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return _this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return _this.num(dt.minute); + case "mm": + return _this.num(dt.minute, 2); + // hours + case "h": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return _this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return _this.num(dt.hour); + case "HH": + return _this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ + format: "narrow", + allowZ: _this.opts.allowZ + }); + case "ZZ": + // like +06:00 + return formatOffset({ + format: "short", + allowZ: _this.opts.allowZ + }); + case "ZZZ": + // like +0600 + return formatOffset({ + format: "techie", + allowZ: _this.opts.allowZ + }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: _this.loc.locale + }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: _this.loc.locale + }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : _this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : _this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return _this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return _this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : _this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : _this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : _this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : _this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : _this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : _this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return _this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return _this.num(dt.weekYear, 4); + case "W": + return _this.num(dt.weekNumber); + case "WW": + return _this.num(dt.weekNumber, 2); + case "n": + return _this.num(dt.localWeekNumber); + case "nn": + return _this.num(dt.localWeekNumber, 2); + case "ii": + return _this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return _this.num(dt.localWeekYear, 4); + case "o": + return _this.num(dt.ordinal); + case "ooo": + return _this.num(dt.ordinal, 3); + case "q": + // like 1 + return _this.num(dt.quarter); + case "qq": + // like 01 + return _this.num(dt.quarter, 2); + case "X": + return _this.num(Math.floor(dt.ts / 1000)); + case "x": + return _this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + }; + _proto.formatDurationFromString = function formatDurationFromString(dur, fmt) { + var _this2 = this; + var invertLargest = this.opts.signMode === "negativeLargestOnly" ? -1 : 1; + var tokenToField = function tokenToField(token) { + switch (token[0]) { + case "S": + return "milliseconds"; + case "s": + return "seconds"; + case "m": + return "minutes"; + case "h": + return "hours"; + case "d": + return "days"; + case "w": + return "weeks"; + case "M": + return "months"; + case "y": + return "years"; + default: + return null; + } + }, + tokenToString = function tokenToString(lildur, info) { + return function (token) { + var mapped = tokenToField(token); + if (mapped) { + var inversionFactor = info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1; + var signDisplay; + if (_this2.opts.signMode === "negativeLargestOnly" && mapped !== info.largestUnit) { + signDisplay = "never"; + } else if (_this2.opts.signMode === "all") { + signDisplay = "always"; + } else { + // "auto" and "negative" are the same, but "auto" has better support + signDisplay = "auto"; + } + return _this2.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay); + } else { + return token; + } + }; + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce(function (found, _ref) { + var literal = _ref.literal, + val = _ref.val; + return literal ? found : found.concat(val); + }, []), + collapsed = dur.shiftTo.apply(dur, realTokens.map(tokenToField).filter(function (t) { + return t; + })), + durationInfo = { + isNegativeDuration: collapsed < 0, + // this relies on "collapsed" being based on "shiftTo", which builds up the object + // in order + largestUnit: Object.keys(collapsed.values)[0] + }; + return stringifyTokens(tokens, tokenToString(collapsed, durationInfo)); + }; + return Formatter; + }(); + + /* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + + var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; + function combineRegexes() { + for (var _len = arguments.length, regexes = new Array(_len), _key = 0; _key < _len; _key++) { + regexes[_key] = arguments[_key]; + } + var full = regexes.reduce(function (f, r) { + return f + r.source; + }, ""); + return RegExp("^" + full + "$"); + } + function combineExtractors() { + for (var _len2 = arguments.length, extractors = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + extractors[_key2] = arguments[_key2]; + } + return function (m) { + return extractors.reduce(function (_ref, ex) { + var mergedVals = _ref[0], + mergedZone = _ref[1], + cursor = _ref[2]; + var _ex = ex(m, cursor), + val = _ex[0], + zone = _ex[1], + next = _ex[2]; + return [_extends({}, mergedVals, val), zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); + }; + } + function parse(s) { + if (s == null) { + return [null, null]; + } + for (var _len3 = arguments.length, patterns = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + patterns[_key3 - 1] = arguments[_key3]; + } + for (var _i = 0, _patterns = patterns; _i < _patterns.length; _i++) { + var _patterns$_i = _patterns[_i], + regex = _patterns$_i[0], + extractor = _patterns$_i[1]; + var m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; + } + function simpleParse() { + for (var _len4 = arguments.length, keys = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + keys[_key4] = arguments[_key4]; + } + return function (match, cursor) { + var ret = {}; + var i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; + } + + // ISO and SQL parsing + var offsetRegex = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/; + var isoExtendedZone = "(?:" + offsetRegex.source + "?(?:\\[(" + ianaRegex.source + ")\\])?)?"; + var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; + var isoTimeRegex = RegExp("" + isoTimeBaseRegex.source + isoExtendedZone); + var isoTimeExtensionRegex = RegExp("(?:[Tt]" + isoTimeRegex.source + ")?"); + var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; + var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; + var isoOrdinalRegex = /(\d{4})-?(\d{3})/; + var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); + var extractISOOrdinalData = simpleParse("year", "ordinal"); + var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one + var sqlTimeRegex = RegExp(isoTimeBaseRegex.source + " ?(?:" + offsetRegex.source + "|(" + ianaRegex.source + "))?"); + var sqlTimeExtensionRegex = RegExp("(?: " + sqlTimeRegex.source + ")?"); + function int(match, pos, fallback) { + var m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); + } + function extractISOYmd(match, cursor) { + var item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1) + }; + return [item, null, cursor + 3]; + } + function extractISOTime(match, cursor) { + var item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]) + }; + return [item, null, cursor + 4]; + } + function extractISOOffset(match, cursor) { + var local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; + } + function extractIANAZone(match, cursor) { + var zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; + } + + // ISO time parsing + + var isoTimeOnly = RegExp("^T?" + isoTimeBaseRegex.source + "$"); + + // ISO duration parsing + + var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; + function extractISODuration(match) { + var s = match[0], + yearStr = match[1], + monthStr = match[2], + weekStr = match[3], + dayStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + millisecondsStr = match[8]; + var hasNegativePrefix = s[0] === "-"; + var negativeSeconds = secondStr && secondStr[0] === "-"; + var maybeNegate = function maybeNegate(num, force) { + if (force === void 0) { + force = false; + } + return num !== undefined && (force || num && hasNegativePrefix) ? -num : num; + }; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; + } + + // These are a little braindead. EDT *should* tell us that we're in, say, America/New_York + // and not just that we're in -240 *right now*. But since I don't think these are used that often + // I'm just going to ignore that + var obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 + }; + function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; + } + + // RFC 2822/5322 + var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; + function extractRFC2822(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + obsOffset = match[8], + milOffset = match[9], + offHourStr = match[10], + offMinuteStr = match[11], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + var offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset)]; + } + function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); + } + + // http date + + var rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; + function extractRFC1123Or850(match) { + var weekdayStr = match[1], + dayStr = match[2], + monthStr = match[3], + yearStr = match[4], + hourStr = match[5], + minuteStr = match[6], + secondStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + function extractASCII(match) { + var weekdayStr = match[1], + monthStr = match[2], + dayStr = match[3], + hourStr = match[4], + minuteStr = match[5], + secondStr = match[6], + yearStr = match[7], + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; + } + var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); + var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); + var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); + var isoTimeCombinedRegex = combineRegexes(isoTimeRegex); + var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); + var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + + /* + * @private + */ + + function parseISODate(s) { + return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); + } + function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); + } + function parseHTTPDate(s) { + return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); + } + function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); + } + var extractISOTimeOnly = combineExtractors(extractISOTime); + function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); + } + var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); + var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); + var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + function parseSQL(s) { + return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); + } + + var INVALID$2 = "Invalid Duration"; + + // unit conversion constants + var lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000 + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000 + }, + hours: { + minutes: 60, + seconds: 60 * 60, + milliseconds: 60 * 60 * 1000 + }, + minutes: { + seconds: 60, + milliseconds: 60 * 1000 + }, + seconds: { + milliseconds: 1000 + } + }, + casualMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000 + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix), + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = _extends({ + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000 + } + }, lowOrderMatrix); + + // units ordered by size + var orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; + var reverseUnits = orderedUnits$1.slice(0).reverse(); + + // clone really means "create another instance just like this one, but with these changes" + function clone$1(dur, alts, clear) { + if (clear === void 0) { + clear = false; + } + // deep merge for vals + var conf = { + values: clear ? alts.values : _extends({}, dur.values, alts.values || {}), + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); + } + function durationToMillis(matrix, vals) { + var _vals$milliseconds; + var sum = (_vals$milliseconds = vals.milliseconds) != null ? _vals$milliseconds : 0; + for (var _iterator = _createForOfIteratorHelperLoose(reverseUnits.slice(1)), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; + } + + // NB: mutates parameters + function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + var factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + orderedUnits$1.reduceRight(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var previousVal = vals[previous] * factor; + var conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + var rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce(function (previous, current) { + if (!isUndefined(vals[current])) { + if (previous) { + var fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); + } + + // Remove all properties with a value of 0 from an object + function removeZeroes(vals) { + var newVals = {}; + for (var _i = 0, _Object$entries = Object.entries(vals); _i < _Object$entries.length; _i++) { + var _Object$entries$_i = _Object$entries[_i], + key = _Object$entries$_i[0], + value = _Object$entries$_i[1]; + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; + } + + /** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ + var Duration = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Duration(config) { + var accurate = config.conversionAccuracy === "longterm" || false; + var matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + Duration.fromMillis = function fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */; + Duration.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got " + (obj === null ? "null" : typeof obj)); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */; + Duration.fromDurationLike = function fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError("Unknown duration argument " + durationLike + " of type " + typeof durationLike); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */; + Duration.fromISO = function fromISO(text, opts) { + var _parseISODuration = parseISODuration(text), + parsed = _parseISODuration[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */; + Duration.fromISOTime = function fromISOTime(text, opts) { + var _parseISOTimeOnly = parseISOTimeOnly(text), + parsed = _parseISOTimeOnly[0]; + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */; + Duration.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid: invalid + }); + } + } + + /** + * @private + */; + Duration.normalizeUnit = function normalizeUnit(unit) { + var normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Duration.isDuration = function isDuration(o) { + return o && o.isLuxonDuration || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */; + var _proto = Duration.prototype; + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat("d s", { signMode: "all" }) //=> "+6 +2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "all" }) //=> "-6 -2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "negativeLargestOnly" }) //=> "-6 2" + * @return {string} + */ + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + var fmtOpts = _extends({}, opts, { + floor: opts.round !== false && opts.floor !== false + }); + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero + * @example + * ```js + * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 mth, 0 wks, 5 hr, 6 min' + * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes' + * ``` + */; + _proto.toHuman = function toHuman(opts) { + var _this = this; + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return INVALID$2; + var showZeros = opts.showZeros !== false; + var l = orderedUnits$1.map(function (unit) { + var val = _this.values[unit]; + if (isUndefined(val) || val === 0 && !showZeros) { + return null; + } + return _this.loc.numberFormatter(_extends({ + style: "unit", + unitDisplay: "long" + }, opts, { + unit: unit.slice(0, -1) + })).format(val); + }).filter(function (n) { + return n; + }); + return this.loc.listFormatter(_extends({ + type: "conjunction", + style: opts.listStyle || "narrow" + }, opts)).format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */; + _proto.toObject = function toObject() { + if (!this.isValid) return {}; + return _extends({}, this.values); + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */; + _proto.toISO = function toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + var s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return null; + var millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + opts = _extends({ + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended" + }, opts, { + includeOffset: false + }); + var dateTime = DateTime.fromMillis(millis, { + zone: "UTC" + }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */; + _proto.toString = function toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Duration { values: " + JSON.stringify(this.values) + " }"; + } else { + return "Duration { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */; + _proto.toMillis = function toMillis() { + if (!this.isValid) return NaN; + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration), + result = {}; + for (var _i2 = 0, _orderedUnits = orderedUnits$1; _i2 < _orderedUnits.length; _i2++) { + var k = _orderedUnits[_i2]; + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */; + _proto.mapUnits = function mapUnits(fn) { + if (!this.isValid) return this; + var result = {}; + for (var _i3 = 0, _Object$keys = Object.keys(this.values); _i3 < _Object$keys.length; _i3++) { + var k = _Object$keys[_i3]; + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */; + _proto.get = function get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var mixed = _extends({}, this.values, normalizeObject(values, Duration.normalizeUnit)); + return clone$1(this, { + values: mixed + }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */; + _proto.reconfigure = function reconfigure(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + locale = _ref.locale, + numberingSystem = _ref.numberingSystem, + conversionAccuracy = _ref.conversionAccuracy, + matrix = _ref.matrix; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem + }); + var opts = { + loc: loc, + matrix: matrix, + conversionAccuracy: conversionAccuracy + }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */; + _proto.as = function as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */; + _proto.normalize = function normalize() { + if (!this.isValid) return this; + var vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */; + _proto.rescale = function rescale() { + if (!this.isValid) return this; + var vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */; + _proto.shiftTo = function shiftTo() { + for (var _len = arguments.length, units = new Array(_len), _key = 0; _key < _len; _key++) { + units[_key] = arguments[_key]; + } + if (!this.isValid) return this; + if (units.length === 0) { + return this; + } + units = units.map(function (u) { + return Duration.normalizeUnit(u); + }); + var built = {}, + accumulated = {}, + vals = this.toObject(); + var lastUnit; + for (var _i4 = 0, _orderedUnits2 = orderedUnits$1; _i4 < _orderedUnits2.length; _i4++) { + var k = _orderedUnits2[_i4]; + if (units.indexOf(k) >= 0) { + lastUnit = k; + var own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (var ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + var i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (var key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + normalizeValues(this.matrix, built); + return clone$1(this, { + values: built + }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */; + _proto.shiftToAll = function shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */; + _proto.negate = function negate() { + if (!this.isValid) return this; + var negated = {}; + for (var _i5 = 0, _Object$keys2 = Object.keys(this.values); _i5 < _Object$keys2.length; _i5++) { + var k = _Object$keys2[_i5]; + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + + /** + * Removes all units with values equal to 0 from this Duration. + * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 } + * @return {Duration} + */; + _proto.removeZeros = function removeZeros() { + if (!this.isValid) return this; + var vals = removeZeroes(this.values); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Get the years. + * @type {number} + */; + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + for (var _i6 = 0, _orderedUnits3 = orderedUnits$1; _i6 < _orderedUnits3.length; _i6++) { + var u = _orderedUnits3[_i6]; + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + }; + _createClass(Duration, [{ + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + }, { + key: "years", + get: function get() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + }, { + key: "quarters", + get: function get() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + }, { + key: "months", + get: function get() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + }, { + key: "weeks", + get: function get() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + }, { + key: "days", + get: function get() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + }, { + key: "hours", + get: function get() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + }, { + key: "minutes", + get: function get() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + }, { + key: "seconds", + get: function get() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + }, { + key: "milliseconds", + get: function get() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Duration; + }(Symbol.for("nodejs.util.inspect.custom")); + + var INVALID$1 = "Invalid Interval"; + + // checks if the start is equal to or before the end + function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid("end before start", "The end of an interval must be after its start, but you had start=" + start.toISO() + " and end=" + end.toISO()); + } else { + return null; + } + } + + /** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ + var Interval = /*#__PURE__*/function (_Symbol$for) { + /** + * @private + */ + function Interval(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + Interval.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid: invalid + }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */; + Interval.fromDateTimes = function fromDateTimes(start, end) { + var builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + var validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.after = function after(start, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */; + Interval.before = function before(end, duration) { + var dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */; + Interval.fromISO = function fromISO(text, opts) { + var _split = (text || "").split("/", 2), + s = _split[0], + e = _split[1]; + if (s && e) { + var start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + var end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + if (startIsValid) { + var dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + var _dur = Duration.fromISO(s, opts); + if (_dur.isValid) { + return Interval.before(end, _dur); + } + } + } + return Interval.invalid("unparsable", "the input \"" + text + "\" can't be parsed as ISO 8601"); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + Interval.isInterval = function isInterval(o) { + return o && o.isLuxonInterval || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */; + var _proto = Interval.prototype; + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + _proto.length = function length(unit) { + if (unit === void 0) { + unit = "milliseconds"; + } + return this.isValid ? this.toDuration.apply(this, [unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */; + _proto.count = function count(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (!this.isValid) return NaN; + var start = this.start.startOf(unit, opts); + var end; + if (opts != null && opts.useLocaleWeeks) { + end = this.end.reconfigure({ + locale: start.locale + }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */; + _proto.hasSame = function hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */; + _proto.isEmpty = function isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isAfter = function isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.isBefore = function isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */; + _proto.contains = function contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */; + _proto.set = function set(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + start = _ref.start, + end = _ref.end; + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */; + _proto.splitAt = function splitAt() { + var _this = this; + if (!this.isValid) return []; + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + var sorted = dateTimes.map(friendlyDateTime).filter(function (d) { + return _this.contains(d); + }).sort(function (a, b) { + return a.toMillis() - b.toMillis(); + }), + results = []; + var s = this.s, + i = 0; + while (s < this.e) { + var added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */; + _proto.splitBy = function splitBy(duration) { + var dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + var s = this.s, + idx = 1, + next; + var results = []; + while (s < this.e) { + var added = this.start.plus(dur.mapUnits(function (x) { + return x * idx; + })); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */; + _proto.divideEqually = function divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */; + _proto.overlaps = function overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsStart = function abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */; + _proto.abutsEnd = function abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise. + * @param {Interval} other + * @return {boolean} + */; + _proto.engulfs = function engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */; + _proto.equals = function equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */; + _proto.intersection = function intersection(other) { + if (!this.isValid) return this; + var s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */; + _proto.union = function union(other) { + if (!this.isValid) return this; + var s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into an equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval + * and ending with the latest. + * + * @param {Array} intervals + * @return {Array} + */; + Interval.merge = function merge(intervals) { + var _intervals$sort$reduc = intervals.sort(function (a, b) { + return a.s - b.s; + }).reduce(function (_ref2, item) { + var sofar = _ref2[0], + current = _ref2[1]; + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]), + found = _intervals$sort$reduc[0], + final = _intervals$sort$reduc[1]; + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */; + Interval.xor = function xor(intervals) { + var _Array$prototype; + var start = null, + currentCount = 0; + var results = [], + ends = intervals.map(function (i) { + return [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]; + }), + flattened = (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, ends), + arr = flattened.sort(function (a, b) { + return a.time - b.time; + }); + for (var _iterator = _createForOfIteratorHelperLoose(arr), _step; !(_step = _iterator()).done;) { + var i = _step.value; + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + start = null; + } + } + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */; + _proto.difference = function difference() { + var _this2 = this; + for (var _len2 = arguments.length, intervals = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + intervals[_key2] = arguments[_key2]; + } + return Interval.xor([this].concat(intervals)).map(function (i) { + return _this2.intersection(i); + }).filter(function (i) { + return i && !i.isEmpty(); + }); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */; + _proto.toString = function toString() { + if (!this.isValid) return INVALID$1; + return "[" + this.s.toISO() + " \u2013 " + this.e.toISO() + ")"; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "Interval { start: " + this.s.toISO() + ", end: " + this.e.toISO() + " }"; + } else { + return "Interval { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISO = function toISO(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISO(opts) + "/" + this.e.toISO(opts); + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */; + _proto.toISODate = function toISODate() { + if (!this.isValid) return INVALID$1; + return this.s.toISODate() + "/" + this.e.toISODate(); + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */; + _proto.toISOTime = function toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return this.s.toISOTime(opts) + "/" + this.e.toISOTime(opts); + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */; + _proto.toFormat = function toFormat(dateFormat, _temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + _ref3$separator = _ref3.separator, + separator = _ref3$separator === void 0 ? " – " : _ref3$separator; + if (!this.isValid) return INVALID$1; + return "" + this.s.toFormat(dateFormat) + separator + this.e.toFormat(dateFormat); + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */; + _proto.toDuration = function toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */; + _proto.mapEndpoints = function mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + }; + _createClass(Interval, [{ + key: "start", + get: function get() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval. This is the first instant which is not part of the interval + * (Interval is half-open). + * @type {DateTime} + */ + }, { + key: "end", + get: function get() { + return this.isValid ? this.e : null; + } + + /** + * Returns the last DateTime included in the interval (since end is not part of the interval) + * @type {DateTime} + */ + }, { + key: "lastDateTime", + get: function get() { + return this.isValid ? this.e ? this.e.minus(1) : null : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + }, { + key: "isValid", + get: function get() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + }]); + return Interval; + }(Symbol.for("nodejs.util.inspect.custom")); + + /** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ + var Info = /*#__PURE__*/function () { + function Info() {} + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + Info.hasDST = function hasDST(zone) { + if (zone === void 0) { + zone = Settings.defaultZone; + } + var proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */; + Info.isValidIANAZone = function isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */; + Info.normalizeZone = function normalizeZone$1(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */; + Info.getStartOfWeek = function getStartOfWeek(_temp) { + var _ref = _temp === void 0 ? {} : _temp, + _ref$locale = _ref.locale, + locale = _ref$locale === void 0 ? null : _ref$locale, + _ref$locObj = _ref.locObj, + locObj = _ref$locObj === void 0 ? null : _ref$locObj; + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */; + Info.getMinimumDaysInFirstWeek = function getMinimumDaysInFirstWeek(_temp2) { + var _ref2 = _temp2 === void 0 ? {} : _temp2, + _ref2$locale = _ref2.locale, + locale = _ref2$locale === void 0 ? null : _ref2$locale, + _ref2$locObj = _ref2.locObj, + locObj = _ref2$locObj === void 0 ? null : _ref2$locObj; + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */; + Info.getWeekendWeekdays = function getWeekendWeekdays(_temp3) { + var _ref3 = _temp3 === void 0 ? {} : _temp3, + _ref3$locale = _ref3.locale, + locale = _ref3$locale === void 0 ? null : _ref3$locale, + _ref3$locObj = _ref3.locObj, + locObj = _ref3$locObj === void 0 ? null : _ref3$locObj; + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */; + Info.months = function months(length, _temp4) { + if (length === void 0) { + length = "long"; + } + var _ref4 = _temp4 === void 0 ? {} : _temp4, + _ref4$locale = _ref4.locale, + locale = _ref4$locale === void 0 ? null : _ref4$locale, + _ref4$numberingSystem = _ref4.numberingSystem, + numberingSystem = _ref4$numberingSystem === void 0 ? null : _ref4$numberingSystem, + _ref4$locObj = _ref4.locObj, + locObj = _ref4$locObj === void 0 ? null : _ref4$locObj, + _ref4$outputCalendar = _ref4.outputCalendar, + outputCalendar = _ref4$outputCalendar === void 0 ? "gregory" : _ref4$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */; + Info.monthsFormat = function monthsFormat(length, _temp5) { + if (length === void 0) { + length = "long"; + } + var _ref5 = _temp5 === void 0 ? {} : _temp5, + _ref5$locale = _ref5.locale, + locale = _ref5$locale === void 0 ? null : _ref5$locale, + _ref5$numberingSystem = _ref5.numberingSystem, + numberingSystem = _ref5$numberingSystem === void 0 ? null : _ref5$numberingSystem, + _ref5$locObj = _ref5.locObj, + locObj = _ref5$locObj === void 0 ? null : _ref5$locObj, + _ref5$outputCalendar = _ref5.outputCalendar, + outputCalendar = _ref5$outputCalendar === void 0 ? "gregory" : _ref5$outputCalendar; + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */; + Info.weekdays = function weekdays(length, _temp6) { + if (length === void 0) { + length = "long"; + } + var _ref6 = _temp6 === void 0 ? {} : _temp6, + _ref6$locale = _ref6.locale, + locale = _ref6$locale === void 0 ? null : _ref6$locale, + _ref6$numberingSystem = _ref6.numberingSystem, + numberingSystem = _ref6$numberingSystem === void 0 ? null : _ref6$numberingSystem, + _ref6$locObj = _ref6.locObj, + locObj = _ref6$locObj === void 0 ? null : _ref6$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */; + Info.weekdaysFormat = function weekdaysFormat(length, _temp7) { + if (length === void 0) { + length = "long"; + } + var _ref7 = _temp7 === void 0 ? {} : _temp7, + _ref7$locale = _ref7.locale, + locale = _ref7$locale === void 0 ? null : _ref7$locale, + _ref7$numberingSystem = _ref7.numberingSystem, + numberingSystem = _ref7$numberingSystem === void 0 ? null : _ref7$numberingSystem, + _ref7$locObj = _ref7.locObj, + locObj = _ref7$locObj === void 0 ? null : _ref7$locObj; + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */; + Info.meridiems = function meridiems(_temp8) { + var _ref8 = _temp8 === void 0 ? {} : _temp8, + _ref8$locale = _ref8.locale, + locale = _ref8$locale === void 0 ? null : _ref8$locale; + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */; + Info.eras = function eras(length, _temp9) { + if (length === void 0) { + length = "short"; + } + var _ref9 = _temp9 === void 0 ? {} : _temp9, + _ref9$locale = _ref9.locale, + locale = _ref9$locale === void 0 ? null : _ref9$locale; + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */; + Info.features = function features() { + return { + relative: hasRelative(), + localeWeek: hasLocaleWeekInfo() + }; + }; + return Info; + }(); + + function dayDiff(earlier, later) { + var utcDayStart = function utcDayStart(dt) { + return dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(); + }, + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); + } + function highOrderDiffs(cursor, later, units) { + var differs = [["years", function (a, b) { + return b.year - a.year; + }], ["quarters", function (a, b) { + return b.quarter - a.quarter + (b.year - a.year) * 4; + }], ["months", function (a, b) { + return b.month - a.month + (b.year - a.year) * 12; + }], ["weeks", function (a, b) { + var days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + var results = {}; + var earlier = cursor; + var lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (var _i = 0, _differs = differs; _i < _differs.length; _i++) { + var _differs$_i = _differs[_i], + unit = _differs$_i[0], + differ = _differs$_i[1]; + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; + } + function _diff (earlier, later, units, opts) { + var _highOrderDiffs = highOrderDiffs(earlier, later, units), + cursor = _highOrderDiffs[0], + results = _highOrderDiffs[1], + highWater = _highOrderDiffs[2], + lowestOrder = _highOrderDiffs[3]; + var remainingMillis = later - cursor; + var lowerOrderUnits = units.filter(function (u) { + return ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0; + }); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + var _cursor$plus; + highWater = cursor.plus((_cursor$plus = {}, _cursor$plus[lowestOrder] = 1, _cursor$plus)); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + var duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + var _Duration$fromMillis; + return (_Duration$fromMillis = Duration.fromMillis(remainingMillis, opts)).shiftTo.apply(_Duration$fromMillis, lowerOrderUnits).plus(duration); + } else { + return duration; + } + } + + var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; + function intUnit(regex, post) { + if (post === void 0) { + post = function post(i) { + return i; + }; + } + return { + regex: regex, + deser: function deser(_ref) { + var s = _ref[0]; + return post(parseDigits(s)); + } + }; + } + var NBSP = String.fromCharCode(160); + var spaceOrNBSP = "[ " + NBSP + "]"; + var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); + function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); + } + function stripInsensitivities(s) { + return s.replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); + } + function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: function deser(_ref2) { + var s = _ref2[0]; + return strings.findIndex(function (i) { + return stripInsensitivities(s) === stripInsensitivities(i); + }) + startIndex; + } + }; + } + } + function offset(regex, groups) { + return { + regex: regex, + deser: function deser(_ref3) { + var h = _ref3[1], + m = _ref3[2]; + return signedOffset(h, m); + }, + groups: groups + }; + } + function simple(regex) { + return { + regex: regex, + deser: function deser(_ref4) { + var s = _ref4[0]; + return s; + } + }; + } + function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); + } + + /** + * @param token + * @param {Locale} loc + */ + function unitForToken(token, loc) { + var one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = function literal(t) { + return { + regex: RegExp(escapeToken(t.val)), + deser: function deser(_ref5) { + var s = _ref5[0]; + return s; + }, + literal: true + }; + }, + unitate = function unitate(t) { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(?::(" + two.source + "))?"), 2); + case "ZZZ": + return offset(new RegExp("([+-]" + oneOrTwo.source + ")(" + two.source + ")?"), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + var unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; + } + var partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy" + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM" + }, + day: { + numeric: "d", + "2-digit": "dd" + }, + weekday: { + short: "EEE", + long: "EEEE" + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh" + }, + hour24: { + numeric: "H", + "2-digit": "HH" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } + }; + function tokenForPart(part, formatOpts, resolvedOpts) { + var type = part.type, + value = part.value; + if (type === "literal") { + var isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + var style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + var actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + var val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val: val + }; + } + return undefined; + } + function buildRegex(units) { + var re = units.map(function (u) { + return u.regex; + }).reduce(function (f, r) { + return f + "(" + r.source + ")"; + }, ""); + return ["^" + re + "$", units]; + } + function match(input, regex, handlers) { + var matches = input.match(regex); + if (matches) { + var all = {}; + var matchIndex = 1; + for (var i in handlers) { + if (hasOwnProperty(handlers, i)) { + var h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } + } + function dateTimeFromMatches(matches) { + var toField = function toField(token) { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + var zone = null; + var specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + var vals = Object.keys(matches).reduce(function (r, k) { + var f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; + } + var dummyDateTimeCache = null; + function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; + } + function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + var formatOpts = Formatter.macroTokenToFormatOpts(token.val); + var tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(undefined)) { + return token; + } + return tokens; + } + function expandMacroTokens(tokens, locale) { + var _Array$prototype; + return (_Array$prototype = Array.prototype).concat.apply(_Array$prototype, tokens.map(function (t) { + return maybeExpandMacroToken(t, locale); + })); + } + + /** + * @private + */ + + var TokenParser = /*#__PURE__*/function () { + function TokenParser(locale, format) { + this.locale = locale; + this.format = format; + this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale); + this.units = this.tokens.map(function (t) { + return unitForToken(t, locale); + }); + this.disqualifyingUnit = this.units.find(function (t) { + return t.invalidReason; + }); + if (!this.disqualifyingUnit) { + var _buildRegex = buildRegex(this.units), + regexString = _buildRegex[0], + handlers = _buildRegex[1]; + this.regex = RegExp(regexString, "i"); + this.handlers = handlers; + } + } + var _proto = TokenParser.prototype; + _proto.explainFromTokens = function explainFromTokens(input) { + if (!this.isValid) { + return { + input: input, + tokens: this.tokens, + invalidReason: this.invalidReason + }; + } else { + var _match = match(input, this.regex, this.handlers), + rawMatches = _match[0], + matches = _match[1], + _ref6 = matches ? dateTimeFromMatches(matches) : [null, null, undefined], + result = _ref6[0], + zone = _ref6[1], + specificOffset = _ref6[2]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input: input, + tokens: this.tokens, + regex: this.regex, + rawMatches: rawMatches, + matches: matches, + result: result, + zone: zone, + specificOffset: specificOffset + }; + } + }; + _createClass(TokenParser, [{ + key: "isValid", + get: function get() { + return !this.disqualifyingUnit; + } + }, { + key: "invalidReason", + get: function get() { + return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null; + } + }]); + return TokenParser; + }(); + function explainFromTokens(locale, input, format) { + var parser = new TokenParser(locale, format); + return parser.explainFromTokens(input); + } + function parseFromTokens(locale, input, format) { + var _explainFromTokens = explainFromTokens(locale, input, format), + result = _explainFromTokens.result, + zone = _explainFromTokens.zone, + specificOffset = _explainFromTokens.specificOffset, + invalidReason = _explainFromTokens.invalidReason; + return [result, zone, specificOffset, invalidReason]; + } + function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + var formatter = Formatter.create(locale, formatOpts); + var df = formatter.dtFormatter(getDummyDateTime()); + var parts = df.formatToParts(); + var resolvedOpts = df.resolvedOptions(); + return parts.map(function (p) { + return tokenForPart(p, formatOpts, resolvedOpts); + }); + } + + var INVALID = "Invalid DateTime"; + var MAX_DATE = 8.64e15; + function unsupportedZone(zone) { + return new Invalid("unsupported zone", "the zone \"" + zone.name + "\" is not supported"); + } + + // we cache week data on the DT object and this intermediates the cache + /** + * @param {DateTime} dt + */ + function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; + } + + /** + * @param {DateTime} dt + */ + function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek(dt.c, dt.loc.getMinDaysInFirstWeek(), dt.loc.getStartOfWeek()); + } + return dt.localWeekData; + } + + // clone really means, "make a new object with these modifications". all "setters" really use this + // to create a new object while only changing some of the properties + function clone(inst, alts) { + var current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime(_extends({}, current, alts, { + old: current + })); + } + + // find the right offset a given local time. The o input is our guess, which determines which + // offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) + function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + var utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + var o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + var o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; + } + + // convert an epoch timestamp into a calendar object with the given offset + function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + var d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; + } + + // convert a calendar object to a epoch timestamp + function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); + } + + // create a new DT instance by adding a duration, adjusting for DSTs + function adjustTime(inst, dur) { + var oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = _extends({}, inst.c, { + year: year, + month: month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }), + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), + localTS = objToLocalTS(c); + var _fixOffset = fixOffset(localTS, oPre, inst.zone), + ts = _fixOffset[0], + o = _fixOffset[1]; + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + return { + ts: ts, + o: o + }; + } + + // helper useful in turning the results of parsing into real dates + // by handling the zone options + function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + var setZone = opts.setZone, + zone = opts.zone; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + var interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, _extends({}, opts, { + zone: interpretationZone, + specificOffset: specificOffset + })); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", "the input \"" + text + "\" can't be parsed as " + format)); + } + } + + // if you want to output a technical format (e.g. RFC 2822), this helper + // helps handle the details + function toTechFormat(dt, format, allowZ) { + if (allowZ === void 0) { + allowZ = true; + } + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ: allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format) : null; + } + function _toISODate(o, extended, precision) { + var longFormat = o.c.year > 9999 || o.c.year < 0; + var c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (precision === "year") return c; + if (extended) { + c += "-"; + c += padStart(o.c.month); + if (precision === "month") return c; + c += "-"; + } else { + c += padStart(o.c.month); + if (precision === "month") return c; + } + c += padStart(o.c.day); + return c; + } + function _toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision) { + var showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0, + c = ""; + switch (precision) { + case "day": + case "month": + case "year": + break; + default: + c += padStart(o.c.hour); + if (precision === "hour") break; + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += ":"; + c += padStart(o.c.second); + } + } else { + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += padStart(o.c.second); + } + } + if (precision === "second") break; + if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; + } + + // defaults for unspecified units in the supported calendars + var defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + + // Units in the supported calendars, sorted by bigness + var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + + // standardize case and plurality in units + function normalizeUnit(unit) { + var normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal" + }[unit.toLowerCase()]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } + } + + // cache offsets for zones based on the current timestamp when this function is + // first called. When we are handling a datetime from components like (year, + // month, day, hour) in a time zone, we need a guess about what the timezone + // offset is so that we can convert into a UTC timestamp. One way is to find the + // offset of now in the zone. The actual date may have a different offset (for + // example, if we handle a date in June while we're in December in a zone that + // observes DST), but we can check and adjust that. + // + // When handling many dates, calculating the offset for now every time is + // expensive. It's just a guess, so we can cache the offset to use even if we + // are right on a time change boundary (we'll just correct in the other + // direction). Using a timestamp from first read is a slight optimization for + // handling dates close to the current date, since those dates will usually be + // in the same offset (we could set the timestamp statically, instead). We use a + // single timestamp for all zones to make things a bit more predictable. + // + // This is safe for quickDT (used by local() and utc()) because we don't fill in + // higher-order units from tsNow (as we do in fromObject, this requires that + // offset is calculated from tsNow). + /** + * @param {Zone} zone + * @return {number} + */ + function guessOffsetForZone(zone) { + if (zoneOffsetTs === undefined) { + zoneOffsetTs = Settings.now(); + } + + // Do not cache anything but IANA zones, because it is not safe to do so. + // Guessing an offset which is not present in the zone can cause wrong results from fixOffset + if (zone.type !== "iana") { + return zone.offset(zoneOffsetTs); + } + var zoneName = zone.name; + var offsetGuess = zoneOffsetGuessCache.get(zoneName); + if (offsetGuess === undefined) { + offsetGuess = zone.offset(zoneOffsetTs); + zoneOffsetGuessCache.set(zoneName, offsetGuess); + } + return offsetGuess; + } + + // this is a dumbed down version of fromObject() that runs about 60% faster + // but doesn't do any validation, makes a bunch of assumptions about what units + // are present, and so on. + function quickDT(obj, opts) { + var zone = normalizeZone(opts.zone, Settings.defaultZone); + if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } + var loc = Locale.fromObject(opts); + var ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (var _i = 0, _orderedUnits = orderedUnits; _i < _orderedUnits.length; _i++) { + var u = _orderedUnits[_i]; + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + var invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + var offsetProvis = guessOffsetForZone(zone); + var _objToTS = objToTS(obj, offsetProvis, zone); + ts = _objToTS[0]; + o = _objToTS[1]; + } else { + ts = Settings.now(); + } + return new DateTime({ + ts: ts, + zone: zone, + loc: loc, + o: o + }); + } + function diffRelative(start, end, opts) { + var round = isUndefined(opts.round) ? true : opts.round, + rounding = isUndefined(opts.rounding) ? "trunc" : opts.rounding, + format = function format(c, unit) { + c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? "round" : rounding); + var formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = function differ(unit) { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + for (var _iterator = _createForOfIteratorHelperLoose(opts.units), _step; !(_step = _iterator()).done;) { + var unit = _step.value; + var count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); + } + function lastOpts(argList) { + var opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; + } + + /** + * Timestamp to use for cached zone offset guesses (exposed for test) + */ + var zoneOffsetTs; + /** + * Cache for zone offset guesses (exposed for test). + * + * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of + * zone.offset(). + */ + var zoneOffsetGuessCache = new Map(); + + /** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ + var DateTime = /*#__PURE__*/function (_Symbol$for) { + /** + * @access private + */ + function DateTime(config) { + var zone = config.zone || Settings.defaultZone; + var invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + var c = null, + o = null; + if (!invalid) { + var unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + var _ref = [config.old.c, config.old.o]; + c = _ref[0]; + o = _ref[1]; + } else { + // If an offset has been passed and we have not been called from + // clone(), we can trust it and avoid the offset calculation. + var ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + DateTime.now = function now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */; + DateTime.local = function local() { + var _lastOpts = lastOpts(arguments), + opts = _lastOpts[0], + args = _lastOpts[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */; + DateTime.utc = function utc() { + var _lastOpts2 = lastOpts(arguments), + opts = _lastOpts2[0], + args = _lastOpts2[1], + year = args[0], + month = args[1], + day = args[2], + hour = args[3], + minute = args[4], + second = args[5], + millisecond = args[6]; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year: year, + month: month, + day: day, + hour: hour, + minute: minute, + second: second, + millisecond: millisecond + }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */; + DateTime.fromJSDate = function fromJSDate(date, options) { + if (options === void 0) { + options = {}; + } + var ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + var zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromMillis = function fromMillis(milliseconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError("fromMillis requires a numerical input, but received a " + typeof milliseconds + " with value " + milliseconds); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromSeconds = function fromSeconds(seconds, options) { + if (options === void 0) { + options = {}; + } + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */; + DateTime.fromObject = function fromObject(obj, opts) { + if (opts === void 0) { + opts = {}; + } + obj = obj || {}; + var zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + var loc = Locale.fromObject(opts); + var normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues = usesLocalWeekValues(normalized, loc), + minDaysInFirstWeek = _usesLocalWeekValues.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues.startOfWeek; + var tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + + // configure ourselves to deal with gregorian dates or week stuff + var units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + var foundFirst = false; + for (var _iterator2 = _createForOfIteratorHelperLoose(units), _step2; !(_step2 = _iterator2()).done;) { + var u = _step2.value; + var v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + var higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + var gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, + _objToTS2 = objToTS(gregorian, offsetProvis, zoneToUse), + tsFinal = _objToTS2[0], + offsetFinal = _objToTS2[1], + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc: loc + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", "you can't specify both a weekday of " + normalized.weekday + " and a date of " + inst.toISO()); + } + if (!inst.isValid) { + return DateTime.invalid(inst.invalid); + } + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */; + DateTime.fromISO = function fromISO(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseISODate = parseISODate(text), + vals = _parseISODate[0], + parsedZone = _parseISODate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */; + DateTime.fromRFC2822 = function fromRFC2822(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseRFC2822Date = parseRFC2822Date(text), + vals = _parseRFC2822Date[0], + parsedZone = _parseRFC2822Date[1]; + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */; + DateTime.fromHTTP = function fromHTTP(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseHTTPDate = parseHTTPDate(text), + vals = _parseHTTPDate[0], + parsedZone = _parseHTTPDate[1]; + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */; + DateTime.fromFormat = function fromFormat(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + var _opts = opts, + _opts$locale = _opts.locale, + locale = _opts$locale === void 0 ? null : _opts$locale, + _opts$numberingSystem = _opts.numberingSystem, + numberingSystem = _opts$numberingSystem === void 0 ? null : _opts$numberingSystem, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }), + _parseFromTokens = parseFromTokens(localeToUse, text, fmt), + vals = _parseFromTokens[0], + parsedZone = _parseFromTokens[1], + specificOffset = _parseFromTokens[2], + invalid = _parseFromTokens[3]; + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, "format " + fmt, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */; + DateTime.fromString = function fromString(text, fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */; + DateTime.fromSQL = function fromSQL(text, opts) { + if (opts === void 0) { + opts = {}; + } + var _parseSQL = parseSQL(text), + vals = _parseSQL[0], + parsedZone = _parseSQL[1]; + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */; + DateTime.invalid = function invalid(reason, explanation) { + if (explanation === void 0) { + explanation = null; + } + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + var invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid: invalid + }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */; + DateTime.isDateTime = function isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */; + DateTime.parseFormatForOpts = function parseFormatForOpts(formatOpts, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map(function (t) { + return t ? t.val : null; + }).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */; + DateTime.expandFormat = function expandFormat(fmt, localeOpts) { + if (localeOpts === void 0) { + localeOpts = {}; + } + var expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map(function (t) { + return t.val; + }).join(""); + }; + DateTime.resetCache = function resetCache() { + zoneOffsetTs = undefined; + zoneOffsetGuessCache.clear(); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */; + var _proto = DateTime.prototype; + _proto.get = function get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */; + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + _proto.getPossibleOffsets = function getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + var dayMs = 86400000; + var minuteMs = 60000; + var localTS = objToLocalTS(this.c); + var oEarlier = this.zone.offset(localTS - dayMs); + var oLater = this.zone.offset(localTS + dayMs); + var o1 = this.zone.offset(localTS - oEarlier * minuteMs); + var o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + var ts1 = localTS - o1 * minuteMs; + var ts2 = localTS - o2 * minuteMs; + var c1 = tsToObj(ts1, o1); + var c2 = tsToObj(ts2, o2); + if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { + return [clone(this, { + ts: ts1 + }), clone(this, { + ts: ts2 + })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */; + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + _proto.resolvedLocaleOptions = function resolvedLocaleOptions(opts) { + if (opts === void 0) { + opts = {}; + } + var _Formatter$create$res = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this), + locale = _Formatter$create$res.locale, + numberingSystem = _Formatter$create$res.numberingSystem, + calendar = _Formatter$create$res.calendar; + return { + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: calendar + }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */; + _proto.toUTC = function toUTC(offset, opts) { + if (offset === void 0) { + offset = 0; + } + if (opts === void 0) { + opts = {}; + } + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */; + _proto.toLocal = function toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */; + _proto.setZone = function setZone(zone, _temp) { + var _ref2 = _temp === void 0 ? {} : _temp, + _ref2$keepLocalTime = _ref2.keepLocalTime, + keepLocalTime = _ref2$keepLocalTime === void 0 ? false : _ref2$keepLocalTime, + _ref2$keepCalendarTim = _ref2.keepCalendarTime, + keepCalendarTime = _ref2$keepCalendarTim === void 0 ? false : _ref2$keepCalendarTim; + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + var newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + var offsetGuess = zone.offset(this.ts); + var asObj = this.toObject(); + var _objToTS3 = objToTS(asObj, offsetGuess, zone); + newTS = _objToTS3[0]; + } + return clone(this, { + ts: newTS, + zone: zone + }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */; + _proto.reconfigure = function reconfigure(_temp2) { + var _ref3 = _temp2 === void 0 ? {} : _temp2, + locale = _ref3.locale, + numberingSystem = _ref3.numberingSystem, + outputCalendar = _ref3.outputCalendar; + var loc = this.loc.clone({ + locale: locale, + numberingSystem: numberingSystem, + outputCalendar: outputCalendar + }); + return clone(this, { + loc: loc + }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */; + _proto.setLocale = function setLocale(locale) { + return this.reconfigure({ + locale: locale + }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */; + _proto.set = function set(values) { + if (!this.isValid) return this; + var normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + var _usesLocalWeekValues2 = usesLocalWeekValues(normalized, this.loc), + minDaysInFirstWeek = _usesLocalWeekValues2.minDaysInFirstWeek, + startOfWeek = _usesLocalWeekValues2.startOfWeek; + var settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + var mixed; + if (settingWeekStuff) { + mixed = weekToGregorian(_extends({}, gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), normalized), minDaysInFirstWeek, startOfWeek); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian(_extends({}, gregorianToOrdinal(this.c), normalized)); + } else { + mixed = _extends({}, this.toObject(), normalized); + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + var _objToTS4 = objToTS(mixed, this.o, this.zone), + ts = _objToTS4[0], + o = _objToTS4[1]; + return clone(this, { + ts: ts, + o: o + }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */; + _proto.plus = function plus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */; + _proto.minus = function minus(duration) { + if (!this.isValid) return this; + var dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */; + _proto.startOf = function startOf(unit, _temp3) { + var _ref4 = _temp3 === void 0 ? {} : _temp3, + _ref4$useLocaleWeeks = _ref4.useLocaleWeeks, + useLocaleWeeks = _ref4$useLocaleWeeks === void 0 ? false : _ref4$useLocaleWeeks; + if (!this.isValid) return this; + var o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + var startOfWeek = this.loc.getStartOfWeek(); + var weekday = this.weekday; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + if (normalizedUnit === "quarters") { + var q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */; + _proto.endOf = function endOf(unit, opts) { + var _this$plus; + return this.isValid ? this.plus((_this$plus = {}, _this$plus[unit] = 1, _this$plus)).startOf(unit, opts).minus(1) : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */; + _proto.toFormat = function toFormat(fmt, opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */; + _proto.toLocaleString = function toLocaleString(formatOpts, opts) { + if (formatOpts === void 0) { + formatOpts = DATE_SHORT; + } + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */; + _proto.toLocaleParts = function toLocaleParts(opts) { + if (opts === void 0) { + opts = {}; + } + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z' + * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z' + * @return {string|null} + */; + _proto.toISO = function toISO(_temp4) { + var _ref5 = _temp4 === void 0 ? {} : _temp4, + _ref5$format = _ref5.format, + format = _ref5$format === void 0 ? "extended" : _ref5$format, + _ref5$suppressSeconds = _ref5.suppressSeconds, + suppressSeconds = _ref5$suppressSeconds === void 0 ? false : _ref5$suppressSeconds, + _ref5$suppressMillise = _ref5.suppressMilliseconds, + suppressMilliseconds = _ref5$suppressMillise === void 0 ? false : _ref5$suppressMillise, + _ref5$includeOffset = _ref5.includeOffset, + includeOffset = _ref5$includeOffset === void 0 ? true : _ref5$includeOffset, + _ref5$extendedZone = _ref5.extendedZone, + extendedZone = _ref5$extendedZone === void 0 ? false : _ref5$extendedZone, + _ref5$precision = _ref5.precision, + precision = _ref5$precision === void 0 ? "milliseconds" : _ref5$precision; + if (!this.isValid) { + return null; + } + precision = normalizeUnit(precision); + var ext = format === "extended"; + var c = _toISODate(this, ext, precision); + if (orderedUnits.indexOf(precision) >= 3) c += "T"; + c += _toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'. + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05' + * @return {string|null} + */; + _proto.toISODate = function toISODate(_temp5) { + var _ref6 = _temp5 === void 0 ? {} : _temp5, + _ref6$format = _ref6.format, + format = _ref6$format === void 0 ? "extended" : _ref6$format, + _ref6$precision = _ref6.precision, + precision = _ref6$precision === void 0 ? "day" : _ref6$precision; + if (!this.isValid) { + return null; + } + return _toISODate(this, format === "extended", normalizeUnit(precision)); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */; + _proto.toISOWeekDate = function toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z' + * @return {string} + */; + _proto.toISOTime = function toISOTime(_temp6) { + var _ref7 = _temp6 === void 0 ? {} : _temp6, + _ref7$suppressMillise = _ref7.suppressMilliseconds, + suppressMilliseconds = _ref7$suppressMillise === void 0 ? false : _ref7$suppressMillise, + _ref7$suppressSeconds = _ref7.suppressSeconds, + suppressSeconds = _ref7$suppressSeconds === void 0 ? false : _ref7$suppressSeconds, + _ref7$includeOffset = _ref7.includeOffset, + includeOffset = _ref7$includeOffset === void 0 ? true : _ref7$includeOffset, + _ref7$includePrefix = _ref7.includePrefix, + includePrefix = _ref7$includePrefix === void 0 ? false : _ref7$includePrefix, + _ref7$extendedZone = _ref7.extendedZone, + extendedZone = _ref7$extendedZone === void 0 ? false : _ref7$extendedZone, + _ref7$format = _ref7.format, + format = _ref7$format === void 0 ? "extended" : _ref7$format, + _ref7$precision = _ref7.precision, + precision = _ref7$precision === void 0 ? "milliseconds" : _ref7$precision; + if (!this.isValid) { + return null; + } + precision = normalizeUnit(precision); + var c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? "T" : ""; + return c + _toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */; + _proto.toRFC2822 = function toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */; + _proto.toHTTP = function toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string|null} + */; + _proto.toSQLDate = function toSQLDate() { + if (!this.isValid) { + return null; + } + return _toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */; + _proto.toSQLTime = function toSQLTime(_temp7) { + var _ref8 = _temp7 === void 0 ? {} : _temp7, + _ref8$includeOffset = _ref8.includeOffset, + includeOffset = _ref8$includeOffset === void 0 ? true : _ref8$includeOffset, + _ref8$includeZone = _ref8.includeZone, + includeZone = _ref8$includeZone === void 0 ? false : _ref8$includeZone, + _ref8$includeOffsetSp = _ref8.includeOffsetSpace, + includeOffsetSpace = _ref8$includeOffsetSp === void 0 ? true : _ref8$includeOffsetSp; + var fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */; + _proto.toSQL = function toSQL(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) { + return null; + } + return this.toSQLDate() + " " + this.toSQLTime(opts); + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */; + _proto.toString = function toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */; + _proto[_Symbol$for] = function () { + if (this.isValid) { + return "DateTime { ts: " + this.toISO() + ", zone: " + this.zone.name + ", locale: " + this.locale + " }"; + } else { + return "DateTime { Invalid, reason: " + this.invalidReason + " }"; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */; + _proto.valueOf = function valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */; + _proto.toMillis = function toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime. + * @return {number} + */; + _proto.toSeconds = function toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */; + _proto.toUnixInteger = function toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */; + _proto.toJSON = function toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */; + _proto.toBSON = function toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */; + _proto.toObject = function toObject(opts) { + if (opts === void 0) { + opts = {}; + } + if (!this.isValid) return {}; + var base = _extends({}, this.c); + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */; + _proto.toJSDate = function toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */; + _proto.diff = function diff(otherDateTime, unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + var durOpts = _extends({ + locale: this.locale, + numberingSystem: this.numberingSystem + }, opts); + var units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = _diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */; + _proto.diffNow = function diffNow(unit, opts) { + if (unit === void 0) { + unit = "milliseconds"; + } + if (opts === void 0) { + opts = {}; + } + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval|DateTime} + */; + _proto.until = function until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */; + _proto.hasSame = function hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + var inputMs = otherDateTime.valueOf(); + var adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */; + _proto.equals = function equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {string} [options.rounding="trunc"] - rounding method to use when rounding the numbers in the output. Can be "trunc" (toward zero), "expand" (away from zero), "round", "floor", or "ceil". + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */; + _proto.toRelative = function toRelative(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + var base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), + padding = options.padding ? this < base ? -options.padding : options.padding : 0; + var units = ["years", "months", "days", "hours", "minutes", "seconds"]; + var unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), _extends({}, options, { + numeric: "always", + units: units, + unit: unit + })); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */; + _proto.toRelativeCalendar = function toRelativeCalendar(options) { + if (options === void 0) { + options = {}; + } + if (!this.isValid) return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, _extends({}, options, { + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + })); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */; + DateTime.min = function min() { + for (var _len = arguments.length, dateTimes = new Array(_len), _key = 0; _key < _len; _key++) { + dateTimes[_key] = arguments[_key]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */; + DateTime.max = function max() { + for (var _len2 = arguments.length, dateTimes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + dateTimes[_key2] = arguments[_key2]; + } + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, function (i) { + return i.valueOf(); + }, Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */; + DateTime.fromFormatExplain = function fromFormatExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + var _options = options, + _options$locale = _options.locale, + locale = _options$locale === void 0 ? null : _options$locale, + _options$numberingSys = _options.numberingSystem, + numberingSystem = _options$numberingSys === void 0 ? null : _options$numberingSys, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */; + DateTime.fromStringExplain = function fromStringExplain(text, fmt, options) { + if (options === void 0) { + options = {}; + } + return DateTime.fromFormatExplain(text, fmt, options); + } + + /** + * Build a parser for `fmt` using the given locale. This parser can be passed + * to {@link DateTime.fromFormatParser} to a parse a date in this format. This + * can be used to optimize cases where many dates need to be parsed in a + * specific format. + * + * @param {String} fmt - the format the string is expected to be in (see + * description) + * @param {Object} options - options used to set locale and numberingSystem + * for parser + * @returns {TokenParser} - opaque object to be used + */; + DateTime.buildFormatParser = function buildFormatParser(fmt, options) { + if (options === void 0) { + options = {}; + } + var _options2 = options, + _options2$locale = _options2.locale, + locale = _options2$locale === void 0 ? null : _options2$locale, + _options2$numberingSy = _options2.numberingSystem, + numberingSystem = _options2$numberingSy === void 0 ? null : _options2$numberingSy, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + return new TokenParser(localeToUse, fmt); + } + + /** + * Create a DateTime from an input string and format parser. + * + * The format parser must have been created with the same locale as this call. + * + * @param {String} text - the string to parse + * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser} + * @param {Object} opts - options taken by fromFormat() + * @returns {DateTime} + */; + DateTime.fromFormatParser = function fromFormatParser(text, formatParser, opts) { + if (opts === void 0) { + opts = {}; + } + if (isUndefined(text) || isUndefined(formatParser)) { + throw new InvalidArgumentError("fromFormatParser requires an input string and a format parser"); + } + var _opts2 = opts, + _opts2$locale = _opts2.locale, + locale = _opts2$locale === void 0 ? null : _opts2$locale, + _opts2$numberingSyste = _opts2.numberingSystem, + numberingSystem = _opts2$numberingSyste === void 0 ? null : _opts2$numberingSyste, + localeToUse = Locale.fromOpts({ + locale: locale, + numberingSystem: numberingSystem, + defaultToEN: true + }); + if (!localeToUse.equals(formatParser.locale)) { + throw new InvalidArgumentError("fromFormatParser called with a locale of " + localeToUse + ", " + ("but the format parser was created for " + formatParser.locale)); + } + var _formatParser$explain = formatParser.explainFromTokens(text), + result = _formatParser$explain.result, + zone = _formatParser$explain.zone, + specificOffset = _formatParser$explain.specificOffset, + invalidReason = _formatParser$explain.invalidReason; + if (invalidReason) { + return DateTime.invalid(invalidReason); + } else { + return parseDataToDateTime(result, zone, opts, "format " + formatParser.format, text, specificOffset); + } + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */; + _createClass(DateTime, [{ + key: "isValid", + get: function get() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidReason", + get: function get() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + }, { + key: "invalidExplanation", + get: function get() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "locale", + get: function get() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "numberingSystem", + get: function get() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + }, { + key: "outputCalendar", + get: function get() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + }, { + key: "zone", + get: function get() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + }, { + key: "zoneName", + get: function get() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + }, { + key: "year", + get: function get() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + }, { + key: "quarter", + get: function get() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + }, { + key: "month", + get: function get() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + }, { + key: "day", + get: function get() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + }, { + key: "hour", + get: function get() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + }, { + key: "minute", + get: function get() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + }, { + key: "second", + get: function get() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + }, { + key: "millisecond", + get: function get() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + }, { + key: "weekYear", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + }, { + key: "weekNumber", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + }, { + key: "weekday", + get: function get() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + }, { + key: "isWeekend", + get: function get() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + }, { + key: "localWeekday", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + }, { + key: "localWeekNumber", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + }, { + key: "localWeekYear", + get: function get() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + }, { + key: "ordinal", + get: function get() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + }, { + key: "monthShort", + get: function get() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + }, { + key: "monthLong", + get: function get() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + }, { + key: "weekdayShort", + get: function get() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + }, { + key: "weekdayLong", + get: function get() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + }, { + key: "offset", + get: function get() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameShort", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + }, { + key: "offsetNameLong", + get: function get() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + }, { + key: "isOffsetFixed", + get: function get() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + }, { + key: "isInDST", + get: function get() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + }, { + key: "isInLeapYear", + get: function get() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + }, { + key: "daysInMonth", + get: function get() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + }, { + key: "daysInYear", + get: function get() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + }, { + key: "weeksInWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + }, { + key: "weeksInLocalWeekYear", + get: function get() { + return this.isValid ? weeksInWeekYear(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN; + } + }], [{ + key: "DATE_SHORT", + get: function get() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED", + get: function get() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_MED_WITH_WEEKDAY", + get: function get() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_FULL", + get: function get() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + }, { + key: "DATE_HUGE", + get: function get() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_SIMPLE", + get: function get() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SECONDS", + get: function get() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_SHORT_OFFSET", + get: function get() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "TIME_WITH_LONG_OFFSET", + get: function get() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_SIMPLE", + get: function get() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SECONDS", + get: function get() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_SHORT_OFFSET", + get: function get() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + }, { + key: "TIME_24_WITH_LONG_OFFSET", + get: function get() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT", + get: function get() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_SHORT_WITH_SECONDS", + get: function get() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED", + get: function get() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_SECONDS", + get: function get() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_MED_WITH_WEEKDAY", + get: function get() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL", + get: function get() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_FULL_WITH_SECONDS", + get: function get() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE", + get: function get() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + }, { + key: "DATETIME_HUGE_WITH_SECONDS", + get: function get() { + return DATETIME_HUGE_WITH_SECONDS; + } + }]); + return DateTime; + }(Symbol.for("nodejs.util.inspect.custom")); + function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError("Unknown datetime argument: " + dateTimeish + ", of type " + typeof dateTimeish); + } + } + + var VERSION = "3.7.2"; + + exports.DateTime = DateTime; + exports.Duration = Duration; + exports.FixedOffsetZone = FixedOffsetZone; + exports.IANAZone = IANAZone; + exports.Info = Info; + exports.Interval = Interval; + exports.InvalidZone = InvalidZone; + exports.Settings = Settings; + exports.SystemZone = SystemZone; + exports.VERSION = VERSION; + exports.Zone = Zone; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +})({}); +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/global/luxon.js.map b/node_modules/luxon/build/global/luxon.js.map new file mode 100644 index 00000000..a7bbf8d6 --- /dev/null +++ b/node_modules/luxon/build/global/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/impl/digits.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nconst dtfCache = new Map();\nfunction makeDTF(zoneName) {\n let dtf = dtfCache.get(zoneName);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zoneName,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n dtfCache.set(zoneName, dtf);\n }\n return dtf;\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nconst ianaZoneCache = new Map();\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n let zone = ianaZoneCache.get(name);\n if (zone === undefined) {\n ianaZoneCache.set(name, (zone = new IANAZone(name)));\n }\n return zone;\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache.clear();\n dtfCache.clear();\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n if (!this.valid) return NaN;\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nconst intlDTCache = new Map();\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache.get(key);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache.set(key, dtf);\n }\n return dtf;\n}\n\nconst intlNumCache = new Map();\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache.get(key);\n if (inf === undefined) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache.set(key, inf);\n }\n return inf;\n}\n\nconst intlRelCache = new Map();\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache.get(key);\n if (inf === undefined) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache.set(key, inf);\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nconst intlResolvedOptionsCache = new Map();\nfunction getCachedIntResolvedOptions(locString) {\n let opts = intlResolvedOptionsCache.get(locString);\n if (opts === undefined) {\n opts = new Intl.DateTimeFormat(locString).resolvedOptions();\n intlResolvedOptionsCache.set(locString, opts);\n }\n return opts;\n}\n\nconst weekInfoCache = new Map();\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache.get(locString);\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86\n if (!(\"minimalDays\" in data)) {\n data = { ...fallbackWeekSettings, ...data };\n }\n weekInfoCache.set(locString, data);\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n getCachedIntResolvedOptions(loc.locale).numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache.clear();\n intlNumCache.clear();\n intlRelCache.clear();\n intlResolvedOptionsCache.clear();\n weekInfoCache.clear();\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n // Workaround for \"ja\" locale: formatToParts does not label all parts of the month\n // as \"month\" and for this locale there is no difference between \"format\" and \"non-format\".\n // As such, just use format() instead of formatToParts() and take the whole string\n const monthSpecialCase = this.intl === \"ja\" || this.intl.startsWith(\"ja-\");\n format &= !monthSpecialCase;\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n const mapper = !monthSpecialCase\n ? (dt) => this.extract(dt, intl, \"month\")\n : (dt) => this.dtFormatter(dt, intl).format();\n this.monthsCache[formatStr][length] = mapMonths(mapper);\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n getCachedIntResolvedOptions(this.intl).locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nconst digitRegexCache = new Map();\nexport function resetDigitRegexCache() {\n digitRegexCache.clear();\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n let appendCache = digitRegexCache.get(ns);\n if (appendCache === undefined) {\n appendCache = new Map();\n digitRegexCache.set(ns, appendCache);\n }\n let regex = appendCache.get(append);\n if (regex === undefined) {\n regex = new RegExp(`${numberingSystems[ns]}${append}`);\n appendCache.set(append, regex);\n }\n\n return regex;\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, rounding = \"round\") {\n const factor = 10 ** digits;\n switch (rounding) {\n case \"expand\":\n return number > 0\n ? Math.ceil(number * factor) / factor\n : Math.floor(number * factor) / factor;\n case \"trunc\":\n return Math.trunc(number * factor) / factor;\n case \"round\":\n return Math.round(number * factor) / factor;\n case \"floor\":\n return Math.floor(number * factor) / factor;\n case \"ceil\":\n return Math.ceil(number * factor) / factor;\n default:\n throw new RangeError(`Value rounding ${rounding} is out of range`);\n }\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || !Number.isFinite(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n // turn '' into a literal signal quote instead of just skipping the empty literal\n if (currentFull.length > 0 || bracketed) {\n splits.push({\n literal: bracketed || /^\\s+$/.test(currentFull),\n val: currentFull === \"\" ? \"'\" : currentFull,\n });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0, signDisplay = undefined) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n if (signDisplay) {\n opts.signDisplay = signDisplay;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const invertLargest = this.opts.signMode === \"negativeLargestOnly\" ? -1 : 1;\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"milliseconds\";\n case \"s\":\n return \"seconds\";\n case \"m\":\n return \"minutes\";\n case \"h\":\n return \"hours\";\n case \"d\":\n return \"days\";\n case \"w\":\n return \"weeks\";\n case \"M\":\n return \"months\";\n case \"y\":\n return \"years\";\n default:\n return null;\n }\n },\n tokenToString = (lildur, info) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n const inversionFactor =\n info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1;\n let signDisplay;\n if (this.opts.signMode === \"negativeLargestOnly\" && mapped !== info.largestUnit) {\n signDisplay = \"never\";\n } else if (this.opts.signMode === \"all\") {\n signDisplay = \"always\";\n } else {\n // \"auto\" and \"negative\" are the same, but \"auto\" has better support\n signDisplay = \"auto\";\n }\n return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)),\n durationInfo = {\n isNegativeDuration: collapsed < 0,\n // this relies on \"collapsed\" being based on \"shiftTo\", which builds up the object\n // in order\n largestUnit: Object.keys(collapsed.values)[0],\n };\n return stringifyTokens(tokens, tokenToString(collapsed, durationInfo));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:([Zz])|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"+6 +2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"-6 -2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"negativeLargestOnly\" }) //=> \"-6 2\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero\n * @example\n * ```js\n * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 mth, 0 wks, 5 hr, 6 min'\n * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const showZeros = opts.showZeros !== false;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val) || (val === 0 && !showZeros)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Removes all units with values equal to 0 from this Duration.\n * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 }\n * @return {Duration}\n */\n removeZeros() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.values);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval. This is the first instant which is not part of the interval\n * (Interval is half-open).\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns the last DateTime included in the interval (since end is not part of the interval)\n * @type {DateTime}\n */\n get lastDateTime() {\n return this.isValid ? (this.e ? this.e.minus(1) : null) : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into an equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval\n * and ending with the latest.\n *\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended, precision) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n if (precision === \"year\") return c;\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n c += \"-\";\n } else {\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n }\n c += padStart(o.c.day);\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n) {\n let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0,\n c = \"\";\n switch (precision) {\n case \"day\":\n case \"month\":\n case \"year\":\n break;\n default:\n c += padStart(o.c.hour);\n if (precision === \"hour\") break;\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += \":\";\n c += padStart(o.c.second);\n }\n } else {\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += padStart(o.c.second);\n }\n }\n if (precision === \"second\") break;\n if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\n/**\n * @param {Zone} zone\n * @return {number}\n */\nfunction guessOffsetForZone(zone) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n // Do not cache anything but IANA zones, because it is not safe to do so.\n // Guessing an offset which is not present in the zone can cause wrong results from fixOffset\n if (zone.type !== \"iana\") {\n return zone.offset(zoneOffsetTs);\n }\n const zoneName = zone.name;\n let offsetGuess = zoneOffsetGuessCache.get(zoneName);\n if (offsetGuess === undefined) {\n offsetGuess = zone.offset(zoneOffsetTs);\n zoneOffsetGuessCache.set(zoneName, offsetGuess);\n }\n return offsetGuess;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n rounding = isUndefined(opts.rounding) ? \"trunc\" : opts.rounding,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? \"round\" : rounding);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nconst zoneOffsetGuessCache = new Map();\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache.clear();\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z'\n * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z'\n * @return {string|null}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext, precision);\n if (orderedUnits.indexOf(precision) >= 3) c += \"T\";\n c += toISOTime(\n this,\n ext,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n );\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'.\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05'\n * @return {string|null}\n */\n toISODate({ format = \"extended\", precision = \"day\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, format === \"extended\", normalizeUnit(precision));\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string|null}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval|DateTime}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {string} [options.rounding=\"trunc\"] - rounding method to use when rounding the numbers in the output. Can be \"trunc\" (toward zero), \"expand\" (away from zero), \"round\", \"floor\", or \"ceil\".\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.7.2\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["LuxonError","_Error","_inheritsLoose","apply","arguments","_wrapNativeSuper","Error","InvalidDateTimeError","_LuxonError","reason","call","toMessage","InvalidIntervalError","_LuxonError2","InvalidDurationError","_LuxonError3","ConflictingSpecificationError","_LuxonError4","InvalidUnitError","_LuxonError5","unit","InvalidArgumentError","_LuxonError6","ZoneIsAbstractError","_LuxonError7","n","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","_proto","prototype","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","_createClass","key","get","name","singleton","SystemZone","_Zone","_ref","locale","parseZoneInfo","Date","getTimezoneOffset","type","Intl","DateTimeFormat","resolvedOptions","timeZone","dtfCache","Map","makeDTF","zoneName","dtf","undefined","hour12","era","set","typeToPos","hackyOffset","date","formatted","replace","parsed","exec","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","formatToParts","filled","i","length","_formatted$i","value","pos","isUndefined","parseInt","ianaZoneCache","IANAZone","create","zone","resetCache","clear","isValidSpecifier","isValidZone","e","_this","valid","NaN","isNaN","_ref2","adOrBc","Math","abs","adjustedHour","asUTC","objToLocalTS","millisecond","asTS","over","intlLFCache","getCachedLF","locString","JSON","stringify","ListFormat","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","NumberFormat","intlRelCache","getCachedRTF","_opts","base","cacheKeyOpts","_objectWithoutPropertiesLoose","_excluded","RelativeTimeFormat","sysLocaleCache","systemLocale","intlResolvedOptionsCache","getCachedIntResolvedOptions","weekInfoCache","getCachedWeekInfo","data","Locale","getWeekInfo","weekInfo","_extends","fallbackWeekSettings","parseLocaleString","localeStr","xIndex","indexOf","substring","uIndex","options","selectedStr","smaller","_options","numberingSystem","calendar","intlConfigString","outputCalendar","includes","mapMonths","f","ms","dt","DateTime","utc","push","mapWeekdays","listStuff","loc","englishFn","intlFn","mode","listingMode","supportsFastNumbers","startsWith","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","_excluded2","Object","keys","intlOpts","useGrouping","minimumIntegerDigits","fixed","roundTo","padStart","PolyDateFormatter","originalZone","z","gmtOffset","offsetZ","setZone","plus","minutes","_proto2","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","_proto3","count","English","numeric","firstDay","minimalDays","weekend","fromOpts","weekSettings","defaultToEN","specifiedLocale","Settings","defaultLocale","localeR","numberingSystemR","defaultNumberingSystem","outputCalendarR","defaultOutputCalendar","weekSettingsR","validateWeekSettings","defaultWeekSettings","fromObject","_temp","numbering","_parseLocaleString","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","_proto4","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","months","_this2","monthSpecialCase","formatStr","mapper","extract","dtFormatter","weekdays","_this3","meridiems","_this4","eras","_this5","field","df","results","matching","find","m","toLowerCase","numberFormatter","fastNumbers","relFormatter","listFormatter","getWeekSettings","hasLocaleWeekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","toString","FixedOffsetZone","instance","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","input","defaultZone","isString","lowered","isNumber","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","split","parseDigits","str","code","charCodeAt","search","_numberingSystemsUTF","min","max","digitRegexCache","resetDigitRegexCache","digitRegex","append","ns","appendCache","regex","RegExp","now","twoDigitCutoffYear","throwOnInvalid","resetCaches","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","_uncomputeOrdinal","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","_uncomputeOrdinal2","usesLocalWeekValues","obj","hasLocaleWeekData","localWeekday","localWeekNumber","localWeekYear","hasIsoWeekData","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","o","isDate","maybeArray","thing","Array","isArray","bestBy","arr","by","compare","reduce","best","next","pair","pick","a","k","hasOwnProperty","prop","settings","some","v","from","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","rounding","factor","pow","ceil","trunc","round","RangeError","modMonth","modYear","firstWeekOffset","fwdlw","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","Number","offMin","offMinSigned","is","asNumber","numericValue","isFinite","normalizeObject","normalizer","normalized","u","hours","sign","monthsLong","monthsShort","monthsNarrow","concat","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","narrow","units","years","quarters","weeks","days","seconds","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","_iterator","_createForOfIteratorHelperLoose","_step","done","token","literal","val","macroTokenToFormatOpts","D","Formats","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","c","charAt","test","formatOpts","systemLoc","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","p","signDisplay","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","isValid","meridiem","maybeMacro","slice","quarter","formatDurationFromString","dur","invertLargest","signMode","tokenToField","lildur","info","mapped","inversionFactor","isNegativeDuration","largestUnit","tokens","realTokens","found","collapsed","shiftTo","filter","durationInfo","values","ianaRegex","combineRegexes","_len","regexes","_key","full","source","combineExtractors","_len2","extractors","_key2","ex","mergedVals","mergedZone","cursor","_ex","parse","_len3","patterns","_key3","_i","_patterns","_patterns$_i","extractor","simpleParse","_len4","_key4","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","item","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","conf","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","previousVal","conv","rollUp","removeZeroes","newVals","_Object$entries","entries","_Object$entries$_i","_Symbol$for","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","_parseISODuration","fromISOTime","_parseISOTimeOnly","week","toFormat","fmtOpts","toHuman","showZeros","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","dateTime","toJSON","invalidReason","valueOf","duration","_i2","_orderedUnits","minus","negate","mapUnits","fn","_i3","_Object$keys","mixed","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","lastUnit","_i4","_orderedUnits2","own","ak","negated","_i5","_Object$keys2","removeZeros","eq","v1","v2","_i6","_orderedUnits3","Symbol","for","validateStartEnd","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","_split","startIsValid","endIsValid","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","isBefore","contains","splitAt","dateTimes","sorted","sort","b","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","_intervals$sort$reduc","sofar","final","xor","_Array$prototype","currentCount","ends","time","flattened","difference","toLocaleString","toISODate","dateFormat","_temp2","_ref3","_ref3$separator","separator","mapEndpoints","mapFn","Info","hasDST","proto","isUniversal","isValidIANAZone","_ref$locale","_ref$locObj","locObj","getMinimumDaysInFirstWeek","_ref2$locale","_ref2$locObj","getWeekendWeekdays","_temp3","_ref3$locale","_ref3$locObj","_temp4","_ref4","_ref4$locale","_ref4$numberingSystem","_ref4$locObj","_ref4$outputCalendar","monthsFormat","_temp5","_ref5","_ref5$locale","_ref5$numberingSystem","_ref5$locObj","_ref5$outputCalendar","_temp6","_ref6","_ref6$locale","_ref6$numberingSystem","_ref6$locObj","weekdaysFormat","_temp7","_ref7","_ref7$locale","_ref7$numberingSystem","_ref7$locObj","_temp8","_ref8","_ref8$locale","_temp9","_ref9","_ref9$locale","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","_differs","_differs$_i","differ","_highOrderDiffs","remainingMillis","lowerOrderUnits","_cursor$plus","_Duration$fromMillis","MISSING_FTP","intUnit","post","deser","NBSP","String","fromCharCode","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","partTypeStyleToTokenVal","short","long","dayperiod","dayPeriod","hour24","tokenForPart","resolvedOpts","isSpace","actualType","buildRegex","re","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","Z","q","M","G","y","S","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","TokenParser","disqualifyingUnit","_buildRegex","regexString","explainFromTokens","_match","rawMatches","parser","parseFromTokens","_explainFromTokens","formatter","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","_fixOffset","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","precision","longFormat","extendedZone","showSeconds","ianaName","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","guessOffsetForZone","zoneOffsetTs","offsetGuess","zoneOffsetGuessCache","quickDT","offsetProvis","_objToTS","diffRelative","calendary","lastOpts","argList","args","unchanged","ot","_zone","isLuxonDateTime","_lastOpts","_lastOpts2","fromJSDate","zoneToUse","fromSeconds","_usesLocalWeekValues","tsNow","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","_iterator2","_step2","higherOrderInvalid","gregorian","_objToTS2","tsFinal","offsetFinal","_parseISODate","fromRFC2822","_parseRFC2822Date","fromHTTP","_parseHTTPDate","fromFormat","_opts$locale","_opts$numberingSystem","localeToUse","_parseFromTokens","fromString","fromSQL","_parseSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","expanded","getPossibleOffsets","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","resolvedLocaleOptions","_Formatter$create$res","toLocal","_ref2$keepLocalTime","_ref2$keepCalendarTim","keepCalendarTime","newTS","asObj","_objToTS3","setLocale","_usesLocalWeekValues2","settingWeekStuff","_objToTS4","_ref4$useLocaleWeeks","normalizedUnit","endOf","_this$plus","toLocaleParts","_ref5$format","_ref5$suppressSeconds","_ref5$suppressMillise","_ref5$includeOffset","_ref5$extendedZone","_ref5$precision","ext","_ref6$format","_ref6$precision","toISOWeekDate","_ref7$suppressMillise","_ref7$suppressSeconds","_ref7$includeOffset","_ref7$includePrefix","_ref7$extendedZone","_ref7$format","_ref7$precision","toRFC2822","toHTTP","toSQLDate","toSQLTime","_ref8$includeOffset","_ref8$includeZone","includeZone","_ref8$includeOffsetSp","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","_options$locale","_options$numberingSys","fromStringExplain","buildFormatParser","_options2","_options2$locale","_options2$numberingSy","fromFormatParser","formatParser","_opts2","_opts2$locale","_opts2$numberingSyste","_formatParser$explain","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,CAACmE,UAAU,CAACm7B,WAAW,CAAC,CAAA;EACzC,GAAC,MAAM;EACL,IAAA,MAAM,IAAInqC,oBAAoB,CAAA,6BAAA,GACEmqC,WAAW,GAAa,YAAA,GAAA,OAAOA,WAC/D,CAAC,CAAA;EACH,GAAA;EACF;;AC/hFMC,MAAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/build/global/luxon.min.js b/node_modules/luxon/build/global/luxon.min.js new file mode 100644 index 00000000..9b013034 --- /dev/null +++ b/node_modules/luxon/build/global/luxon.min.js @@ -0,0 +1 @@ +var luxon=function(e){"use strict";function L(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(q(Error)),P=function(t){function e(e){return t.call(this,"Invalid DateTime: "+e.toMessage())||this}return o(e,t),e}(t),Y=function(t){function e(e){return t.call(this,"Invalid Interval: "+e.toMessage())||this}return o(e,t),e}(t),H=function(t){function e(e){return t.call(this,"Invalid Duration: "+e.toMessage())||this}return o(e,t),e}(t),w=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(t),J=function(t){function e(e){return t.call(this,"Invalid unit "+e)||this}return o(e,t),e}(t),u=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(t),n=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return o(t,e),t}(t),t="numeric",r="short",a="long",G={year:t,month:t,day:t},$={year:t,month:r,day:t},B={year:t,month:r,day:t,weekday:r},Q={year:t,month:a,day:t},K={year:t,month:a,day:t,weekday:a},X={hour:t,minute:t},ee={hour:t,minute:t,second:t},te={hour:t,minute:t,second:t,timeZoneName:r},ne={hour:t,minute:t,second:t,timeZoneName:a},re={hour:t,minute:t,hourCycle:"h23"},ie={hour:t,minute:t,second:t,hourCycle:"h23"},oe={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:r},ae={hour:t,minute:t,second:t,hourCycle:"h23",timeZoneName:a},se={year:t,month:t,day:t,hour:t,minute:t},ue={year:t,month:t,day:t,hour:t,minute:t,second:t},le={year:t,month:r,day:t,hour:t,minute:t},ce={year:t,month:r,day:t,hour:t,minute:t,second:t},fe={year:t,month:r,day:t,weekday:r,hour:t,minute:t},de={year:t,month:a,day:t,hour:t,minute:t,timeZoneName:r},he={year:t,month:a,day:t,hour:t,minute:t,second:t,timeZoneName:r},me={year:t,month:a,day:t,weekday:a,hour:t,minute:t,timeZoneName:a},ye={year:t,month:a,day:t,weekday:a,hour:t,minute:t,second:t,timeZoneName:a},s=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new n},t.formatOffset=function(e,t){throw new n},t.offset=function(e){throw new n},t.equals=function(e){throw new n},i(e,[{key:"type",get:function(){throw new n}},{key:"name",get:function(){throw new n}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new n}},{key:"isValid",get:function(){throw new n}}]),e}(),ve=null,ge=function(e){function t(){return e.apply(this,arguments)||this}o(t,e);var n=t.prototype;return n.offsetName=function(e,t){return Ot(e,t.format,t.locale)},n.formatOffset=function(e,t){return Dt(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},i(t,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return ve=null===ve?new t:ve}}]),t}(s),pe=new Map;var ke={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var we=new Map,c=function(n){function r(e){var t=n.call(this)||this;return t.zoneName=e,t.valid=r.isValidZone(e),t}o(r,n),r.create=function(e){var t=we.get(e);return void 0===t&&we.set(e,t=new r(e)),t},r.resetCache=function(){we.clear(),pe.clear()},r.isValidSpecifier=function(e){return this.isValidZone(e)},r.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var e=r.prototype;return e.offsetName=function(e,t){return Ot(e,t.format,t.locale,this.name)},e.formatOffset=function(e,t){return Dt(this.offset(e),t)},e.offset=function(e){var t,n,r,i,o,a,s,u;return!this.valid||(e=new Date(e),isNaN(e))?NaN:(i=this.name,void 0===(o=pe.get(i))&&(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),pe.set(i,o)),a=(i=(i=o).formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;ibt(i,t,n)?(r=i+1,a=1):r=i,l({weekYear:r,weekNumber:a,weekday:o},It(e))}function it(e,t,n){void 0===n&&(n=1);var r,i=e.weekYear,o=e.weekNumber,a=e.weekday,n=nt(Xe(i,1,t=void 0===t?4:t),n),s=D(i),o=7*o+a-n-7+t,a=(o<1?o+=D(r=i-1):sO.twoDigitCutoffYear?1900+e:2e3+e}function Ot(e,t,n,r){void 0===r&&(r=null);var e=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},r=(r&&(i.timeZone=r),l({timeZoneName:t},i)),t=new Intl.DateTimeFormat(n,r).formatToParts(e).find(function(e){return"timezonename"===e.type.toLowerCase()});return t?t.value:null}function Tt(e,t){e=parseInt(e,10),Number.isNaN(e)&&(e=0),t=parseInt(t,10)||0;return 60*e+(e<0||Object.is(e,-0)?-t:t)}function Nt(e){var t=Number(e);if("boolean"!=typeof e&&""!==e&&Number.isFinite(t))return t;throw new u("Invalid unit value "+e)}function Mt(e,t){var n,r,i={};for(n in e)h(e,n)&&null!=(r=e[n])&&(i[t(n)]=Nt(r));return i}function Dt(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=0<=e?"+":"-";switch(t){case"short":return i+m(n,2)+":"+m(r,2);case"narrow":return i+n+(0e},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&this.s<=e&&this.e>e},t.set=function(e){var e=void 0===e?{}:e,t=e.start,e=e.end;return this.isValid?l.fromDateTimes(t||this.s,e||this.e):this},t.splitAt=function(){var t=this;if(!this.isValid)return[];for(var e=arguments.length,n=new Array(e),r=0;r+this.e?this.e:u;o.push(l.fromDateTimes(a,u)),a=u,s+=1}return o},t.splitBy=function(e){var t=x.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];for(var n=this.s,r=1,i=[];n+this.e?this.e:o;i.push(l.fromDateTimes(n,o)),n=o,r+=1}return i},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s=e.e},t.equals=function(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)},t.intersection=function(e){var t;return this.isValid?(t=(this.s>e.s?this:e).s,(e=(this.ee.e?this:e).e,l.fromDateTimes(t,e)):this},l.merge=function(e){var e=e.sort(function(e,t){return e.s-t.s}).reduce(function(e,t){var n=e[0],e=e[1];return e?e.overlaps(t)||e.abutsStart(t)?[n,e.union(t)]:[n.concat([e]),t]:[n,t]},[[],null]),t=e[0],e=e[1];return e&&t.push(e),t},l.xor=function(e){for(var t,n=null,r=0,i=[],e=e.map(function(e){return[{time:e.s,type:"s"},{time:e.e,type:"e"}]}),o=R((t=Array.prototype).concat.apply(t,e).sort(function(e,t){return e.time-t.time}));!(a=o()).done;)var a=a.value,n=1===(r+="s"===a.type?1:-1)?a.time:(n&&+n!=+a.time&&i.push(l.fromDateTimes(n,a.time)),null);return l.merge(i)},t.difference=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;rthis.valueOf())?this:e,r?e:this,t,n),r?e.negate():e):x.invalid("created by diffing an invalid DateTime")},t.diffNow=function(e,t){return void 0===e&&(e="milliseconds"),void 0===t&&(t={}),this.diff(k.now(),e,t)},t.until=function(e){return this.isValid?Zn.fromDateTimes(this,e):this},t.hasSame=function(e,t,n){var r;return!!this.isValid&&(r=e.valueOf(),(e=this.setZone(e.zone,{keepLocalTime:!0})).startOf(t,n)<=r)&&r<=e.endOf(t,n)},t.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(e){var t,n,r,i;return this.isValid?(t=(e=void 0===e?{}:e).base||k.fromObject({},{zone:this.zone}),n=e.padding?thisthis.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return gt(this.year)}},{key:"daysInMonth",get:function(){return pt(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?D(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?bt(this.weekYear):NaN}},{key:"weeksInLocalWeekYear",get:function(){return this.isValid?bt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}}],[{key:"DATE_SHORT",get:function(){return G}},{key:"DATE_MED",get:function(){return $}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return B}},{key:"DATE_FULL",get:function(){return Q}},{key:"DATE_HUGE",get:function(){return K}},{key:"TIME_SIMPLE",get:function(){return X}},{key:"TIME_WITH_SECONDS",get:function(){return ee}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return te}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return ne}},{key:"TIME_24_SIMPLE",get:function(){return re}},{key:"TIME_24_WITH_SECONDS",get:function(){return ie}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return oe}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return ae}},{key:"DATETIME_SHORT",get:function(){return se}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return ue}},{key:"DATETIME_MED",get:function(){return le}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return ce}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return fe}},{key:"DATETIME_FULL",get:function(){return de}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return he}},{key:"DATETIME_HUGE",get:function(){return me}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return ye}}]),k}(Symbol.for("nodejs.util.inspect.custom"));function Or(e){if(W.isDateTime(e))return e;if(e&&e.valueOf&&v(e.valueOf()))return W.fromJSDate(e);if(e&&"object"==typeof e)return W.fromObject(e);throw new u("Unknown datetime argument: "+e+", of type "+typeof e)}return e.DateTime=W,e.Duration=x,e.FixedOffsetZone=f,e.IANAZone=c,e.Info=Wn,e.Interval=Zn,e.InvalidZone=ze,e.Settings=O,e.SystemZone=ge,e.VERSION="3.7.2",e.Zone=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); \ No newline at end of file diff --git a/node_modules/luxon/build/global/luxon.min.js.map b/node_modules/luxon/build/global/luxon.min.js.map new file mode 100644 index 00000000..64d99aa3 --- /dev/null +++ b/node_modules/luxon/build/global/luxon.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"build/global/luxon.js","sources":["0"],"names":["luxon","exports","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","arg","key","input","hint","prim","Symbol","toPrimitive","undefined","String","Number","res","call","TypeError","_createClass","Constructor","protoProps","staticProps","prototype","_extends","assign","bind","arguments","source","hasOwnProperty","apply","this","_inheritsLoose","subClass","superClass","create","_setPrototypeOf","constructor","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","__proto__","p","_construct","Parent","args","Class","Reflect","construct","sham","Proxy","Boolean","valueOf","e","a","push","instance","Function","_wrapNativeSuper","_cache","Map","toString","indexOf","has","get","set","Wrapper","value","_objectWithoutPropertiesLoose","excluded","sourceKeys","keys","_arrayLikeToArray","arr","len","arr2","Array","_createForOfIteratorHelperLoose","allowArrayLike","it","iterator","next","isArray","minLen","n","slice","name","from","test","done","LuxonError","_Error","Error","InvalidDateTimeError","_LuxonError","reason","toMessage","InvalidIntervalError","_LuxonError2","InvalidDurationError","_LuxonError3","ConflictingSpecificationError","_LuxonError4","InvalidUnitError","_LuxonError5","unit","InvalidArgumentError","_LuxonError6","ZoneIsAbstractError","_LuxonError7","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","_proto","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","singleton$1","SystemZone","_Zone","_ref","parseZoneInfo","locale","Date","getTimezoneOffset","type","Intl","DateTimeFormat","resolvedOptions","timeZone","dtfCache","typeToPos","era","ianaZoneCache","IANAZone","_this","zoneName","valid","isValidZone","zone","resetCache","clear","isValidSpecifier","adOrBc","dtf","date","fDay","adjustedHour","over","isNaN","NaN","hour12","_ref2","formatToParts","formatted","filled","_formatted$i","pos","isUndefined","parseInt","replace","fMonth","parsed","exec","asTS","objToLocalTS","Math","abs","millisecond","_excluded","_excluded2","intlLFCache","intlDTCache","getCachedDTF","locString","JSON","stringify","intlNumCache","intlRelCache","sysLocaleCache","intlResolvedOptionsCache","getCachedIntResolvedOptions","weekInfoCache","listStuff","loc","englishFn","intlFn","mode","listingMode","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","intlOpts","useGrouping","minimumIntegerDigits","inf","NumberFormat","fixed","padStart","roundTo","PolyDateFormatter","dt","z","originalZone","offsetZ","gmtOffset","setZone","plus","minutes","_proto2","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","_opts","base","cacheKeyOpts","RelativeTimeFormat","_proto3","count","formatRelativeTime","numeric","narrow","units","years","quarters","months","weeks","days","hours","seconds","lastable","isDay","isInPast","is","singular","fmtValue","lilUnits","fmtUnit","fallbackWeekSettings","firstDay","minimalDays","weekend","Locale","numbering","outputCalendar","weekSettings","specifiedLocale","_parseLocaleString","localeStr","xIndex","uIndex","substring","options","selectedStr","smaller","_options","numberingSystem","calendar","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","includes","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","fromOpts","defaultToEN","Settings","defaultLocale","defaultNumberingSystem","defaultOutputCalendar","validateWeekSettings","defaultWeekSettings","fromObject","_temp","_proto4","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","_this2","monthSpecialCase","startsWith","formatStr","f","ms","DateTime","utc","dtFormatter","extract","weekdays","_this3","meridiems","_this4","eras","_this5","field","matching","find","m","toLowerCase","numberFormatter","fastNumbers","relFormatter","listFormatter","ListFormat","getWeekSettings","hasLocaleWeekInfo","data","getWeekInfo","weekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","singleton","FixedOffsetZone","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","defaultZone","lowered","isNumber","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","split","digitRegexCache","digitRegex","append","ns","appendCache","regex","RegExp","throwOnInvalid","now","twoDigitCutoffYear","resetCaches","cutoffYear","t","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekYear","weekNumber","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","_uncomputeOrdinal","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","_uncomputeOrdinal2","usesLocalWeekValues","obj","localWeekday","localWeekNumber","localWeekYear","hasInvalidGregorianData","validYear","isInteger","validMonth","integerBetween","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","bestBy","by","compare","reduce","best","pair","prop","settings","some","v","thing","bottom","top","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","rounding","factor","pow","ceil","trunc","round","RangeError","modMonth","x","firstWeekOffset","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","offMin","asNumber","numericValue","isFinite","normalizeObject","normalizer","u","normalized","sign","k","monthsLong","monthsShort","monthsNarrow","concat","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","stringifyTokens","splits","tokenToString","_iterator","_step","token","literal","val","_macroTokenToFormatOpts","D","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","formatOpts","systemLoc","parseFormat","fmt","current","currentFull","bracketed","c","charAt","macroTokenToFormatOpts","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","signDisplay","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","isValid","meridiem","maybeMacro","quarter","formatDurationFromString","dur","lildur","info","invertLargest","signMode","tokenToField","tokens","realTokens","found","collapsed","shiftTo","filter","durationInfo","isNegativeDuration","largestUnit","values","inversionFactor","mapped","ianaRegex","combineRegexes","_len","regexes","_key","full","combineExtractors","_len2","extractors","_key2","ex","mergedVals","mergedZone","cursor","_ex","parse","_len3","patterns","_key3","_i","_patterns","_patterns$_i","extractor","simpleParse","_len4","_key4","ret","offsetRegex","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","extractISOWeekData","extractISOOrdinalData","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","maybeNegate","force","hasNegativePrefix","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","negativeSeconds","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","extractISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","INVALID$2","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits$1","reverseUnits","reverse","clone$1","conf","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","conv","rollUp","previousVal","removeZeroes","newVals","_Object$entries","entries","_Object$entries$_i","_Symbol$for","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","fromISOTime","week","toFormat","fmtOpts","toHuman","showZeros","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","toJSON","invalidReason","duration","_i2","_orderedUnits","minus","negate","mapUnits","fn","_i3","_Object$keys","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","_i4","_orderedUnits2","ak","lastUnit","own","negated","_i5","_Object$keys2","removeZeros","v1","_i6","_orderedUnits3","v2","for","INVALID$1","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","endIsValid","_split","startIsValid","_dur","isInterval","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","dateTime","isBefore","contains","splitAt","dateTimes","sorted","sort","b","results","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","_intervals$sort$reduc","item","sofar","final","xor","_Array$prototype","currentCount","ends","time","difference","toLocaleString","toISODate","dateFormat","_temp2","_ref3$separator","separator","mapEndpoints","mapFn","Info","hasDST","proto","isUniversal","isValidIANAZone","_ref$locale","_ref$locObj","locObj","getMinimumDaysInFirstWeek","_ref2$locale","_ref2$locObj","getWeekendWeekdays","_temp3","_ref3","_ref3$locale","_ref3$locObj","_temp4","_ref4","_ref4$locale","_ref4$numberingSystem","_ref4$locObj","_ref4$outputCalendar","monthsFormat","_temp5","_ref5","_ref5$locale","_ref5$numberingSystem","_ref5$locObj","_ref5$outputCalendar","_temp6","_ref6","_ref6$locale","_ref6$numberingSystem","_ref6$locObj","weekdaysFormat","_temp7","_ref7","_ref7$locale","_ref7$numberingSystem","_ref7$locObj","_temp8","_ref8$locale","_temp9","_ref9$locale","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","_diff","_highOrderDiffs","lowestOrder","highWater","_differs","_differs$_i","differ","remainingMillis","lowerOrderUnits","_cursor$plus","_Duration$fromMillis","MISSING_FTP","intUnit","post","deser","str","code","charCodeAt","search","_numberingSystemsUTF","min","max","spaceOrNBSP","fromCharCode","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","simple","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","partTypeStyleToTokenVal","2-digit","short","long","dayperiod","dayPeriod","hour24","dummyDateTimeCache","expandMacroTokens","formatOptsToTokens","TokenParser","handlers","disqualifyingUnit","_buildRegex","explainFromTokens","_match","matches","h","all","matchIndex","rawMatches","Z","specificOffset","q","M","G","y","S","resolvedOpts","df","isSpace","actualType","INVALID","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","_fixOffset","parseDataToDateTime","parsedZone","toTechFormat","_toISODate","extended","precision","longFormat","_toISOTime","extendedZone","showSeconds","ianaName","zoneOffsetTs","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedUnits","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","quickDT","offsetGuess","_objToTS","zoneOffsetGuessCache","diffRelative","calendary","lastOpts","argList","ot","_zone","isLuxonDateTime","_lastOpts","_lastOpts2","fromJSDate","zoneToUse","fromSeconds","_usesLocalWeekValues","tsNow","offsetProvis","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","defaultValues","useWeekData","objNow","foundFirst","_iterator2","_step2","validWeek","validWeekday","validOrdinal","_objToTS2","_parseISODate","fromRFC2822","_parseRFC2822Date","trim","fromHTTP","_parseHTTPDate","fromFormat","_opts$locale","_opts$numberingSystem","localeToUse","_parseFromTokens","_explainFromTokens","fromString","fromSQL","_parseSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","getPossibleOffsets","ts1","ts2","c1","c2","oEarlier","oLater","o1","resolvedLocaleOptions","_Formatter$create$res","toLocal","newTS","_ref2$keepLocalTime","_ref2$keepCalendarTim","keepCalendarTime","setLocale","mixed","_usesLocalWeekValues2","settingWeekStuff","_objToTS4","_ref4$useLocaleWeeks","normalizedUnit","endOf","_this$plus","toLocaleParts","_ref5$format","_ref5$suppressSeconds","_ref5$suppressMillise","_ref5$includeOffset","_ref5$extendedZone","_ref5$precision","ext","_ref6$format","_ref6$precision","toISOWeekDate","_ref7$suppressMillise","_ref7$suppressSeconds","_ref7$includeOffset","_ref7$includePrefix","_ref7$extendedZone","_ref7$format","_ref7$precision","toRFC2822","toHTTP","toSQLDate","toSQLTime","_ref8","_ref8$includeOffset","_ref8$includeZone","includeZone","_ref8$includeOffsetSp","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","otherIsLater","durOpts","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","_options$locale","_options$numberingSys","fromStringExplain","buildFormatParser","_options2","_options2$locale","_options2$numberingSy","fromFormatParser","formatParser","_opts2","_opts2$locale","_opts2$numberingSyste","_formatParser$explain","dateTimeish","VERSION"],"mappings":"AAAA,IAAIA,MAAQ,SAAWC,GACrB,aAEA,SAASC,EAAkBC,EAAQC,GACjC,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,CAAC,GAAI,CACrC,IAAIE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,YAAc,CAAA,EACjDD,EAAWE,aAAe,CAAA,EACtB,UAAWF,IAAYA,EAAWG,SAAW,CAAA,GACjDC,OAAOC,eAAeT,EAuJ1B,SAAwBU,GAClBC,EAXN,SAAsBC,EAAOC,GAC3B,GAAqB,UAAjB,OAAOD,GAAgC,OAAVA,EAAgB,OAAOA,EACxD,IAAIE,EAAOF,EAAMG,OAAOC,aACxB,GAAaC,KAAAA,IAATH,EAKJ,OAAiB,WAATD,EAAoBK,OAASC,QAAQP,CAAK,EAJ5CQ,EAAMN,EAAKO,KAAKT,EAAOC,GAAQ,SAAS,EAC5C,GAAmB,UAAf,OAAOO,EAAkB,OAAOA,EACpC,MAAM,IAAIE,UAAU,8CAA8C,CAGtE,EAEyBZ,EAAK,QAAQ,EACpC,MAAsB,UAAf,OAAOC,E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DpI,IAAK,gBACL0D,IAAK,WACH,OAAO2E,EACT,CAMF,EAAG,CACDrI,IAAK,6BACL0D,IAAK,WACH,OAAO4E,EACT,CAMF,EAAG,CACDtI,IAAK,gBACL0D,IAAK,WACH,OAAO6E,EACT,CAMF,EAAG,CACDvI,IAAK,6BACL0D,IAAK,WACH,OAAO8E,EACT,CACF,EAAE,EACKoM,CACT,EAAExU,OAAO6wB,IAAI,4BAA4B,CAAC,EAC1C,SAASM,GAAiBoX,GACxB,GAAI/zB,EAASuuB,WAAWwF,CAAW,EACjC,OAAOA,EACF,GAAIA,GAAeA,EAAY7lC,SAAWsU,EAASuxB,EAAY7lC,QAAQ,CAAC,EAC7E,OAAO8R,EAASmsB,WAAW4H,CAAW,EACjC,GAAIA,GAAsC,UAAvB,OAAOA,EAC/B,OAAO/zB,EAAShB,WAAW+0B,CAAW,EAEtC,MAAM,IAAIviC,EAAqB,8BAAgCuiC,EAAc,aAAe,OAAOA,CAAW,CAElH,CAkBA,OAdAxpC,EAAQyV,SAAWA,EACnBzV,EAAQktB,SAAWA,EACnBltB,EAAQuX,gBAAkBA,EAC1BvX,EAAQiL,SAAWA,EACnBjL,EAAQ61B,KAAOA,GACf71B,EAAQgyB,SAAWA,GACnBhyB,EAAQ6X,YAAcA,GACtB7X,EAAQmU,SAAWA,EACnBnU,EAAQiK,WAAaA,GACrBjK,EAAQypC,QAXM,QAYdzpC,EAAQsJ,KAAOA,EAEf5I,OAAOC,eAAeX,EAAS,aAAc,CAAE0E,MAAO,CAAA,CAAK,CAAC,EAErD1E,CAER,EAAE,EAAE"} \ No newline at end of file diff --git a/node_modules/luxon/build/node/luxon.js b/node_modules/luxon/build/node/luxon.js new file mode 100644 index 00000000..a8ee891f --- /dev/null +++ b/node_modules/luxon/build/node/luxon.js @@ -0,0 +1,7792 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// these aren't really private, but nor are they really useful to document + +/** + * @private + */ +class LuxonError extends Error {} + +/** + * @private + */ +class InvalidDateTimeError extends LuxonError { + constructor(reason) { + super(`Invalid DateTime: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class InvalidIntervalError extends LuxonError { + constructor(reason) { + super(`Invalid Interval: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class InvalidDurationError extends LuxonError { + constructor(reason) { + super(`Invalid Duration: ${reason.toMessage()}`); + } +} + +/** + * @private + */ +class ConflictingSpecificationError extends LuxonError {} + +/** + * @private + */ +class InvalidUnitError extends LuxonError { + constructor(unit) { + super(`Invalid unit ${unit}`); + } +} + +/** + * @private + */ +class InvalidArgumentError extends LuxonError {} + +/** + * @private + */ +class ZoneIsAbstractError extends LuxonError { + constructor() { + super("Zone is an abstract class"); + } +} + +/** + * @private + */ + +const n = "numeric", + s = "short", + l = "long"; +const DATE_SHORT = { + year: n, + month: n, + day: n +}; +const DATE_MED = { + year: n, + month: s, + day: n +}; +const DATE_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s +}; +const DATE_FULL = { + year: n, + month: l, + day: n +}; +const DATE_HUGE = { + year: n, + month: l, + day: n, + weekday: l +}; +const TIME_SIMPLE = { + hour: n, + minute: n +}; +const TIME_WITH_SECONDS = { + hour: n, + minute: n, + second: n +}; +const TIME_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: s +}; +const TIME_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + timeZoneName: l +}; +const TIME_24_SIMPLE = { + hour: n, + minute: n, + hourCycle: "h23" +}; +const TIME_24_WITH_SECONDS = { + hour: n, + minute: n, + second: n, + hourCycle: "h23" +}; +const TIME_24_WITH_SHORT_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: s +}; +const TIME_24_WITH_LONG_OFFSET = { + hour: n, + minute: n, + second: n, + hourCycle: "h23", + timeZoneName: l +}; +const DATETIME_SHORT = { + year: n, + month: n, + day: n, + hour: n, + minute: n +}; +const DATETIME_SHORT_WITH_SECONDS = { + year: n, + month: n, + day: n, + hour: n, + minute: n, + second: n +}; +const DATETIME_MED = { + year: n, + month: s, + day: n, + hour: n, + minute: n +}; +const DATETIME_MED_WITH_SECONDS = { + year: n, + month: s, + day: n, + hour: n, + minute: n, + second: n +}; +const DATETIME_MED_WITH_WEEKDAY = { + year: n, + month: s, + day: n, + weekday: s, + hour: n, + minute: n +}; +const DATETIME_FULL = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + timeZoneName: s +}; +const DATETIME_FULL_WITH_SECONDS = { + year: n, + month: l, + day: n, + hour: n, + minute: n, + second: n, + timeZoneName: s +}; +const DATETIME_HUGE = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + timeZoneName: l +}; +const DATETIME_HUGE_WITH_SECONDS = { + year: n, + month: l, + day: n, + weekday: l, + hour: n, + minute: n, + second: n, + timeZoneName: l +}; + +/** + * @interface + */ +class Zone { + /** + * The type of zone + * @abstract + * @type {string} + */ + get type() { + throw new ZoneIsAbstractError(); + } + + /** + * The name of this zone. + * @abstract + * @type {string} + */ + get name() { + throw new ZoneIsAbstractError(); + } + + /** + * The IANA name of this zone. + * Defaults to `name` if not overwritten by a subclass. + * @abstract + * @type {string} + */ + get ianaName() { + return this.name; + } + + /** + * Returns whether the offset is known to be fixed for the whole year. + * @abstract + * @type {boolean} + */ + get isUniversal() { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + offsetName(ts, opts) { + throw new ZoneIsAbstractError(); + } + + /** + * Returns the offset's value as a string + * @abstract + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format) { + throw new ZoneIsAbstractError(); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @abstract + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */ + offset(ts) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is equal to another zone + * @abstract + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + throw new ZoneIsAbstractError(); + } + + /** + * Return whether this Zone is valid. + * @abstract + * @type {boolean} + */ + get isValid() { + throw new ZoneIsAbstractError(); + } +} + +let singleton$1 = null; + +/** + * Represents the local zone for this JavaScript environment. + * @implements {Zone} + */ +class SystemZone extends Zone { + /** + * Get a singleton instance of the local zone + * @return {SystemZone} + */ + static get instance() { + if (singleton$1 === null) { + singleton$1 = new SystemZone(); + } + return singleton$1; + } + + /** @override **/ + get type() { + return "system"; + } + + /** @override **/ + get name() { + return new Intl.DateTimeFormat().resolvedOptions().timeZone; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName(ts, { + format, + locale + }) { + return parseZoneInfo(ts, format, locale); + } + + /** @override **/ + formatOffset(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** @override **/ + offset(ts) { + return -new Date(ts).getTimezoneOffset(); + } + + /** @override **/ + equals(otherZone) { + return otherZone.type === "system"; + } + + /** @override **/ + get isValid() { + return true; + } +} + +const dtfCache = new Map(); +function makeDTF(zoneName) { + let dtf = dtfCache.get(zoneName); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat("en-US", { + hour12: false, + timeZone: zoneName, + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + era: "short" + }); + dtfCache.set(zoneName, dtf); + } + return dtf; +} +const typeToPos = { + year: 0, + month: 1, + day: 2, + era: 3, + hour: 4, + minute: 5, + second: 6 +}; +function hackyOffset(dtf, date) { + const formatted = dtf.format(date).replace(/\u200E/g, ""), + parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), + [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed; + return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond]; +} +function partsOffset(dtf, date) { + const formatted = dtf.formatToParts(date); + const filled = []; + for (let i = 0; i < formatted.length; i++) { + const { + type, + value + } = formatted[i]; + const pos = typeToPos[type]; + if (type === "era") { + filled[pos] = value; + } else if (!isUndefined(pos)) { + filled[pos] = parseInt(value, 10); + } + } + return filled; +} +const ianaZoneCache = new Map(); +/** + * A zone identified by an IANA identifier, like America/New_York + * @implements {Zone} + */ +class IANAZone extends Zone { + /** + * @param {string} name - Zone name + * @return {IANAZone} + */ + static create(name) { + let zone = ianaZoneCache.get(name); + if (zone === undefined) { + ianaZoneCache.set(name, zone = new IANAZone(name)); + } + return zone; + } + + /** + * Reset local caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCache() { + ianaZoneCache.clear(); + dtfCache.clear(); + } + + /** + * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that. + * @param {string} s - The string to check validity on + * @example IANAZone.isValidSpecifier("America/New_York") //=> true + * @example IANAZone.isValidSpecifier("Sport~~blorp") //=> false + * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead. + * @return {boolean} + */ + static isValidSpecifier(s) { + return this.isValidZone(s); + } + + /** + * Returns whether the provided string identifies a real zone + * @param {string} zone - The string to check + * @example IANAZone.isValidZone("America/New_York") //=> true + * @example IANAZone.isValidZone("Fantasia/Castle") //=> false + * @example IANAZone.isValidZone("Sport~~blorp") //=> false + * @return {boolean} + */ + static isValidZone(zone) { + if (!zone) { + return false; + } + try { + new Intl.DateTimeFormat("en-US", { + timeZone: zone + }).format(); + return true; + } catch (e) { + return false; + } + } + constructor(name) { + super(); + /** @private **/ + this.zoneName = name; + /** @private **/ + this.valid = IANAZone.isValidZone(name); + } + + /** + * The type of zone. `iana` for all instances of `IANAZone`. + * @override + * @type {string} + */ + get type() { + return "iana"; + } + + /** + * The name of this zone (i.e. the IANA zone name). + * @override + * @type {string} + */ + get name() { + return this.zoneName; + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns false for all IANA zones. + * @override + * @type {boolean} + */ + get isUniversal() { + return false; + } + + /** + * Returns the offset's common name (such as EST) at the specified timestamp + * @override + * @param {number} ts - Epoch milliseconds for which to get the name + * @param {Object} opts - Options to affect the format + * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'. + * @param {string} opts.locale - What locale to return the offset name in. + * @return {string} + */ + offsetName(ts, { + format, + locale + }) { + return parseZoneInfo(ts, format, locale, this.name); + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format) { + return formatOffset(this.offset(ts), format); + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * @override + * @param {number} ts - Epoch milliseconds for which to compute the offset + * @return {number} + */ + offset(ts) { + if (!this.valid) return NaN; + const date = new Date(ts); + if (isNaN(date)) return NaN; + const dtf = makeDTF(this.name); + let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date); + if (adOrBc === "BC") { + year = -Math.abs(year) + 1; + } + + // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat + const adjustedHour = hour === 24 ? 0 : hour; + const asUTC = objToLocalTS({ + year, + month, + day, + hour: adjustedHour, + minute, + second, + millisecond: 0 + }); + let asTS = +date; + const over = asTS % 1000; + asTS -= over >= 0 ? over : 1000 + over; + return (asUTC - asTS) / (60 * 1000); + } + + /** + * Return whether this Zone is equal to another zone + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + return otherZone.type === "iana" && otherZone.name === this.name; + } + + /** + * Return whether this Zone is valid. + * @override + * @type {boolean} + */ + get isValid() { + return this.valid; + } +} + +// todo - remap caching + +let intlLFCache = {}; +function getCachedLF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlLFCache[key]; + if (!dtf) { + dtf = new Intl.ListFormat(locString, opts); + intlLFCache[key] = dtf; + } + return dtf; +} +const intlDTCache = new Map(); +function getCachedDTF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let dtf = intlDTCache.get(key); + if (dtf === undefined) { + dtf = new Intl.DateTimeFormat(locString, opts); + intlDTCache.set(key, dtf); + } + return dtf; +} +const intlNumCache = new Map(); +function getCachedINF(locString, opts = {}) { + const key = JSON.stringify([locString, opts]); + let inf = intlNumCache.get(key); + if (inf === undefined) { + inf = new Intl.NumberFormat(locString, opts); + intlNumCache.set(key, inf); + } + return inf; +} +const intlRelCache = new Map(); +function getCachedRTF(locString, opts = {}) { + const { + base, + ...cacheKeyOpts + } = opts; // exclude `base` from the options + const key = JSON.stringify([locString, cacheKeyOpts]); + let inf = intlRelCache.get(key); + if (inf === undefined) { + inf = new Intl.RelativeTimeFormat(locString, opts); + intlRelCache.set(key, inf); + } + return inf; +} +let sysLocaleCache = null; +function systemLocale() { + if (sysLocaleCache) { + return sysLocaleCache; + } else { + sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale; + return sysLocaleCache; + } +} +const intlResolvedOptionsCache = new Map(); +function getCachedIntResolvedOptions(locString) { + let opts = intlResolvedOptionsCache.get(locString); + if (opts === undefined) { + opts = new Intl.DateTimeFormat(locString).resolvedOptions(); + intlResolvedOptionsCache.set(locString, opts); + } + return opts; +} +const weekInfoCache = new Map(); +function getCachedWeekInfo(locString) { + let data = weekInfoCache.get(locString); + if (!data) { + const locale = new Intl.Locale(locString); + // browsers currently implement this as a property, but spec says it should be a getter function + data = "getWeekInfo" in locale ? locale.getWeekInfo() : locale.weekInfo; + // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86 + if (!("minimalDays" in data)) { + data = { + ...fallbackWeekSettings, + ...data + }; + } + weekInfoCache.set(locString, data); + } + return data; +} +function parseLocaleString(localeStr) { + // I really want to avoid writing a BCP 47 parser + // see, e.g. https://github.com/wooorm/bcp-47 + // Instead, we'll do this: + + // a) if the string has no -u extensions, just leave it alone + // b) if it does, use Intl to resolve everything + // c) if Intl fails, try again without the -u + + // private subtags and unicode subtags have ordering requirements, + // and we're not properly parsing this, so just strip out the + // private ones if they exist. + const xIndex = localeStr.indexOf("-x-"); + if (xIndex !== -1) { + localeStr = localeStr.substring(0, xIndex); + } + const uIndex = localeStr.indexOf("-u-"); + if (uIndex === -1) { + return [localeStr]; + } else { + let options; + let selectedStr; + try { + options = getCachedDTF(localeStr).resolvedOptions(); + selectedStr = localeStr; + } catch (e) { + const smaller = localeStr.substring(0, uIndex); + options = getCachedDTF(smaller).resolvedOptions(); + selectedStr = smaller; + } + const { + numberingSystem, + calendar + } = options; + return [selectedStr, numberingSystem, calendar]; + } +} +function intlConfigString(localeStr, numberingSystem, outputCalendar) { + if (outputCalendar || numberingSystem) { + if (!localeStr.includes("-u-")) { + localeStr += "-u"; + } + if (outputCalendar) { + localeStr += `-ca-${outputCalendar}`; + } + if (numberingSystem) { + localeStr += `-nu-${numberingSystem}`; + } + return localeStr; + } else { + return localeStr; + } +} +function mapMonths(f) { + const ms = []; + for (let i = 1; i <= 12; i++) { + const dt = DateTime.utc(2009, i, 1); + ms.push(f(dt)); + } + return ms; +} +function mapWeekdays(f) { + const ms = []; + for (let i = 1; i <= 7; i++) { + const dt = DateTime.utc(2016, 11, 13 + i); + ms.push(f(dt)); + } + return ms; +} +function listStuff(loc, length, englishFn, intlFn) { + const mode = loc.listingMode(); + if (mode === "error") { + return null; + } else if (mode === "en") { + return englishFn(length); + } else { + return intlFn(length); + } +} +function supportsFastNumbers(loc) { + if (loc.numberingSystem && loc.numberingSystem !== "latn") { + return false; + } else { + return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || getCachedIntResolvedOptions(loc.locale).numberingSystem === "latn"; + } +} + +/** + * @private + */ + +class PolyNumberFormatter { + constructor(intl, forceSimple, opts) { + this.padTo = opts.padTo || 0; + this.floor = opts.floor || false; + const { + padTo, + floor, + ...otherOpts + } = opts; + if (!forceSimple || Object.keys(otherOpts).length > 0) { + const intlOpts = { + useGrouping: false, + ...opts + }; + if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + this.inf = getCachedINF(intl, intlOpts); + } + } + format(i) { + if (this.inf) { + const fixed = this.floor ? Math.floor(i) : i; + return this.inf.format(fixed); + } else { + // to match the browser's numberformatter defaults + const fixed = this.floor ? Math.floor(i) : roundTo(i, 3); + return padStart(fixed, this.padTo); + } + } +} + +/** + * @private + */ + +class PolyDateFormatter { + constructor(dt, intl, opts) { + this.opts = opts; + this.originalZone = undefined; + let z = undefined; + if (this.opts.timeZone) { + // Don't apply any workarounds if a timeZone is explicitly provided in opts + this.dt = dt; + } else if (dt.zone.type === "fixed") { + // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like. + // That is why fixed-offset TZ is set to that unless it is: + // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT. + // 2. Unsupported by the browser: + // - some do not support Etc/ + // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata + const gmtOffset = -1 * (dt.offset / 60); + const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`; + if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) { + z = offsetZ; + this.dt = dt; + } else { + // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so + // we manually apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + } else if (dt.zone.type === "system") { + this.dt = dt; + } else if (dt.zone.type === "iana") { + this.dt = dt; + z = dt.zone.name; + } else { + // Custom zones can have any offset / offsetName so we just manually + // apply the offset and substitute the zone as needed. + z = "UTC"; + this.dt = dt.setZone("UTC").plus({ + minutes: dt.offset + }); + this.originalZone = dt.zone; + } + const intlOpts = { + ...this.opts + }; + intlOpts.timeZone = intlOpts.timeZone || z; + this.dtf = getCachedDTF(intl, intlOpts); + } + format() { + if (this.originalZone) { + // If we have to substitute in the actual zone name, we have to use + // formatToParts so that the timezone can be replaced. + return this.formatToParts().map(({ + value + }) => value).join(""); + } + return this.dtf.format(this.dt.toJSDate()); + } + formatToParts() { + const parts = this.dtf.formatToParts(this.dt.toJSDate()); + if (this.originalZone) { + return parts.map(part => { + if (part.type === "timeZoneName") { + const offsetName = this.originalZone.offsetName(this.dt.ts, { + locale: this.dt.locale, + format: this.opts.timeZoneName + }); + return { + ...part, + value: offsetName + }; + } else { + return part; + } + }); + } + return parts; + } + resolvedOptions() { + return this.dtf.resolvedOptions(); + } +} + +/** + * @private + */ +class PolyRelFormatter { + constructor(intl, isEnglish, opts) { + this.opts = { + style: "long", + ...opts + }; + if (!isEnglish && hasRelative()) { + this.rtf = getCachedRTF(intl, opts); + } + } + format(count, unit) { + if (this.rtf) { + return this.rtf.format(count, unit); + } else { + return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long"); + } + } + formatToParts(count, unit) { + if (this.rtf) { + return this.rtf.formatToParts(count, unit); + } else { + return []; + } + } +} +const fallbackWeekSettings = { + firstDay: 1, + minimalDays: 4, + weekend: [6, 7] +}; + +/** + * @private + */ +class Locale { + static fromOpts(opts) { + return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.weekSettings, opts.defaultToEN); + } + static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) { + const specifiedLocale = locale || Settings.defaultLocale; + // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats + const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale()); + const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem; + const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar; + const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings; + return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale); + } + static resetCache() { + sysLocaleCache = null; + intlDTCache.clear(); + intlNumCache.clear(); + intlRelCache.clear(); + intlResolvedOptionsCache.clear(); + weekInfoCache.clear(); + } + static fromObject({ + locale, + numberingSystem, + outputCalendar, + weekSettings + } = {}) { + return Locale.create(locale, numberingSystem, outputCalendar, weekSettings); + } + constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) { + const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale); + this.locale = parsedLocale; + this.numberingSystem = numbering || parsedNumberingSystem || null; + this.outputCalendar = outputCalendar || parsedOutputCalendar || null; + this.weekSettings = weekSettings; + this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar); + this.weekdaysCache = { + format: {}, + standalone: {} + }; + this.monthsCache = { + format: {}, + standalone: {} + }; + this.meridiemCache = null; + this.eraCache = {}; + this.specifiedLocale = specifiedLocale; + this.fastNumbersCached = null; + } + get fastNumbers() { + if (this.fastNumbersCached == null) { + this.fastNumbersCached = supportsFastNumbers(this); + } + return this.fastNumbersCached; + } + listingMode() { + const isActuallyEn = this.isEnglish(); + const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory"); + return isActuallyEn && hasNoWeirdness ? "en" : "intl"; + } + clone(alts) { + if (!alts || Object.getOwnPropertyNames(alts).length === 0) { + return this; + } else { + return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, validateWeekSettings(alts.weekSettings) || this.weekSettings, alts.defaultToEN || false); + } + } + redefaultToEN(alts = {}) { + return this.clone({ + ...alts, + defaultToEN: true + }); + } + redefaultToSystem(alts = {}) { + return this.clone({ + ...alts, + defaultToEN: false + }); + } + months(length, format = false) { + return listStuff(this, length, months, () => { + // Workaround for "ja" locale: formatToParts does not label all parts of the month + // as "month" and for this locale there is no difference between "format" and "non-format". + // As such, just use format() instead of formatToParts() and take the whole string + const monthSpecialCase = this.intl === "ja" || this.intl.startsWith("ja-"); + format &= !monthSpecialCase; + const intl = format ? { + month: length, + day: "numeric" + } : { + month: length + }, + formatStr = format ? "format" : "standalone"; + if (!this.monthsCache[formatStr][length]) { + const mapper = !monthSpecialCase ? dt => this.extract(dt, intl, "month") : dt => this.dtFormatter(dt, intl).format(); + this.monthsCache[formatStr][length] = mapMonths(mapper); + } + return this.monthsCache[formatStr][length]; + }); + } + weekdays(length, format = false) { + return listStuff(this, length, weekdays, () => { + const intl = format ? { + weekday: length, + year: "numeric", + month: "long", + day: "numeric" + } : { + weekday: length + }, + formatStr = format ? "format" : "standalone"; + if (!this.weekdaysCache[formatStr][length]) { + this.weekdaysCache[formatStr][length] = mapWeekdays(dt => this.extract(dt, intl, "weekday")); + } + return this.weekdaysCache[formatStr][length]; + }); + } + meridiems() { + return listStuff(this, undefined, () => meridiems, () => { + // In theory there could be aribitrary day periods. We're gonna assume there are exactly two + // for AM and PM. This is probably wrong, but it's makes parsing way easier. + if (!this.meridiemCache) { + const intl = { + hour: "numeric", + hourCycle: "h12" + }; + this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(dt => this.extract(dt, intl, "dayperiod")); + } + return this.meridiemCache; + }); + } + eras(length) { + return listStuff(this, length, eras, () => { + const intl = { + era: length + }; + + // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates + // to definitely enumerate them. + if (!this.eraCache[length]) { + this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(dt => this.extract(dt, intl, "era")); + } + return this.eraCache[length]; + }); + } + extract(dt, intlOpts, field) { + const df = this.dtFormatter(dt, intlOpts), + results = df.formatToParts(), + matching = results.find(m => m.type.toLowerCase() === field); + return matching ? matching.value : null; + } + numberFormatter(opts = {}) { + // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave) + // (in contrast, the rest of the condition is used heavily) + return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts); + } + dtFormatter(dt, intlOpts = {}) { + return new PolyDateFormatter(dt, this.intl, intlOpts); + } + relFormatter(opts = {}) { + return new PolyRelFormatter(this.intl, this.isEnglish(), opts); + } + listFormatter(opts = {}) { + return getCachedLF(this.intl, opts); + } + isEnglish() { + return this.locale === "en" || this.locale.toLowerCase() === "en-us" || getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us"); + } + getWeekSettings() { + if (this.weekSettings) { + return this.weekSettings; + } else if (!hasLocaleWeekInfo()) { + return fallbackWeekSettings; + } else { + return getCachedWeekInfo(this.locale); + } + } + getStartOfWeek() { + return this.getWeekSettings().firstDay; + } + getMinDaysInFirstWeek() { + return this.getWeekSettings().minimalDays; + } + getWeekendDays() { + return this.getWeekSettings().weekend; + } + equals(other) { + return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar; + } + toString() { + return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`; + } +} + +let singleton = null; + +/** + * A zone with a fixed offset (meaning no DST) + * @implements {Zone} + */ +class FixedOffsetZone extends Zone { + /** + * Get a singleton instance of UTC + * @return {FixedOffsetZone} + */ + static get utcInstance() { + if (singleton === null) { + singleton = new FixedOffsetZone(0); + } + return singleton; + } + + /** + * Get an instance with a specified offset + * @param {number} offset - The offset in minutes + * @return {FixedOffsetZone} + */ + static instance(offset) { + return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset); + } + + /** + * Get an instance of FixedOffsetZone from a UTC offset string, like "UTC+6" + * @param {string} s - The offset string to parse + * @example FixedOffsetZone.parseSpecifier("UTC+6") + * @example FixedOffsetZone.parseSpecifier("UTC+06") + * @example FixedOffsetZone.parseSpecifier("UTC-6:00") + * @return {FixedOffsetZone} + */ + static parseSpecifier(s) { + if (s) { + const r = s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i); + if (r) { + return new FixedOffsetZone(signedOffset(r[1], r[2])); + } + } + return null; + } + constructor(offset) { + super(); + /** @private **/ + this.fixed = offset; + } + + /** + * The type of zone. `fixed` for all instances of `FixedOffsetZone`. + * @override + * @type {string} + */ + get type() { + return "fixed"; + } + + /** + * The name of this zone. + * All fixed zones' names always start with "UTC" (plus optional offset) + * @override + * @type {string} + */ + get name() { + return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`; + } + + /** + * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn` + * + * @override + * @type {string} + */ + get ianaName() { + if (this.fixed === 0) { + return "Etc/UTC"; + } else { + return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`; + } + } + + /** + * Returns the offset's common name at the specified timestamp. + * + * For fixed offset zones this equals to the zone name. + * @override + */ + offsetName() { + return this.name; + } + + /** + * Returns the offset's value as a string + * @override + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ + formatOffset(ts, format) { + return formatOffset(this.fixed, format); + } + + /** + * Returns whether the offset is known to be fixed for the whole year: + * Always returns true for all fixed offset zones. + * @override + * @type {boolean} + */ + get isUniversal() { + return true; + } + + /** + * Return the offset in minutes for this zone at the specified timestamp. + * + * For fixed offset zones, this is constant and does not depend on a timestamp. + * @override + * @return {number} + */ + offset() { + return this.fixed; + } + + /** + * Return whether this Zone is equal to another zone (i.e. also fixed and same offset) + * @override + * @param {Zone} otherZone - the zone to compare + * @return {boolean} + */ + equals(otherZone) { + return otherZone.type === "fixed" && otherZone.fixed === this.fixed; + } + + /** + * Return whether this Zone is valid: + * All fixed offset zones are valid. + * @override + * @type {boolean} + */ + get isValid() { + return true; + } +} + +/** + * A zone that failed to parse. You should never need to instantiate this. + * @implements {Zone} + */ +class InvalidZone extends Zone { + constructor(zoneName) { + super(); + /** @private */ + this.zoneName = zoneName; + } + + /** @override **/ + get type() { + return "invalid"; + } + + /** @override **/ + get name() { + return this.zoneName; + } + + /** @override **/ + get isUniversal() { + return false; + } + + /** @override **/ + offsetName() { + return null; + } + + /** @override **/ + formatOffset() { + return ""; + } + + /** @override **/ + offset() { + return NaN; + } + + /** @override **/ + equals() { + return false; + } + + /** @override **/ + get isValid() { + return false; + } +} + +/** + * @private + */ +function normalizeZone(input, defaultZone) { + if (isUndefined(input) || input === null) { + return defaultZone; + } else if (input instanceof Zone) { + return input; + } else if (isString(input)) { + const lowered = input.toLowerCase(); + if (lowered === "default") return defaultZone;else if (lowered === "local" || lowered === "system") return SystemZone.instance;else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance;else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + } else if (isNumber(input)) { + return FixedOffsetZone.instance(input); + } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + // This is dumb, but the instanceof check above doesn't seem to really work + // so we're duck checking it + return input; + } else { + return new InvalidZone(input); + } +} + +const numberingSystems = { + arab: "[\u0660-\u0669]", + arabext: "[\u06F0-\u06F9]", + bali: "[\u1B50-\u1B59]", + beng: "[\u09E6-\u09EF]", + deva: "[\u0966-\u096F]", + fullwide: "[\uFF10-\uFF19]", + gujr: "[\u0AE6-\u0AEF]", + hanidec: "[〇|一|二|三|四|五|六|七|八|九]", + khmr: "[\u17E0-\u17E9]", + knda: "[\u0CE6-\u0CEF]", + laoo: "[\u0ED0-\u0ED9]", + limb: "[\u1946-\u194F]", + mlym: "[\u0D66-\u0D6F]", + mong: "[\u1810-\u1819]", + mymr: "[\u1040-\u1049]", + orya: "[\u0B66-\u0B6F]", + tamldec: "[\u0BE6-\u0BEF]", + telu: "[\u0C66-\u0C6F]", + thai: "[\u0E50-\u0E59]", + tibt: "[\u0F20-\u0F29]", + latn: "\\d" +}; +const numberingSystemsUTF16 = { + arab: [1632, 1641], + arabext: [1776, 1785], + bali: [6992, 7001], + beng: [2534, 2543], + deva: [2406, 2415], + fullwide: [65296, 65303], + gujr: [2790, 2799], + khmr: [6112, 6121], + knda: [3302, 3311], + laoo: [3792, 3801], + limb: [6470, 6479], + mlym: [3430, 3439], + mong: [6160, 6169], + mymr: [4160, 4169], + orya: [2918, 2927], + tamldec: [3046, 3055], + telu: [3174, 3183], + thai: [3664, 3673], + tibt: [3872, 3881] +}; +const hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split(""); +function parseDigits(str) { + let value = parseInt(str, 10); + if (isNaN(value)) { + value = ""; + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + if (str[i].search(numberingSystems.hanidec) !== -1) { + value += hanidecChars.indexOf(str[i]); + } else { + for (const key in numberingSystemsUTF16) { + const [min, max] = numberingSystemsUTF16[key]; + if (code >= min && code <= max) { + value += code - min; + } + } + } + } + return parseInt(value, 10); + } else { + return value; + } +} + +// cache of {numberingSystem: {append: regex}} +const digitRegexCache = new Map(); +function resetDigitRegexCache() { + digitRegexCache.clear(); +} +function digitRegex({ + numberingSystem +}, append = "") { + const ns = numberingSystem || "latn"; + let appendCache = digitRegexCache.get(ns); + if (appendCache === undefined) { + appendCache = new Map(); + digitRegexCache.set(ns, appendCache); + } + let regex = appendCache.get(append); + if (regex === undefined) { + regex = new RegExp(`${numberingSystems[ns]}${append}`); + appendCache.set(append, regex); + } + return regex; +} + +let now = () => Date.now(), + defaultZone = "system", + defaultLocale = null, + defaultNumberingSystem = null, + defaultOutputCalendar = null, + twoDigitCutoffYear = 60, + throwOnInvalid, + defaultWeekSettings = null; + +/** + * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here. + */ +class Settings { + /** + * Get the callback for returning the current timestamp. + * @type {function} + */ + static get now() { + return now; + } + + /** + * Set the callback for returning the current timestamp. + * The function should return a number, which will be interpreted as an Epoch millisecond count + * @type {function} + * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future + * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time + */ + static set now(n) { + now = n; + } + + /** + * Set the default time zone to create DateTimes in. Does not affect existing instances. + * Use the value "system" to reset this value to the system's time zone. + * @type {string} + */ + static set defaultZone(zone) { + defaultZone = zone; + } + + /** + * Get the default time zone object currently used to create DateTimes. Does not affect existing instances. + * The default value is the system's time zone (the one set on the machine that runs this code). + * @type {Zone} + */ + static get defaultZone() { + return normalizeZone(defaultZone, SystemZone.instance); + } + + /** + * Get the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultLocale() { + return defaultLocale; + } + + /** + * Set the default locale to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultLocale(locale) { + defaultLocale = locale; + } + + /** + * Get the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultNumberingSystem() { + return defaultNumberingSystem; + } + + /** + * Set the default numbering system to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultNumberingSystem(numberingSystem) { + defaultNumberingSystem = numberingSystem; + } + + /** + * Get the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static get defaultOutputCalendar() { + return defaultOutputCalendar; + } + + /** + * Set the default output calendar to create DateTimes with. Does not affect existing instances. + * @type {string} + */ + static set defaultOutputCalendar(outputCalendar) { + defaultOutputCalendar = outputCalendar; + } + + /** + * @typedef {Object} WeekSettings + * @property {number} firstDay + * @property {number} minimalDays + * @property {number[]} weekend + */ + + /** + * @return {WeekSettings|null} + */ + static get defaultWeekSettings() { + return defaultWeekSettings; + } + + /** + * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and + * how many days are required in the first week of a year. + * Does not affect existing instances. + * + * @param {WeekSettings|null} weekSettings + */ + static set defaultWeekSettings(weekSettings) { + defaultWeekSettings = validateWeekSettings(weekSettings); + } + + /** + * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + */ + static get twoDigitCutoffYear() { + return twoDigitCutoffYear; + } + + /** + * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx. + * @type {number} + * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century + * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century + * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950 + * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + */ + static set twoDigitCutoffYear(cutoffYear) { + twoDigitCutoffYear = cutoffYear % 100; + } + + /** + * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static get throwOnInvalid() { + return throwOnInvalid; + } + + /** + * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals + * @type {boolean} + */ + static set throwOnInvalid(t) { + throwOnInvalid = t; + } + + /** + * Reset Luxon's global caches. Should only be necessary in testing scenarios. + * @return {void} + */ + static resetCaches() { + Locale.resetCache(); + IANAZone.resetCache(); + DateTime.resetCache(); + resetDigitRegexCache(); + } +} + +class Invalid { + constructor(reason, explanation) { + this.reason = reason; + this.explanation = explanation; + } + toMessage() { + if (this.explanation) { + return `${this.reason}: ${this.explanation}`; + } else { + return this.reason; + } + } +} + +const nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], + leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; +function unitOutOfRange(unit, value) { + return new Invalid("unit out of range", `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`); +} +function dayOfWeek(year, month, day) { + const d = new Date(Date.UTC(year, month - 1, day)); + if (year < 100 && year >= 0) { + d.setUTCFullYear(d.getUTCFullYear() - 1900); + } + const js = d.getUTCDay(); + return js === 0 ? 7 : js; +} +function computeOrdinal(year, month, day) { + return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1]; +} +function uncomputeOrdinal(year, ordinal) { + const table = isLeapYear(year) ? leapLadder : nonLeapLadder, + month0 = table.findIndex(i => i < ordinal), + day = ordinal - table[month0]; + return { + month: month0 + 1, + day + }; +} +function isoWeekdayToLocal(isoWeekday, startOfWeek) { + return (isoWeekday - startOfWeek + 7) % 7 + 1; +} + +/** + * @private + */ + +function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) { + const { + year, + month, + day + } = gregObj, + ordinal = computeOrdinal(year, month, day), + weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek); + let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), + weekYear; + if (weekNumber < 1) { + weekYear = year - 1; + weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek); + } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) { + weekYear = year + 1; + weekNumber = 1; + } else { + weekYear = year; + } + return { + weekYear, + weekNumber, + weekday, + ...timeObject(gregObj) + }; +} +function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) { + const { + weekYear, + weekNumber, + weekday + } = weekData, + weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), + yearInDays = daysInYear(weekYear); + let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, + year; + if (ordinal < 1) { + year = weekYear - 1; + ordinal += daysInYear(year); + } else if (ordinal > yearInDays) { + year = weekYear + 1; + ordinal -= daysInYear(weekYear); + } else { + year = weekYear; + } + const { + month, + day + } = uncomputeOrdinal(year, ordinal); + return { + year, + month, + day, + ...timeObject(weekData) + }; +} +function gregorianToOrdinal(gregData) { + const { + year, + month, + day + } = gregData; + const ordinal = computeOrdinal(year, month, day); + return { + year, + ordinal, + ...timeObject(gregData) + }; +} +function ordinalToGregorian(ordinalData) { + const { + year, + ordinal + } = ordinalData; + const { + month, + day + } = uncomputeOrdinal(year, ordinal); + return { + year, + month, + day, + ...timeObject(ordinalData) + }; +} + +/** + * Check if local week units like localWeekday are used in obj. + * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties. + * Modifies obj in-place! + * @param obj the object values + */ +function usesLocalWeekValues(obj, loc) { + const hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear); + if (hasLocaleWeekData) { + const hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear); + if (hasIsoWeekData) { + throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields"); + } + if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday; + if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber; + if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear; + delete obj.localWeekday; + delete obj.localWeekNumber; + delete obj.localWeekYear; + return { + minDaysInFirstWeek: loc.getMinDaysInFirstWeek(), + startOfWeek: loc.getStartOfWeek() + }; + } else { + return { + minDaysInFirstWeek: 4, + startOfWeek: 1 + }; + } +} +function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) { + const validYear = isInteger(obj.weekYear), + validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)), + validWeekday = integerBetween(obj.weekday, 1, 7); + if (!validYear) { + return unitOutOfRange("weekYear", obj.weekYear); + } else if (!validWeek) { + return unitOutOfRange("week", obj.weekNumber); + } else if (!validWeekday) { + return unitOutOfRange("weekday", obj.weekday); + } else return false; +} +function hasInvalidOrdinalData(obj) { + const validYear = isInteger(obj.year), + validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validOrdinal) { + return unitOutOfRange("ordinal", obj.ordinal); + } else return false; +} +function hasInvalidGregorianData(obj) { + const validYear = isInteger(obj.year), + validMonth = integerBetween(obj.month, 1, 12), + validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); + if (!validYear) { + return unitOutOfRange("year", obj.year); + } else if (!validMonth) { + return unitOutOfRange("month", obj.month); + } else if (!validDay) { + return unitOutOfRange("day", obj.day); + } else return false; +} +function hasInvalidTimeData(obj) { + const { + hour, + minute, + second, + millisecond + } = obj; + const validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, + validMinute = integerBetween(minute, 0, 59), + validSecond = integerBetween(second, 0, 59), + validMillisecond = integerBetween(millisecond, 0, 999); + if (!validHour) { + return unitOutOfRange("hour", hour); + } else if (!validMinute) { + return unitOutOfRange("minute", minute); + } else if (!validSecond) { + return unitOutOfRange("second", second); + } else if (!validMillisecond) { + return unitOutOfRange("millisecond", millisecond); + } else return false; +} + +/* + This is just a junk drawer, containing anything used across multiple classes. + Because Luxon is small(ish), this should stay small and we won't worry about splitting + it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area. +*/ + +/** + * @private + */ + +// TYPES + +function isUndefined(o) { + return typeof o === "undefined"; +} +function isNumber(o) { + return typeof o === "number"; +} +function isInteger(o) { + return typeof o === "number" && o % 1 === 0; +} +function isString(o) { + return typeof o === "string"; +} +function isDate(o) { + return Object.prototype.toString.call(o) === "[object Date]"; +} + +// CAPABILITIES + +function hasRelative() { + try { + return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat; + } catch (e) { + return false; + } +} +function hasLocaleWeekInfo() { + try { + return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype); + } catch (e) { + return false; + } +} + +// OBJECTS AND ARRAYS + +function maybeArray(thing) { + return Array.isArray(thing) ? thing : [thing]; +} +function bestBy(arr, by, compare) { + if (arr.length === 0) { + return undefined; + } + return arr.reduce((best, next) => { + const pair = [by(next), next]; + if (!best) { + return pair; + } else if (compare(best[0], pair[0]) === best[0]) { + return best; + } else { + return pair; + } + }, null)[1]; +} +function pick(obj, keys) { + return keys.reduce((a, k) => { + a[k] = obj[k]; + return a; + }, {}); +} +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} +function validateWeekSettings(settings) { + if (settings == null) { + return null; + } else if (typeof settings !== "object") { + throw new InvalidArgumentError("Week settings must be an object"); + } else { + if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some(v => !integerBetween(v, 1, 7))) { + throw new InvalidArgumentError("Invalid week settings"); + } + return { + firstDay: settings.firstDay, + minimalDays: settings.minimalDays, + weekend: Array.from(settings.weekend) + }; + } +} + +// NUMBERS AND STRINGS + +function integerBetween(thing, bottom, top) { + return isInteger(thing) && thing >= bottom && thing <= top; +} + +// x % n but takes the sign of n instead of x +function floorMod(x, n) { + return x - n * Math.floor(x / n); +} +function padStart(input, n = 2) { + const isNeg = input < 0; + let padded; + if (isNeg) { + padded = "-" + ("" + -input).padStart(n, "0"); + } else { + padded = ("" + input).padStart(n, "0"); + } + return padded; +} +function parseInteger(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseInt(string, 10); + } +} +function parseFloating(string) { + if (isUndefined(string) || string === null || string === "") { + return undefined; + } else { + return parseFloat(string); + } +} +function parseMillis(fraction) { + // Return undefined (instead of 0) in these cases, where fraction is not set + if (isUndefined(fraction) || fraction === null || fraction === "") { + return undefined; + } else { + const f = parseFloat("0." + fraction) * 1000; + return Math.floor(f); + } +} +function roundTo(number, digits, rounding = "round") { + const factor = 10 ** digits; + switch (rounding) { + case "expand": + return number > 0 ? Math.ceil(number * factor) / factor : Math.floor(number * factor) / factor; + case "trunc": + return Math.trunc(number * factor) / factor; + case "round": + return Math.round(number * factor) / factor; + case "floor": + return Math.floor(number * factor) / factor; + case "ceil": + return Math.ceil(number * factor) / factor; + default: + throw new RangeError(`Value rounding ${rounding} is out of range`); + } +} + +// DATE BASICS + +function isLeapYear(year) { + return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); +} +function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; +} +function daysInMonth(year, month) { + const modMonth = floorMod(month - 1, 12) + 1, + modYear = year + (month - modMonth) / 12; + if (modMonth === 2) { + return isLeapYear(modYear) ? 29 : 28; + } else { + return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1]; + } +} + +// convert a calendar object to a local timestamp (epoch, but with the offset baked in) +function objToLocalTS(obj) { + let d = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond); + + // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that + if (obj.year < 100 && obj.year >= 0) { + d = new Date(d); + // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not + // so if obj.year is in 99, but obj.day makes it roll over into year 100, + // the calculations done by Date.UTC are using year 2000 - which is incorrect + d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + } + return +d; +} + +// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js +function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) { + const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek); + return -fwdlw + minDaysInFirstWeek - 1; +} +function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) { + const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek); + const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek); + return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7; +} +function untruncateYear(year) { + if (year > 99) { + return year; + } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year; +} + +// PARSING + +function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) { + const date = new Date(ts), + intlOpts = { + hourCycle: "h23", + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit" + }; + if (timeZone) { + intlOpts.timeZone = timeZone; + } + const modified = { + timeZoneName: offsetFormat, + ...intlOpts + }; + const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find(m => m.type.toLowerCase() === "timezonename"); + return parsed ? parsed.value : null; +} + +// signedOffset('-5', '30') -> -330 +function signedOffset(offHourStr, offMinuteStr) { + let offHour = parseInt(offHourStr, 10); + + // don't || this because we want to preserve -0 + if (Number.isNaN(offHour)) { + offHour = 0; + } + const offMin = parseInt(offMinuteStr, 10) || 0, + offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin; + return offHour * 60 + offMinSigned; +} + +// COERCION + +function asNumber(value) { + const numericValue = Number(value); + if (typeof value === "boolean" || value === "" || !Number.isFinite(numericValue)) throw new InvalidArgumentError(`Invalid unit value ${value}`); + return numericValue; +} +function normalizeObject(obj, normalizer) { + const normalized = {}; + for (const u in obj) { + if (hasOwnProperty(obj, u)) { + const v = obj[u]; + if (v === undefined || v === null) continue; + normalized[normalizer(u)] = asNumber(v); + } + } + return normalized; +} + +/** + * Returns the offset's value as a string + * @param {number} ts - Epoch milliseconds for which to get the offset + * @param {string} format - What style of offset to return. + * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively + * @return {string} + */ +function formatOffset(offset, format) { + const hours = Math.trunc(Math.abs(offset / 60)), + minutes = Math.trunc(Math.abs(offset % 60)), + sign = offset >= 0 ? "+" : "-"; + switch (format) { + case "short": + return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`; + case "narrow": + return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`; + case "techie": + return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`; + default: + throw new RangeError(`Value format ${format} is out of range for property format`); + } +} +function timeObject(obj) { + return pick(obj, ["hour", "minute", "second", "millisecond"]); +} + +/** + * @private + */ + +const monthsLong = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; +const monthsShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; +const monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]; +function months(length) { + switch (length) { + case "narrow": + return [...monthsNarrow]; + case "short": + return [...monthsShort]; + case "long": + return [...monthsLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"]; + case "2-digit": + return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; + default: + return null; + } +} +const weekdaysLong = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; +const weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; +const weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"]; +function weekdays(length) { + switch (length) { + case "narrow": + return [...weekdaysNarrow]; + case "short": + return [...weekdaysShort]; + case "long": + return [...weekdaysLong]; + case "numeric": + return ["1", "2", "3", "4", "5", "6", "7"]; + default: + return null; + } +} +const meridiems = ["AM", "PM"]; +const erasLong = ["Before Christ", "Anno Domini"]; +const erasShort = ["BC", "AD"]; +const erasNarrow = ["B", "A"]; +function eras(length) { + switch (length) { + case "narrow": + return [...erasNarrow]; + case "short": + return [...erasShort]; + case "long": + return [...erasLong]; + default: + return null; + } +} +function meridiemForDateTime(dt) { + return meridiems[dt.hour < 12 ? 0 : 1]; +} +function weekdayForDateTime(dt, length) { + return weekdays(length)[dt.weekday - 1]; +} +function monthForDateTime(dt, length) { + return months(length)[dt.month - 1]; +} +function eraForDateTime(dt, length) { + return eras(length)[dt.year < 0 ? 0 : 1]; +} +function formatRelativeTime(unit, count, numeric = "always", narrow = false) { + const units = { + years: ["year", "yr."], + quarters: ["quarter", "qtr."], + months: ["month", "mo."], + weeks: ["week", "wk."], + days: ["day", "day", "days"], + hours: ["hour", "hr."], + minutes: ["minute", "min."], + seconds: ["second", "sec."] + }; + const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1; + if (numeric === "auto" && lastable) { + const isDay = unit === "days"; + switch (count) { + case 1: + return isDay ? "tomorrow" : `next ${units[unit][0]}`; + case -1: + return isDay ? "yesterday" : `last ${units[unit][0]}`; + case 0: + return isDay ? "today" : `this ${units[unit][0]}`; + } + } + + const isInPast = Object.is(count, -0) || count < 0, + fmtValue = Math.abs(count), + singular = fmtValue === 1, + lilUnits = units[unit], + fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit; + return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`; +} + +function stringifyTokens(splits, tokenToString) { + let s = ""; + for (const token of splits) { + if (token.literal) { + s += token.val; + } else { + s += tokenToString(token.val); + } + } + return s; +} +const macroTokenToFormatOpts = { + D: DATE_SHORT, + DD: DATE_MED, + DDD: DATE_FULL, + DDDD: DATE_HUGE, + t: TIME_SIMPLE, + tt: TIME_WITH_SECONDS, + ttt: TIME_WITH_SHORT_OFFSET, + tttt: TIME_WITH_LONG_OFFSET, + T: TIME_24_SIMPLE, + TT: TIME_24_WITH_SECONDS, + TTT: TIME_24_WITH_SHORT_OFFSET, + TTTT: TIME_24_WITH_LONG_OFFSET, + f: DATETIME_SHORT, + ff: DATETIME_MED, + fff: DATETIME_FULL, + ffff: DATETIME_HUGE, + F: DATETIME_SHORT_WITH_SECONDS, + FF: DATETIME_MED_WITH_SECONDS, + FFF: DATETIME_FULL_WITH_SECONDS, + FFFF: DATETIME_HUGE_WITH_SECONDS +}; + +/** + * @private + */ + +class Formatter { + static create(locale, opts = {}) { + return new Formatter(locale, opts); + } + static parseFormat(fmt) { + // white-space is always considered a literal in user-provided formats + // the " " token has a special meaning (see unitForToken) + + let current = null, + currentFull = "", + bracketed = false; + const splits = []; + for (let i = 0; i < fmt.length; i++) { + const c = fmt.charAt(i); + if (c === "'") { + // turn '' into a literal signal quote instead of just skipping the empty literal + if (currentFull.length > 0 || bracketed) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull === "" ? "'" : currentFull + }); + } + current = null; + currentFull = ""; + bracketed = !bracketed; + } else if (bracketed) { + currentFull += c; + } else if (c === current) { + currentFull += c; + } else { + if (currentFull.length > 0) { + splits.push({ + literal: /^\s+$/.test(currentFull), + val: currentFull + }); + } + currentFull = c; + current = c; + } + } + if (currentFull.length > 0) { + splits.push({ + literal: bracketed || /^\s+$/.test(currentFull), + val: currentFull + }); + } + return splits; + } + static macroTokenToFormatOpts(token) { + return macroTokenToFormatOpts[token]; + } + constructor(locale, formatOpts) { + this.opts = formatOpts; + this.loc = locale; + this.systemLoc = null; + } + formatWithSystemDefault(dt, opts) { + if (this.systemLoc === null) { + this.systemLoc = this.loc.redefaultToSystem(); + } + const df = this.systemLoc.dtFormatter(dt, { + ...this.opts, + ...opts + }); + return df.format(); + } + dtFormatter(dt, opts = {}) { + return this.loc.dtFormatter(dt, { + ...this.opts, + ...opts + }); + } + formatDateTime(dt, opts) { + return this.dtFormatter(dt, opts).format(); + } + formatDateTimeParts(dt, opts) { + return this.dtFormatter(dt, opts).formatToParts(); + } + formatInterval(interval, opts) { + const df = this.dtFormatter(interval.start, opts); + return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); + } + resolvedOptions(dt, opts) { + return this.dtFormatter(dt, opts).resolvedOptions(); + } + num(n, p = 0, signDisplay = undefined) { + // we get some perf out of doing this here, annoyingly + if (this.opts.forceSimple) { + return padStart(n, p); + } + const opts = { + ...this.opts + }; + if (p > 0) { + opts.padTo = p; + } + if (signDisplay) { + opts.signDisplay = signDisplay; + } + return this.loc.numberFormatter(opts).format(n); + } + formatDateTimeFromString(dt, fmt) { + const knownEnglish = this.loc.listingMode() === "en", + useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", + string = (opts, extract) => this.loc.extract(dt, opts, extract), + formatOffset = opts => { + if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) { + return "Z"; + } + return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : ""; + }, + meridiem = () => knownEnglish ? meridiemForDateTime(dt) : string({ + hour: "numeric", + hourCycle: "h12" + }, "dayperiod"), + month = (length, standalone) => knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { + month: length + } : { + month: length, + day: "numeric" + }, "month"), + weekday = (length, standalone) => knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { + weekday: length + } : { + weekday: length, + month: "long", + day: "numeric" + }, "weekday"), + maybeMacro = token => { + const formatOpts = Formatter.macroTokenToFormatOpts(token); + if (formatOpts) { + return this.formatWithSystemDefault(dt, formatOpts); + } else { + return token; + } + }, + era = length => knownEnglish ? eraForDateTime(dt, length) : string({ + era: length + }, "era"), + tokenToString = token => { + // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols + switch (token) { + // ms + case "S": + return this.num(dt.millisecond); + case "u": + // falls through + case "SSS": + return this.num(dt.millisecond, 3); + // seconds + case "s": + return this.num(dt.second); + case "ss": + return this.num(dt.second, 2); + // fractional seconds + case "uu": + return this.num(Math.floor(dt.millisecond / 10), 2); + case "uuu": + return this.num(Math.floor(dt.millisecond / 100)); + // minutes + case "m": + return this.num(dt.minute); + case "mm": + return this.num(dt.minute, 2); + // hours + case "h": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); + case "hh": + return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2); + case "H": + return this.num(dt.hour); + case "HH": + return this.num(dt.hour, 2); + // offset + case "Z": + // like +6 + return formatOffset({ + format: "narrow", + allowZ: this.opts.allowZ + }); + case "ZZ": + // like +06:00 + return formatOffset({ + format: "short", + allowZ: this.opts.allowZ + }); + case "ZZZ": + // like +0600 + return formatOffset({ + format: "techie", + allowZ: this.opts.allowZ + }); + case "ZZZZ": + // like EST + return dt.zone.offsetName(dt.ts, { + format: "short", + locale: this.loc.locale + }); + case "ZZZZZ": + // like Eastern Standard Time + return dt.zone.offsetName(dt.ts, { + format: "long", + locale: this.loc.locale + }); + // zone + case "z": + // like America/New_York + return dt.zoneName; + // meridiems + case "a": + return meridiem(); + // dates + case "d": + return useDateTimeFormatter ? string({ + day: "numeric" + }, "day") : this.num(dt.day); + case "dd": + return useDateTimeFormatter ? string({ + day: "2-digit" + }, "day") : this.num(dt.day, 2); + // weekdays - standalone + case "c": + // like 1 + return this.num(dt.weekday); + case "ccc": + // like 'Tues' + return weekday("short", true); + case "cccc": + // like 'Tuesday' + return weekday("long", true); + case "ccccc": + // like 'T' + return weekday("narrow", true); + // weekdays - format + case "E": + // like 1 + return this.num(dt.weekday); + case "EEE": + // like 'Tues' + return weekday("short", false); + case "EEEE": + // like 'Tuesday' + return weekday("long", false); + case "EEEEE": + // like 'T' + return weekday("narrow", false); + // months - standalone + case "L": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric", + day: "numeric" + }, "month") : this.num(dt.month); + case "LL": + // like 01, doesn't seem to work + return useDateTimeFormatter ? string({ + month: "2-digit", + day: "numeric" + }, "month") : this.num(dt.month, 2); + case "LLL": + // like Jan + return month("short", true); + case "LLLL": + // like January + return month("long", true); + case "LLLLL": + // like J + return month("narrow", true); + // months - format + case "M": + // like 1 + return useDateTimeFormatter ? string({ + month: "numeric" + }, "month") : this.num(dt.month); + case "MM": + // like 01 + return useDateTimeFormatter ? string({ + month: "2-digit" + }, "month") : this.num(dt.month, 2); + case "MMM": + // like Jan + return month("short", false); + case "MMMM": + // like January + return month("long", false); + case "MMMMM": + // like J + return month("narrow", false); + // years + case "y": + // like 2014 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year); + case "yy": + // like 14 + return useDateTimeFormatter ? string({ + year: "2-digit" + }, "year") : this.num(dt.year.toString().slice(-2), 2); + case "yyyy": + // like 0012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year, 4); + case "yyyyyy": + // like 000012 + return useDateTimeFormatter ? string({ + year: "numeric" + }, "year") : this.num(dt.year, 6); + // eras + case "G": + // like AD + return era("short"); + case "GG": + // like Anno Domini + return era("long"); + case "GGGGG": + return era("narrow"); + case "kk": + return this.num(dt.weekYear.toString().slice(-2), 2); + case "kkkk": + return this.num(dt.weekYear, 4); + case "W": + return this.num(dt.weekNumber); + case "WW": + return this.num(dt.weekNumber, 2); + case "n": + return this.num(dt.localWeekNumber); + case "nn": + return this.num(dt.localWeekNumber, 2); + case "ii": + return this.num(dt.localWeekYear.toString().slice(-2), 2); + case "iiii": + return this.num(dt.localWeekYear, 4); + case "o": + return this.num(dt.ordinal); + case "ooo": + return this.num(dt.ordinal, 3); + case "q": + // like 1 + return this.num(dt.quarter); + case "qq": + // like 01 + return this.num(dt.quarter, 2); + case "X": + return this.num(Math.floor(dt.ts / 1000)); + case "x": + return this.num(dt.ts); + default: + return maybeMacro(token); + } + }; + return stringifyTokens(Formatter.parseFormat(fmt), tokenToString); + } + formatDurationFromString(dur, fmt) { + const invertLargest = this.opts.signMode === "negativeLargestOnly" ? -1 : 1; + const tokenToField = token => { + switch (token[0]) { + case "S": + return "milliseconds"; + case "s": + return "seconds"; + case "m": + return "minutes"; + case "h": + return "hours"; + case "d": + return "days"; + case "w": + return "weeks"; + case "M": + return "months"; + case "y": + return "years"; + default: + return null; + } + }, + tokenToString = (lildur, info) => token => { + const mapped = tokenToField(token); + if (mapped) { + const inversionFactor = info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1; + let signDisplay; + if (this.opts.signMode === "negativeLargestOnly" && mapped !== info.largestUnit) { + signDisplay = "never"; + } else if (this.opts.signMode === "all") { + signDisplay = "always"; + } else { + // "auto" and "negative" are the same, but "auto" has better support + signDisplay = "auto"; + } + return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay); + } else { + return token; + } + }, + tokens = Formatter.parseFormat(fmt), + realTokens = tokens.reduce((found, { + literal, + val + }) => literal ? found : found.concat(val), []), + collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter(t => t)), + durationInfo = { + isNegativeDuration: collapsed < 0, + // this relies on "collapsed" being based on "shiftTo", which builds up the object + // in order + largestUnit: Object.keys(collapsed.values)[0] + }; + return stringifyTokens(tokens, tokenToString(collapsed, durationInfo)); + } +} + +/* + * This file handles parsing for well-specified formats. Here's how it works: + * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match. + * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object + * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence. + * Extractors can take a "cursor" representing the offset in the match to look at. This makes it easy to combine extractors. + * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions. + * Some extractions are super dumb and simpleParse and fromStrings help DRY them. + */ + +const ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/; +function combineRegexes(...regexes) { + const full = regexes.reduce((f, r) => f + r.source, ""); + return RegExp(`^${full}$`); +} +function combineExtractors(...extractors) { + return m => extractors.reduce(([mergedVals, mergedZone, cursor], ex) => { + const [val, zone, next] = ex(m, cursor); + return [{ + ...mergedVals, + ...val + }, zone || mergedZone, next]; + }, [{}, null, 1]).slice(0, 2); +} +function parse(s, ...patterns) { + if (s == null) { + return [null, null]; + } + for (const [regex, extractor] of patterns) { + const m = regex.exec(s); + if (m) { + return extractor(m); + } + } + return [null, null]; +} +function simpleParse(...keys) { + return (match, cursor) => { + const ret = {}; + let i; + for (i = 0; i < keys.length; i++) { + ret[keys[i]] = parseInteger(match[cursor + i]); + } + return [ret, null, cursor + i]; + }; +} + +// ISO and SQL parsing +const offsetRegex = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/; +const isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`; +const isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/; +const isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`); +const isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`); +const isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/; +const isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/; +const isoOrdinalRegex = /(\d{4})-?(\d{3})/; +const extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay"); +const extractISOOrdinalData = simpleParse("year", "ordinal"); +const sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/; // dumbed-down version of the ISO one +const sqlTimeRegex = RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`); +const sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`); +function int(match, pos, fallback) { + const m = match[pos]; + return isUndefined(m) ? fallback : parseInteger(m); +} +function extractISOYmd(match, cursor) { + const item = { + year: int(match, cursor), + month: int(match, cursor + 1, 1), + day: int(match, cursor + 2, 1) + }; + return [item, null, cursor + 3]; +} +function extractISOTime(match, cursor) { + const item = { + hours: int(match, cursor, 0), + minutes: int(match, cursor + 1, 0), + seconds: int(match, cursor + 2, 0), + milliseconds: parseMillis(match[cursor + 3]) + }; + return [item, null, cursor + 4]; +} +function extractISOOffset(match, cursor) { + const local = !match[cursor] && !match[cursor + 1], + fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]), + zone = local ? null : FixedOffsetZone.instance(fullOffset); + return [{}, zone, cursor + 3]; +} +function extractIANAZone(match, cursor) { + const zone = match[cursor] ? IANAZone.create(match[cursor]) : null; + return [{}, zone, cursor + 1]; +} + +// ISO time parsing + +const isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`); + +// ISO duration parsing + +const isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/; +function extractISODuration(match) { + const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match; + const hasNegativePrefix = s[0] === "-"; + const negativeSeconds = secondStr && secondStr[0] === "-"; + const maybeNegate = (num, force = false) => num !== undefined && (force || num && hasNegativePrefix) ? -num : num; + return [{ + years: maybeNegate(parseFloating(yearStr)), + months: maybeNegate(parseFloating(monthStr)), + weeks: maybeNegate(parseFloating(weekStr)), + days: maybeNegate(parseFloating(dayStr)), + hours: maybeNegate(parseFloating(hourStr)), + minutes: maybeNegate(parseFloating(minuteStr)), + seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"), + milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds) + }]; +} + +// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York +// and not just that we're in -240 *right now*. But since I don't think these are used that often +// I'm just going to ignore that +const obsOffsets = { + GMT: 0, + EDT: -4 * 60, + EST: -5 * 60, + CDT: -5 * 60, + CST: -6 * 60, + MDT: -6 * 60, + MST: -7 * 60, + PDT: -7 * 60, + PST: -8 * 60 +}; +function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + const result = { + year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr), + month: monthsShort.indexOf(monthStr) + 1, + day: parseInteger(dayStr), + hour: parseInteger(hourStr), + minute: parseInteger(minuteStr) + }; + if (secondStr) result.second = parseInteger(secondStr); + if (weekdayStr) { + result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; + } + return result; +} + +// RFC 2822/5322 +const rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/; +function extractRFC2822(match) { + const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr, obsOffset, milOffset, offHourStr, offMinuteStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + let offset; + if (obsOffset) { + offset = obsOffsets[obsOffset]; + } else if (milOffset) { + offset = 0; + } else { + offset = signedOffset(offHourStr, offMinuteStr); + } + return [result, new FixedOffsetZone(offset)]; +} +function preprocessRFC2822(s) { + // Remove comments and folding whitespace and replace multiple-spaces with a single space + return s.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim(); +} + +// http date + +const rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, + rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, + ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/; +function extractRFC1123Or850(match) { + const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} +function extractASCII(match) { + const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match, + result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr); + return [result, FixedOffsetZone.utcInstance]; +} +const isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex); +const isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex); +const isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex); +const isoTimeCombinedRegex = combineRegexes(isoTimeRegex); +const extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone); +const extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone); +const extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone); +const extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); + +/* + * @private + */ + +function parseISODate(s) { + return parse(s, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]); +} +function parseRFC2822Date(s) { + return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]); +} +function parseHTTPDate(s) { + return parse(s, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]); +} +function parseISODuration(s) { + return parse(s, [isoDuration, extractISODuration]); +} +const extractISOTimeOnly = combineExtractors(extractISOTime); +function parseISOTimeOnly(s) { + return parse(s, [isoTimeOnly, extractISOTimeOnly]); +} +const sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex); +const sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex); +const extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone); +function parseSQL(s) { + return parse(s, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]); +} + +const INVALID$2 = "Invalid Duration"; + +// unit conversion constants +const lowOrderMatrix = { + weeks: { + days: 7, + hours: 7 * 24, + minutes: 7 * 24 * 60, + seconds: 7 * 24 * 60 * 60, + milliseconds: 7 * 24 * 60 * 60 * 1000 + }, + days: { + hours: 24, + minutes: 24 * 60, + seconds: 24 * 60 * 60, + milliseconds: 24 * 60 * 60 * 1000 + }, + hours: { + minutes: 60, + seconds: 60 * 60, + milliseconds: 60 * 60 * 1000 + }, + minutes: { + seconds: 60, + milliseconds: 60 * 1000 + }, + seconds: { + milliseconds: 1000 + } + }, + casualMatrix = { + years: { + quarters: 4, + months: 12, + weeks: 52, + days: 365, + hours: 365 * 24, + minutes: 365 * 24 * 60, + seconds: 365 * 24 * 60 * 60, + milliseconds: 365 * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: 13, + days: 91, + hours: 91 * 24, + minutes: 91 * 24 * 60, + seconds: 91 * 24 * 60 * 60, + milliseconds: 91 * 24 * 60 * 60 * 1000 + }, + months: { + weeks: 4, + days: 30, + hours: 30 * 24, + minutes: 30 * 24 * 60, + seconds: 30 * 24 * 60 * 60, + milliseconds: 30 * 24 * 60 * 60 * 1000 + }, + ...lowOrderMatrix + }, + daysInYearAccurate = 146097.0 / 400, + daysInMonthAccurate = 146097.0 / 4800, + accurateMatrix = { + years: { + quarters: 4, + months: 12, + weeks: daysInYearAccurate / 7, + days: daysInYearAccurate, + hours: daysInYearAccurate * 24, + minutes: daysInYearAccurate * 24 * 60, + seconds: daysInYearAccurate * 24 * 60 * 60, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 + }, + quarters: { + months: 3, + weeks: daysInYearAccurate / 28, + days: daysInYearAccurate / 4, + hours: daysInYearAccurate * 24 / 4, + minutes: daysInYearAccurate * 24 * 60 / 4, + seconds: daysInYearAccurate * 24 * 60 * 60 / 4, + milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000 / 4 + }, + months: { + weeks: daysInMonthAccurate / 7, + days: daysInMonthAccurate, + hours: daysInMonthAccurate * 24, + minutes: daysInMonthAccurate * 24 * 60, + seconds: daysInMonthAccurate * 24 * 60 * 60, + milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000 + }, + ...lowOrderMatrix + }; + +// units ordered by size +const orderedUnits$1 = ["years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"]; +const reverseUnits = orderedUnits$1.slice(0).reverse(); + +// clone really means "create another instance just like this one, but with these changes" +function clone$1(dur, alts, clear = false) { + // deep merge for vals + const conf = { + values: clear ? alts.values : { + ...dur.values, + ...(alts.values || {}) + }, + loc: dur.loc.clone(alts.loc), + conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy, + matrix: alts.matrix || dur.matrix + }; + return new Duration(conf); +} +function durationToMillis(matrix, vals) { + var _vals$milliseconds; + let sum = (_vals$milliseconds = vals.milliseconds) != null ? _vals$milliseconds : 0; + for (const unit of reverseUnits.slice(1)) { + if (vals[unit]) { + sum += vals[unit] * matrix[unit]["milliseconds"]; + } + } + return sum; +} + +// NB: mutates parameters +function normalizeValues(matrix, vals) { + // the logic below assumes the overall value of the duration is positive + // if this is not the case, factor is used to make it so + const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1; + orderedUnits$1.reduceRight((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + const previousVal = vals[previous] * factor; + const conv = matrix[current][previous]; + + // if (previousVal < 0): + // lower order unit is negative (e.g. { years: 2, days: -2 }) + // normalize this by reducing the higher order unit by the appropriate amount + // and increasing the lower order unit + // this can never make the higher order unit negative, because this function only operates + // on positive durations, so the amount of time represented by the lower order unit cannot + // be larger than the higher order unit + // else: + // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 }) + // in this case we attempt to convert as much as possible from the lower order unit into + // the higher order one + // + // Math.floor takes care of both of these cases, rounding away from 0 + // if previousVal < 0 it makes the absolute value larger + // if previousVal >= it makes the absolute value smaller + const rollUp = Math.floor(previousVal / conv); + vals[current] += rollUp * factor; + vals[previous] -= rollUp * conv * factor; + } + return current; + } else { + return previous; + } + }, null); + + // try to convert any decimals into smaller units if possible + // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 } + orderedUnits$1.reduce((previous, current) => { + if (!isUndefined(vals[current])) { + if (previous) { + const fraction = vals[previous] % 1; + vals[previous] -= fraction; + vals[current] += fraction * matrix[previous][current]; + } + return current; + } else { + return previous; + } + }, null); +} + +// Remove all properties with a value of 0 from an object +function removeZeroes(vals) { + const newVals = {}; + for (const [key, value] of Object.entries(vals)) { + if (value !== 0) { + newVals[key] = value; + } + } + return newVals; +} + +/** + * A Duration object represents a period of time, like "2 months" or "1 day, 1 hour". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime. + * + * Here is a brief overview of commonly used methods and getters in Duration: + * + * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}. + * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors. + * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors. + * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}. + * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON} + * + * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation. + */ +class Duration { + /** + * @private + */ + constructor(config) { + const accurate = config.conversionAccuracy === "longterm" || false; + let matrix = accurate ? accurateMatrix : casualMatrix; + if (config.matrix) { + matrix = config.matrix; + } + + /** + * @access private + */ + this.values = config.values; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.conversionAccuracy = accurate ? "longterm" : "casual"; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.matrix = matrix; + /** + * @access private + */ + this.isLuxonDuration = true; + } + + /** + * Create Duration from a number of milliseconds. + * @param {number} count of milliseconds + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + static fromMillis(count, opts) { + return Duration.fromObject({ + milliseconds: count + }, opts); + } + + /** + * Create a Duration from a JavaScript object with keys like 'years' and 'hours'. + * If this object is empty then a zero milliseconds duration is returned. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.years + * @param {number} obj.quarters + * @param {number} obj.months + * @param {number} obj.weeks + * @param {number} obj.days + * @param {number} obj.hours + * @param {number} obj.minutes + * @param {number} obj.seconds + * @param {number} obj.milliseconds + * @param {Object} [opts=[]] - options for creating this Duration + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the custom conversion system to use + * @return {Duration} + */ + static fromObject(obj, opts = {}) { + if (obj == null || typeof obj !== "object") { + throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`); + } + return new Duration({ + values: normalizeObject(obj, Duration.normalizeUnit), + loc: Locale.fromObject(opts), + conversionAccuracy: opts.conversionAccuracy, + matrix: opts.matrix + }); + } + + /** + * Create a Duration from DurationLike. + * + * @param {Object | number | Duration} durationLike + * One of: + * - object with keys like 'years' and 'hours'. + * - number representing milliseconds + * - Duration instance + * @return {Duration} + */ + static fromDurationLike(durationLike) { + if (isNumber(durationLike)) { + return Duration.fromMillis(durationLike); + } else if (Duration.isDuration(durationLike)) { + return durationLike; + } else if (typeof durationLike === "object") { + return Duration.fromObject(durationLike); + } else { + throw new InvalidArgumentError(`Unknown duration argument ${durationLike} of type ${typeof durationLike}`); + } + } + + /** + * Create a Duration from an ISO 8601 duration string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the preset conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 } + * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 } + * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 } + * @return {Duration} + */ + static fromISO(text, opts) { + const [parsed] = parseISODuration(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + + /** + * Create a Duration from an ISO 8601 time string. + * @param {string} text - text to parse + * @param {Object} opts - options for parsing + * @param {string} [opts.locale='en-US'] - the locale to use + * @param {string} opts.numberingSystem - the numbering system to use + * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use + * @param {string} [opts.matrix=Object] - the conversion system to use + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 } + * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 } + * @return {Duration} + */ + static fromISOTime(text, opts) { + const [parsed] = parseISOTimeOnly(text); + if (parsed) { + return Duration.fromObject(parsed, opts); + } else { + return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + } + + /** + * Create an invalid Duration. + * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Duration} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Duration is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDurationError(invalid); + } else { + return new Duration({ + invalid + }); + } + } + + /** + * @private + */ + static normalizeUnit(unit) { + const normalized = { + year: "years", + years: "years", + quarter: "quarters", + quarters: "quarters", + month: "months", + months: "months", + week: "weeks", + weeks: "weeks", + day: "days", + days: "days", + hour: "hours", + hours: "hours", + minute: "minutes", + minutes: "minutes", + second: "seconds", + seconds: "seconds", + millisecond: "milliseconds", + milliseconds: "milliseconds" + }[unit ? unit.toLowerCase() : unit]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; + } + + /** + * Check if an object is a Duration. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDuration(o) { + return o && o.isLuxonDuration || false; + } + + /** + * Get the locale of a Duration, such 'en-GB' + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens: + * * `S` for milliseconds + * * `s` for seconds + * * `m` for minutes + * * `h` for hours + * * `d` for days + * * `w` for weeks + * * `M` for months + * * `y` for years + * Notes: + * * Add padding by repeating the token, e.g. "yy" pads the years to two digits, "hhhh" pads the hours out to four digits + * * Tokens can be escaped by wrapping with single quotes. + * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting. + * @param {string} fmt - the format string + * @param {Object} opts - options + * @param {boolean} [opts.floor=true] - floor numerical values + * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("y d s") //=> "1 6 2" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("yy dd sss") //=> "01 06 002" + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat("M S") //=> "12 518402000" + * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat("d s", { signMode: "all" }) //=> "+6 +2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "all" }) //=> "-6 -2" + * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat("d s", { signMode: "negativeLargestOnly" }) //=> "-6 2" + * @return {string} + */ + toFormat(fmt, opts = {}) { + // reverse-compat since 1.2; we always round down now, never up, and we do it by default + const fmtOpts = { + ...opts, + floor: opts.round !== false && opts.floor !== false + }; + return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2; + } + + /** + * Returns a string representation of a Duration with all units included. + * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options + * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`. + * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor. + * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero + * @example + * ```js + * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 }) + * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes' + * dur.toHuman({ listStyle: "long" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes' + * dur.toHuman({ unitDisplay: "short" }) //=> '1 mth, 0 wks, 5 hr, 6 min' + * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes' + * ``` + */ + toHuman(opts = {}) { + if (!this.isValid) return INVALID$2; + const showZeros = opts.showZeros !== false; + const l = orderedUnits$1.map(unit => { + const val = this.values[unit]; + if (isUndefined(val) || val === 0 && !showZeros) { + return null; + } + return this.loc.numberFormatter({ + style: "unit", + unitDisplay: "long", + ...opts, + unit: unit.slice(0, -1) + }).format(val); + }).filter(n => n); + return this.loc.listFormatter({ + type: "conjunction", + style: opts.listStyle || "narrow", + ...opts + }).format(l); + } + + /** + * Returns a JavaScript object with this Duration's values. + * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 } + * @return {Object} + */ + toObject() { + if (!this.isValid) return {}; + return { + ...this.values + }; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration. + * @see https://en.wikipedia.org/wiki/ISO_8601#Durations + * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S' + * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S' + * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M' + * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M' + * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S' + * @return {string} + */ + toISO() { + // we could use the formatter, but this is an easier way to get the minimum string + if (!this.isValid) return null; + let s = "P"; + if (this.years !== 0) s += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) s += this.weeks + "W"; + if (this.days !== 0) s += this.days + "D"; + if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s += "T"; + if (this.hours !== 0) s += this.hours + "H"; + if (this.minutes !== 0) s += this.minutes + "M"; + if (this.seconds !== 0 || this.milliseconds !== 0) + // this will handle "floating point madness" by removing extra decimal places + // https://stackoverflow.com/questions/588004/is-floating-point-math-broken + s += roundTo(this.seconds + this.milliseconds / 1000, 3) + "S"; + if (s === "P") s += "T0S"; + return s; + } + + /** + * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day. + * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours. + * @see https://en.wikipedia.org/wiki/ISO_8601#Times + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000' + * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000' + * @return {string} + */ + toISOTime(opts = {}) { + if (!this.isValid) return null; + const millis = this.toMillis(); + if (millis < 0 || millis >= 86400000) return null; + opts = { + suppressMilliseconds: false, + suppressSeconds: false, + includePrefix: false, + format: "extended", + ...opts, + includeOffset: false + }; + const dateTime = DateTime.fromMillis(millis, { + zone: "UTC" + }); + return dateTime.toISOTime(opts); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + + /** + * Returns an ISO 8601 representation of this Duration appropriate for use in debugging. + * @return {string} + */ + toString() { + return this.toISO(); + } + + /** + * Returns a string representation of this Duration appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `Duration { values: ${JSON.stringify(this.values)} }`; + } else { + return `Duration { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns an milliseconds value of this Duration. + * @return {number} + */ + toMillis() { + if (!this.isValid) return NaN; + return durationToMillis(this.matrix, this.values); + } + + /** + * Returns an milliseconds value of this Duration. Alias of {@link toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + + /** + * Make this Duration longer by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + plus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration), + result = {}; + for (const k of orderedUnits$1) { + if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { + result[k] = dur.get(k) + this.get(k); + } + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @return {Duration} + */ + minus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration); + return this.plus(dur.negate()); + } + + /** + * Scale this Duration by the specified amount. Return a newly-constructed Duration. + * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number. + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 } + * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === "hours" ? x * 2 : x) //=> { hours: 2, minutes: 30 } + * @return {Duration} + */ + mapUnits(fn) { + if (!this.isValid) return this; + const result = {}; + for (const k of Object.keys(this.values)) { + result[k] = asNumber(fn(this.values[k], k)); + } + return clone$1(this, { + values: result + }, true); + } + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2 + * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0 + * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3 + * @return {number} + */ + get(unit) { + return this[Duration.normalizeUnit(unit)]; + } + + /** + * "Set" the values of specified units. Return a newly-constructed Duration. + * @param {Object} values - a mapping of units to numbers + * @example dur.set({ years: 2017 }) + * @example dur.set({ hours: 8, minutes: 30 }) + * @return {Duration} + */ + set(values) { + if (!this.isValid) return this; + const mixed = { + ...this.values, + ...normalizeObject(values, Duration.normalizeUnit) + }; + return clone$1(this, { + values: mixed + }); + } + + /** + * "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration. + * @example dur.reconfigure({ locale: 'en-GB' }) + * @return {Duration} + */ + reconfigure({ + locale, + numberingSystem, + conversionAccuracy, + matrix + } = {}) { + const loc = this.loc.clone({ + locale, + numberingSystem + }); + const opts = { + loc, + matrix, + conversionAccuracy + }; + return clone$1(this, opts); + } + + /** + * Return the length of the duration in the specified unit. + * @param {string} unit - a unit such as 'minutes' or 'days' + * @example Duration.fromObject({years: 1}).as('days') //=> 365 + * @example Duration.fromObject({years: 1}).as('months') //=> 12 + * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5 + * @return {number} + */ + as(unit) { + return this.isValid ? this.shiftTo(unit).get(unit) : NaN; + } + + /** + * Reduce this Duration to its canonical representation in its current units. + * Assuming the overall value of the Duration is positive, this means: + * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) + * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise + * the overall value would be negative, see third example) + * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) + * + * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. + * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } + * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } + * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } + * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } + * @return {Duration} + */ + normalize() { + if (!this.isValid) return this; + const vals = this.toObject(); + normalizeValues(this.matrix, vals); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Rescale units to its largest representation + * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 } + * @return {Duration} + */ + rescale() { + if (!this.isValid) return this; + const vals = removeZeroes(this.normalize().shiftToAll().toObject()); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Convert this Duration into its representation in a different set of units. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 } + * @return {Duration} + */ + shiftTo(...units) { + if (!this.isValid) return this; + if (units.length === 0) { + return this; + } + units = units.map(u => Duration.normalizeUnit(u)); + const built = {}, + accumulated = {}, + vals = this.toObject(); + let lastUnit; + for (const k of orderedUnits$1) { + if (units.indexOf(k) >= 0) { + lastUnit = k; + let own = 0; + + // anything we haven't boiled down yet should get boiled to this unit + for (const ak in accumulated) { + own += this.matrix[ak][k] * accumulated[ak]; + accumulated[ak] = 0; + } + + // plus anything that's already in this unit + if (isNumber(vals[k])) { + own += vals[k]; + } + + // only keep the integer part for now in the hopes of putting any decimal part + // into a smaller unit later + const i = Math.trunc(own); + built[k] = i; + accumulated[k] = (own * 1000 - i * 1000) / 1000; + + // otherwise, keep it in the wings to boil it later + } else if (isNumber(vals[k])) { + accumulated[k] = vals[k]; + } + } + + // anything leftover becomes the decimal for the last unit + // lastUnit must be defined since units is not empty + for (const key in accumulated) { + if (accumulated[key] !== 0) { + built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; + } + } + normalizeValues(this.matrix, built); + return clone$1(this, { + values: built + }, true); + } + + /** + * Shift this Duration to all available units. + * Same as shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds") + * @return {Duration} + */ + shiftToAll() { + if (!this.isValid) return this; + return this.shiftTo("years", "months", "weeks", "days", "hours", "minutes", "seconds", "milliseconds"); + } + + /** + * Return the negative of this Duration. + * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 } + * @return {Duration} + */ + negate() { + if (!this.isValid) return this; + const negated = {}; + for (const k of Object.keys(this.values)) { + negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; + } + return clone$1(this, { + values: negated + }, true); + } + + /** + * Removes all units with values equal to 0 from this Duration. + * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 } + * @return {Duration} + */ + removeZeros() { + if (!this.isValid) return this; + const vals = removeZeroes(this.values); + return clone$1(this, { + values: vals + }, true); + } + + /** + * Get the years. + * @type {number} + */ + get years() { + return this.isValid ? this.values.years || 0 : NaN; + } + + /** + * Get the quarters. + * @type {number} + */ + get quarters() { + return this.isValid ? this.values.quarters || 0 : NaN; + } + + /** + * Get the months. + * @type {number} + */ + get months() { + return this.isValid ? this.values.months || 0 : NaN; + } + + /** + * Get the weeks + * @type {number} + */ + get weeks() { + return this.isValid ? this.values.weeks || 0 : NaN; + } + + /** + * Get the days. + * @type {number} + */ + get days() { + return this.isValid ? this.values.days || 0 : NaN; + } + + /** + * Get the hours. + * @type {number} + */ + get hours() { + return this.isValid ? this.values.hours || 0 : NaN; + } + + /** + * Get the minutes. + * @type {number} + */ + get minutes() { + return this.isValid ? this.values.minutes || 0 : NaN; + } + + /** + * Get the seconds. + * @return {number} + */ + get seconds() { + return this.isValid ? this.values.seconds || 0 : NaN; + } + + /** + * Get the milliseconds. + * @return {number} + */ + get milliseconds() { + return this.isValid ? this.values.milliseconds || 0 : NaN; + } + + /** + * Returns whether the Duration is invalid. Invalid durations are returned by diff operations + * on invalid DateTimes or Intervals. + * @return {boolean} + */ + get isValid() { + return this.invalid === null; + } + + /** + * Returns an error code if this Duration became invalid, or null if the Duration is valid + * @return {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Duration became invalid, or null if the Duration is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Equality check + * Two Durations are equal iff they have the same units and the same values for each unit. + * @param {Duration} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + if (!this.loc.equals(other.loc)) { + return false; + } + function eq(v1, v2) { + // Consider 0 and undefined as equal + if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0; + return v1 === v2; + } + for (const u of orderedUnits$1) { + if (!eq(this.values[u], other.values[u])) { + return false; + } + } + return true; + } +} + +const INVALID$1 = "Invalid Interval"; + +// checks if the start is equal to or before the end +function validateStartEnd(start, end) { + if (!start || !start.isValid) { + return Interval.invalid("missing or invalid start"); + } else if (!end || !end.isValid) { + return Interval.invalid("missing or invalid end"); + } else if (end < start) { + return Interval.invalid("end before start", `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`); + } else { + return null; + } +} + +/** + * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them. + * + * Here is a brief overview of the most commonly used methods and getters in Interval: + * + * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}. + * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end. + * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}. + * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}. + * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs} + * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}. + */ +class Interval { + /** + * @private + */ + constructor(config) { + /** + * @access private + */ + this.s = config.start; + /** + * @access private + */ + this.e = config.end; + /** + * @access private + */ + this.invalid = config.invalid || null; + /** + * @access private + */ + this.isLuxonInterval = true; + } + + /** + * Create an invalid Interval. + * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {Interval} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the Interval is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidIntervalError(invalid); + } else { + return new Interval({ + invalid + }); + } + } + + /** + * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end. + * @param {DateTime|Date|Object} start + * @param {DateTime|Date|Object} end + * @return {Interval} + */ + static fromDateTimes(start, end) { + const builtStart = friendlyDateTime(start), + builtEnd = friendlyDateTime(end); + const validateError = validateStartEnd(builtStart, builtEnd); + if (validateError == null) { + return new Interval({ + start: builtStart, + end: builtEnd + }); + } else { + return validateError; + } + } + + /** + * Create an Interval from a start DateTime and a Duration to extend to. + * @param {DateTime|Date|Object} start + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static after(start, duration) { + const dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(start); + return Interval.fromDateTimes(dt, dt.plus(dur)); + } + + /** + * Create an Interval from an end DateTime and a Duration to extend backwards to. + * @param {DateTime|Date|Object} end + * @param {Duration|Object|number} duration - the length of the Interval. + * @return {Interval} + */ + static before(end, duration) { + const dur = Duration.fromDurationLike(duration), + dt = friendlyDateTime(end); + return Interval.fromDateTimes(dt.minus(dur), dt); + } + + /** + * Create an Interval from an ISO 8601 string. + * Accepts `/`, `/`, and `/` formats. + * @param {string} text - the ISO string to parse + * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO} + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {Interval} + */ + static fromISO(text, opts) { + const [s, e] = (text || "").split("/", 2); + if (s && e) { + let start, startIsValid; + try { + start = DateTime.fromISO(s, opts); + startIsValid = start.isValid; + } catch (e) { + startIsValid = false; + } + let end, endIsValid; + try { + end = DateTime.fromISO(e, opts); + endIsValid = end.isValid; + } catch (e) { + endIsValid = false; + } + if (startIsValid && endIsValid) { + return Interval.fromDateTimes(start, end); + } + if (startIsValid) { + const dur = Duration.fromISO(e, opts); + if (dur.isValid) { + return Interval.after(start, dur); + } + } else if (endIsValid) { + const dur = Duration.fromISO(s, opts); + if (dur.isValid) { + return Interval.before(end, dur); + } + } + } + return Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`); + } + + /** + * Check if an object is an Interval. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isInterval(o) { + return o && o.isLuxonInterval || false; + } + + /** + * Returns the start of the Interval + * @type {DateTime} + */ + get start() { + return this.isValid ? this.s : null; + } + + /** + * Returns the end of the Interval. This is the first instant which is not part of the interval + * (Interval is half-open). + * @type {DateTime} + */ + get end() { + return this.isValid ? this.e : null; + } + + /** + * Returns the last DateTime included in the interval (since end is not part of the interval) + * @type {DateTime} + */ + get lastDateTime() { + return this.isValid ? this.e ? this.e.minus(1) : null : null; + } + + /** + * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'. + * @type {boolean} + */ + get isValid() { + return this.invalidReason === null; + } + + /** + * Returns an error code if this Interval is invalid, or null if the Interval is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this Interval became invalid, or null if the Interval is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Returns the length of the Interval in the specified unit. + * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in. + * @return {number} + */ + length(unit = "milliseconds") { + return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN; + } + + /** + * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part. + * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day' + * asks 'what dates are included in this interval?', not 'how many days long is this interval?' + * @param {string} [unit='milliseconds'] - the unit of time to count. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime + * @return {number} + */ + count(unit = "milliseconds", opts) { + if (!this.isValid) return NaN; + const start = this.start.startOf(unit, opts); + let end; + if (opts != null && opts.useLocaleWeeks) { + end = this.end.reconfigure({ + locale: start.locale + }); + } else { + end = this.end; + } + end = end.startOf(unit, opts); + return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf()); + } + + /** + * Returns whether this Interval's start and end are both in the same unit of time + * @param {string} unit - the unit of time to check sameness on + * @return {boolean} + */ + hasSame(unit) { + return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false; + } + + /** + * Return whether this Interval has the same start and end DateTimes. + * @return {boolean} + */ + isEmpty() { + return this.s.valueOf() === this.e.valueOf(); + } + + /** + * Return whether this Interval's start is after the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isAfter(dateTime) { + if (!this.isValid) return false; + return this.s > dateTime; + } + + /** + * Return whether this Interval's end is before the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + isBefore(dateTime) { + if (!this.isValid) return false; + return this.e <= dateTime; + } + + /** + * Return whether this Interval contains the specified DateTime. + * @param {DateTime} dateTime + * @return {boolean} + */ + contains(dateTime) { + if (!this.isValid) return false; + return this.s <= dateTime && this.e > dateTime; + } + + /** + * "Sets" the start and/or end dates. Returns a newly-constructed Interval. + * @param {Object} values - the values to set + * @param {DateTime} values.start - the starting DateTime + * @param {DateTime} values.end - the ending DateTime + * @return {Interval} + */ + set({ + start, + end + } = {}) { + if (!this.isValid) return this; + return Interval.fromDateTimes(start || this.s, end || this.e); + } + + /** + * Split this Interval at each of the specified DateTimes + * @param {...DateTime} dateTimes - the unit of time to count. + * @return {Array} + */ + splitAt(...dateTimes) { + if (!this.isValid) return []; + const sorted = dateTimes.map(friendlyDateTime).filter(d => this.contains(d)).sort((a, b) => a.toMillis() - b.toMillis()), + results = []; + let { + s + } = this, + i = 0; + while (s < this.e) { + const added = sorted[i] || this.e, + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + i += 1; + } + return results; + } + + /** + * Split this Interval into smaller Intervals, each of the specified length. + * Left over time is grouped into a smaller interval + * @param {Duration|Object|number} duration - The length of each resulting interval. + * @return {Array} + */ + splitBy(duration) { + const dur = Duration.fromDurationLike(duration); + if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) { + return []; + } + let { + s + } = this, + idx = 1, + next; + const results = []; + while (s < this.e) { + const added = this.start.plus(dur.mapUnits(x => x * idx)); + next = +added > +this.e ? this.e : added; + results.push(Interval.fromDateTimes(s, next)); + s = next; + idx += 1; + } + return results; + } + + /** + * Split this Interval into the specified number of smaller intervals. + * @param {number} numberOfParts - The number of Intervals to divide the Interval into. + * @return {Array} + */ + divideEqually(numberOfParts) { + if (!this.isValid) return []; + return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); + } + + /** + * Return whether this Interval overlaps with the specified Interval + * @param {Interval} other + * @return {boolean} + */ + overlaps(other) { + return this.e > other.s && this.s < other.e; + } + + /** + * Return whether this Interval's end is adjacent to the specified Interval's start. + * @param {Interval} other + * @return {boolean} + */ + abutsStart(other) { + if (!this.isValid) return false; + return +this.e === +other.s; + } + + /** + * Return whether this Interval's start is adjacent to the specified Interval's end. + * @param {Interval} other + * @return {boolean} + */ + abutsEnd(other) { + if (!this.isValid) return false; + return +other.e === +this.s; + } + + /** + * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise. + * @param {Interval} other + * @return {boolean} + */ + engulfs(other) { + if (!this.isValid) return false; + return this.s <= other.s && this.e >= other.e; + } + + /** + * Return whether this Interval has the same start and end as the specified Interval. + * @param {Interval} other + * @return {boolean} + */ + equals(other) { + if (!this.isValid || !other.isValid) { + return false; + } + return this.s.equals(other.s) && this.e.equals(other.e); + } + + /** + * Return an Interval representing the intersection of this Interval and the specified Interval. + * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals. + * Returns null if the intersection is empty, meaning, the intervals don't intersect. + * @param {Interval} other + * @return {Interval} + */ + intersection(other) { + if (!this.isValid) return this; + const s = this.s > other.s ? this.s : other.s, + e = this.e < other.e ? this.e : other.e; + if (s >= e) { + return null; + } else { + return Interval.fromDateTimes(s, e); + } + } + + /** + * Return an Interval representing the union of this Interval and the specified Interval. + * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals. + * @param {Interval} other + * @return {Interval} + */ + union(other) { + if (!this.isValid) return this; + const s = this.s < other.s ? this.s : other.s, + e = this.e > other.e ? this.e : other.e; + return Interval.fromDateTimes(s, e); + } + + /** + * Merge an array of Intervals into an equivalent minimal set of Intervals. + * Combines overlapping and adjacent Intervals. + * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval + * and ending with the latest. + * + * @param {Array} intervals + * @return {Array} + */ + static merge(intervals) { + const [found, final] = intervals.sort((a, b) => a.s - b.s).reduce(([sofar, current], item) => { + if (!current) { + return [sofar, item]; + } else if (current.overlaps(item) || current.abutsStart(item)) { + return [sofar, current.union(item)]; + } else { + return [sofar.concat([current]), item]; + } + }, [[], null]); + if (final) { + found.push(final); + } + return found; + } + + /** + * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals. + * @param {Array} intervals + * @return {Array} + */ + static xor(intervals) { + let start = null, + currentCount = 0; + const results = [], + ends = intervals.map(i => [{ + time: i.s, + type: "s" + }, { + time: i.e, + type: "e" + }]), + flattened = Array.prototype.concat(...ends), + arr = flattened.sort((a, b) => a.time - b.time); + for (const i of arr) { + currentCount += i.type === "s" ? 1 : -1; + if (currentCount === 1) { + start = i.time; + } else { + if (start && +start !== +i.time) { + results.push(Interval.fromDateTimes(start, i.time)); + } + start = null; + } + } + return Interval.merge(results); + } + + /** + * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals. + * @param {...Interval} intervals + * @return {Array} + */ + difference(...intervals) { + return Interval.xor([this].concat(intervals)).map(i => this.intersection(i)).filter(i => i && !i.isEmpty()); + } + + /** + * Returns a string representation of this Interval appropriate for debugging. + * @return {string} + */ + toString() { + if (!this.isValid) return INVALID$1; + return `[${this.s.toISO()} – ${this.e.toISO()})`; + } + + /** + * Returns a string representation of this Interval appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`; + } else { + return `Interval { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns a localized string representing this Interval. Accepts the same options as the + * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as + * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method + * is browser-specific, but in general it will return an appropriate representation of the + * Interval in the assigned locale. Defaults to the system's locale if no locale has been + * specified. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or + * Intl.DateTimeFormat constructor options. + * @param {Object} opts - Options to override the configuration of the start DateTime. + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022 + * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022 + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM + * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1; + } + + /** + * Returns an ISO 8601-compliant string representation of this Interval. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISO(opts) { + if (!this.isValid) return INVALID$1; + return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`; + } + + /** + * Returns an ISO 8601-compliant string representation of date of this Interval. + * The time components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @return {string} + */ + toISODate() { + if (!this.isValid) return INVALID$1; + return `${this.s.toISODate()}/${this.e.toISODate()}`; + } + + /** + * Returns an ISO 8601-compliant string representation of time of this Interval. + * The date components are ignored. + * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals + * @param {Object} opts - The same options as {@link DateTime#toISO} + * @return {string} + */ + toISOTime(opts) { + if (!this.isValid) return INVALID$1; + return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; + } + + /** + * Returns a string representation of this Interval formatted according to the specified format + * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible + * formatting tool. + * @param {string} dateFormat - The format string. This string formats the start and end time. + * See {@link DateTime#toFormat} for details. + * @param {Object} opts - Options. + * @param {string} [opts.separator = ' – '] - A separator to place between the start and end + * representations. + * @return {string} + */ + toFormat(dateFormat, { + separator = " – " + } = {}) { + if (!this.isValid) return INVALID$1; + return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; + } + + /** + * Return a Duration representing the time spanned by this interval. + * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 } + * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 } + * @return {Duration} + */ + toDuration(unit, opts) { + if (!this.isValid) { + return Duration.invalid(this.invalidReason); + } + return this.e.diff(this.s, unit, opts); + } + + /** + * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes + * @param {function} mapFn + * @return {Interval} + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC()) + * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 })) + */ + mapEndpoints(mapFn) { + return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e)); + } +} + +/** + * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment. + */ +class Info { + /** + * Return whether the specified zone contains a DST. + * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone. + * @return {boolean} + */ + static hasDST(zone = Settings.defaultZone) { + const proto = DateTime.now().setZone(zone).set({ + month: 12 + }); + return !zone.isUniversal && proto.offset !== proto.set({ + month: 6 + }).offset; + } + + /** + * Return whether the specified zone is a valid IANA specifier. + * @param {string} zone - Zone to check + * @return {boolean} + */ + static isValidIANAZone(zone) { + return IANAZone.isValidZone(zone); + } + + /** + * Converts the input into a {@link Zone} instance. + * + * * If `input` is already a Zone instance, it is returned unchanged. + * * If `input` is a string containing a valid time zone name, a Zone instance + * with that name is returned. + * * If `input` is a string that doesn't refer to a known time zone, a Zone + * instance with {@link Zone#isValid} == false is returned. + * * If `input is a number, a Zone instance with the specified fixed offset + * in minutes is returned. + * * If `input` is `null` or `undefined`, the default zone is returned. + * @param {string|Zone|number} [input] - the value to be converted + * @return {Zone} + */ + static normalizeZone(input) { + return normalizeZone(input, Settings.defaultZone); + } + + /** + * Get the weekday on which the week starts according to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} the start of the week, 1 for Monday through 7 for Sunday + */ + static getStartOfWeek({ + locale = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale)).getStartOfWeek(); + } + + /** + * Get the minimum number of days necessary in a week before it is considered part of the next year according + * to the given locale. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number} + */ + static getMinimumDaysInFirstWeek({ + locale = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale)).getMinDaysInFirstWeek(); + } + + /** + * Get the weekdays, which are considered the weekend according to the given locale + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.locObj=null] - an existing locale object to use + * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday + */ + static getWeekendWeekdays({ + locale = null, + locObj = null + } = {}) { + // copy the array, because we cache it internally + return (locObj || Locale.create(locale)).getWeekendDays().slice(); + } + + /** + * Return an array of standalone month names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @example Info.months()[0] //=> 'January' + * @example Info.months('short')[0] //=> 'Jan' + * @example Info.months('numeric')[0] //=> '1' + * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.' + * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١' + * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I' + * @return {Array} + */ + static months(length = "long", { + locale = null, + numberingSystem = null, + locObj = null, + outputCalendar = "gregory" + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length); + } + + /** + * Return an array of format month names. + * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that + * changes the string. + * See {@link Info#months} + * @param {string} [length='long'] - the length of the month representation, such as "numeric", "2-digit", "narrow", "short", "long" + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @param {string} [opts.outputCalendar='gregory'] - the calendar + * @return {Array} + */ + static monthsFormat(length = "long", { + locale = null, + numberingSystem = null, + locObj = null, + outputCalendar = "gregory" + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true); + } + + /** + * Return an array of standalone week names. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param {string} [length='long'] - the length of the weekday representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @example Info.weekdays()[0] //=> 'Monday' + * @example Info.weekdays('short')[0] //=> 'Mon' + * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.' + * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين' + * @return {Array} + */ + static weekdays(length = "long", { + locale = null, + numberingSystem = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length); + } + + /** + * Return an array of format week names. + * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that + * changes the string. + * See {@link Info#weekdays} + * @param {string} [length='long'] - the length of the month representation, such as "narrow", "short", "long". + * @param {Object} opts - options + * @param {string} [opts.locale=null] - the locale code + * @param {string} [opts.numberingSystem=null] - the numbering system + * @param {string} [opts.locObj=null] - an existing locale object to use + * @return {Array} + */ + static weekdaysFormat(length = "long", { + locale = null, + numberingSystem = null, + locObj = null + } = {}) { + return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true); + } + + /** + * Return an array of meridiems. + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.meridiems() //=> [ 'AM', 'PM' ] + * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ] + * @return {Array} + */ + static meridiems({ + locale = null + } = {}) { + return Locale.create(locale).meridiems(); + } + + /** + * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian. + * @param {string} [length='short'] - the length of the era representation, such as "short" or "long". + * @param {Object} opts - options + * @param {string} [opts.locale] - the locale code + * @example Info.eras() //=> [ 'BC', 'AD' ] + * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ] + * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ] + * @return {Array} + */ + static eras(length = "short", { + locale = null + } = {}) { + return Locale.create(locale, null, "gregory").eras(length); + } + + /** + * Return the set of available features in this environment. + * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case. + * Keys: + * * `relative`: whether this environment supports relative time formatting + * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale + * @example Info.features() //=> { relative: false, localeWeek: true } + * @return {Object} + */ + static features() { + return { + relative: hasRelative(), + localeWeek: hasLocaleWeekInfo() + }; + } +} + +function dayDiff(earlier, later) { + const utcDayStart = dt => dt.toUTC(0, { + keepLocalTime: true + }).startOf("day").valueOf(), + ms = utcDayStart(later) - utcDayStart(earlier); + return Math.floor(Duration.fromMillis(ms).as("days")); +} +function highOrderDiffs(cursor, later, units) { + const differs = [["years", (a, b) => b.year - a.year], ["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4], ["months", (a, b) => b.month - a.month + (b.year - a.year) * 12], ["weeks", (a, b) => { + const days = dayDiff(a, b); + return (days - days % 7) / 7; + }], ["days", dayDiff]]; + const results = {}; + const earlier = cursor; + let lowestOrder, highWater; + + /* This loop tries to diff using larger units first. + If we overshoot, we backtrack and try the next smaller unit. + "cursor" starts out at the earlier timestamp and moves closer and closer to "later" + as we use smaller and smaller units. + highWater keeps track of where we would be if we added one more of the smallest unit, + this is used later to potentially convert any difference smaller than the smallest higher order unit + into a fraction of that smallest higher order unit + */ + for (const [unit, differ] of differs) { + if (units.indexOf(unit) >= 0) { + lowestOrder = unit; + results[unit] = differ(cursor, later); + highWater = earlier.plus(results); + if (highWater > later) { + // we overshot the end point, backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + + // if we are still overshooting now, we need to backtrack again + // this happens in certain situations when diffing times in different zones, + // because this calculation ignores time zones + if (cursor > later) { + // keep the "overshot by 1" around as highWater + highWater = cursor; + // backtrack cursor by 1 + results[unit]--; + cursor = earlier.plus(results); + } + } else { + cursor = highWater; + } + } + } + return [cursor, results, highWater, lowestOrder]; +} +function diff (earlier, later, units, opts) { + let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units); + const remainingMillis = later - cursor; + const lowerOrderUnits = units.filter(u => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0); + if (lowerOrderUnits.length === 0) { + if (highWater < later) { + highWater = cursor.plus({ + [lowestOrder]: 1 + }); + } + if (highWater !== cursor) { + results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor); + } + } + const duration = Duration.fromObject(results, opts); + if (lowerOrderUnits.length > 0) { + return Duration.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration); + } else { + return duration; + } +} + +const MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support"; +function intUnit(regex, post = i => i) { + return { + regex, + deser: ([s]) => post(parseDigits(s)) + }; +} +const NBSP = String.fromCharCode(160); +const spaceOrNBSP = `[ ${NBSP}]`; +const spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g"); +function fixListRegex(s) { + // make dots optional and also make them literal + // make space and non breakable space characters interchangeable + return s.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP); +} +function stripInsensitivities(s) { + return s.replace(/\./g, "") // ignore dots that were made optional + .replace(spaceOrNBSPRegExp, " ") // interchange space and nbsp + .toLowerCase(); +} +function oneOf(strings, startIndex) { + if (strings === null) { + return null; + } else { + return { + regex: RegExp(strings.map(fixListRegex).join("|")), + deser: ([s]) => strings.findIndex(i => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex + }; + } +} +function offset(regex, groups) { + return { + regex, + deser: ([, h, m]) => signedOffset(h, m), + groups + }; +} +function simple(regex) { + return { + regex, + deser: ([s]) => s + }; +} +function escapeToken(value) { + return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); +} + +/** + * @param token + * @param {Locale} loc + */ +function unitForToken(token, loc) { + const one = digitRegex(loc), + two = digitRegex(loc, "{2}"), + three = digitRegex(loc, "{3}"), + four = digitRegex(loc, "{4}"), + six = digitRegex(loc, "{6}"), + oneOrTwo = digitRegex(loc, "{1,2}"), + oneToThree = digitRegex(loc, "{1,3}"), + oneToSix = digitRegex(loc, "{1,6}"), + oneToNine = digitRegex(loc, "{1,9}"), + twoToFour = digitRegex(loc, "{2,4}"), + fourToSix = digitRegex(loc, "{4,6}"), + literal = t => ({ + regex: RegExp(escapeToken(t.val)), + deser: ([s]) => s, + literal: true + }), + unitate = t => { + if (token.literal) { + return literal(t); + } + switch (t.val) { + // era + case "G": + return oneOf(loc.eras("short"), 0); + case "GG": + return oneOf(loc.eras("long"), 0); + // years + case "y": + return intUnit(oneToSix); + case "yy": + return intUnit(twoToFour, untruncateYear); + case "yyyy": + return intUnit(four); + case "yyyyy": + return intUnit(fourToSix); + case "yyyyyy": + return intUnit(six); + // months + case "M": + return intUnit(oneOrTwo); + case "MM": + return intUnit(two); + case "MMM": + return oneOf(loc.months("short", true), 1); + case "MMMM": + return oneOf(loc.months("long", true), 1); + case "L": + return intUnit(oneOrTwo); + case "LL": + return intUnit(two); + case "LLL": + return oneOf(loc.months("short", false), 1); + case "LLLL": + return oneOf(loc.months("long", false), 1); + // dates + case "d": + return intUnit(oneOrTwo); + case "dd": + return intUnit(two); + // ordinals + case "o": + return intUnit(oneToThree); + case "ooo": + return intUnit(three); + // time + case "HH": + return intUnit(two); + case "H": + return intUnit(oneOrTwo); + case "hh": + return intUnit(two); + case "h": + return intUnit(oneOrTwo); + case "mm": + return intUnit(two); + case "m": + return intUnit(oneOrTwo); + case "q": + return intUnit(oneOrTwo); + case "qq": + return intUnit(two); + case "s": + return intUnit(oneOrTwo); + case "ss": + return intUnit(two); + case "S": + return intUnit(oneToThree); + case "SSS": + return intUnit(three); + case "u": + return simple(oneToNine); + case "uu": + return simple(oneOrTwo); + case "uuu": + return intUnit(one); + // meridiem + case "a": + return oneOf(loc.meridiems(), 0); + // weekYear (k) + case "kkkk": + return intUnit(four); + case "kk": + return intUnit(twoToFour, untruncateYear); + // weekNumber (W) + case "W": + return intUnit(oneOrTwo); + case "WW": + return intUnit(two); + // weekdays + case "E": + case "c": + return intUnit(one); + case "EEE": + return oneOf(loc.weekdays("short", false), 1); + case "EEEE": + return oneOf(loc.weekdays("long", false), 1); + case "ccc": + return oneOf(loc.weekdays("short", true), 1); + case "cccc": + return oneOf(loc.weekdays("long", true), 1); + // offset/zone + case "Z": + case "ZZ": + return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2); + case "ZZZ": + return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2); + // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing + // because we don't have any way to figure out what they are + case "z": + return simple(/[a-z_+-/]{1,256}?/i); + // this special-case "token" represents a place where a macro-token expanded into a white-space literal + // in this case we accept any non-newline white-space + case " ": + return simple(/[^\S\n\r]/); + default: + return literal(t); + } + }; + const unit = unitate(token) || { + invalidReason: MISSING_FTP + }; + unit.token = token; + return unit; +} +const partTypeStyleToTokenVal = { + year: { + "2-digit": "yy", + numeric: "yyyyy" + }, + month: { + numeric: "M", + "2-digit": "MM", + short: "MMM", + long: "MMMM" + }, + day: { + numeric: "d", + "2-digit": "dd" + }, + weekday: { + short: "EEE", + long: "EEEE" + }, + dayperiod: "a", + dayPeriod: "a", + hour12: { + numeric: "h", + "2-digit": "hh" + }, + hour24: { + numeric: "H", + "2-digit": "HH" + }, + minute: { + numeric: "m", + "2-digit": "mm" + }, + second: { + numeric: "s", + "2-digit": "ss" + }, + timeZoneName: { + long: "ZZZZZ", + short: "ZZZ" + } +}; +function tokenForPart(part, formatOpts, resolvedOpts) { + const { + type, + value + } = part; + if (type === "literal") { + const isSpace = /^\s+$/.test(value); + return { + literal: !isSpace, + val: isSpace ? " " : value + }; + } + const style = formatOpts[type]; + + // The user might have explicitly specified hour12 or hourCycle + // if so, respect their decision + // if not, refer back to the resolvedOpts, which are based on the locale + let actualType = type; + if (type === "hour") { + if (formatOpts.hour12 != null) { + actualType = formatOpts.hour12 ? "hour12" : "hour24"; + } else if (formatOpts.hourCycle != null) { + if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { + actualType = "hour12"; + } else { + actualType = "hour24"; + } + } else { + // tokens only differentiate between 24 hours or not, + // so we do not need to check hourCycle here, which is less supported anyways + actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; + } + } + let val = partTypeStyleToTokenVal[actualType]; + if (typeof val === "object") { + val = val[style]; + } + if (val) { + return { + literal: false, + val + }; + } + return undefined; +} +function buildRegex(units) { + const re = units.map(u => u.regex).reduce((f, r) => `${f}(${r.source})`, ""); + return [`^${re}$`, units]; +} +function match(input, regex, handlers) { + const matches = input.match(regex); + if (matches) { + const all = {}; + let matchIndex = 1; + for (const i in handlers) { + if (hasOwnProperty(handlers, i)) { + const h = handlers[i], + groups = h.groups ? h.groups + 1 : 1; + if (!h.literal && h.token) { + all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups)); + } + matchIndex += groups; + } + } + return [matches, all]; + } else { + return [matches, {}]; + } +} +function dateTimeFromMatches(matches) { + const toField = token => { + switch (token) { + case "S": + return "millisecond"; + case "s": + return "second"; + case "m": + return "minute"; + case "h": + case "H": + return "hour"; + case "d": + return "day"; + case "o": + return "ordinal"; + case "L": + case "M": + return "month"; + case "y": + return "year"; + case "E": + case "c": + return "weekday"; + case "W": + return "weekNumber"; + case "k": + return "weekYear"; + case "q": + return "quarter"; + default: + return null; + } + }; + let zone = null; + let specificOffset; + if (!isUndefined(matches.z)) { + zone = IANAZone.create(matches.z); + } + if (!isUndefined(matches.Z)) { + if (!zone) { + zone = new FixedOffsetZone(matches.Z); + } + specificOffset = matches.Z; + } + if (!isUndefined(matches.q)) { + matches.M = (matches.q - 1) * 3 + 1; + } + if (!isUndefined(matches.h)) { + if (matches.h < 12 && matches.a === 1) { + matches.h += 12; + } else if (matches.h === 12 && matches.a === 0) { + matches.h = 0; + } + } + if (matches.G === 0 && matches.y) { + matches.y = -matches.y; + } + if (!isUndefined(matches.u)) { + matches.S = parseMillis(matches.u); + } + const vals = Object.keys(matches).reduce((r, k) => { + const f = toField(k); + if (f) { + r[f] = matches[k]; + } + return r; + }, {}); + return [vals, zone, specificOffset]; +} +let dummyDateTimeCache = null; +function getDummyDateTime() { + if (!dummyDateTimeCache) { + dummyDateTimeCache = DateTime.fromMillis(1555555555555); + } + return dummyDateTimeCache; +} +function maybeExpandMacroToken(token, locale) { + if (token.literal) { + return token; + } + const formatOpts = Formatter.macroTokenToFormatOpts(token.val); + const tokens = formatOptsToTokens(formatOpts, locale); + if (tokens == null || tokens.includes(undefined)) { + return token; + } + return tokens; +} +function expandMacroTokens(tokens, locale) { + return Array.prototype.concat(...tokens.map(t => maybeExpandMacroToken(t, locale))); +} + +/** + * @private + */ + +class TokenParser { + constructor(locale, format) { + this.locale = locale; + this.format = format; + this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale); + this.units = this.tokens.map(t => unitForToken(t, locale)); + this.disqualifyingUnit = this.units.find(t => t.invalidReason); + if (!this.disqualifyingUnit) { + const [regexString, handlers] = buildRegex(this.units); + this.regex = RegExp(regexString, "i"); + this.handlers = handlers; + } + } + explainFromTokens(input) { + if (!this.isValid) { + return { + input, + tokens: this.tokens, + invalidReason: this.invalidReason + }; + } else { + const [rawMatches, matches] = match(input, this.regex, this.handlers), + [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null, undefined]; + if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) { + throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format"); + } + return { + input, + tokens: this.tokens, + regex: this.regex, + rawMatches, + matches, + result, + zone, + specificOffset + }; + } + } + get isValid() { + return !this.disqualifyingUnit; + } + get invalidReason() { + return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null; + } +} +function explainFromTokens(locale, input, format) { + const parser = new TokenParser(locale, format); + return parser.explainFromTokens(input); +} +function parseFromTokens(locale, input, format) { + const { + result, + zone, + specificOffset, + invalidReason + } = explainFromTokens(locale, input, format); + return [result, zone, specificOffset, invalidReason]; +} +function formatOptsToTokens(formatOpts, locale) { + if (!formatOpts) { + return null; + } + const formatter = Formatter.create(locale, formatOpts); + const df = formatter.dtFormatter(getDummyDateTime()); + const parts = df.formatToParts(); + const resolvedOpts = df.resolvedOptions(); + return parts.map(p => tokenForPart(p, formatOpts, resolvedOpts)); +} + +const INVALID = "Invalid DateTime"; +const MAX_DATE = 8.64e15; +function unsupportedZone(zone) { + return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`); +} + +// we cache week data on the DT object and this intermediates the cache +/** + * @param {DateTime} dt + */ +function possiblyCachedWeekData(dt) { + if (dt.weekData === null) { + dt.weekData = gregorianToWeek(dt.c); + } + return dt.weekData; +} + +/** + * @param {DateTime} dt + */ +function possiblyCachedLocalWeekData(dt) { + if (dt.localWeekData === null) { + dt.localWeekData = gregorianToWeek(dt.c, dt.loc.getMinDaysInFirstWeek(), dt.loc.getStartOfWeek()); + } + return dt.localWeekData; +} + +// clone really means, "make a new object with these modifications". all "setters" really use this +// to create a new object while only changing some of the properties +function clone(inst, alts) { + const current = { + ts: inst.ts, + zone: inst.zone, + c: inst.c, + o: inst.o, + loc: inst.loc, + invalid: inst.invalid + }; + return new DateTime({ + ...current, + ...alts, + old: current + }); +} + +// find the right offset a given local time. The o input is our guess, which determines which +// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST) +function fixOffset(localTS, o, tz) { + // Our UTC time is just a guess because our offset is just a guess + let utcGuess = localTS - o * 60 * 1000; + + // Test whether the zone matches the offset for this ts + const o2 = tz.offset(utcGuess); + + // If so, offset didn't change and we're done + if (o === o2) { + return [utcGuess, o]; + } + + // If not, change the ts by the difference in the offset + utcGuess -= (o2 - o) * 60 * 1000; + + // If that gives us the local time we want, we're done + const o3 = tz.offset(utcGuess); + if (o2 === o3) { + return [utcGuess, o2]; + } + + // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time + return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)]; +} + +// convert an epoch timestamp into a calendar object with the given offset +function tsToObj(ts, offset) { + ts += offset * 60 * 1000; + const d = new Date(ts); + return { + year: d.getUTCFullYear(), + month: d.getUTCMonth() + 1, + day: d.getUTCDate(), + hour: d.getUTCHours(), + minute: d.getUTCMinutes(), + second: d.getUTCSeconds(), + millisecond: d.getUTCMilliseconds() + }; +} + +// convert a calendar object to a epoch timestamp +function objToTS(obj, offset, zone) { + return fixOffset(objToLocalTS(obj), offset, zone); +} + +// create a new DT instance by adding a duration, adjusting for DSTs +function adjustTime(inst, dur) { + const oPre = inst.o, + year = inst.c.year + Math.trunc(dur.years), + month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, + c = { + ...inst.c, + year, + month, + day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7 + }, + millisToAdd = Duration.fromObject({ + years: dur.years - Math.trunc(dur.years), + quarters: dur.quarters - Math.trunc(dur.quarters), + months: dur.months - Math.trunc(dur.months), + weeks: dur.weeks - Math.trunc(dur.weeks), + days: dur.days - Math.trunc(dur.days), + hours: dur.hours, + minutes: dur.minutes, + seconds: dur.seconds, + milliseconds: dur.milliseconds + }).as("milliseconds"), + localTS = objToLocalTS(c); + let [ts, o] = fixOffset(localTS, oPre, inst.zone); + if (millisToAdd !== 0) { + ts += millisToAdd; + // that could have changed the offset by going over a DST, but we want to keep the ts the same + o = inst.zone.offset(ts); + } + return { + ts, + o + }; +} + +// helper useful in turning the results of parsing into real dates +// by handling the zone options +function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) { + const { + setZone, + zone + } = opts; + if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + const interpretationZone = parsedZone || zone, + inst = DateTime.fromObject(parsed, { + ...opts, + zone: interpretationZone, + specificOffset + }); + return setZone ? inst : inst.setZone(zone); + } else { + return DateTime.invalid(new Invalid("unparsable", `the input "${text}" can't be parsed as ${format}`)); + } +} + +// if you want to output a technical format (e.g. RFC 2822), this helper +// helps handle the details +function toTechFormat(dt, format, allowZ = true) { + return dt.isValid ? Formatter.create(Locale.create("en-US"), { + allowZ, + forceSimple: true + }).formatDateTimeFromString(dt, format) : null; +} +function toISODate(o, extended, precision) { + const longFormat = o.c.year > 9999 || o.c.year < 0; + let c = ""; + if (longFormat && o.c.year >= 0) c += "+"; + c += padStart(o.c.year, longFormat ? 6 : 4); + if (precision === "year") return c; + if (extended) { + c += "-"; + c += padStart(o.c.month); + if (precision === "month") return c; + c += "-"; + } else { + c += padStart(o.c.month); + if (precision === "month") return c; + } + c += padStart(o.c.day); + return c; +} +function toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision) { + let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0, + c = ""; + switch (precision) { + case "day": + case "month": + case "year": + break; + default: + c += padStart(o.c.hour); + if (precision === "hour") break; + if (extended) { + c += ":"; + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += ":"; + c += padStart(o.c.second); + } + } else { + c += padStart(o.c.minute); + if (precision === "minute") break; + if (showSeconds) { + c += padStart(o.c.second); + } + } + if (precision === "second") break; + if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) { + c += "."; + c += padStart(o.c.millisecond, 3); + } + } + if (includeOffset) { + if (o.isOffsetFixed && o.offset === 0 && !extendedZone) { + c += "Z"; + } else if (o.o < 0) { + c += "-"; + c += padStart(Math.trunc(-o.o / 60)); + c += ":"; + c += padStart(Math.trunc(-o.o % 60)); + } else { + c += "+"; + c += padStart(Math.trunc(o.o / 60)); + c += ":"; + c += padStart(Math.trunc(o.o % 60)); + } + } + if (extendedZone) { + c += "[" + o.zone.ianaName + "]"; + } + return c; +} + +// defaults for unspecified units in the supported calendars +const defaultUnitValues = { + month: 1, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultWeekUnitValues = { + weekNumber: 1, + weekday: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }, + defaultOrdinalUnitValues = { + ordinal: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0 + }; + +// Units in the supported calendars, sorted by bigness +const orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"], + orderedWeekUnits = ["weekYear", "weekNumber", "weekday", "hour", "minute", "second", "millisecond"], + orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"]; + +// standardize case and plurality in units +function normalizeUnit(unit) { + const normalized = { + year: "year", + years: "year", + month: "month", + months: "month", + day: "day", + days: "day", + hour: "hour", + hours: "hour", + minute: "minute", + minutes: "minute", + quarter: "quarter", + quarters: "quarter", + second: "second", + seconds: "second", + millisecond: "millisecond", + milliseconds: "millisecond", + weekday: "weekday", + weekdays: "weekday", + weeknumber: "weekNumber", + weeksnumber: "weekNumber", + weeknumbers: "weekNumber", + weekyear: "weekYear", + weekyears: "weekYear", + ordinal: "ordinal" + }[unit.toLowerCase()]; + if (!normalized) throw new InvalidUnitError(unit); + return normalized; +} +function normalizeUnitWithLocalWeeks(unit) { + switch (unit.toLowerCase()) { + case "localweekday": + case "localweekdays": + return "localWeekday"; + case "localweeknumber": + case "localweeknumbers": + return "localWeekNumber"; + case "localweekyear": + case "localweekyears": + return "localWeekYear"; + default: + return normalizeUnit(unit); + } +} + +// cache offsets for zones based on the current timestamp when this function is +// first called. When we are handling a datetime from components like (year, +// month, day, hour) in a time zone, we need a guess about what the timezone +// offset is so that we can convert into a UTC timestamp. One way is to find the +// offset of now in the zone. The actual date may have a different offset (for +// example, if we handle a date in June while we're in December in a zone that +// observes DST), but we can check and adjust that. +// +// When handling many dates, calculating the offset for now every time is +// expensive. It's just a guess, so we can cache the offset to use even if we +// are right on a time change boundary (we'll just correct in the other +// direction). Using a timestamp from first read is a slight optimization for +// handling dates close to the current date, since those dates will usually be +// in the same offset (we could set the timestamp statically, instead). We use a +// single timestamp for all zones to make things a bit more predictable. +// +// This is safe for quickDT (used by local() and utc()) because we don't fill in +// higher-order units from tsNow (as we do in fromObject, this requires that +// offset is calculated from tsNow). +/** + * @param {Zone} zone + * @return {number} + */ +function guessOffsetForZone(zone) { + if (zoneOffsetTs === undefined) { + zoneOffsetTs = Settings.now(); + } + + // Do not cache anything but IANA zones, because it is not safe to do so. + // Guessing an offset which is not present in the zone can cause wrong results from fixOffset + if (zone.type !== "iana") { + return zone.offset(zoneOffsetTs); + } + const zoneName = zone.name; + let offsetGuess = zoneOffsetGuessCache.get(zoneName); + if (offsetGuess === undefined) { + offsetGuess = zone.offset(zoneOffsetTs); + zoneOffsetGuessCache.set(zoneName, offsetGuess); + } + return offsetGuess; +} + +// this is a dumbed down version of fromObject() that runs about 60% faster +// but doesn't do any validation, makes a bunch of assumptions about what units +// are present, and so on. +function quickDT(obj, opts) { + const zone = normalizeZone(opts.zone, Settings.defaultZone); + if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } + const loc = Locale.fromObject(opts); + let ts, o; + + // assume we have the higher-order units + if (!isUndefined(obj.year)) { + for (const u of orderedUnits) { + if (isUndefined(obj[u])) { + obj[u] = defaultUnitValues[u]; + } + } + const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj); + if (invalid) { + return DateTime.invalid(invalid); + } + const offsetProvis = guessOffsetForZone(zone); + [ts, o] = objToTS(obj, offsetProvis, zone); + } else { + ts = Settings.now(); + } + return new DateTime({ + ts, + zone, + loc, + o + }); +} +function diffRelative(start, end, opts) { + const round = isUndefined(opts.round) ? true : opts.round, + rounding = isUndefined(opts.rounding) ? "trunc" : opts.rounding, + format = (c, unit) => { + c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? "round" : rounding); + const formatter = end.loc.clone(opts).relFormatter(opts); + return formatter.format(c, unit); + }, + differ = unit => { + if (opts.calendary) { + if (!end.hasSame(start, unit)) { + return end.startOf(unit).diff(start.startOf(unit), unit).get(unit); + } else return 0; + } else { + return end.diff(start, unit).get(unit); + } + }; + if (opts.unit) { + return format(differ(opts.unit), opts.unit); + } + for (const unit of opts.units) { + const count = differ(unit); + if (Math.abs(count) >= 1) { + return format(count, unit); + } + } + return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]); +} +function lastOpts(argList) { + let opts = {}, + args; + if (argList.length > 0 && typeof argList[argList.length - 1] === "object") { + opts = argList[argList.length - 1]; + args = Array.from(argList).slice(0, argList.length - 1); + } else { + args = Array.from(argList); + } + return [opts, args]; +} + +/** + * Timestamp to use for cached zone offset guesses (exposed for test) + */ +let zoneOffsetTs; +/** + * Cache for zone offset guesses (exposed for test). + * + * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of + * zone.offset(). + */ +const zoneOffsetGuessCache = new Map(); + +/** + * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them. + * + * A DateTime comprises of: + * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch. + * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone). + * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`. + * + * Here is a brief overview of the most commonly used functionality it provides: + * + * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}. + * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month}, + * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors. + * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors. + * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors. + * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}. + * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}. + * + * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation. + */ +class DateTime { + /** + * @access private + */ + constructor(config) { + const zone = config.zone || Settings.defaultZone; + let invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null); + /** + * @access private + */ + this.ts = isUndefined(config.ts) ? Settings.now() : config.ts; + let c = null, + o = null; + if (!invalid) { + const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone); + if (unchanged) { + [c, o] = [config.old.c, config.old.o]; + } else { + // If an offset has been passed and we have not been called from + // clone(), we can trust it and avoid the offset calculation. + const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts); + c = tsToObj(this.ts, ot); + invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null; + c = invalid ? null : c; + o = invalid ? null : ot; + } + } + + /** + * @access private + */ + this._zone = zone; + /** + * @access private + */ + this.loc = config.loc || Locale.create(); + /** + * @access private + */ + this.invalid = invalid; + /** + * @access private + */ + this.weekData = null; + /** + * @access private + */ + this.localWeekData = null; + /** + * @access private + */ + this.c = c; + /** + * @access private + */ + this.o = o; + /** + * @access private + */ + this.isLuxonDateTime = true; + } + + // CONSTRUCT + + /** + * Create a DateTime for the current instant, in the system's time zone. + * + * Use Settings to override these default values if needed. + * @example DateTime.now().toISO() //~> now in the ISO format + * @return {DateTime} + */ + static now() { + return new DateTime({}); + } + + /** + * Create a local DateTime + * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month, 1-indexed + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @example DateTime.local() //~> now + * @example DateTime.local({ zone: "America/New_York" }) //~> now, in US east coast time + * @example DateTime.local(2017) //~> 2017-01-01T00:00:00 + * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00 + * @example DateTime.local(2017, 3, 12, { locale: "fr" }) //~> 2017-03-12T00:00:00, with a French locale + * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00 + * @example DateTime.local(2017, 3, 12, 5, { zone: "utc" }) //~> 2017-03-12T05:00:00, in UTC + * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00 + * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10 + * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765 + * @return {DateTime} + */ + static local() { + const [opts, args] = lastOpts(arguments), + [year, month, day, hour, minute, second, millisecond] = args; + return quickDT({ + year, + month, + day, + hour, + minute, + second, + millisecond + }, opts); + } + + /** + * Create a DateTime in UTC + * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used + * @param {number} [month=1] - The month, 1-indexed + * @param {number} [day=1] - The day of the month + * @param {number} [hour=0] - The hour of the day, in 24-hour time + * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59 + * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59 + * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999 + * @param {Object} options - configuration options for the DateTime + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.utc() //~> now + * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z + * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z + * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z + * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z + * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: "fr" }) //~> 2017-03-12T05:45:00Z with a French locale + * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z + * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: "fr" }) //~> 2017-03-12T05:45:10.765Z with a French locale + * @return {DateTime} + */ + static utc() { + const [opts, args] = lastOpts(arguments), + [year, month, day, hour, minute, second, millisecond] = args; + opts.zone = FixedOffsetZone.utcInstance; + return quickDT({ + year, + month, + day, + hour, + minute, + second, + millisecond + }, opts); + } + + /** + * Create a DateTime from a JavaScript Date object. Uses the default zone. + * @param {Date} date - a JavaScript Date object + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @return {DateTime} + */ + static fromJSDate(date, options = {}) { + const ts = isDate(date) ? date.valueOf() : NaN; + if (Number.isNaN(ts)) { + return DateTime.invalid("invalid input"); + } + const zoneToUse = normalizeZone(options.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + return new DateTime({ + ts: ts, + zone: zoneToUse, + loc: Locale.fromObject(options) + }); + } + + /** + * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} milliseconds - a number of milliseconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromMillis(milliseconds, options = {}) { + if (!isNumber(milliseconds)) { + throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`); + } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) { + // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start + return DateTime.invalid("Timestamp out of range"); + } else { + return new DateTime({ + ts: milliseconds, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone. + * @param {number} seconds - a number of seconds since 1970 UTC + * @param {Object} options - configuration options for the DateTime + * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into + * @param {string} [options.locale] - a locale to set on the resulting DateTime instance + * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromSeconds(seconds, options = {}) { + if (!isNumber(seconds)) { + throw new InvalidArgumentError("fromSeconds requires a numerical input"); + } else { + return new DateTime({ + ts: seconds * 1000, + zone: normalizeZone(options.zone, Settings.defaultZone), + loc: Locale.fromObject(options) + }); + } + } + + /** + * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults. + * @param {Object} obj - the object to create the DateTime from + * @param {number} obj.year - a year, such as 1987 + * @param {number} obj.month - a month, 1-12 + * @param {number} obj.day - a day of the month, 1-31, depending on the month + * @param {number} obj.ordinal - day of the year, 1-365 or 366 + * @param {number} obj.weekYear - an ISO week year + * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year + * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday + * @param {number} obj.localWeekYear - a week year, according to the locale + * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale + * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale + * @param {number} obj.hour - hour of the day, 0-23 + * @param {number} obj.minute - minute of the hour, 0-59 + * @param {number} obj.second - second of the minute, 0-59 + * @param {number} obj.millisecond - millisecond of the second, 0-999 + * @param {Object} opts - options for creating this DateTime + * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone() + * @param {string} [opts.locale='system\'s locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25' + * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01' + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06 + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }), + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' }) + * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' }) + * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13' + * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: "en-US" }).toISODate() //=> '2021-12-26' + * @return {DateTime} + */ + static fromObject(obj, opts = {}) { + obj = obj || {}; + const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone); + if (!zoneToUse.isValid) { + return DateTime.invalid(unsupportedZone(zoneToUse)); + } + const loc = Locale.fromObject(opts); + const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks); + const { + minDaysInFirstWeek, + startOfWeek + } = usesLocalWeekValues(normalized, loc); + const tsNow = Settings.now(), + offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + + // cases: + // just a weekday -> this week's instance of that weekday, no worries + // (gregorian data or ordinal) + (weekYear or weekNumber) -> error + // (gregorian month or day) + ordinal -> error + // otherwise just use weeks or ordinals or gregorian, depending on what's specified + + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor; + + // configure ourselves to deal with gregorian dates or week stuff + let units, + defaultValues, + objNow = tsToObj(tsNow, offsetProvis); + if (useWeekData) { + units = orderedWeekUnits; + defaultValues = defaultWeekUnitValues; + objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek); + } else if (containsOrdinal) { + units = orderedOrdinalUnits; + defaultValues = defaultOrdinalUnitValues; + objNow = gregorianToOrdinal(objNow); + } else { + units = orderedUnits; + defaultValues = defaultUnitValues; + } + + // set default values for missing stuff + let foundFirst = false; + for (const u of units) { + const v = normalized[u]; + if (!isUndefined(v)) { + foundFirst = true; + } else if (foundFirst) { + normalized[u] = defaultValues[u]; + } else { + normalized[u] = objNow[u]; + } + } + + // make sure the values we have are in range + const higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), + invalid = higherOrderInvalid || hasInvalidTimeData(normalized); + if (invalid) { + return DateTime.invalid(invalid); + } + + // compute the actual time + const gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, + [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), + inst = new DateTime({ + ts: tsFinal, + zone: zoneToUse, + o: offsetFinal, + loc + }); + + // gregorian data + weekday serves only to validate + if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) { + return DateTime.invalid("mismatched weekday", `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`); + } + if (!inst.isValid) { + return DateTime.invalid(inst.invalid); + } + return inst; + } + + /** + * Create a DateTime from an ISO 8601 string + * @param {string} text - the ISO string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance + * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance + * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance + * @example DateTime.fromISO('2016-05-25T09:08:34.123') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00') + * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true}) + * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'}) + * @example DateTime.fromISO('2016-W05-4') + * @return {DateTime} + */ + static fromISO(text, opts = {}) { + const [vals, parsedZone] = parseISODate(text); + return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text); + } + + /** + * Create a DateTime from an RFC 2822 string + * @param {string} text - the RFC 2822 string + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT') + * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600') + * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z') + * @return {DateTime} + */ + static fromRFC2822(text, opts = {}) { + const [vals, parsedZone] = parseRFC2822Date(text); + return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text); + } + + /** + * Create a DateTime from an HTTP header date + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @param {string} text - the HTTP header date + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in. + * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods. + * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT') + * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT') + * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994') + * @return {DateTime} + */ + static fromHTTP(text, opts = {}) { + const [vals, parsedZone] = parseHTTPDate(text); + return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts); + } + + /** + * Create a DateTime from an input string and format string. + * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens). + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see the link below for the formats) + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @return {DateTime} + */ + static fromFormat(text, fmt, opts = {}) { + if (isUndefined(text) || isUndefined(fmt)) { + throw new InvalidArgumentError("fromFormat requires an input string and a format"); + } + const { + locale = null, + numberingSystem = null + } = opts, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true + }), + [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt); + if (invalid) { + return DateTime.invalid(invalid); + } else { + return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset); + } + } + + /** + * @deprecated use fromFormat instead + */ + static fromString(text, fmt, opts = {}) { + return DateTime.fromFormat(text, fmt, opts); + } + + /** + * Create a DateTime from a SQL date, time, or datetime + * Defaults to en-US if no locale has been specified, regardless of the system's locale + * @param {string} text - the string to parse + * @param {Object} opts - options to affect the creation + * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone + * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one + * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale + * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system + * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance + * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance + * @example DateTime.fromSQL('2017-05-15') + * @example DateTime.fromSQL('2017-05-15 09:12:34') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles') + * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true }) + * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' }) + * @example DateTime.fromSQL('09:12:34.342') + * @return {DateTime} + */ + static fromSQL(text, opts = {}) { + const [vals, parsedZone] = parseSQL(text); + return parseDataToDateTime(vals, parsedZone, opts, "SQL", text); + } + + /** + * Create an invalid DateTime. + * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information + * @return {DateTime} + */ + static invalid(reason, explanation = null) { + if (!reason) { + throw new InvalidArgumentError("need to specify a reason the DateTime is invalid"); + } + const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation); + if (Settings.throwOnInvalid) { + throw new InvalidDateTimeError(invalid); + } else { + return new DateTime({ + invalid + }); + } + } + + /** + * Check if an object is an instance of DateTime. Works across context boundaries + * @param {object} o + * @return {boolean} + */ + static isDateTime(o) { + return o && o.isLuxonDateTime || false; + } + + /** + * Produce the format string for a set of options + * @param formatOpts + * @param localeOpts + * @returns {string} + */ + static parseFormatForOpts(formatOpts, localeOpts = {}) { + const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts)); + return !tokenList ? null : tokenList.map(t => t ? t.val : null).join(""); + } + + /** + * Produce the the fully expanded format token for the locale + * Does NOT quote characters, so quoted tokens will not round trip correctly + * @param fmt + * @param localeOpts + * @returns {string} + */ + static expandFormat(fmt, localeOpts = {}) { + const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts)); + return expanded.map(t => t.val).join(""); + } + static resetCache() { + zoneOffsetTs = undefined; + zoneOffsetGuessCache.clear(); + } + + // INFO + + /** + * Get the value of unit. + * @param {string} unit - a unit such as 'minute' or 'day' + * @example DateTime.local(2017, 7, 4).get('month'); //=> 7 + * @example DateTime.local(2017, 7, 4).get('day'); //=> 4 + * @return {number} + */ + get(unit) { + return this[unit]; + } + + /** + * Returns whether the DateTime is valid. Invalid DateTimes occur when: + * * The DateTime was created from invalid calendar information, such as the 13th month or February 30 + * * The DateTime was created by an operation on another invalid date + * @type {boolean} + */ + get isValid() { + return this.invalid === null; + } + + /** + * Returns an error code if this DateTime is invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidReason() { + return this.invalid ? this.invalid.reason : null; + } + + /** + * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid + * @type {string} + */ + get invalidExplanation() { + return this.invalid ? this.invalid.explanation : null; + } + + /** + * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime + * + * @type {string} + */ + get locale() { + return this.isValid ? this.loc.locale : null; + } + + /** + * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime + * + * @type {string} + */ + get numberingSystem() { + return this.isValid ? this.loc.numberingSystem : null; + } + + /** + * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime + * + * @type {string} + */ + get outputCalendar() { + return this.isValid ? this.loc.outputCalendar : null; + } + + /** + * Get the time zone associated with this DateTime. + * @type {Zone} + */ + get zone() { + return this._zone; + } + + /** + * Get the name of the time zone. + * @type {string} + */ + get zoneName() { + return this.isValid ? this.zone.name : null; + } + + /** + * Get the year + * @example DateTime.local(2017, 5, 25).year //=> 2017 + * @type {number} + */ + get year() { + return this.isValid ? this.c.year : NaN; + } + + /** + * Get the quarter + * @example DateTime.local(2017, 5, 25).quarter //=> 2 + * @type {number} + */ + get quarter() { + return this.isValid ? Math.ceil(this.c.month / 3) : NaN; + } + + /** + * Get the month (1-12). + * @example DateTime.local(2017, 5, 25).month //=> 5 + * @type {number} + */ + get month() { + return this.isValid ? this.c.month : NaN; + } + + /** + * Get the day of the month (1-30ish). + * @example DateTime.local(2017, 5, 25).day //=> 25 + * @type {number} + */ + get day() { + return this.isValid ? this.c.day : NaN; + } + + /** + * Get the hour of the day (0-23). + * @example DateTime.local(2017, 5, 25, 9).hour //=> 9 + * @type {number} + */ + get hour() { + return this.isValid ? this.c.hour : NaN; + } + + /** + * Get the minute of the hour (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30 + * @type {number} + */ + get minute() { + return this.isValid ? this.c.minute : NaN; + } + + /** + * Get the second of the minute (0-59). + * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52 + * @type {number} + */ + get second() { + return this.isValid ? this.c.second : NaN; + } + + /** + * Get the millisecond of the second (0-999). + * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654 + * @type {number} + */ + get millisecond() { + return this.isValid ? this.c.millisecond : NaN; + } + + /** + * Get the week year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 12, 31).weekYear //=> 2015 + * @type {number} + */ + get weekYear() { + return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN; + } + + /** + * Get the week number of the week year (1-52ish). + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2017, 5, 25).weekNumber //=> 21 + * @type {number} + */ + get weekNumber() { + return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN; + } + + /** + * Get the day of the week. + * 1 is Monday and 7 is Sunday + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2014, 11, 31).weekday //=> 4 + * @type {number} + */ + get weekday() { + return this.isValid ? possiblyCachedWeekData(this).weekday : NaN; + } + + /** + * Returns true if this date is on a weekend according to the locale, false otherwise + * @returns {boolean} + */ + get isWeekend() { + return this.isValid && this.loc.getWeekendDays().includes(this.weekday); + } + + /** + * Get the day of the week according to the locale. + * 1 is the first day of the week and 7 is the last day of the week. + * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1, + * @returns {number} + */ + get localWeekday() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN; + } + + /** + * Get the week number of the week year according to the locale. Different locales assign week numbers differently, + * because the week can start on different days of the week (see localWeekday) and because a different number of days + * is required for a week to count as the first week of a year. + * @returns {number} + */ + get localWeekNumber() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN; + } + + /** + * Get the week year according to the locale. Different locales assign week numbers (and therefor week years) + * differently, see localWeekNumber. + * @returns {number} + */ + get localWeekYear() { + return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN; + } + + /** + * Get the ordinal (meaning the day of the year) + * @example DateTime.local(2017, 5, 25).ordinal //=> 145 + * @type {number|DateTime} + */ + get ordinal() { + return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN; + } + + /** + * Get the human readable short month name, such as 'Oct'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthShort //=> Oct + * @type {string} + */ + get monthShort() { + return this.isValid ? Info.months("short", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable long month name, such as 'October'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).monthLong //=> October + * @type {string} + */ + get monthLong() { + return this.isValid ? Info.months("long", { + locObj: this.loc + })[this.month - 1] : null; + } + + /** + * Get the human readable short weekday, such as 'Mon'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon + * @type {string} + */ + get weekdayShort() { + return this.isValid ? Info.weekdays("short", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the human readable long weekday, such as 'Monday'. + * Defaults to the system's locale if no locale has been specified + * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday + * @type {string} + */ + get weekdayLong() { + return this.isValid ? Info.weekdays("long", { + locObj: this.loc + })[this.weekday - 1] : null; + } + + /** + * Get the UTC offset of this DateTime in minutes + * @example DateTime.now().offset //=> -240 + * @example DateTime.utc().offset //=> 0 + * @type {number} + */ + get offset() { + return this.isValid ? +this.o : NaN; + } + + /** + * Get the short human name for the zone's current offset, for example "EST" or "EDT". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameShort() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "short", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get the long human name for the zone's current offset, for example "Eastern Standard Time" or "Eastern Daylight Time". + * Defaults to the system's locale if no locale has been specified + * @type {string} + */ + get offsetNameLong() { + if (this.isValid) { + return this.zone.offsetName(this.ts, { + format: "long", + locale: this.locale + }); + } else { + return null; + } + } + + /** + * Get whether this zone's offset ever changes, as in a DST. + * @type {boolean} + */ + get isOffsetFixed() { + return this.isValid ? this.zone.isUniversal : null; + } + + /** + * Get whether the DateTime is in a DST. + * @type {boolean} + */ + get isInDST() { + if (this.isOffsetFixed) { + return false; + } else { + return this.offset > this.set({ + month: 1, + day: 1 + }).offset || this.offset > this.set({ + month: 5 + }).offset; + } + } + + /** + * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC + * in this DateTime's zone. During DST changes local time can be ambiguous, for example + * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. + * This method will return both possible DateTimes if this DateTime's local time is ambiguous. + * @returns {DateTime[]} + */ + getPossibleOffsets() { + if (!this.isValid || this.isOffsetFixed) { + return [this]; + } + const dayMs = 86400000; + const minuteMs = 60000; + const localTS = objToLocalTS(this.c); + const oEarlier = this.zone.offset(localTS - dayMs); + const oLater = this.zone.offset(localTS + dayMs); + const o1 = this.zone.offset(localTS - oEarlier * minuteMs); + const o2 = this.zone.offset(localTS - oLater * minuteMs); + if (o1 === o2) { + return [this]; + } + const ts1 = localTS - o1 * minuteMs; + const ts2 = localTS - o2 * minuteMs; + const c1 = tsToObj(ts1, o1); + const c2 = tsToObj(ts2, o2); + if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { + return [clone(this, { + ts: ts1 + }), clone(this, { + ts: ts2 + })]; + } + return [this]; + } + + /** + * Returns true if this DateTime is in a leap year, false otherwise + * @example DateTime.local(2016).isInLeapYear //=> true + * @example DateTime.local(2013).isInLeapYear //=> false + * @type {boolean} + */ + get isInLeapYear() { + return isLeapYear(this.year); + } + + /** + * Returns the number of days in this DateTime's month + * @example DateTime.local(2016, 2).daysInMonth //=> 29 + * @example DateTime.local(2016, 3).daysInMonth //=> 31 + * @type {number} + */ + get daysInMonth() { + return daysInMonth(this.year, this.month); + } + + /** + * Returns the number of days in this DateTime's year + * @example DateTime.local(2016).daysInYear //=> 366 + * @example DateTime.local(2013).daysInYear //=> 365 + * @type {number} + */ + get daysInYear() { + return this.isValid ? daysInYear(this.year) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's year + * @see https://en.wikipedia.org/wiki/ISO_week_date + * @example DateTime.local(2004).weeksInWeekYear //=> 53 + * @example DateTime.local(2013).weeksInWeekYear //=> 52 + * @type {number} + */ + get weeksInWeekYear() { + return this.isValid ? weeksInWeekYear(this.weekYear) : NaN; + } + + /** + * Returns the number of weeks in this DateTime's local week year + * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52 + * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53 + * @type {number} + */ + get weeksInLocalWeekYear() { + return this.isValid ? weeksInWeekYear(this.localWeekYear, this.loc.getMinDaysInFirstWeek(), this.loc.getStartOfWeek()) : NaN; + } + + /** + * Returns the resolved Intl options for this DateTime. + * This is useful in understanding the behavior of formatting methods + * @param {Object} opts - the same options as toLocaleString + * @return {Object} + */ + resolvedLocaleOptions(opts = {}) { + const { + locale, + numberingSystem, + calendar + } = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this); + return { + locale, + numberingSystem, + outputCalendar: calendar + }; + } + + // TRANSFORM + + /** + * "Set" the DateTime's zone to UTC. Returns a newly-constructed DateTime. + * + * Equivalent to {@link DateTime#setZone}('utc') + * @param {number} [offset=0] - optionally, an offset from UTC in minutes + * @param {Object} [opts={}] - options to pass to `setZone()` + * @return {DateTime} + */ + toUTC(offset = 0, opts = {}) { + return this.setZone(FixedOffsetZone.instance(offset), opts); + } + + /** + * "Set" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime. + * + * Equivalent to `setZone('local')` + * @return {DateTime} + */ + toLocal() { + return this.setZone(Settings.defaultZone); + } + + /** + * "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime. + * + * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones. + * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class. + * @param {Object} opts - options + * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this. + * @return {DateTime} + */ + setZone(zone, { + keepLocalTime = false, + keepCalendarTime = false + } = {}) { + zone = normalizeZone(zone, Settings.defaultZone); + if (zone.equals(this.zone)) { + return this; + } else if (!zone.isValid) { + return DateTime.invalid(unsupportedZone(zone)); + } else { + let newTS = this.ts; + if (keepLocalTime || keepCalendarTime) { + const offsetGuess = zone.offset(this.ts); + const asObj = this.toObject(); + [newTS] = objToTS(asObj, offsetGuess, zone); + } + return clone(this, { + ts: newTS, + zone + }); + } + } + + /** + * "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime. + * @param {Object} properties - the properties to set + * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' }) + * @return {DateTime} + */ + reconfigure({ + locale, + numberingSystem, + outputCalendar + } = {}) { + const loc = this.loc.clone({ + locale, + numberingSystem, + outputCalendar + }); + return clone(this, { + loc + }); + } + + /** + * "Set" the locale. Returns a newly-constructed DateTime. + * Just a convenient alias for reconfigure({ locale }) + * @example DateTime.local(2017, 5, 25).setLocale('en-GB') + * @return {DateTime} + */ + setLocale(locale) { + return this.reconfigure({ + locale + }); + } + + /** + * "Set" the values of specified units. Returns a newly-constructed DateTime. + * You can only set units with this method; for "setting" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}. + * + * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`. + * They cannot be mixed with ISO-week units like `weekday`. + * @param {Object} values - a mapping of units to numbers + * @example dt.set({ year: 2017 }) + * @example dt.set({ hour: 8, minute: 30 }) + * @example dt.set({ weekday: 5 }) + * @example dt.set({ year: 2005, ordinal: 234 }) + * @return {DateTime} + */ + set(values) { + if (!this.isValid) return this; + const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks); + const { + minDaysInFirstWeek, + startOfWeek + } = usesLocalWeekValues(normalized, this.loc); + const settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), + containsOrdinal = !isUndefined(normalized.ordinal), + containsGregorYear = !isUndefined(normalized.year), + containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), + containsGregor = containsGregorYear || containsGregorMD, + definiteWeekDef = normalized.weekYear || normalized.weekNumber; + if ((containsGregor || containsOrdinal) && definiteWeekDef) { + throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals"); + } + if (containsGregorMD && containsOrdinal) { + throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day"); + } + let mixed; + if (settingWeekStuff) { + mixed = weekToGregorian({ + ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), + ...normalized + }, minDaysInFirstWeek, startOfWeek); + } else if (!isUndefined(normalized.ordinal)) { + mixed = ordinalToGregorian({ + ...gregorianToOrdinal(this.c), + ...normalized + }); + } else { + mixed = { + ...this.toObject(), + ...normalized + }; + + // if we didn't set the day but we ended up on an overflow date, + // use the last day of the right month + if (isUndefined(normalized.day)) { + mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day); + } + } + const [ts, o] = objToTS(mixed, this.o, this.zone); + return clone(this, { + ts, + o + }); + } + + /** + * Add a period of time to this DateTime and return the resulting DateTime + * + * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between. + * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + * @example DateTime.now().plus(123) //~> in 123 milliseconds + * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes + * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow + * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday + * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min + * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min + * @return {DateTime} + */ + plus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration); + return clone(this, adjustTime(this, dur)); + } + + /** + * Subtract a period of time to this DateTime and return the resulting DateTime + * See {@link DateTime#plus} + * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() + @return {DateTime} + */ + minus(duration) { + if (!this.isValid) return this; + const dur = Duration.fromDurationLike(duration).negate(); + return clone(this, adjustTime(this, dur)); + } + + /** + * "Set" this DateTime to the beginning of a unit of time. + * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01' + * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01' + * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00' + * @return {DateTime} + */ + startOf(unit, { + useLocaleWeeks = false + } = {}) { + if (!this.isValid) return this; + const o = {}, + normalizedUnit = Duration.normalizeUnit(unit); + switch (normalizedUnit) { + case "years": + o.month = 1; + // falls through + case "quarters": + case "months": + o.day = 1; + // falls through + case "weeks": + case "days": + o.hour = 0; + // falls through + case "hours": + o.minute = 0; + // falls through + case "minutes": + o.second = 0; + // falls through + case "seconds": + o.millisecond = 0; + break; + // no default, invalid units throw in normalizeUnit() + } + + if (normalizedUnit === "weeks") { + if (useLocaleWeeks) { + const startOfWeek = this.loc.getStartOfWeek(); + const { + weekday + } = this; + if (weekday < startOfWeek) { + o.weekNumber = this.weekNumber - 1; + } + o.weekday = startOfWeek; + } else { + o.weekday = 1; + } + } + if (normalizedUnit === "quarters") { + const q = Math.ceil(this.month / 3); + o.month = (q - 1) * 3 + 1; + } + return this.set(o); + } + + /** + * "Set" this DateTime to the end (meaning the last millisecond) of a unit of time + * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'. + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week + * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00' + * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00' + * @return {DateTime} + */ + endOf(unit, opts) { + return this.isValid ? this.plus({ + [unit]: 1 + }).startOf(unit, opts).minus(1) : this; + } + + // OUTPUT + + /** + * Returns a string representation of this DateTime formatted according to the specified format string. + * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens). + * Defaults to en-US if no locale has been specified, regardless of the system's locale. + * @param {string} fmt - the format string + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22' + * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22' + * @example DateTime.now().toFormat('yyyy LLL dd', { locale: "fr" }) //=> '2017 avr. 22' + * @example DateTime.now().toFormat("HH 'hours and' mm 'minutes'") //=> '20 hours and 55 minutes' + * @return {string} + */ + toFormat(fmt, opts = {}) { + return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID; + } + + /** + * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`. + * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation + * of the DateTime in the assigned locale. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat + * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options + * @param {Object} opts - opts to override the configuration options on this DateTime + * @example DateTime.now().toLocaleString(); //=> 4/20/2017 + * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017' + * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022' + * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM' + * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM' + * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20' + * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM' + * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32' + * @return {string} + */ + toLocaleString(formatOpts = DATE_SHORT, opts = {}) { + return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID; + } + + /** + * Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output. + * Defaults to the system's locale if no locale has been specified + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts + * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`. + * @example DateTime.now().toLocaleParts(); //=> [ + * //=> { type: 'day', value: '25' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'month', value: '05' }, + * //=> { type: 'literal', value: '/' }, + * //=> { type: 'year', value: '1982' } + * //=> ] + */ + toLocaleParts(opts = {}) { + return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : []; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=false] - add the time zone format extension + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z' + * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00' + * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335' + * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400' + * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z' + * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z' + * @return {string|null} + */ + toISO({ + format = "extended", + suppressSeconds = false, + suppressMilliseconds = false, + includeOffset = true, + extendedZone = false, + precision = "milliseconds" + } = {}) { + if (!this.isValid) { + return null; + } + precision = normalizeUnit(precision); + const ext = format === "extended"; + let c = toISODate(this, ext, precision); + if (orderedUnits.indexOf(precision) >= 3) c += "T"; + c += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision); + return c; + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's date component + * @param {Object} opts - options + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'. + * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25' + * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525' + * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05' + * @return {string|null} + */ + toISODate({ + format = "extended", + precision = "day" + } = {}) { + if (!this.isValid) { + return null; + } + return toISODate(this, format === "extended", normalizeUnit(precision)); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's week date + * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2' + * @return {string} + */ + toISOWeekDate() { + return toTechFormat(this, "kkkk-'W'WW-c"); + } + + /** + * Returns an ISO 8601-compliant string representation of this DateTime's time component + * @param {Object} opts - options + * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0 + * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0 + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.extendedZone=true] - add the time zone format extension + * @param {boolean} [opts.includePrefix=false] - include the `T` prefix + * @param {string} [opts.format='extended'] - choose between the basic and extended format + * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0. + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z' + * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z' + * @return {string} + */ + toISOTime({ + suppressMilliseconds = false, + suppressSeconds = false, + includeOffset = true, + includePrefix = false, + extendedZone = false, + format = "extended", + precision = "milliseconds" + } = {}) { + if (!this.isValid) { + return null; + } + precision = normalizeUnit(precision); + let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? "T" : ""; + return c + toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision); + } + + /** + * Returns an RFC 2822-compatible string representation of this DateTime + * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000' + * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400' + * @return {string} + */ + toRFC2822() { + return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false); + } + + /** + * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT. + * Specifically, the string conforms to RFC 1123. + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1 + * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT' + * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT' + * @return {string} + */ + toHTTP() { + return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'"); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Date + * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13' + * @return {string|null} + */ + toSQLDate() { + if (!this.isValid) { + return null; + } + return toISODate(this, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL Time + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc().toSQL() //=> '05:15:16.345' + * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00' + * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345' + * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York' + * @return {string} + */ + toSQLTime({ + includeOffset = true, + includeZone = false, + includeOffsetSpace = true + } = {}) { + let fmt = "HH:mm:ss.SSS"; + if (includeZone || includeOffset) { + if (includeOffsetSpace) { + fmt += " "; + } + if (includeZone) { + fmt += "z"; + } else if (includeOffset) { + fmt += "ZZ"; + } + } + return toTechFormat(this, fmt, true); + } + + /** + * Returns a string representation of this DateTime appropriate for use in SQL DateTime + * @param {Object} opts - options + * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset. + * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00' + * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00' + * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z' + * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00' + * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000' + * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York' + * @return {string} + */ + toSQL(opts = {}) { + if (!this.isValid) { + return null; + } + return `${this.toSQLDate()} ${this.toSQLTime(opts)}`; + } + + /** + * Returns a string representation of this DateTime appropriate for debugging + * @return {string} + */ + toString() { + return this.isValid ? this.toISO() : INVALID; + } + + /** + * Returns a string representation of this DateTime appropriate for the REPL. + * @return {string} + */ + [Symbol.for("nodejs.util.inspect.custom")]() { + if (this.isValid) { + return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`; + } else { + return `DateTime { Invalid, reason: ${this.invalidReason} }`; + } + } + + /** + * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis} + * @return {number} + */ + valueOf() { + return this.toMillis(); + } + + /** + * Returns the epoch milliseconds of this DateTime. + * @return {number} + */ + toMillis() { + return this.isValid ? this.ts : NaN; + } + + /** + * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime. + * @return {number} + */ + toSeconds() { + return this.isValid ? this.ts / 1000 : NaN; + } + + /** + * Returns the epoch seconds (as a whole number) of this DateTime. + * @return {number} + */ + toUnixInteger() { + return this.isValid ? Math.floor(this.ts / 1000) : NaN; + } + + /** + * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON. + * @return {string} + */ + toJSON() { + return this.toISO(); + } + + /** + * Returns a BSON serializable equivalent to this DateTime. + * @return {Date} + */ + toBSON() { + return this.toJSDate(); + } + + /** + * Returns a JavaScript object with this DateTime's year, month, day, and so on. + * @param opts - options for generating the object + * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output + * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 } + * @return {Object} + */ + toObject(opts = {}) { + if (!this.isValid) return {}; + const base = { + ...this.c + }; + if (opts.includeConfig) { + base.outputCalendar = this.outputCalendar; + base.numberingSystem = this.loc.numberingSystem; + base.locale = this.loc.locale; + } + return base; + } + + /** + * Returns a JavaScript Date equivalent to this DateTime. + * @return {Date} + */ + toJSDate() { + return new Date(this.isValid ? this.ts : NaN); + } + + // COMPARE + + /** + * Return the difference between two DateTimes as a Duration. + * @param {DateTime} otherDateTime - the DateTime to compare this one to + * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration. + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @example + * var i1 = DateTime.fromISO('1982-05-25T09:45'), + * i2 = DateTime.fromISO('1983-10-14T10:30'); + * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 } + * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 } + * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 } + * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 } + * @return {Duration} + */ + diff(otherDateTime, unit = "milliseconds", opts = {}) { + if (!this.isValid || !otherDateTime.isValid) { + return Duration.invalid("created by diffing an invalid DateTime"); + } + const durOpts = { + locale: this.locale, + numberingSystem: this.numberingSystem, + ...opts + }; + const units = maybeArray(unit).map(Duration.normalizeUnit), + otherIsLater = otherDateTime.valueOf() > this.valueOf(), + earlier = otherIsLater ? this : otherDateTime, + later = otherIsLater ? otherDateTime : this, + diffed = diff(earlier, later, units, durOpts); + return otherIsLater ? diffed.negate() : diffed; + } + + /** + * Return the difference between this DateTime and right now. + * See {@link DateTime#diff} + * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration + * @param {Object} opts - options that affect the creation of the Duration + * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use + * @return {Duration} + */ + diffNow(unit = "milliseconds", opts = {}) { + return this.diff(DateTime.now(), unit, opts); + } + + /** + * Return an Interval spanning between this DateTime and another DateTime + * @param {DateTime} otherDateTime - the other end point of the Interval + * @return {Interval|DateTime} + */ + until(otherDateTime) { + return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this; + } + + /** + * Return whether this DateTime is in the same unit of time as another DateTime. + * Higher-order units must also be identical for this function to return `true`. + * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed. + * @param {DateTime} otherDateTime - the other DateTime + * @param {string} unit - the unit of time to check sameness on + * @param {Object} opts - options + * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used + * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day + * @return {boolean} + */ + hasSame(otherDateTime, unit, opts) { + if (!this.isValid) return false; + const inputMs = otherDateTime.valueOf(); + const adjustedToZone = this.setZone(otherDateTime.zone, { + keepLocalTime: true + }); + return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts); + } + + /** + * Equality check + * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid. + * To compare just the millisecond values, use `+dt1 === +dt2`. + * @param {DateTime} other - the other DateTime + * @return {boolean} + */ + equals(other) { + return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc); + } + + /** + * Returns a string representation of a this time relative to now, such as "in two days". Can only internationalize if your + * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} [options.style="long"] - the style of units, must be "long", "short", or "narrow" + * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of "years", "quarters", "months", "weeks", "days", "hours", "minutes", or "seconds" + * @param {boolean} [options.round=true] - whether to round the numbers in the output. + * @param {string} [options.rounding="trunc"] - rounding method to use when rounding the numbers in the output. Can be "trunc" (toward zero), "expand" (away from zero), "round", "floor", or "ceil". + * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelative() //=> "in 1 day" + * @example DateTime.now().setLocale("es").toRelative({ days: 1 }) //=> "dentro de 1 día" + * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: "fr" }) //=> "dans 23 heures" + * @example DateTime.now().minus({ days: 2 }).toRelative() //=> "2 days ago" + * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: "hours" }) //=> "48 hours ago" + * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" + */ + toRelative(options = {}) { + if (!this.isValid) return null; + const base = options.base || DateTime.fromObject({}, { + zone: this.zone + }), + padding = options.padding ? this < base ? -options.padding : options.padding : 0; + let units = ["years", "months", "days", "hours", "minutes", "seconds"]; + let unit = options.unit; + if (Array.isArray(options.unit)) { + units = options.unit; + unit = undefined; + } + return diffRelative(base, this.plus(padding), { + ...options, + numeric: "always", + units, + unit + }); + } + + /** + * Returns a string representation of this date relative to today, such as "yesterday" or "next month". + * Only internationalizes on platforms that supports Intl.RelativeTimeFormat. + * @param {Object} options - options that affect the output + * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now. + * @param {string} options.locale - override the locale of this DateTime + * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of "years", "quarters", "months", "weeks", or "days" + * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> "tomorrow" + * @example DateTime.now().setLocale("es").plus({ days: 1 }).toRelative() //=> ""mañana" + * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: "fr" }) //=> "demain" + * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" + */ + toRelativeCalendar(options = {}) { + if (!this.isValid) return null; + return diffRelative(options.base || DateTime.fromObject({}, { + zone: this.zone + }), this, { + ...options, + numeric: "auto", + units: ["years", "months", "days"], + calendary: true + }); + } + + /** + * Return the min of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum + * @return {DateTime} the min DateTime, or undefined if called with no argument + */ + static min(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("min requires all arguments be DateTimes"); + } + return bestBy(dateTimes, i => i.valueOf(), Math.min); + } + + /** + * Return the max of several date times + * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum + * @return {DateTime} the max DateTime, or undefined if called with no argument + */ + static max(...dateTimes) { + if (!dateTimes.every(DateTime.isDateTime)) { + throw new InvalidArgumentError("max requires all arguments be DateTimes"); + } + return bestBy(dateTimes, i => i.valueOf(), Math.max); + } + + // MISC + + /** + * Explain how a string would be parsed by fromFormat() + * @param {string} text - the string to parse + * @param {string} fmt - the format the string is expected to be in (see description) + * @param {Object} options - options taken by fromFormat() + * @return {Object} + */ + static fromFormatExplain(text, fmt, options = {}) { + const { + locale = null, + numberingSystem = null + } = options, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true + }); + return explainFromTokens(localeToUse, text, fmt); + } + + /** + * @deprecated use fromFormatExplain instead + */ + static fromStringExplain(text, fmt, options = {}) { + return DateTime.fromFormatExplain(text, fmt, options); + } + + /** + * Build a parser for `fmt` using the given locale. This parser can be passed + * to {@link DateTime.fromFormatParser} to a parse a date in this format. This + * can be used to optimize cases where many dates need to be parsed in a + * specific format. + * + * @param {String} fmt - the format the string is expected to be in (see + * description) + * @param {Object} options - options used to set locale and numberingSystem + * for parser + * @returns {TokenParser} - opaque object to be used + */ + static buildFormatParser(fmt, options = {}) { + const { + locale = null, + numberingSystem = null + } = options, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true + }); + return new TokenParser(localeToUse, fmt); + } + + /** + * Create a DateTime from an input string and format parser. + * + * The format parser must have been created with the same locale as this call. + * + * @param {String} text - the string to parse + * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser} + * @param {Object} opts - options taken by fromFormat() + * @returns {DateTime} + */ + static fromFormatParser(text, formatParser, opts = {}) { + if (isUndefined(text) || isUndefined(formatParser)) { + throw new InvalidArgumentError("fromFormatParser requires an input string and a format parser"); + } + const { + locale = null, + numberingSystem = null + } = opts, + localeToUse = Locale.fromOpts({ + locale, + numberingSystem, + defaultToEN: true + }); + if (!localeToUse.equals(formatParser.locale)) { + throw new InvalidArgumentError(`fromFormatParser called with a locale of ${localeToUse}, ` + `but the format parser was created for ${formatParser.locale}`); + } + const { + result, + zone, + specificOffset, + invalidReason + } = formatParser.explainFromTokens(text); + if (invalidReason) { + return DateTime.invalid(invalidReason); + } else { + return parseDataToDateTime(result, zone, opts, `format ${formatParser.format}`, text, specificOffset); + } + } + + // FORMAT PRESETS + + /** + * {@link DateTime#toLocaleString} format like 10/14/1983 + * @type {Object} + */ + static get DATE_SHORT() { + return DATE_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED() { + return DATE_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983' + * @type {Object} + */ + static get DATE_MED_WITH_WEEKDAY() { + return DATE_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983' + * @type {Object} + */ + static get DATE_FULL() { + return DATE_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983' + * @type {Object} + */ + static get DATE_HUGE() { + return DATE_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_SIMPLE() { + return TIME_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SECONDS() { + return TIME_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_SHORT_OFFSET() { + return TIME_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get TIME_WITH_LONG_OFFSET() { + return TIME_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30', always 24-hour. + * @type {Object} + */ + static get TIME_24_SIMPLE() { + return TIME_24_SIMPLE; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SECONDS() { + return TIME_24_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_SHORT_OFFSET() { + return TIME_24_WITH_SHORT_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour. + * @type {Object} + */ + static get TIME_24_WITH_LONG_OFFSET() { + return TIME_24_WITH_LONG_OFFSET; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT() { + return DATETIME_SHORT; + } + + /** + * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_SHORT_WITH_SECONDS() { + return DATETIME_SHORT_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED() { + return DATETIME_MED; + } + + /** + * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_SECONDS() { + return DATETIME_MED_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_MED_WITH_WEEKDAY() { + return DATETIME_MED_WITH_WEEKDAY; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL() { + return DATETIME_FULL; + } + + /** + * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_FULL_WITH_SECONDS() { + return DATETIME_FULL_WITH_SECONDS; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE() { + return DATETIME_HUGE; + } + + /** + * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is. + * @type {Object} + */ + static get DATETIME_HUGE_WITH_SECONDS() { + return DATETIME_HUGE_WITH_SECONDS; + } +} + +/** + * @private + */ +function friendlyDateTime(dateTimeish) { + if (DateTime.isDateTime(dateTimeish)) { + return dateTimeish; + } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) { + return DateTime.fromJSDate(dateTimeish); + } else if (dateTimeish && typeof dateTimeish === "object") { + return DateTime.fromObject(dateTimeish); + } else { + throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`); + } +} + +const VERSION = "3.7.2"; + +exports.DateTime = DateTime; +exports.Duration = Duration; +exports.FixedOffsetZone = FixedOffsetZone; +exports.IANAZone = IANAZone; +exports.Info = Info; +exports.Interval = Interval; +exports.InvalidZone = InvalidZone; +exports.Settings = Settings; +exports.SystemZone = SystemZone; +exports.VERSION = VERSION; +exports.Zone = Zone; +//# sourceMappingURL=luxon.js.map diff --git a/node_modules/luxon/build/node/luxon.js.map b/node_modules/luxon/build/node/luxon.js.map new file mode 100644 index 00000000..bcb08350 --- /dev/null +++ b/node_modules/luxon/build/node/luxon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"luxon.js","sources":["../../src/errors.js","../../src/impl/formats.js","../../src/zone.js","../../src/zones/systemZone.js","../../src/zones/IANAZone.js","../../src/impl/locale.js","../../src/zones/fixedOffsetZone.js","../../src/zones/invalidZone.js","../../src/impl/zoneUtil.js","../../src/impl/digits.js","../../src/settings.js","../../src/impl/invalid.js","../../src/impl/conversions.js","../../src/impl/util.js","../../src/impl/english.js","../../src/impl/formatter.js","../../src/impl/regexParser.js","../../src/duration.js","../../src/interval.js","../../src/info.js","../../src/impl/diff.js","../../src/impl/tokenParser.js","../../src/datetime.js","../../src/luxon.js"],"sourcesContent":["// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nexport class InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nexport class ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nexport class InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nexport class InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nexport class ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n","/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nexport const DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nexport const DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nexport const DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nexport const DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nexport const DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nexport const TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nexport const TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nexport const TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nexport const TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nexport const TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nexport const DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nexport const DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nexport const DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nexport const DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nexport const DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n","import { ZoneIsAbstractError } from \"./errors.js\";\n\n/**\n * @interface\n */\nexport default class Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n","import { formatOffset, parseZoneInfo } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nexport default class SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton === null) {\n singleton = new SystemZone();\n }\n return singleton;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n","import { formatOffset, parseZoneInfo, isUndefined, objToLocalTS } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nconst dtfCache = new Map();\nfunction makeDTF(zoneName) {\n let dtf = dtfCache.get(zoneName);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zoneName,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n dtfCache.set(zoneName, dtf);\n }\n return dtf;\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nconst ianaZoneCache = new Map();\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nexport default class IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n let zone = ianaZoneCache.get(name);\n if (zone === undefined) {\n ianaZoneCache.set(name, (zone = new IANAZone(name)));\n }\n return zone;\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache.clear();\n dtfCache.clear();\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n if (!this.valid) return NaN;\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n","import { hasLocaleWeekInfo, hasRelative, padStart, roundTo, validateWeekSettings } from \"./util.js\";\nimport * as English from \"./english.js\";\nimport Settings from \"../settings.js\";\nimport DateTime from \"../datetime.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nconst intlDTCache = new Map();\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache.get(key);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache.set(key, dtf);\n }\n return dtf;\n}\n\nconst intlNumCache = new Map();\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache.get(key);\n if (inf === undefined) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache.set(key, inf);\n }\n return inf;\n}\n\nconst intlRelCache = new Map();\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache.get(key);\n if (inf === undefined) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache.set(key, inf);\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nconst intlResolvedOptionsCache = new Map();\nfunction getCachedIntResolvedOptions(locString) {\n let opts = intlResolvedOptionsCache.get(locString);\n if (opts === undefined) {\n opts = new Intl.DateTimeFormat(locString).resolvedOptions();\n intlResolvedOptionsCache.set(locString, opts);\n }\n return opts;\n}\n\nconst weekInfoCache = new Map();\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache.get(locString);\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86\n if (!(\"minimalDays\" in data)) {\n data = { ...fallbackWeekSettings, ...data };\n }\n weekInfoCache.set(locString, data);\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n getCachedIntResolvedOptions(loc.locale).numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return English.formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\nexport default class Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache.clear();\n intlNumCache.clear();\n intlRelCache.clear();\n intlResolvedOptionsCache.clear();\n weekInfoCache.clear();\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, English.months, () => {\n // Workaround for \"ja\" locale: formatToParts does not label all parts of the month\n // as \"month\" and for this locale there is no difference between \"format\" and \"non-format\".\n // As such, just use format() instead of formatToParts() and take the whole string\n const monthSpecialCase = this.intl === \"ja\" || this.intl.startsWith(\"ja-\");\n format &= !monthSpecialCase;\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n const mapper = !monthSpecialCase\n ? (dt) => this.extract(dt, intl, \"month\")\n : (dt) => this.dtFormatter(dt, intl).format();\n this.monthsCache[formatStr][length] = mapMonths(mapper);\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, English.weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => English.meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, English.eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n getCachedIntResolvedOptions(this.intl).locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n","import { formatOffset, signedOffset } from \"../impl/util.js\";\nimport Zone from \"../zone.js\";\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nexport default class FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n","import Zone from \"../zone.js\";\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nexport default class InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n","/**\n * @private\n */\n\nimport Zone from \"../zone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport InvalidZone from \"../zones/invalidZone.js\";\n\nimport { isUndefined, isString, isNumber } from \"./util.js\";\nimport SystemZone from \"../zones/systemZone.js\";\n\nexport function normalizeZone(input, defaultZone) {\n let offset;\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n","const numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nexport function parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nconst digitRegexCache = new Map();\nexport function resetDigitRegexCache() {\n digitRegexCache.clear();\n}\n\nexport function digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n let appendCache = digitRegexCache.get(ns);\n if (appendCache === undefined) {\n appendCache = new Map();\n digitRegexCache.set(ns, appendCache);\n }\n let regex = appendCache.get(append);\n if (regex === undefined) {\n regex = new RegExp(`${numberingSystems[ns]}${append}`);\n appendCache.set(append, regex);\n }\n\n return regex;\n}\n","import SystemZone from \"./zones/systemZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport DateTime from \"./datetime.js\";\n\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport { validateWeekSettings } from \"./impl/util.js\";\nimport { resetDigitRegexCache } from \"./impl/digits.js\";\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nexport default class Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n","export default class Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n","import {\n integerBetween,\n isLeapYear,\n timeObject,\n daysInYear,\n daysInMonth,\n weeksInWeekYear,\n isInteger,\n isUndefined,\n} from \"./util.js\";\nimport Invalid from \"./invalid.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nexport function dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nexport function isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nexport function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nexport function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nexport function gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nexport function ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nexport function usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nexport function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nexport function hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nexport function hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nexport function hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n","/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\nimport { InvalidArgumentError } from \"../errors.js\";\nimport Settings from \"../settings.js\";\nimport { dayOfWeek, isoWeekdayToLocal } from \"./conversions.js\";\n\n/**\n * @private\n */\n\n// TYPES\n\nexport function isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nexport function isNumber(o) {\n return typeof o === \"number\";\n}\n\nexport function isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nexport function isString(o) {\n return typeof o === \"string\";\n}\n\nexport function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nexport function hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nexport function hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nexport function maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nexport function bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nexport function pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nexport function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport function validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nexport function integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nexport function floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nexport function padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nexport function parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nexport function parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nexport function parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nexport function roundTo(number, digits, rounding = \"round\") {\n const factor = 10 ** digits;\n switch (rounding) {\n case \"expand\":\n return number > 0\n ? Math.ceil(number * factor) / factor\n : Math.floor(number * factor) / factor;\n case \"trunc\":\n return Math.trunc(number * factor) / factor;\n case \"round\":\n return Math.round(number * factor) / factor;\n case \"floor\":\n return Math.floor(number * factor) / factor;\n case \"ceil\":\n return Math.ceil(number * factor) / factor;\n default:\n throw new RangeError(`Value rounding ${rounding} is out of range`);\n }\n}\n\n// DATE BASICS\n\nexport function isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nexport function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nexport function daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nexport function objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nexport function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nexport function untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nexport function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nexport function signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nexport function asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || !Number.isFinite(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nexport function normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nexport function formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nexport function timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n","import * as Formats from \"./formats.js\";\nimport { pick } from \"./util.js\";\n\nfunction stringify(obj) {\n return JSON.stringify(obj, Object.keys(obj).sort());\n}\n\n/**\n * @private\n */\n\nexport const monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nexport const monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nexport const monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nexport function months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nexport const weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nexport const weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nexport const weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nexport function weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nexport const meridiems = [\"AM\", \"PM\"];\n\nexport const erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nexport const erasShort = [\"BC\", \"AD\"];\n\nexport const erasNarrow = [\"B\", \"A\"];\n\nexport function eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nexport function meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nexport function weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nexport function monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nexport function eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nexport function formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n default: // fall through\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nexport function formatString(knownFormat) {\n // these all have the offsets removed because we don't have access to them\n // without all the intl stuff this is backfilling\n const filtered = pick(knownFormat, [\n \"weekday\",\n \"era\",\n \"year\",\n \"month\",\n \"day\",\n \"hour\",\n \"minute\",\n \"second\",\n \"timeZoneName\",\n \"hourCycle\",\n ]),\n key = stringify(filtered),\n dateTimeHuge = \"EEEE, LLLL d, yyyy, h:mm a\";\n switch (key) {\n case stringify(Formats.DATE_SHORT):\n return \"M/d/yyyy\";\n case stringify(Formats.DATE_MED):\n return \"LLL d, yyyy\";\n case stringify(Formats.DATE_MED_WITH_WEEKDAY):\n return \"EEE, LLL d, yyyy\";\n case stringify(Formats.DATE_FULL):\n return \"LLLL d, yyyy\";\n case stringify(Formats.DATE_HUGE):\n return \"EEEE, LLLL d, yyyy\";\n case stringify(Formats.TIME_SIMPLE):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_SECONDS):\n return \"h:mm:ss a\";\n case stringify(Formats.TIME_WITH_SHORT_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_WITH_LONG_OFFSET):\n return \"h:mm a\";\n case stringify(Formats.TIME_24_SIMPLE):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_SECONDS):\n return \"HH:mm:ss\";\n case stringify(Formats.TIME_24_WITH_SHORT_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.TIME_24_WITH_LONG_OFFSET):\n return \"HH:mm\";\n case stringify(Formats.DATETIME_SHORT):\n return \"M/d/yyyy, h:mm a\";\n case stringify(Formats.DATETIME_MED):\n return \"LLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL):\n return \"LLLL d, yyyy, h:mm a\";\n case stringify(Formats.DATETIME_HUGE):\n return dateTimeHuge;\n case stringify(Formats.DATETIME_SHORT_WITH_SECONDS):\n return \"M/d/yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_SECONDS):\n return \"LLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_MED_WITH_WEEKDAY):\n return \"EEE, d LLL yyyy, h:mm a\";\n case stringify(Formats.DATETIME_FULL_WITH_SECONDS):\n return \"LLLL d, yyyy, h:mm:ss a\";\n case stringify(Formats.DATETIME_HUGE_WITH_SECONDS):\n return \"EEEE, LLLL d, yyyy, h:mm:ss a\";\n default:\n return dateTimeHuge;\n }\n}\n","import * as English from \"./english.js\";\nimport * as Formats from \"./formats.js\";\nimport { padStart } from \"./util.js\";\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: Formats.DATE_SHORT,\n DD: Formats.DATE_MED,\n DDD: Formats.DATE_FULL,\n DDDD: Formats.DATE_HUGE,\n t: Formats.TIME_SIMPLE,\n tt: Formats.TIME_WITH_SECONDS,\n ttt: Formats.TIME_WITH_SHORT_OFFSET,\n tttt: Formats.TIME_WITH_LONG_OFFSET,\n T: Formats.TIME_24_SIMPLE,\n TT: Formats.TIME_24_WITH_SECONDS,\n TTT: Formats.TIME_24_WITH_SHORT_OFFSET,\n TTTT: Formats.TIME_24_WITH_LONG_OFFSET,\n f: Formats.DATETIME_SHORT,\n ff: Formats.DATETIME_MED,\n fff: Formats.DATETIME_FULL,\n ffff: Formats.DATETIME_HUGE,\n F: Formats.DATETIME_SHORT_WITH_SECONDS,\n FF: Formats.DATETIME_MED_WITH_SECONDS,\n FFF: Formats.DATETIME_FULL_WITH_SECONDS,\n FFFF: Formats.DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nexport default class Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n // turn '' into a literal signal quote instead of just skipping the empty literal\n if (currentFull.length > 0 || bracketed) {\n splits.push({\n literal: bracketed || /^\\s+$/.test(currentFull),\n val: currentFull === \"\" ? \"'\" : currentFull,\n });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0, signDisplay = undefined) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n if (signDisplay) {\n opts.signDisplay = signDisplay;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? English.meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? English.monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? English.weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? English.eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const invertLargest = this.opts.signMode === \"negativeLargestOnly\" ? -1 : 1;\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"milliseconds\";\n case \"s\":\n return \"seconds\";\n case \"m\":\n return \"minutes\";\n case \"h\":\n return \"hours\";\n case \"d\":\n return \"days\";\n case \"w\":\n return \"weeks\";\n case \"M\":\n return \"months\";\n case \"y\":\n return \"years\";\n default:\n return null;\n }\n },\n tokenToString = (lildur, info) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n const inversionFactor =\n info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1;\n let signDisplay;\n if (this.opts.signMode === \"negativeLargestOnly\" && mapped !== info.largestUnit) {\n signDisplay = \"never\";\n } else if (this.opts.signMode === \"all\") {\n signDisplay = \"always\";\n } else {\n // \"auto\" and \"negative\" are the same, but \"auto\" has better support\n signDisplay = \"auto\";\n }\n return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)),\n durationInfo = {\n isNegativeDuration: collapsed < 0,\n // this relies on \"collapsed\" being based on \"shiftTo\", which builds up the object\n // in order\n largestUnit: Object.keys(collapsed.values)[0],\n };\n return stringifyTokens(tokens, tokenToString(collapsed, durationInfo));\n }\n}\n","import {\n untruncateYear,\n signedOffset,\n parseInteger,\n parseMillis,\n isUndefined,\n parseFloating,\n} from \"./util.js\";\nimport * as English from \"./english.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:([Zz])|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: English.monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? English.weekdaysLong.indexOf(weekdayStr) + 1\n : English.weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nexport function parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nexport function parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nexport function parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nexport function parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nexport function parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nexport function parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n","import { InvalidArgumentError, InvalidDurationError, InvalidUnitError } from \"./errors.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Locale from \"./impl/locale.js\";\nimport { parseISODuration, parseISOTimeOnly } from \"./impl/regexParser.js\";\nimport {\n asNumber,\n hasOwnProperty,\n isNumber,\n isUndefined,\n normalizeObject,\n roundTo,\n} from \"./impl/util.js\";\nimport Settings from \"./settings.js\";\nimport DateTime from \"./datetime.js\";\n\nconst INVALID = \"Invalid Duration\";\n\n// unit conversion constants\nexport const lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nexport default class Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"+6 +2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"-6 -2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"negativeLargestOnly\" }) //=> \"-6 2\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero\n * @example\n * ```js\n * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 mth, 0 wks, 5 hr, 6 min'\n * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID;\n\n const showZeros = opts.showZeros !== false;\n\n const l = orderedUnits\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val) || (val === 0 && !showZeros)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone(this, { values: negated }, true);\n }\n\n /**\n * Removes all units with values equal to 0 from this Duration.\n * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 }\n * @return {Duration}\n */\n removeZeros() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.values);\n return clone(this, { values: vals }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n","import DateTime, { friendlyDateTime } from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Settings from \"./settings.js\";\nimport { InvalidArgumentError, InvalidIntervalError } from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport * as Formats from \"./impl/formats.js\";\n\nconst INVALID = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nexport default class Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `/`, `/`, and `/` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval. This is the first instant which is not part of the interval\n * (Interval is half-open).\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns the last DateTime included in the interval (since end is not part of the interval)\n * @type {DateTime}\n */\n get lastDateTime() {\n return this.isValid ? (this.e ? this.e.minus(1) : null) : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into an equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval\n * and ending with the latest.\n *\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Settings from \"./settings.js\";\nimport Locale from \"./impl/locale.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\n\nimport { hasLocaleWeekInfo, hasRelative } from \"./impl/util.js\";\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nexport default class Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n","import Duration from \"../duration.js\";\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nexport default function (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n","import { parseMillis, isUndefined, untruncateYear, signedOffset, hasOwnProperty } from \"./util.js\";\nimport Formatter from \"./formatter.js\";\nimport FixedOffsetZone from \"../zones/fixedOffsetZone.js\";\nimport IANAZone from \"../zones/IANAZone.js\";\nimport DateTime from \"../datetime.js\";\nimport { digitRegex, parseDigits } from \"./digits.js\";\nimport { ConflictingSpecificationError } from \"../errors.js\";\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nexport function expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nexport class TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nexport function explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nexport function parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nexport function formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n","import Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Settings from \"./settings.js\";\nimport Info from \"./info.js\";\nimport Formatter from \"./impl/formatter.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport Locale from \"./impl/locale.js\";\nimport {\n isUndefined,\n maybeArray,\n isDate,\n isNumber,\n bestBy,\n daysInMonth,\n daysInYear,\n isLeapYear,\n weeksInWeekYear,\n normalizeObject,\n roundTo,\n objToLocalTS,\n padStart,\n} from \"./impl/util.js\";\nimport { normalizeZone } from \"./impl/zoneUtil.js\";\nimport diff from \"./impl/diff.js\";\nimport { parseRFC2822Date, parseISODate, parseHTTPDate, parseSQL } from \"./impl/regexParser.js\";\nimport {\n parseFromTokens,\n explainFromTokens,\n formatOptsToTokens,\n expandMacroTokens,\n TokenParser,\n} from \"./impl/tokenParser.js\";\nimport {\n gregorianToWeek,\n weekToGregorian,\n gregorianToOrdinal,\n ordinalToGregorian,\n hasInvalidGregorianData,\n hasInvalidWeekData,\n hasInvalidOrdinalData,\n hasInvalidTimeData,\n usesLocalWeekValues,\n isoWeekdayToLocal,\n} from \"./impl/conversions.js\";\nimport * as Formats from \"./impl/formats.js\";\nimport {\n InvalidArgumentError,\n ConflictingSpecificationError,\n InvalidUnitError,\n InvalidDateTimeError,\n} from \"./errors.js\";\nimport Invalid from \"./impl/invalid.js\";\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended, precision) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n if (precision === \"year\") return c;\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n c += \"-\";\n } else {\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n }\n c += padStart(o.c.day);\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n) {\n let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0,\n c = \"\";\n switch (precision) {\n case \"day\":\n case \"month\":\n case \"year\":\n break;\n default:\n c += padStart(o.c.hour);\n if (precision === \"hour\") break;\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += \":\";\n c += padStart(o.c.second);\n }\n } else {\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += padStart(o.c.second);\n }\n }\n if (precision === \"second\") break;\n if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\n/**\n * @param {Zone} zone\n * @return {number}\n */\nfunction guessOffsetForZone(zone) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n // Do not cache anything but IANA zones, because it is not safe to do so.\n // Guessing an offset which is not present in the zone can cause wrong results from fixOffset\n if (zone.type !== \"iana\") {\n return zone.offset(zoneOffsetTs);\n }\n const zoneName = zone.name;\n let offsetGuess = zoneOffsetGuessCache.get(zoneName);\n if (offsetGuess === undefined) {\n offsetGuess = zone.offset(zoneOffsetTs);\n zoneOffsetGuessCache.set(zoneName, offsetGuess);\n }\n return offsetGuess;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n rounding = isUndefined(opts.rounding) ? \"trunc\" : opts.rounding,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? \"round\" : rounding);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nconst zoneOffsetGuessCache = new Map();\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nexport default class DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache.clear();\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n case \"milliseconds\":\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = Formats.DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z'\n * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z'\n * @return {string|null}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext, precision);\n if (orderedUnits.indexOf(precision) >= 3) c += \"T\";\n c += toISOTime(\n this,\n ext,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n );\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'.\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05'\n * @return {string|null}\n */\n toISODate({ format = \"extended\", precision = \"day\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, format === \"extended\", normalizeUnit(precision));\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string|null}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval|DateTime}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {string} [options.rounding=\"trunc\"] - rounding method to use when rounding the numbers in the output. Can be \"trunc\" (toward zero), \"expand\" (away from zero), \"round\", \"floor\", or \"ceil\".\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return Formats.DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return Formats.DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return Formats.DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return Formats.DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return Formats.DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return Formats.TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return Formats.TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return Formats.TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return Formats.TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return Formats.TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return Formats.TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return Formats.TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return Formats.TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return Formats.DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return Formats.DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return Formats.DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return Formats.DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return Formats.DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return Formats.DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return Formats.DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return Formats.DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return Formats.DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nexport function friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n","import DateTime from \"./datetime.js\";\nimport Duration from \"./duration.js\";\nimport Interval from \"./interval.js\";\nimport Info from \"./info.js\";\nimport Zone from \"./zone.js\";\nimport FixedOffsetZone from \"./zones/fixedOffsetZone.js\";\nimport IANAZone from \"./zones/IANAZone.js\";\nimport InvalidZone from \"./zones/invalidZone.js\";\nimport SystemZone from \"./zones/systemZone.js\";\nimport Settings from \"./settings.js\";\n\nconst VERSION = \"3.7.2\";\n\nexport {\n VERSION,\n DateTime,\n Duration,\n Interval,\n Info,\n Zone,\n FixedOffsetZone,\n IANAZone,\n InvalidZone,\n SystemZone,\n Settings,\n};\n"],"names":["LuxonError","Error","InvalidDateTimeError","constructor","reason","toMessage","InvalidIntervalError","InvalidDurationError","ConflictingSpecificationError","InvalidUnitError","unit","InvalidArgumentError","ZoneIsAbstractError","n","s","l","DATE_SHORT","year","month","day","DATE_MED","DATE_MED_WITH_WEEKDAY","weekday","DATE_FULL","DATE_HUGE","TIME_SIMPLE","hour","minute","TIME_WITH_SECONDS","second","TIME_WITH_SHORT_OFFSET","timeZoneName","TIME_WITH_LONG_OFFSET","TIME_24_SIMPLE","hourCycle","TIME_24_WITH_SECONDS","TIME_24_WITH_SHORT_OFFSET","TIME_24_WITH_LONG_OFFSET","DATETIME_SHORT","DATETIME_SHORT_WITH_SECONDS","DATETIME_MED","DATETIME_MED_WITH_SECONDS","DATETIME_MED_WITH_WEEKDAY","DATETIME_FULL","DATETIME_FULL_WITH_SECONDS","DATETIME_HUGE","DATETIME_HUGE_WITH_SECONDS","Zone","type","name","ianaName","isUniversal","offsetName","ts","opts","formatOffset","format","offset","equals","otherZone","isValid","singleton","SystemZone","instance","Intl","DateTimeFormat","resolvedOptions","timeZone","locale","parseZoneInfo","Date","getTimezoneOffset","dtfCache","Map","makeDTF","zoneName","dtf","get","undefined","hour12","era","set","typeToPos","hackyOffset","date","formatted","replace","parsed","exec","fMonth","fDay","fYear","fadOrBc","fHour","fMinute","fSecond","partsOffset","formatToParts","filled","i","length","value","pos","isUndefined","parseInt","ianaZoneCache","IANAZone","create","zone","resetCache","clear","isValidSpecifier","isValidZone","e","valid","NaN","isNaN","adOrBc","Math","abs","adjustedHour","asUTC","objToLocalTS","millisecond","asTS","over","intlLFCache","getCachedLF","locString","key","JSON","stringify","ListFormat","intlDTCache","getCachedDTF","intlNumCache","getCachedINF","inf","NumberFormat","intlRelCache","getCachedRTF","base","cacheKeyOpts","RelativeTimeFormat","sysLocaleCache","systemLocale","intlResolvedOptionsCache","getCachedIntResolvedOptions","weekInfoCache","getCachedWeekInfo","data","Locale","getWeekInfo","weekInfo","fallbackWeekSettings","parseLocaleString","localeStr","xIndex","indexOf","substring","uIndex","options","selectedStr","smaller","numberingSystem","calendar","intlConfigString","outputCalendar","includes","mapMonths","f","ms","dt","DateTime","utc","push","mapWeekdays","listStuff","loc","englishFn","intlFn","mode","listingMode","supportsFastNumbers","startsWith","PolyNumberFormatter","intl","forceSimple","padTo","floor","otherOpts","Object","keys","intlOpts","useGrouping","minimumIntegerDigits","fixed","roundTo","padStart","PolyDateFormatter","originalZone","z","gmtOffset","offsetZ","setZone","plus","minutes","map","join","toJSDate","parts","part","PolyRelFormatter","isEnglish","style","hasRelative","rtf","count","English","numeric","firstDay","minimalDays","weekend","fromOpts","weekSettings","defaultToEN","specifiedLocale","Settings","defaultLocale","localeR","numberingSystemR","defaultNumberingSystem","outputCalendarR","defaultOutputCalendar","weekSettingsR","validateWeekSettings","defaultWeekSettings","fromObject","numbering","parsedLocale","parsedNumberingSystem","parsedOutputCalendar","weekdaysCache","standalone","monthsCache","meridiemCache","eraCache","fastNumbersCached","fastNumbers","isActuallyEn","hasNoWeirdness","clone","alts","getOwnPropertyNames","redefaultToEN","redefaultToSystem","months","monthSpecialCase","formatStr","mapper","extract","dtFormatter","weekdays","meridiems","eras","field","df","results","matching","find","m","toLowerCase","numberFormatter","relFormatter","listFormatter","getWeekSettings","hasLocaleWeekInfo","getStartOfWeek","getMinDaysInFirstWeek","getWeekendDays","other","toString","FixedOffsetZone","utcInstance","parseSpecifier","r","match","signedOffset","InvalidZone","normalizeZone","input","defaultZone","isString","lowered","isNumber","numberingSystems","arab","arabext","bali","beng","deva","fullwide","gujr","hanidec","khmr","knda","laoo","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt","latn","numberingSystemsUTF16","hanidecChars","split","parseDigits","str","code","charCodeAt","search","min","max","digitRegexCache","resetDigitRegexCache","digitRegex","append","ns","appendCache","regex","RegExp","now","twoDigitCutoffYear","throwOnInvalid","cutoffYear","t","resetCaches","Invalid","explanation","nonLeapLadder","leapLadder","unitOutOfRange","dayOfWeek","d","UTC","setUTCFullYear","getUTCFullYear","js","getUTCDay","computeOrdinal","isLeapYear","uncomputeOrdinal","ordinal","table","month0","findIndex","isoWeekdayToLocal","isoWeekday","startOfWeek","gregorianToWeek","gregObj","minDaysInFirstWeek","weekNumber","weekYear","weeksInWeekYear","timeObject","weekToGregorian","weekData","weekdayOfJan4","yearInDays","daysInYear","gregorianToOrdinal","gregData","ordinalToGregorian","ordinalData","usesLocalWeekValues","obj","hasLocaleWeekData","localWeekday","localWeekNumber","localWeekYear","hasIsoWeekData","hasInvalidWeekData","validYear","isInteger","validWeek","integerBetween","validWeekday","hasInvalidOrdinalData","validOrdinal","hasInvalidGregorianData","validMonth","validDay","daysInMonth","hasInvalidTimeData","validHour","validMinute","validSecond","validMillisecond","o","isDate","prototype","call","maybeArray","thing","Array","isArray","bestBy","arr","by","compare","reduce","best","next","pair","pick","a","k","hasOwnProperty","prop","settings","some","v","from","bottom","top","floorMod","x","isNeg","padded","parseInteger","string","parseFloating","parseFloat","parseMillis","fraction","number","digits","rounding","factor","ceil","trunc","round","RangeError","modMonth","modYear","firstWeekOffset","fwdlw","weekOffset","weekOffsetNext","untruncateYear","offsetFormat","modified","offHourStr","offMinuteStr","offHour","Number","offMin","offMinSigned","is","asNumber","numericValue","isFinite","normalizeObject","normalizer","normalized","u","hours","sign","monthsLong","monthsShort","monthsNarrow","weekdaysLong","weekdaysShort","weekdaysNarrow","erasLong","erasShort","erasNarrow","meridiemForDateTime","weekdayForDateTime","monthForDateTime","eraForDateTime","formatRelativeTime","narrow","units","years","quarters","weeks","days","seconds","lastable","isDay","isInPast","fmtValue","singular","lilUnits","fmtUnit","stringifyTokens","splits","tokenToString","token","literal","val","macroTokenToFormatOpts","D","Formats","DD","DDD","DDDD","tt","ttt","tttt","T","TT","TTT","TTTT","ff","fff","ffff","F","FF","FFF","FFFF","Formatter","parseFormat","fmt","current","currentFull","bracketed","c","charAt","test","formatOpts","systemLoc","formatWithSystemDefault","formatDateTime","formatDateTimeParts","formatInterval","interval","start","formatRange","end","num","p","signDisplay","formatDateTimeFromString","knownEnglish","useDateTimeFormatter","isOffsetFixed","allowZ","meridiem","maybeMacro","slice","quarter","formatDurationFromString","dur","invertLargest","signMode","tokenToField","lildur","info","mapped","inversionFactor","isNegativeDuration","largestUnit","tokens","realTokens","found","concat","collapsed","shiftTo","filter","durationInfo","values","ianaRegex","combineRegexes","regexes","full","source","combineExtractors","extractors","mergedVals","mergedZone","cursor","ex","parse","patterns","extractor","simpleParse","ret","offsetRegex","isoExtendedZone","isoTimeBaseRegex","isoTimeRegex","isoTimeExtensionRegex","isoYmdRegex","isoWeekRegex","isoOrdinalRegex","extractISOWeekData","extractISOOrdinalData","sqlYmdRegex","sqlTimeRegex","sqlTimeExtensionRegex","int","fallback","extractISOYmd","item","extractISOTime","milliseconds","extractISOOffset","local","fullOffset","extractIANAZone","isoTimeOnly","isoDuration","extractISODuration","yearStr","monthStr","weekStr","dayStr","hourStr","minuteStr","secondStr","millisecondsStr","hasNegativePrefix","negativeSeconds","maybeNegate","force","obsOffsets","GMT","EDT","EST","CDT","CST","MDT","MST","PDT","PST","fromStrings","weekdayStr","result","rfc2822","extractRFC2822","obsOffset","milOffset","preprocessRFC2822","trim","rfc1123","rfc850","ascii","extractRFC1123Or850","extractASCII","isoYmdWithTimeExtensionRegex","isoWeekWithTimeExtensionRegex","isoOrdinalWithTimeExtensionRegex","isoTimeCombinedRegex","extractISOYmdTimeAndOffset","extractISOWeekTimeAndOffset","extractISOOrdinalDateAndTime","extractISOTimeAndOffset","parseISODate","parseRFC2822Date","parseHTTPDate","parseISODuration","extractISOTimeOnly","parseISOTimeOnly","sqlYmdWithTimeExtensionRegex","sqlTimeCombinedRegex","extractISOTimeOffsetAndIANAZone","parseSQL","INVALID","lowOrderMatrix","casualMatrix","daysInYearAccurate","daysInMonthAccurate","accurateMatrix","orderedUnits","reverseUnits","reverse","conf","conversionAccuracy","matrix","Duration","durationToMillis","vals","_vals$milliseconds","sum","normalizeValues","reduceRight","previous","previousVal","conv","rollUp","removeZeroes","newVals","entries","config","accurate","invalid","isLuxonDuration","fromMillis","normalizeUnit","fromDurationLike","durationLike","isDuration","fromISO","text","fromISOTime","week","toFormat","fmtOpts","toHuman","showZeros","unitDisplay","listStyle","toObject","toISO","toISOTime","millis","toMillis","suppressMilliseconds","suppressSeconds","includePrefix","includeOffset","dateTime","toJSON","Symbol","for","invalidReason","valueOf","duration","minus","negate","mapUnits","fn","mixed","reconfigure","as","normalize","rescale","shiftToAll","built","accumulated","lastUnit","own","ak","negated","removeZeros","invalidExplanation","eq","v1","v2","validateStartEnd","Interval","isLuxonInterval","fromDateTimes","builtStart","friendlyDateTime","builtEnd","validateError","after","before","startIsValid","endIsValid","isInterval","lastDateTime","toDuration","startOf","useLocaleWeeks","diff","hasSame","isEmpty","isAfter","isBefore","contains","splitAt","dateTimes","sorted","sort","b","added","splitBy","idx","divideEqually","numberOfParts","overlaps","abutsStart","abutsEnd","engulfs","intersection","union","merge","intervals","final","sofar","xor","currentCount","ends","time","flattened","difference","toLocaleString","toISODate","dateFormat","separator","mapEndpoints","mapFn","Info","hasDST","proto","isValidIANAZone","locObj","getMinimumDaysInFirstWeek","getWeekendWeekdays","monthsFormat","weekdaysFormat","features","relative","localeWeek","dayDiff","earlier","later","utcDayStart","toUTC","keepLocalTime","highOrderDiffs","differs","lowestOrder","highWater","differ","remainingMillis","lowerOrderUnits","MISSING_FTP","intUnit","post","deser","NBSP","String","fromCharCode","spaceOrNBSP","spaceOrNBSPRegExp","fixListRegex","stripInsensitivities","oneOf","strings","startIndex","groups","h","simple","escapeToken","unitForToken","one","two","three","four","six","oneOrTwo","oneToThree","oneToSix","oneToNine","twoToFour","fourToSix","unitate","partTypeStyleToTokenVal","short","long","dayperiod","dayPeriod","hour24","tokenForPart","resolvedOpts","isSpace","actualType","buildRegex","re","handlers","matches","all","matchIndex","dateTimeFromMatches","toField","specificOffset","Z","q","M","G","y","S","dummyDateTimeCache","getDummyDateTime","maybeExpandMacroToken","formatOptsToTokens","expandMacroTokens","TokenParser","disqualifyingUnit","regexString","explainFromTokens","rawMatches","parser","parseFromTokens","formatter","MAX_DATE","unsupportedZone","possiblyCachedWeekData","possiblyCachedLocalWeekData","localWeekData","inst","old","fixOffset","localTS","tz","utcGuess","o2","o3","tsToObj","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","objToTS","adjustTime","oPre","millisToAdd","parseDataToDateTime","parsedZone","interpretationZone","toTechFormat","extended","precision","longFormat","extendedZone","showSeconds","defaultUnitValues","defaultWeekUnitValues","defaultOrdinalUnitValues","orderedWeekUnits","orderedOrdinalUnits","weeknumber","weeksnumber","weeknumbers","weekyear","weekyears","normalizeUnitWithLocalWeeks","guessOffsetForZone","zoneOffsetTs","offsetGuess","zoneOffsetGuessCache","quickDT","offsetProvis","diffRelative","calendary","lastOpts","argList","args","unchanged","ot","_zone","isLuxonDateTime","arguments","fromJSDate","zoneToUse","fromSeconds","tsNow","containsOrdinal","containsGregorYear","containsGregorMD","containsGregor","definiteWeekDef","useWeekData","defaultValues","objNow","foundFirst","higherOrderInvalid","gregorian","tsFinal","offsetFinal","fromRFC2822","fromHTTP","fromFormat","localeToUse","fromString","fromSQL","isDateTime","parseFormatForOpts","localeOpts","tokenList","expandFormat","expanded","isWeekend","monthShort","monthLong","weekdayShort","weekdayLong","offsetNameShort","offsetNameLong","isInDST","getPossibleOffsets","dayMs","minuteMs","oEarlier","oLater","o1","ts1","ts2","c1","c2","isInLeapYear","weeksInLocalWeekYear","resolvedLocaleOptions","toLocal","keepCalendarTime","newTS","asObj","setLocale","settingWeekStuff","normalizedUnit","endOf","toLocaleParts","ext","toISOWeekDate","toRFC2822","toHTTP","toSQLDate","toSQLTime","includeZone","includeOffsetSpace","toSQL","toSeconds","toUnixInteger","toBSON","includeConfig","otherDateTime","durOpts","otherIsLater","diffed","diffNow","until","inputMs","adjustedToZone","toRelative","padding","toRelativeCalendar","every","fromFormatExplain","fromStringExplain","buildFormatParser","fromFormatParser","formatParser","dateTimeish","VERSION"],"mappings":";;;;AAAA;;AAEA;AACA;AACA;AACA,MAAMA,UAAU,SAASC,KAAK,CAAC,EAAA;;AAE/B;AACA;AACA;AACO,MAAMC,oBAAoB,SAASF,UAAU,CAAC;EACnDG,WAAWA,CAACC,MAAM,EAAE;IAClB,KAAK,CAAE,qBAAoBA,MAAM,CAACC,SAAS,EAAG,EAAC,CAAC,CAAA;AAClD,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACO,MAAMC,oBAAoB,SAASN,UAAU,CAAC;EACnDG,WAAWA,CAACC,MAAM,EAAE;IAClB,KAAK,CAAE,qBAAoBA,MAAM,CAACC,SAAS,EAAG,EAAC,CAAC,C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A;AAC3C,GAAA;;AAEA;AACF;AACA;AACA;EACE,WAAWhd,aAAaA,GAAG;IACzB,OAAOgd,aAAqB,CAAA;AAC9B,GAAA;;AAEA;AACF;AACA;AACA;EACE,WAAW/c,0BAA0BA,GAAG;IACtC,OAAO+c,0BAAkC,CAAA;AAC3C,GAAA;AACF,CAAA;;AAEA;AACA;AACA;AACO,SAAS4P,gBAAgBA,CAACqS,WAAW,EAAE;AAC5C,EAAA,IAAIj3B,QAAQ,CAAC+yB,UAAU,CAACkE,WAAW,CAAC,EAAE;AACpC,IAAA,OAAOA,WAAW,CAAA;AACpB,GAAC,MAAM,IAAIA,WAAW,IAAIA,WAAW,CAACjU,OAAO,IAAIvb,QAAQ,CAACwvB,WAAW,CAACjU,OAAO,EAAE,CAAC,EAAE;AAChF,IAAA,OAAOhjB,QAAQ,CAACwxB,UAAU,CAACyF,WAAW,CAAC,CAAA;GACxC,MAAM,IAAIA,WAAW,IAAI,OAAOA,WAAW,KAAK,QAAQ,EAAE;AACzD,IAAA,OAAOj3B,QAAQ,CAACgE,UAAU,CAACizB,WAAW,CAAC,CAAA;AACzC,GAAC,MAAM;IACL,MAAM,IAAInhC,oBAAoB,CAC3B,CAAA,2BAAA,EAA6BmhC,WAAY,CAAY,UAAA,EAAA,OAAOA,WAAY,CAAA,CAC3E,CAAC,CAAA;AACH,GAAA;AACF;;AC/hFMC,MAAAA,OAAO,GAAG;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/luxon/package.json b/node_modules/luxon/package.json new file mode 100644 index 00000000..f80269b1 --- /dev/null +++ b/node_modules/luxon/package.json @@ -0,0 +1,87 @@ +{ + "name": "luxon", + "version": "3.7.2", + "description": "Immutable date wrapper", + "author": "Isaac Cambron", + "keywords": [ + "date", + "immutable" + ], + "repository": "https://github.com/moment/luxon", + "exports": { + ".": { + "import": "./build/es6/luxon.mjs", + "require": "./build/node/luxon.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "build": "babel-node tasks/buildAll.js", + "build-node": "babel-node tasks/buildNode.js", + "build-global": "babel-node tasks/buildGlobal.js", + "jest": "jest", + "test": "jest --coverage", + "api-docs": "mkdir -p build && documentation build src/luxon.js -f html -o build/api-docs && sed -i.bak 's/<\\/body>/ +``` + +``` +// "lite" version + +``` + +## Quick Start + +For the full version (800+ MIME types, 1,000+ extensions): + +```javascript +const mime = require('mime'); + +mime.getType('txt'); // ⇨ 'text/plain' +mime.getExtension('text/plain'); // ⇨ 'txt' +``` + +See [Mime API](#mime-api) below for API details. + +## Lite Version + +The "lite" version of this module omits vendor-specific (`*/vnd.*`) and +experimental (`*/x-*`) types. It weighs in at ~2.5KB, compared to 8KB for the +full version. To load the lite version: + +```javascript +const mime = require('mime/lite'); +``` + +## Mime .vs. mime-types .vs. mime-db modules + +For those of you wondering about the difference between these [popular] NPM modules, +here's a brief rundown ... + +[`mime-db`](https://github.com/jshttp/mime-db) is "the source of +truth" for MIME type information. It is not an API. Rather, it is a canonical +dataset of mime type definitions pulled from IANA, Apache, NGINX, and custom mappings +submitted by the Node.js community. + +[`mime-types`](https://github.com/jshttp/mime-types) is a thin +wrapper around mime-db that provides an API drop-in compatible(ish) with `mime @ < v1.3.6` API. + +`mime` is, as of v2, a self-contained module bundled with a pre-optimized version +of the `mime-db` dataset. It provides a simplified API with the following characteristics: + +* Intelligently resolved type conflicts (See [mime-score](https://github.com/broofa/mime-score) for details) +* Method naming consistent with industry best-practices +* Compact footprint. E.g. The minified+compressed sizes of the various modules: + +Module | Size +--- | --- +`mime-db` | 18 KB +`mime-types` | same as mime-db +`mime` | 8 KB +`mime/lite` | 2 KB + +## Mime API + +Both `require('mime')` and `require('mime/lite')` return instances of the MIME +class, documented below. + +Note: Inputs to this API are case-insensitive. Outputs (returned values) will +be lowercase. + +### new Mime(typeMap, ... more maps) + +Most users of this module will not need to create Mime instances directly. +However if you would like to create custom mappings, you may do so as follows +... + +```javascript +// Require Mime class +const Mime = require('mime/Mime'); + +// Define mime type -> extensions map +const typeMap = { + 'text/abc': ['abc', 'alpha', 'bet'], + 'text/def': ['leppard'] +}; + +// Create and use Mime instance +const myMime = new Mime(typeMap); +myMime.getType('abc'); // ⇨ 'text/abc' +myMime.getExtension('text/def'); // ⇨ 'leppard' +``` + +If more than one map argument is provided, each map is `define()`ed (see below), in order. + +### mime.getType(pathOrExtension) + +Get mime type for the given path or extension. E.g. + +```javascript +mime.getType('js'); // ⇨ 'application/javascript' +mime.getType('json'); // ⇨ 'application/json' + +mime.getType('txt'); // ⇨ 'text/plain' +mime.getType('dir/text.txt'); // ⇨ 'text/plain' +mime.getType('dir\\text.txt'); // ⇨ 'text/plain' +mime.getType('.text.txt'); // ⇨ 'text/plain' +mime.getType('.txt'); // ⇨ 'text/plain' +``` + +`null` is returned in cases where an extension is not detected or recognized + +```javascript +mime.getType('foo/txt'); // ⇨ null +mime.getType('bogus_type'); // ⇨ null +``` + +### mime.getExtension(type) +Get extension for the given mime type. Charset options (often included in +Content-Type headers) are ignored. + +```javascript +mime.getExtension('text/plain'); // ⇨ 'txt' +mime.getExtension('application/json'); // ⇨ 'json' +mime.getExtension('text/html; charset=utf8'); // ⇨ 'html' +``` + +### mime.define(typeMap[, force = false]) + +Define [more] type mappings. + +`typeMap` is a map of type -> extensions, as documented in `new Mime`, above. + +By default this method will throw an error if you try to map a type to an +extension that is already assigned to another type. Passing `true` for the +`force` argument will suppress this behavior (overriding any previous mapping). + +```javascript +mime.define({'text/x-abc': ['abc', 'abcd']}); + +mime.getType('abcd'); // ⇨ 'text/x-abc' +mime.getExtension('text/x-abc') // ⇨ 'abc' +``` + +## Command Line + + mime [path_or_extension] + +E.g. + + > mime scripts/jquery.js + application/javascript + +---- +Markdown generated from [src/README_js.md](src/README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd) \ No newline at end of file diff --git a/node_modules/mime/cli.js b/node_modules/mime/cli.js new file mode 100644 index 00000000..ab70a49c --- /dev/null +++ b/node_modules/mime/cli.js @@ -0,0 +1,46 @@ +#!/usr/bin/env node + +'use strict'; + +process.title = 'mime'; +let mime = require('.'); +let pkg = require('./package.json'); +let args = process.argv.splice(2); + +if (args.includes('--version') || args.includes('-v') || args.includes('--v')) { + console.log(pkg.version); + process.exit(0); +} else if (args.includes('--name') || args.includes('-n') || args.includes('--n')) { + console.log(pkg.name); + process.exit(0); +} else if (args.includes('--help') || args.includes('-h') || args.includes('--h')) { + console.log(pkg.name + ' - ' + pkg.description + '\n'); + console.log(`Usage: + + mime [flags] [path_or_extension] + + Flags: + --help, -h Show this message + --version, -v Display the version + --name, -n Print the name of the program + + Note: the command will exit after it executes if a command is specified + The path_or_extension is the path to the file or the extension of the file. + + Examples: + mime --help + mime --version + mime --name + mime -v + mime src/log.js + mime new.py + mime foo.sh + `); + process.exit(0); +} + +let file = args[0]; +let type = mime.getType(file); + +process.stdout.write(type + '\n'); + diff --git a/node_modules/mime/index.js b/node_modules/mime/index.js new file mode 100644 index 00000000..fadcf8d6 --- /dev/null +++ b/node_modules/mime/index.js @@ -0,0 +1,4 @@ +'use strict'; + +let Mime = require('./Mime'); +module.exports = new Mime(require('./types/standard'), require('./types/other')); diff --git a/node_modules/mime/lite.js b/node_modules/mime/lite.js new file mode 100644 index 00000000..835cffb3 --- /dev/null +++ b/node_modules/mime/lite.js @@ -0,0 +1,4 @@ +'use strict'; + +let Mime = require('./Mime'); +module.exports = new Mime(require('./types/standard')); diff --git a/node_modules/mime/package.json b/node_modules/mime/package.json new file mode 100644 index 00000000..84f51323 --- /dev/null +++ b/node_modules/mime/package.json @@ -0,0 +1,52 @@ +{ + "author": { + "name": "Robert Kieffer", + "url": "http://github.com/broofa", + "email": "robert@broofa.com" + }, + "engines": { + "node": ">=10.0.0" + }, + "bin": { + "mime": "cli.js" + }, + "contributors": [], + "description": "A comprehensive library for mime-type mapping", + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "benchmark": "*", + "chalk": "4.1.2", + "eslint": "8.1.0", + "mime-db": "1.50.0", + "mime-score": "1.2.0", + "mime-types": "2.1.33", + "mocha": "9.1.3", + "runmd": "*", + "standard-version": "9.3.2" + }, + "files": [ + "index.js", + "lite.js", + "Mime.js", + "cli.js", + "/types" + ], + "scripts": { + "prepare": "node src/build.js && runmd --output README.md src/README_js.md", + "release": "standard-version", + "benchmark": "node src/benchmark.js", + "md": "runmd --watch --output README.md src/README_js.md", + "test": "mocha src/test.js" + }, + "keywords": [ + "util", + "mime" + ], + "name": "mime", + "repository": { + "url": "https://github.com/broofa/mime", + "type": "git" + }, + "version": "3.0.0" +} diff --git a/node_modules/mime/types/other.js b/node_modules/mime/types/other.js new file mode 100644 index 00000000..bb6a0353 --- /dev/null +++ b/node_modules/mime/types/other.js @@ -0,0 +1 @@ +module.exports = {"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}; \ No newline at end of file diff --git a/node_modules/mime/types/standard.js b/node_modules/mime/types/standard.js new file mode 100644 index 00000000..5ee9937e --- /dev/null +++ b/node_modules/mime/types/standard.js @@ -0,0 +1 @@ +module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}; \ No newline at end of file diff --git a/node_modules/minimatch/LICENSE.md b/node_modules/minimatch/LICENSE.md new file mode 100644 index 00000000..8cb5cc6e --- /dev/null +++ b/node_modules/minimatch/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** diff --git a/node_modules/minimatch/README.md b/node_modules/minimatch/README.md new file mode 100644 index 00000000..1a068fab --- /dev/null +++ b/node_modules/minimatch/README.md @@ -0,0 +1,528 @@ +# minimatch + +A minimal matching utility. + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Important Security Consideration! + +> [!WARNING] +> This library uses JavaScript regular expressions. Please read +> the following warning carefully, and be thoughtful about what +> you provide to this library in production systems. + +_Any_ library in JavaScript that deals with matching string +patterns using regular expressions will be subject to +[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) +if the pattern is generated using untrusted input. + +Efforts have been made to mitigate risk as much as is feasible in +such a library, providing maximum recursion depths and so forth, +but these measures can only ultimately protect against accidents, +not malice. A dedicated attacker can _always_ find patterns that +cannot be defended against by a bash-compatible glob pattern +matching system that uses JavaScript regular expressions. + +To be extremely clear: + +> [!WARNING] +> **If you create a system where you take user input, and use +> that input as the source of a Regular Expression pattern, in +> this or any extant glob matcher in JavaScript, you will be +> pwned.** + +A future version of this library _may_ use a different matching +algorithm which does not exhibit backtracking problems. If and +when that happens, it will likely be a sweeping change, and those +improvements will **not** be backported to legacy versions. + +In the near term, it is not reasonable to continue to play +whack-a-mole with security advisories, and so any future ReDoS +reports will be considered "working as intended", and resolved +entirely by this warning. + +## Usage + +```js +// hybrid module, load with require() or import +import { minimatch } from 'minimatch' +// or: +const { minimatch } = require('minimatch') + +minimatch('bar.foo', '*.foo') // true! +minimatch('bar.foo', '*.bar') // false! +minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +- Brace Expansion +- Extended glob matching +- "Globstar" `**` matching +- [Posix character + classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html), + like `[[:alpha:]]`, supporting the full range of Unicode + characters. For example, `[[:alpha:]]` will match against + `'é'`, though `[a-zA-Z]` will not. Collating symbol and set + matching is not supported, so `[[=e=]]` will _not_ match `'é'` + and `[[.ch.]]` will not match `'ch'` in locales where `ch` is + considered a single character. + +See: + +- `man sh` +- `man bash` [Pattern + Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) +- `man 3 fnmatch` +- `man 5 gitignore` + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes in patterns +will always be interpreted as escape characters, not path separators. + +Note that `\` or `/` _will_ be interpreted as path separators in paths on +Windows, and will match against `/` in glob expressions. + +So just always use `/` in patterns. + +### UNC Paths + +On Windows, UNC paths like `//?/c:/...` or +`//ComputerName/Share/...` are handled specially. + +- Patterns starting with a double-slash followed by some + non-slash characters will preserve their double-slash. As a + result, a pattern like `//*` will match `//x`, but not `/x`. +- Patterns staring with `//?/:` will _not_ treat + the `?` as a wildcard character. Instead, it will be treated + as a normal string. +- Patterns starting with `//?/:/...` will match + file paths starting with `:/...`, and vice versa, + as if the `//?/` was not present. This behavior only is + present when the drive letters are a case-insensitive match to + one another. The remaining portions of the path/pattern are + compared case sensitively, unless `nocase:true` is set. + +Note that specifying a UNC path using `\` characters as path +separators is always allowed in the file path argument, but only +allowed in the pattern argument when `windowsPathsNoEscape: true` +is set in the options. + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require('minimatch').Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +- `pattern` The original pattern the minimatch object represents. +- `options` The options supplied to the constructor. +- `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +- `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +- `negate` True if the pattern is negated. +- `comment` True if the pattern is a comment. +- `empty` True if the pattern is `""`. + +### Methods + +- `makeRe()` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +- `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +- `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. +- `hasMagic()` Returns true if the parsed pattern contains any + magic characters. Returns false if all comparator parts are + string literals. If the `magicalBraces` option is set on the + constructor, then it will consider brace expansions which are + not otherwise magical to be magic. If not set, then a pattern + like `a{b,c}d` will return `false`, because neither `abd` nor + `acd` contain any special glob characters. + + This does **not** mean that the pattern string can be used as a + literal filename, as it may contain magic glob characters that + are escaped. For example, the pattern `\\*` or `[*]` would not + be considered to have magic, as the matching portion parses to + the literal string `'*'` and would match a path named `'*'`, + not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may + be used to remove escape characters. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, '*.js', { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter( + minimatch.filter('*.js', { matchBase: true }), +) +``` + +### minimatch.escape(pattern, options = {}) + +Escape all magic characters in a glob pattern, so that it will +only ever match literal strings. + +If the `windowsPathsNoEscape` option is used, then characters are +escaped by wrapping in `[]`, because a magic character wrapped in +a character class can only be satisfied by that exact character. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.unescape(pattern, options = {}) + +Un-escape a glob string that may contain some escaped characters. + +If the `windowsPathsNoEscape` option is used, then square-brace +escapes are removed, but not backslash escapes. For example, it +will turn the string `'[*]'` into `*`, but it will not turn +`'\\*'` into `'*'`, because `\` is a path separator in +`windowsPathsNoEscape` mode. + +When `windowsPathsNoEscape` is not set, then both brace escapes +and backslash escapes are removed. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, '*.js', { matchBase: true }) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nocaseMagicOnly + +When used with `{nocase: true}`, create regular expressions that +are case-insensitive, but leave string match portions untouched. +Has no effect when used without `{nocase: true}`. + +Useful when some other form of case-insensitive matching is used, +or if the original string representation is useful in some other +way. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### magicalBraces + +This only affects the results of the `Minimatch.hasMagic` method. + +If the pattern contains brace expansions, such as `a{b,c}d`, but +no other magic characters, then the `Minimatch.hasMagic()` method +will return `false` by default. When this option set, it will +return `true` for brace expansion as well as other magic glob +characters. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### windowsPathsNoEscape + +Use `\\` as a path separator _only_, and _never_ as an escape +character. If set, all `\\` characters are replaced with `/` in +the pattern. Note that this makes it **impossible** to match +against paths containing literal glob pattern characters, but +allows matching with patterns constructed using `path.join()` and +`path.resolve()` on Windows platforms, mimicking the (buggy!) +behavior of earlier versions on Windows. Please use with +caution, and be mindful of [the caveat about Windows +paths](#windows). + +For legacy reasons, this is also set if +`options.allowWindowsEscape` is set to the exact value `false`. + +### windowsNoMagicRoot + +When a pattern starts with a UNC path or drive letter, and in +`nocase:true` mode, do not convert the root portions of the +pattern into a case-insensitive regular expression, and instead +leave them as strings. + +This is the default when the platform is `win32` and +`nocase:true` is set. + +### preserveMultipleSlashes + +By default, multiple `/` characters (other than the leading `//` +in a UNC path, see "UNC Paths" above) are treated as a single +`/`. + +That is, a pattern like `a///b` will match the file path `a/b`. + +Set `preserveMultipleSlashes: true` to suppress this behavior. + +### optimizationLevel + +A number indicating the level of optimization that should be done +to the pattern prior to parsing and using it for matches. + +Globstar parts `**` are always converted to `*` when `noglobstar` +is set, and multiple adjacent `**` parts are converted into a +single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this +is equivalent in all cases). + +- `0` - Make no further changes. In this mode, `.` and `..` are + maintained in the pattern, meaning that they must also appear + in the same position in the test path string. Eg, a pattern + like `a/*/../c` will match the string `a/b/../c` but not the + string `a/c`. +- `1` - (default) Remove cases where a double-dot `..` follows a + pattern portion that is not `**`, `.`, `..`, or empty `''`. For + example, the pattern `./a/b/../*` is converted to `./a/*`, and + so it will match the path string `./a/c`, but not the path + string `./a/b/../c`. Dots and empty path portions in the + pattern are preserved. +- `2` (or higher) - Much more aggressive optimizations, suitable + for use with file-walking cases: + - Remove cases where a double-dot `..` follows a pattern + portion that is not `**`, `.`, or empty `''`. Remove empty + and `.` portions of the pattern, where safe to do so (ie, + anywhere other than the last position, the first position, or + the second position in a pattern starting with `/`, as this + may indicate a UNC path on Windows). + - Convert patterns containing `
/**/../

/` into the + equivalent `

/{..,**}/

/`, where `

` is a + a pattern portion other than `.`, `..`, `**`, or empty + `''`. + - Dedupe patterns where a `**` portion is present in one and + omitted in another, and it is not the final path portion, and + they are otherwise equivalent. So `{a/**/b,a/b}` becomes + `a/**/b`, because `**` matches against an empty path portion. + - Dedupe patterns where a `*` portion is present in one, and a + non-dot pattern other than `**`, `.`, `..`, or `''` is in the + same position in the other. So `a/{*,x}/b` becomes `a/*/b`, + because `*` can match against `x`. + + While these optimizations improve the performance of + file-walking use cases such as [glob](http://npm.im/glob) (ie, + the reason this module exists), there are cases where it will + fail to match a literal string that would have been matched in + optimization level 1 or 0. + + Specifically, while the `Minimatch.match()` method will + optimize the file path string in the same ways, resulting in + the same matches, it will fail when tested with the regular + expression provided by `Minimatch.makeRe()`, unless the path + string is first processed with + `minimatch.levelTwoFileOptimize()` or similar. + +### platform + +When set to `win32`, this will trigger all windows-specific +behaviors (special handling for UNC paths, and treating `\` as +separators in file paths for comparison.) + +Defaults to the value of `process.platform`. + +### maxGlobstarRecursion + +Max number of non-adjacent `**` patterns to recursively walk +down. + +The default of `200` is almost certainly high enough for most +purposes, and can handle absurdly excessive patterns. + +If the limit is exceeded (which would require very excessively +long patterns and paths containing lots of `**` patterns!), then +it is treated as non-matching, even if the path would normally +match the pattern provided. + +That is, this is an intentional false negative, deemed an +acceptable break in correctness for security and performance. + +### maxExtglobRecursion + +Max depth to traverse for nested extglobs like `*(a|b|c)` + +Default is 2, which is quite low, but any higher value swiftly +results in punishing performance impacts. Note that this is _not_ +relevant when the globstar types can be safely coalesced into a +single set. + +For example, `*(a|@(b|c)|d)` would be flattened into +`*(a|b|c|d)`. Thus, many common extglobs will retain good +performance and never hit this limit, even if they are +excessively deep and complicated. + +If the limit is hit, then the extglob characters are simply not +parsed, and the pattern effectively switches into `noextglob: +true` mode for the contents of that nested sub-pattern. This will +typically _not_ result in a match, but is considered a valid +trade-off for security and performance. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a +worthwhile goal, some discrepancies exist between minimatch and +other implementations. Some are intentional, and some are +unavoidable. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +Negated extglob patterns are handled as closely as possible to +Bash semantics, but there are some cases with negative extglobs +which are exceedingly difficult to express in a JavaScript +regular expression. In particular the negated pattern +`!(*|)*` will in bash match anything that does +not start with ``. However, +`!(*)*` _will_ match paths starting with +``, because the empty string can match against +the negated portion. In this library, `!(*|)*` +will _not_ match any pattern starting with ``, due to a +difference in precisely which patterns are considered "greedy" in +Regular Expressions vs bash path expansion. This may be fixable, +but not without incurring some complexity and performance costs, +and the trade-off seems to not be worth pursuing. + +Note that `fnmatch(3)` in libc is an extremely naive string comparison +matcher, which does not do anything special for slashes. This library is +designed to be used in glob searching and file walkers, and so it does do +special things with `/`. Thus, `foo*` will not match `foo/bar` in this +library, even though it would in `fnmatch(3)`. diff --git a/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts b/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts new file mode 100644 index 00000000..34d7a78a --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts @@ -0,0 +1,2 @@ +export declare const assertValidPattern: (pattern: unknown) => void; +//# sourceMappingURL=assert-valid-pattern.d.ts.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map b/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map new file mode 100644 index 00000000..30ddcd51 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js b/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js new file mode 100644 index 00000000..5fc86bbd --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertValidPattern = void 0; +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; +exports.assertValidPattern = assertValidPattern; +//# sourceMappingURL=assert-valid-pattern.js.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map b/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map new file mode 100644 index 00000000..9fc27a93 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n pattern: unknown,\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/ast.d.ts b/node_modules/minimatch/dist/commonjs/ast.d.ts new file mode 100644 index 00000000..74f2cf93 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/ast.d.ts @@ -0,0 +1,22 @@ +import type { MinimatchOptions, MMRegExp } from './index.js'; +export type ExtglobType = '!' | '?' | '+' | '*' | '@'; +export declare class AST { + #private; + type: ExtglobType | null; + id: number; + get depth(): number; + constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions); + get hasMagic(): boolean | undefined; + toString(): string; + push(...parts: (string | AST)[]): void; + toJSON(): unknown[]; + isStart(): boolean; + isEnd(): boolean; + copyIn(part: AST | string): void; + clone(parent: AST): AST; + static fromGlob(pattern: string, options?: MinimatchOptions): AST; + toMMPattern(): MMRegExp | string; + get options(): MinimatchOptions; + toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean]; +} +//# sourceMappingURL=ast.d.ts.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/ast.d.ts.map b/node_modules/minimatch/dist/commonjs/ast.d.ts.map new file mode 100644 index 00000000..8965fd6a --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/ast.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/ast.js b/node_modules/minimatch/dist/commonjs/ast.js new file mode 100644 index 00000000..33df3769 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/ast.js @@ -0,0 +1,845 @@ +"use strict"; +// parse a single path portion +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST = void 0; +const brace_expressions_js_1 = require("./brace-expressions.js"); +const unescape_js_1 = require("./unescape.js"); +const types = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types.has(c); +const isExtglobAST = (c) => isExtglobType(c.type); +// Map of which extglob types can adopt the children of a nested extglob +// +// anything but ! can adopt a matching type: +// +(a|+(b|c)|d) => +(a|b|c|d) +// *(a|*(b|c)|d) => *(a|b|c|d) +// @(a|@(b|c)|d) => @(a|b|c|d) +// ?(a|?(b|c)|d) => ?(a|b|c|d) +// +// * can adopt anything, because 0 or repetition is allowed +// *(a|?(b|c)|d) => *(a|b|c|d) +// *(a|+(b|c)|d) => *(a|b|c|d) +// *(a|@(b|c)|d) => *(a|b|c|d) +// +// + can adopt @, because 1 or repetition is allowed +// +(a|@(b|c)|d) => +(a|b|c|d) +// +// + and @ CANNOT adopt *, because 0 would be allowed +// +(a|*(b|c)|d) => would match "", on *(b|c) +// @(a|*(b|c)|d) => would match "", on *(b|c) +// +// + and @ CANNOT adopt ?, because 0 would be allowed +// +(a|?(b|c)|d) => would match "", on ?(b|c) +// @(a|?(b|c)|d) => would match "", on ?(b|c) +// +// ? can adopt @, because 0 or 1 is allowed +// ?(a|@(b|c)|d) => ?(a|b|c|d) +// +// ? and @ CANNOT adopt * or +, because >1 would be allowed +// ?(a|*(b|c)|d) => would match bbb on *(b|c) +// @(a|*(b|c)|d) => would match bbb on *(b|c) +// ?(a|+(b|c)|d) => would match bbb on +(b|c) +// @(a|+(b|c)|d) => would match bbb on +(b|c) +// +// ! CANNOT adopt ! (nothing else can either) +// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c) +// +// ! can adopt @ +// !(a|@(b|c)|d) => !(a|b|c|d) +// +// ! CANNOT adopt * +// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed +// +// ! CANNOT adopt + +// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed +// +// ! CANNOT adopt ? +// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x" +const adoptionMap = new Map([ + ['!', ['@']], + ['?', ['?', '@']], + ['@', ['@']], + ['*', ['*', '+', '?', '@']], + ['+', ['+', '@']], +]); +// nested extglobs that can be adopted in, but with the addition of +// a blank '' element. +const adoptionWithSpaceMap = new Map([ + ['!', ['?']], + ['@', ['?']], + ['+', ['?', '*']], +]); +// union of the previous two maps +const adoptionAnyMap = new Map([ + ['!', ['?', '@']], + ['?', ['?', '@']], + ['@', ['?', '@']], + ['*', ['*', '+', '?', '@']], + ['+', ['+', '@', '?', '*']], +]); +// Extglobs that can take over their parent if they are the only child +// the key is parent, value maps child to resulting extglob parent type +// '@' is omitted because it's a special case. An `@` extglob with a single +// member can always be usurped by that subpattern. +const usurpMap = new Map([ + ['!', new Map([['!', '@']])], + [ + '?', + new Map([ + ['*', '*'], + ['+', '*'], + ]), + ], + [ + '@', + new Map([ + ['!', '!'], + ['?', '?'], + ['@', '@'], + ['*', '*'], + ['+', '+'], + ]), + ], + [ + '+', + new Map([ + ['?', '*'], + ['*', '*'], + ]), + ], +]); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +let ID = 0; +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + id = ++ID; + get depth() { + return (this.#parent?.depth ?? -1) + 1; + } + [Symbol.for('nodejs.util.inspect.custom')]() { + return { + '@@type': 'AST', + id: this.id, + type: this.type, + root: this.#root.id, + parent: this.#parent?.id, + depth: this.depth, + partsLength: this.#parts.length, + parts: this.#parts, + }; + } + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + return (this.#toString !== undefined ? this.#toString + : !this.type ? + (this.#toString = this.#parts.map(p => String(p)).join('')) + : (this.#toString = + this.type + + '(' + + this.#parts.map(p => String(p)).join('|') + + ')')); + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && + !(p instanceof _a && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null ? + this.#parts + .slice() + .map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof _a && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new _a(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt, extDepth) { + const maxDepth = opt.maxExtglobRecursion ?? 2; + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + // we don't have to check for adoption here, because that's + // done at the other recursion point. + const doRecurse = !opt.noext && + isExtglobType(c) && + str.charAt(i) === '(' && + extDepth <= maxDepth; + if (doRecurse) { + ast.push(acc); + acc = ''; + const ext = new _a(c, ast); + i = _a.#parseAST(str, ext, i, opt, extDepth + 1); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new _a(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + const doRecurse = !opt.noext && + isExtglobType(c) && + str.charAt(i) === '(' && + /* c8 ignore start - the maxDepth is sufficient here */ + (extDepth <= maxDepth || (ast && ast.#canAdoptType(c))); + /* c8 ignore stop */ + if (doRecurse) { + const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; + part.push(acc); + acc = ''; + const ext = new _a(c, part); + part.push(ext); + i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new _a(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + #canAdoptWithSpace(child) { + return this.#canAdopt(child, adoptionWithSpaceMap); + } + #canAdopt(child, map = adoptionMap) { + if (!child || + typeof child !== 'object' || + child.type !== null || + child.#parts.length !== 1 || + this.type === null) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== 'object' || gc.type === null) { + return false; + } + return this.#canAdoptType(gc.type, map); + } + #canAdoptType(c, map = adoptionAnyMap) { + return !!map.get(this.type)?.includes(c); + } + #adoptWithSpace(child, index) { + const gc = child.#parts[0]; + const blank = new _a(null, gc, this.options); + blank.#parts.push(''); + gc.push(blank); + this.#adopt(child, index); + } + #adopt(child, index) { + const gc = child.#parts[0]; + this.#parts.splice(index, 1, ...gc.#parts); + for (const p of gc.#parts) { + if (typeof p === 'object') + p.#parent = this; + } + this.#toString = undefined; + } + #canUsurpType(c) { + const m = usurpMap.get(this.type); + return !!m?.has(c); + } + #canUsurp(child) { + if (!child || + typeof child !== 'object' || + child.type !== null || + child.#parts.length !== 1 || + this.type === null || + this.#parts.length !== 1) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== 'object' || gc.type === null) { + return false; + } + return this.#canUsurpType(gc.type); + } + #usurp(child) { + const m = usurpMap.get(this.type); + const gc = child.#parts[0]; + const nt = m?.get(gc.type); + /* c8 ignore start - impossible */ + if (!nt) + return false; + /* c8 ignore stop */ + this.#parts = gc.#parts; + for (const p of this.#parts) { + if (typeof p === 'object') { + p.#parent = this; + } + } + this.type = nt; + this.#toString = undefined; + this.#emptyExt = false; + } + static fromGlob(pattern, options = {}) { + const ast = new _a(null, undefined, options); + _a.#parseAST(pattern, ast, 0, options, 0); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + get options() { + return this.#options; + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) { + this.#flatten(); + this.#fillNegs(); + } + if (!isExtglobAST(this)) { + const noEmpty = this.isStart() && + this.isEnd() && + !this.#parts.some(s => typeof s !== 'string'); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' ? + _a.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = + needNoTrav ? startNoTraversal + : needNoDot ? startNoDot + : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + (0, unescape_js_1.unescape)(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + const me = this; + me.#parts = [s]; + me.type = null; + me.#hasMagic = undefined; + return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; + } + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? + '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' ? + // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star + + ')' + : this.type === '@' ? ')' + : this.type === '?' ? ')?' + : this.type === '+' && bodyDotAllowed ? ')' + : this.type === '*' && bodyDotAllowed ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + (0, unescape_js_1.unescape)(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #flatten() { + if (!isExtglobAST(this)) { + for (const p of this.#parts) { + if (typeof p === 'object') { + p.#flatten(); + } + } + } + else { + // do up to 10 passes to flatten as much as possible + let iterations = 0; + let done = false; + do { + done = true; + for (let i = 0; i < this.#parts.length; i++) { + const c = this.#parts[i]; + if (typeof c === 'object') { + c.#flatten(); + if (this.#canAdopt(c)) { + done = false; + this.#adopt(c, i); + } + else if (this.#canAdoptWithSpace(c)) { + done = false; + this.#adoptWithSpace(c, i); + } + else if (this.#canUsurp(c)) { + done = false; + this.#usurp(c); + } + } + } + } while (!done && ++iterations < 10); + } + this.#toString = undefined; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + // multiple stars that aren't globstars coalesce into one * + let inStar = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '*') { + if (inStar) + continue; + inStar = true; + re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star; + hasMagic = true; + continue; + } + else { + inStar = false; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '?') { + re += qmark; + hasMagic = true; + continue; + } + re += regExpEscape(c); + } + return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag]; + } +} +exports.AST = AST; +_a = AST; +//# sourceMappingURL=ast.js.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/ast.js.map b/node_modules/minimatch/dist/commonjs/ast.js.map new file mode 100644 index 00000000..3498fb26 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/ast.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":";AAAA,8BAA8B;;;;AAE9B,iEAAmD;AAEnD,+CAAwC;AAwCxC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC7D,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAoB,EAAE,CAC3D,KAAK,CAAC,GAAG,CAAC,CAAgB,CAAC,CAAA;AAC7B,MAAM,YAAY,GAAG,CAAC,CAAM,EAAoC,EAAE,CAChE,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAEvB,wEAAwE;AACxE,EAAE;AACF,4CAA4C;AAC5C,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,oDAAoD;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C,KAAK,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,EAAE,IAAI,MAAM,CAAA;gBACd,CAAC;qBAAM,CAAC;oBACN,QAAQ,GAAG,IAAI,CAAA;gBACjB,CAAC;gBACD,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,IAAA,iCAAU,EAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gBAC7D,IAAI,QAAQ,EAAE,CAAC;oBACb,EAAE,IAAI,GAAG,CAAA;oBACT,KAAK,GAAG,KAAK,IAAI,SAAS,CAAA;oBAC1B,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;oBACjB,QAAQ,GAAG,QAAQ,IAAI,KAAK,CAAA;oBAC5B,SAAQ;gBACV,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,EAAE,IAAI,KAAK,CAAA;gBACX,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,IAAA,sBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF;AArxBD,kBAqxBC","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n// 1 2 3 4 5 6 1 2 3 46 5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n// v----- .* because there's more following,\n// v v otherwise, .+ because it must be\n// v v *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n// copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n ExtglobType,\n Map\n>([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n type: ExtglobType | null\n readonly #root: AST\n\n #hasMagic?: boolean\n #uflag: boolean = false\n #parts: (string | AST)[] = []\n #parent?: AST\n #parentIndex: number\n #negs: AST[]\n #filledNegs: boolean = false\n #options: MinimatchOptions\n #toString?: string\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt: boolean = false\n id = ++ID\n\n get depth(): number {\n return (this.#parent?.depth ?? -1) + 1\n }\n\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n }\n }\n\n constructor(\n type: ExtglobType | null,\n parent?: AST,\n options: MinimatchOptions = {},\n ) {\n this.type = type\n // extglobs are inherently magical\n if (type) this.#hasMagic = true\n this.#parent = parent\n this.#root = this.#parent ? this.#parent.#root : this\n this.#options = this.#root === this ? options : this.#root.#options\n this.#negs = this.#root === this ? [] : this.#root.#negs\n if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n }\n\n get hasMagic(): boolean | undefined {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined) return this.#hasMagic\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string') continue\n if (p.type || p.hasMagic) return (this.#hasMagic = true)\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic\n }\n\n // reconstructs the pattern\n toString(): string {\n return (\n this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')')\n )\n }\n\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root) throw new Error('should only call on root')\n if (this.#filledNegs) return this\n /* c8 ignore stop */\n\n // call toString() once to fill this out\n this.toString()\n this.#filledNegs = true\n let n: AST | undefined\n while ((n = this.#negs.pop())) {\n if (n.type !== '!') continue\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p: AST | undefined = n\n let pp = p.#parent\n while (pp) {\n for (\n let i = p.#parentIndex + 1;\n !pp.type && i < pp.#parts.length;\n i++\n ) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??')\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i])\n }\n }\n p = pp\n pp = p.#parent\n }\n }\n return this\n }\n\n push(...parts: (string | AST)[]) {\n for (const p of parts) {\n if (p === '') continue\n /* c8 ignore start */\n if (\n typeof p !== 'string' &&\n !(p instanceof AST && p.#parent === this)\n ) {\n throw new Error('invalid part: ' + p)\n }\n /* c8 ignore stop */\n this.#parts.push(p)\n }\n }\n\n toJSON() {\n const ret: unknown[] =\n this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n if (this.isStart() && !this.type) ret.unshift([])\n if (\n this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))\n ) {\n ret.push({})\n }\n return ret\n }\n\n isStart(): boolean {\n if (this.#root === this) return true\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart()) return false\n if (this.#parentIndex === 0) return true\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i]\n if (!(pp instanceof AST && pp.type === '!')) {\n return false\n }\n }\n return true\n }\n\n isEnd(): boolean {\n if (this.#root === this) return true\n if (this.#parent?.type === '!') return true\n if (!this.#parent?.isEnd()) return false\n if (!this.type) return this.#parent?.isEnd()\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1\n }\n\n copyIn(part: AST | string) {\n if (typeof part === 'string') this.push(part)\n else this.push(part.clone(this))\n }\n\n clone(parent: AST) {\n const c = new AST(this.type, parent)\n for (const p of this.#parts) {\n c.copyIn(p)\n }\n return c\n }\n\n static #parseAST(\n str: string,\n ast: AST,\n pos: number,\n opt: MinimatchOptions,\n extDepth: number,\n ): number {\n const maxDepth = opt.maxExtglobRecursion ?? 2\n let escaping = false\n let inBrace = false\n let braceStart = -1\n let braceNeg = false\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth\n if (doRecurse) {\n ast.push(acc)\n acc = ''\n const ext = new AST(c, ast)\n i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n ast.push(ext)\n continue\n }\n acc += c\n }\n ast.push(acc)\n return i\n }\n\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1\n let part = new AST(null, ast)\n const parts: AST[] = []\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n part.push(acc)\n acc = ''\n const ext = new AST(c, part)\n part.push(ext)\n i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n continue\n }\n if (c === '|') {\n part.push(acc)\n acc = ''\n parts.push(part)\n part = new AST(null, ast)\n continue\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true\n }\n part.push(acc)\n acc = ''\n ast.push(...parts, part)\n return i\n }\n acc += c\n }\n\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null\n ast.#hasMagic = undefined\n ast.#parts = [str.substring(pos - 1)]\n return i\n }\n\n #canAdoptWithSpace(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n return this.#canAdopt(child, adoptionWithSpaceMap)\n }\n\n #canAdopt(\n child?: AST | string,\n map: Map = adoptionMap,\n ): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canAdoptType(\n gc.type,\n map,\n )\n }\n #canAdoptType(\n c: string,\n map: Map = adoptionAnyMap,\n ): c is ExtglobType {\n return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n }\n\n #adoptWithSpace(\n this: AST & { type: ExtglobType },\n child: AST & {\n type: null\n },\n index: number,\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const blank = new AST(null, gc, this.options)\n blank.#parts.push('')\n gc.push(blank)\n this.#adopt(child, index)\n }\n\n #adopt(\n child: AST & {\n type: null\n },\n index: number,\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n this.#parts.splice(index, 1, ...gc.#parts)\n for (const p of gc.#parts) {\n if (typeof p === 'object') p.#parent = this\n }\n this.#toString = undefined\n }\n\n #canUsurpType(c: string): boolean {\n const m = usurpMap.get(this.type as ExtglobType)\n return !!m?.has(c as ExtglobType)\n }\n\n #canUsurp(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n }\n\n #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n const m = usurpMap.get(this.type as ExtglobType)\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const nt = m?.get(gc.type)\n /* c8 ignore start - impossible */\n if (!nt) return false\n /* c8 ignore stop */\n this.#parts = gc.#parts\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this\n }\n }\n this.type = nt\n this.#toString = undefined\n this.#emptyExt = false\n }\n\n static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n const ast = new AST(null, undefined, options)\n AST.#parseAST(pattern, ast, 0, options, 0)\n return ast\n }\n\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern(): MMRegExp | string {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root) return this.#root.toMMPattern()\n /* c8 ignore stop */\n const glob = this.toString()\n const [re, body, hasMagic, uflag] = this.toRegExpSource()\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic =\n hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase())\n if (!anyMagic) {\n return body\n }\n\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n })\n }\n\n get options() {\n return this.#options\n }\n\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(\n allowDot?: boolean,\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n const dot = allowDot ?? !!this.#options.dot\n if (this.#root === this) {\n this.#flatten()\n this.#fillNegs()\n }\n if (!isExtglobAST(this)) {\n const noEmpty =\n this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string')\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] =\n typeof p === 'string' ?\n AST.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot)\n this.#hasMagic = this.#hasMagic || hasMagic\n this.#uflag = this.#uflag || uflag\n return re\n })\n .join('')\n\n let start = ''\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed =\n this.#parts.length === 1 && justDots.has(this.#parts[0])\n if (!dotTravAllowed) {\n const aps = addPatternStart\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav =\n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : ''\n }\n }\n }\n\n // append the \"end of path portion\" pattern to negation tails\n let end = ''\n if (\n this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!'\n ) {\n end = '(?:$|\\\\/)'\n }\n const final = start + src + end\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n\n const repeated = this.type === '*' || this.type === '+'\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString()\n const me = this as AST\n me.#parts = [s]\n me.type = null\n me.#hasMagic = undefined\n return [s, unescape(this.toString()), false, false]\n }\n\n let bodyDotAllowed =\n !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true)\n if (bodyDotAllowed === body) {\n bodyDotAllowed = ''\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`\n }\n\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = ''\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n } else {\n const close =\n this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`\n final = start + body + close\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten()\n }\n }\n } else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0\n let done = false\n do {\n done = true\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i]\n if (typeof c === 'object') {\n c.#flatten()\n if (this.#canAdopt(c)) {\n done = false\n this.#adopt(c, i)\n } else if (this.#canAdoptWithSpace(c)) {\n done = false\n ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n } else if (this.#canUsurp(c)) {\n done = false\n ;(this as AST & { type: ExtglobType }).#usurp(c)\n }\n }\n }\n } while (!done && ++iterations < 10)\n }\n this.#toString = undefined\n }\n\n #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??')\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n this.#uflag = this.#uflag || uflag\n return re\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|')\n }\n\n static #parseGlob(\n glob: string,\n hasMagic: boolean | undefined,\n noEmpty: boolean = false,\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n let escaping = false\n let re = ''\n let uflag = false\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i)\n if (escaping) {\n escaping = false\n re += (reSpecials.has(c) ? '\\\\' : '') + c\n continue\n }\n if (c === '*') {\n if (inStar) continue\n inStar = true\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n hasMagic = true\n continue\n } else {\n inStar = false\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\'\n } else {\n escaping = true\n }\n continue\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i)\n if (consumed) {\n re += src\n uflag = uflag || needUflag\n i += consumed - 1\n hasMagic = hasMagic || magic\n continue\n }\n }\n if (c === '?') {\n re += qmark\n hasMagic = true\n continue\n }\n re += regExpEscape(c)\n }\n return [re, unescape(glob), !!hasMagic, uflag]\n }\n}\n"]} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts b/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts new file mode 100644 index 00000000..b1572deb --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts @@ -0,0 +1,8 @@ +export type ParseClassResult = [ + src: string, + uFlag: boolean, + consumed: number, + hasMagic: boolean +]; +export declare const parseClass: (glob: string, position: number) => ParseClassResult; +//# sourceMappingURL=brace-expressions.d.ts.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map b/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map new file mode 100644 index 00000000..09b4c110 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/brace-expressions.js b/node_modules/minimatch/dist/commonjs/brace-expressions.js new file mode 100644 index 00000000..2b7b0371 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/brace-expressions.js @@ -0,0 +1,150 @@ +"use strict"; +// translate the various posix character classes into unicode properties +// this works across all unicode locales +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseClass = void 0; +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')' + : ranges.length ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; +exports.parseClass = parseClass; +//# sourceMappingURL=brace-expressions.js.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/brace-expressions.js.map b/node_modules/minimatch/dist/commonjs/brace-expressions.js.map new file mode 100644 index 00000000..3cc3b343 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/brace-expressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,wCAAwC;;;AAExC,8DAA8D;AAC9D,MAAM,YAAY,GAChB;IACE,WAAW,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC;IAC7C,WAAW,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,UAAU,EAAE,CAAC,6BAA6B,EAAE,IAAI,CAAC;IACjD,YAAY,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;CACnC,CAAA;AAEH,+DAA+D;AAC/D,mBAAmB;AACnB,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AACjE,qCAAqC;AACrC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CACjC,CAAC,CAAC,OAAO,CAAC,0BAA0B,EAAE,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AK,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,MAAM,EACP,CAAC;QACD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAClE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;IACxE,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACpE,MAAM,IAAI,GACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG;QAChE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;YACzB,CAAC,CAAC,KAAK,CAAA;IAET,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA;AA9HY,QAAA,UAAU,cA8HtB","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n src: string,\n uFlag: boolean,\n consumed: number,\n hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n glob: string,\n position: number,\n): ParseClassResult => {\n const pos = position\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression')\n }\n /* c8 ignore stop */\n const ranges: string[] = []\n const negs: string[] = []\n\n let i = pos + 1\n let sawStart = false\n let uflag = false\n let escaping = false\n let negate = false\n let endPos = pos\n let rangeStart = ''\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i)\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true\n i++\n continue\n }\n\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1\n break\n }\n\n sawStart = true\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true\n i++\n continue\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true]\n }\n i += cls.length\n if (neg) negs.push(unip)\n else ranges.push(unip)\n uflag = uflag || u\n continue WHILE\n }\n }\n }\n\n // now it's just a normal character, effectively\n escaping = false\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n } else if (c === rangeStart) {\n ranges.push(braceEscape(c))\n }\n rangeStart = ''\n i++\n continue\n }\n\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'))\n i += 2\n continue\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c\n i += 2\n continue\n }\n\n // not the start of a range, just a single character\n ranges.push(braceEscape(c))\n i++\n }\n\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false]\n }\n\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true]\n }\n\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (\n negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate\n ) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n return [regexpEscape(r), false, endPos - pos, false]\n }\n\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n const comb =\n ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs\n\n return [comb, uflag, endPos - pos, true]\n}\n"]} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/escape.d.ts b/node_modules/minimatch/dist/commonjs/escape.d.ts new file mode 100644 index 00000000..141024a0 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/escape.d.ts @@ -0,0 +1,15 @@ +import type { MinimatchOptions } from './index.js'; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link MinimatchOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + * + * If the {@link MinimatchOptions.magicalBraces} option is used, + * then braces (`{` and `}`) will be escaped. + */ +export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +//# sourceMappingURL=escape.d.ts.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/escape.d.ts.map b/node_modules/minimatch/dist/commonjs/escape.d.ts.map new file mode 100644 index 00000000..e167e300 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/escape.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/escape.js b/node_modules/minimatch/dist/commonjs/escape.js new file mode 100644 index 00000000..83a713a2 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/escape.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escape = void 0; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link MinimatchOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + * + * If the {@link MinimatchOptions.magicalBraces} option is used, + * then braces (`{` and `}`) will be escaped. + */ +const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + if (magicalBraces) { + return windowsPathsNoEscape ? + s.replace(/[?*()[\]{}]/g, '[$&]') + : s.replace(/[?*()[\]\\{}]/g, '\\$&'); + } + return windowsPathsNoEscape ? + s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; +exports.escape = escape; +//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/escape.js.map b/node_modules/minimatch/dist/commonjs/escape.js.map new file mode 100644 index 00000000..f963f0a1 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/escape.js.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACI,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA;AAlBY,QAAA,MAAM,UAkBlB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = false,\n }: Pick = {},\n) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/index.d.ts b/node_modules/minimatch/dist/commonjs/index.d.ts new file mode 100644 index 00000000..7e1fc2ed --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/index.d.ts @@ -0,0 +1,174 @@ +import { AST } from './ast.js'; +export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; +export interface MinimatchOptions { + /** do not expand `{x,y}` style braces */ + nobrace?: boolean; + /** do not treat patterns starting with `#` as a comment */ + nocomment?: boolean; + /** do not treat patterns starting with `!` as a negation */ + nonegate?: boolean; + /** print LOTS of debugging output */ + debug?: boolean; + /** treat `**` the same as `*` */ + noglobstar?: boolean; + /** do not expand extglobs like `+(a|b)` */ + noext?: boolean; + /** return the pattern if nothing matches */ + nonull?: boolean; + /** treat `\\` as a path separator, not an escape character */ + windowsPathsNoEscape?: boolean; + /** + * inverse of {@link MinimatchOptions.windowsPathsNoEscape} + * @deprecated + */ + allowWindowsEscape?: boolean; + /** + * Compare a partial path to a pattern. As long as the parts + * of the path that are present are not contradicted by the + * pattern, it will be treated as a match. This is useful in + * applications where you're walking through a folder structure, + * and don't yet have the full path, but want to ensure that you + * do not walk down paths that can never be a match. + */ + partial?: boolean; + /** allow matches that start with `.` even if the pattern does not */ + dot?: boolean; + /** ignore case */ + nocase?: boolean; + /** ignore case only in wildcard patterns */ + nocaseMagicOnly?: boolean; + /** consider braces to be "magic" for the purpose of `hasMagic` */ + magicalBraces?: boolean; + /** + * If set, then patterns without slashes will be matched + * against the basename of the path if it contains slashes. + * For example, `a?b` would match the path `/xyz/123/acb`, but + * not `/xyz/acb/123`. + */ + matchBase?: boolean; + /** invert the results of negated matches */ + flipNegate?: boolean; + /** do not collapse multiple `/` into a single `/` */ + preserveMultipleSlashes?: boolean; + /** + * A number indicating the level of optimization that should be done + * to the pattern prior to parsing and using it for matches. + */ + optimizationLevel?: number; + /** operating system platform */ + platform?: Platform; + /** + * When a pattern starts with a UNC path or drive letter, and in + * `nocase:true` mode, do not convert the root portions of the + * pattern into a case-insensitive regular expression, and instead + * leave them as strings. + * + * This is the default when the platform is `win32` and + * `nocase:true` is set. + */ + windowsNoMagicRoot?: boolean; + /** + * max number of `{...}` patterns to expand. Default 100_000. + */ + braceExpandMax?: number; + /** + * Max number of non-adjacent `**` patterns to recursively walk down. + * + * The default of 200 is almost certainly high enough for most purposes, + * and can handle absurdly excessive patterns. + */ + maxGlobstarRecursion?: number; + /** + * Max depth to traverse for nested extglobs like `*(a|b|c)` + * + * Default is 2, which is quite low, but any higher value + * swiftly results in punishing performance impacts. Note + * that this is *not* relevant when the globstar types can + * be safely coalesced into a single set. + * + * For example, `*(a|@(b|c)|d)` would be flattened into + * `*(a|b|c|d)`. Thus, many common extglobs will retain good + * performance and never hit this limit, even if they are + * excessively deep and complicated. + * + * If the limit is hit, then the extglob characters are simply + * not parsed, and the pattern effectively switches into + * `noextglob: true` mode for the contents of that nested + * sub-pattern. This will typically _not_ result in a match, + * but is considered a valid trade-off for security and + * performance. + */ + maxExtglobRecursion?: number; +} +export declare const minimatch: { + (p: string, pattern: string, options?: MinimatchOptions): boolean; + sep: Sep; + GLOBSTAR: typeof GLOBSTAR; + filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; + defaults: (def: MinimatchOptions) => typeof minimatch; + braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; + makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; + match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; + AST: typeof AST; + Minimatch: typeof Minimatch; + escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; + unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +}; +export type Sep = '\\' | '/'; +export declare const sep: Sep; +export declare const GLOBSTAR: unique symbol; +export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; +export declare const defaults: (def: MinimatchOptions) => typeof minimatch; +export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; +export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; +export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; +export type MMRegExp = RegExp & { + _src?: string; + _glob?: string; +}; +export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR; +export type ParseReturn = ParseReturnFiltered | false; +export declare class Minimatch { + #private; + options: MinimatchOptions; + set: ParseReturnFiltered[][]; + pattern: string; + windowsPathsNoEscape: boolean; + nonegate: boolean; + negate: boolean; + comment: boolean; + empty: boolean; + preserveMultipleSlashes: boolean; + partial: boolean; + globSet: string[]; + globParts: string[][]; + nocase: boolean; + isWindows: boolean; + platform: Platform; + windowsNoMagicRoot: boolean; + maxGlobstarRecursion: number; + regexp: false | null | MMRegExp; + constructor(pattern: string, options?: MinimatchOptions); + hasMagic(): boolean; + debug(..._: unknown[]): void; + make(): void; + preprocess(globParts: string[][]): string[][]; + adjascentGlobstarOptimize(globParts: string[][]): string[][]; + levelOneOptimize(globParts: string[][]): string[][]; + levelTwoFileOptimize(parts: string | string[]): string[]; + firstPhasePreProcess(globParts: string[][]): string[][]; + secondPhasePreProcess(globParts: string[][]): string[][]; + partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[]; + parseNegate(): void; + matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean; + braceExpand(): string[]; + parse(pattern: string): ParseReturn; + makeRe(): false | MMRegExp; + slashSplit(p: string): string[]; + match(f: string, partial?: boolean): boolean; + static defaults(def: MinimatchOptions): typeof Minimatch; +} +export { AST } from './ast.js'; +export { escape } from './escape.js'; +export { unescape } from './unescape.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/index.d.ts.map b/node_modules/minimatch/dist/commonjs/index.d.ts.map new file mode 100644 index 00000000..7620db91 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OA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W,EAAE,EACtB,OAAO,GAAE,OAAe;IAiX1B,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"} \ No newline at end of file diff --git a/node_modules/minimatch/dist/commonjs/index.js b/node_modules/minimatch/dist/commonjs/index.js new file mode 100644 index 00000000..5a698348 --- /dev/null +++ b/node_modules/minimatch/dist/commonjs/index.js @@ -0,0 +1,1127 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; +const brace_expansion_1 = require("brace-expansion"); +const assert_valid_pattern_js_1 = require("./assert-valid-pattern.js"); +const ast_js_1 = require("./ast.js"); +const escape_js_1 = require("./escape.js"); +const unescape_js_1 = require("./unescape.js"); +const minimatch = (p, pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +exports.minimatch = minimatch; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?*[(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?*[(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform = (typeof process === 'object' && process ? + (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; +exports.minimatch.sep = exports.sep; +exports.GLOBSTAR = Symbol('globstar **'); +exports.minimatch.GLOBSTAR = exports.GLOBSTAR; +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options); +exports.filter = filter; +exports.minimatch.filter = exports.filter; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return exports.minimatch; + } + const orig = exports.minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: exports.GLOBSTAR, + }); +}; +exports.defaults = defaults; +exports.minimatch.defaults = exports.defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }); +}; +exports.braceExpand = braceExpand; +exports.minimatch.braceExpand = exports.braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +exports.makeRe = makeRe; +exports.minimatch.makeRe = exports.makeRe; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +exports.match = match; +exports.minimatch.match = exports.match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + maxGlobstarRecursion; + regexp; + constructor(pattern, options = {}) { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + options = options || {}; + this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; + // avoid the annoying deprecation flag lol + const awe = ('allowWindow' + 'sEscape'); + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options[awe] === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined ? + options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + //oxlint-disable-next-line no-console + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [ + ...s.slice(0, 4), + ...s.slice(4).map(ss => this.parse(ss)), + ]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn ** into * + if (this.options.noglobstar) { + for (const partset of globParts) { + for (let j = 0; j < partset.length; j++) { + if (partset[j] === '**') { + partset[j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + // just collapse multiple ** portions into one + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //

// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p &&
+                    p !== '.' &&
+                    p !== '..' &&
+                    p !== '**' &&
+                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        let fileStartIndex = 0;
+        let patternStartIndex = 0;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3
+                : fileDrive ? 0
+                    : undefined;
+            const pdi = patternUNC ? 3
+                : patternDrive ? 0
+                    : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [
+                    file[fdi],
+                    pattern[pdi],
+                ];
+                // start matching at the drive letter index of each
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    patternStartIndex = pdi;
+                    fileStartIndex = fdi;
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // don't need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        if (pattern.includes(exports.GLOBSTAR)) {
+            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
+        }
+        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+    }
+    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
+        // split the pattern into head, tail, and middle of ** delimited parts
+        const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex);
+        const lastgs = pattern.lastIndexOf(exports.GLOBSTAR);
+        // split the pattern up into globstar-delimited sections
+        // the tail has to be at the end, and the others just have
+        // to be found in order from the head.
+        const [head, body, tail] = partial ?
+            [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1),
+                [],
+            ]
+            : [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1, lastgs),
+                pattern.slice(lastgs + 1),
+            ];
+        // check the head, from the current file/pattern index.
+        if (head.length) {
+            const fileHead = file.slice(fileIndex, fileIndex + head.length);
+            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
+                return false;
+            }
+            fileIndex += head.length;
+            patternIndex += head.length;
+        }
+        // now we know the head matches!
+        // if the last portion is not empty, it MUST match the end
+        // check the tail
+        let fileTailMatch = 0;
+        if (tail.length) {
+            // if head + tail > file, then we cannot possibly match
+            if (tail.length + fileIndex > file.length)
+                return false;
+            // try to match the tail
+            let tailStart = file.length - tail.length;
+            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
+                fileTailMatch = tail.length;
+            }
+            else {
+                // affordance for stuff like a/**/* matching a/b/
+                // if the last file portion is '', and there's more to the pattern
+                // then try without the '' bit.
+                if (file[file.length - 1] !== '' ||
+                    fileIndex + tail.length === file.length) {
+                    return false;
+                }
+                tailStart--;
+                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
+                    return false;
+                }
+                fileTailMatch = tail.length + 1;
+            }
+        }
+        // now we know the tail matches!
+        // the middle is zero or more portions wrapped in **, possibly
+        // containing more ** sections.
+        // so a/**/b/**/c/**/d has become **/b/**/c/**
+        // if it's empty, it means a/**/b, just verify we have no bad dots
+        // if there's no tail, so it ends on /**, then we must have *something*
+        // after the head, or it's not a matc
+        if (!body.length) {
+            let sawSome = !!fileTailMatch;
+            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
+                const f = String(file[i]);
+                sawSome = true;
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            // in partial mode, we just need to get past all file parts
+            return partial || sawSome;
+        }
+        // now we know that there's one or more body sections, which can
+        // be matched anywhere from the 0 index (because the head was pruned)
+        // through to the length-fileTailMatch index.
+        // split the body up into sections, and note the minimum index it can
+        // be found at (start with the length of all previous segments)
+        // [section, before, after]
+        const bodySegments = [[[], 0]];
+        let currentBody = bodySegments[0];
+        let nonGsParts = 0;
+        const nonGsPartsSums = [0];
+        for (const b of body) {
+            if (b === exports.GLOBSTAR) {
+                nonGsPartsSums.push(nonGsParts);
+                currentBody = [[], 0];
+                bodySegments.push(currentBody);
+            }
+            else {
+                currentBody[0].push(b);
+                nonGsParts++;
+            }
+        }
+        let i = bodySegments.length - 1;
+        const fileLength = file.length - fileTailMatch;
+        for (const b of bodySegments) {
+            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+        }
+        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+    }
+    // return false for "nope, not matching"
+    // return null for "not matching, cannot keep trying"
+    #matchGlobStarBodySections(file, 
+    // pattern section, last possible position for it
+    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
+        // take the first body segment, and walk from fileIndex to its "after"
+        // value at the end
+        // If it doesn't match at that position, we increment, until we hit
+        // that final possible position, and give up.
+        // If it does match, then advance and try to rest.
+        // If any of them fail we keep walking forward.
+        // this is still a bit recursively painful, but it's more constrained
+        // than previous implementations, because we never test something that
+        // can't possibly be a valid matching condition.
+        const bs = bodySegments[bodyIndex];
+        if (!bs) {
+            // just make sure that there's no bad dots
+            for (let i = fileIndex; i < file.length; i++) {
+                sawTail = true;
+                const f = file[i];
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            return sawTail;
+        }
+        // have a non-globstar body section to test
+        const [body, after] = bs;
+        while (fileIndex <= after) {
+            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
+            // if limit exceeded, no match. intentional false negative,
+            // acceptable break in correctness for security.
+            if (m && globStarDepth < this.maxGlobstarRecursion) {
+                // match! see if the rest match. if so, we're done!
+                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
+                if (sub !== false) {
+                    return sub;
+                }
+            }
+            const f = file[fileIndex];
+            if (f === '.' ||
+                f === '..' ||
+                (!this.options.dot && f.startsWith('.'))) {
+                return false;
+            }
+            fileIndex++;
+        }
+        // walked off. no point continuing
+        return partial || null;
+    }
+    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
+        let fi;
+        let pi;
+        let pl;
+        let fl;
+        for (fi = fileIndex,
+            pi = patternIndex,
+            fl = file.length,
+            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            let p = pattern[pi];
+            let f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false || p === exports.GLOBSTAR) {
+                return false;
+            }
+            /* c8 ignore stop */
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return (0, exports.braceExpand)(this.pattern, this.options);
+    }
+    parse(pattern) {
+        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return exports.GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar ? star
+            : options.dot ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return (typeof p === 'string' ? regExpEscape(p)
+                    : p === exports.GLOBSTAR ? exports.GLOBSTAR
+                        : p._src);
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== exports.GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
+                }
+                else if (next !== exports.GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = exports.GLOBSTAR;
+                }
+            });
+            const filtered = pp.filter(p => p !== exports.GLOBSTAR);
+            // For partial matches, we need to make the pattern match
+            // any prefix of the full path. We do this by generating
+            // alternative patterns that match progressively longer prefixes.
+            if (this.partial && filtered.length >= 1) {
+                const prefixes = [];
+                for (let i = 1; i <= filtered.length; i++) {
+                    prefixes.push(filtered.slice(0, i).join('/'));
+                }
+                return '(?:' + prefixes.join('|') + ')';
+            }
+            return filtered.join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // In partial mode, '/' should always match as it's a valid prefix for any pattern
+        if (this.partial) {
+            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
+        }
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (const pattern of set) {
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return exports.minimatch.defaults(def).Minimatch;
+    }
+}
+exports.Minimatch = Minimatch;
+/* c8 ignore start */
+var ast_js_2 = require("./ast.js");
+Object.defineProperty(exports, "AST", { enumerable: true, get: function () { return ast_js_2.AST; } });
+var escape_js_2 = require("./escape.js");
+Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
+var unescape_js_2 = require("./unescape.js");
+Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return unescape_js_2.unescape; } });
+/* c8 ignore stop */
+exports.minimatch.AST = ast_js_1.AST;
+exports.minimatch.Minimatch = Minimatch;
+exports.minimatch.escape = escape_js_1.escape;
+exports.minimatch.unescape = unescape_js_1.unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/commonjs/index.js.map b/node_modules/minimatch/dist/commonjs/index.js.map
new file mode 100644
index 00000000..f0b81f03
--- /dev/null
+++ b/node_modules/minimatch/dist/commonjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAwC;AACxC,uEAA8D;AAE9D,qCAA8B;AAC9B,2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B,iBAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,iBAAS,CAAC,MAAM,GAAG,kBAAM,CAAA;AACzB,iBAAS,CAAC,QAAQ,GAAG,sBAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/commonjs/package.json b/node_modules/minimatch/dist/commonjs/package.json
new file mode 100644
index 00000000..5bbefffb
--- /dev/null
+++ b/node_modules/minimatch/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
diff --git a/node_modules/minimatch/dist/commonjs/unescape.d.ts b/node_modules/minimatch/dist/commonjs/unescape.d.ts
new file mode 100644
index 00000000..c4a14473
--- /dev/null
+++ b/node_modules/minimatch/dist/commonjs/unescape.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=unescape.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/commonjs/unescape.d.ts.map b/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
new file mode 100644
index 00000000..09d6eab4
--- /dev/null
+++ b/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/commonjs/unescape.js b/node_modules/minimatch/dist/commonjs/unescape.js
new file mode 100644
index 00000000..ad648fba
--- /dev/null
+++ b/node_modules/minimatch/dist/commonjs/unescape.js
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.unescape = void 0;
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/\[([^/\\])\]/g, '$1')
+            : s
+                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
+                .replace(/\\([^/])/g, '$1');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/\[([^/\\{}])\]/g, '$1')
+        : s
+            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
+            .replace(/\\([^/{}])/g, '$1');
+};
+exports.unescape = unescape;
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/commonjs/unescape.js.map b/node_modules/minimatch/dist/commonjs/unescape.js.map
new file mode 100644
index 00000000..44387ec5
--- /dev/null
+++ b/node_modules/minimatch/dist/commonjs/unescape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEI,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts b/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts
new file mode 100644
index 00000000..34d7a78a
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts
@@ -0,0 +1,2 @@
+export declare const assertValidPattern: (pattern: unknown) => void;
+//# sourceMappingURL=assert-valid-pattern.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map b/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
new file mode 100644
index 00000000..30ddcd51
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/assert-valid-pattern.js b/node_modules/minimatch/dist/esm/assert-valid-pattern.js
new file mode 100644
index 00000000..7b534fc3
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/assert-valid-pattern.js
@@ -0,0 +1,10 @@
+const MAX_PATTERN_LENGTH = 1024 * 64;
+export const assertValidPattern = (pattern) => {
+    if (typeof pattern !== 'string') {
+        throw new TypeError('invalid pattern');
+    }
+    if (pattern.length > MAX_PATTERN_LENGTH) {
+        throw new TypeError('pattern is too long');
+    }
+};
+//# sourceMappingURL=assert-valid-pattern.js.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map b/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
new file mode 100644
index 00000000..550f61df
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n  pattern: unknown,\n): asserts pattern is string => {\n  if (typeof pattern !== 'string') {\n    throw new TypeError('invalid pattern')\n  }\n\n  if (pattern.length > MAX_PATTERN_LENGTH) {\n    throw new TypeError('pattern is too long')\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/ast.d.ts b/node_modules/minimatch/dist/esm/ast.d.ts
new file mode 100644
index 00000000..74f2cf93
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/ast.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions, MMRegExp } from './index.js';
+export type ExtglobType = '!' | '?' | '+' | '*' | '@';
+export declare class AST {
+    #private;
+    type: ExtglobType | null;
+    id: number;
+    get depth(): number;
+    constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
+    get hasMagic(): boolean | undefined;
+    toString(): string;
+    push(...parts: (string | AST)[]): void;
+    toJSON(): unknown[];
+    isStart(): boolean;
+    isEnd(): boolean;
+    copyIn(part: AST | string): void;
+    clone(parent: AST): AST;
+    static fromGlob(pattern: string, options?: MinimatchOptions): AST;
+    toMMPattern(): MMRegExp | string;
+    get options(): MinimatchOptions;
+    toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
+}
+//# sourceMappingURL=ast.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/ast.d.ts.map b/node_modules/minimatch/dist/esm/ast.d.ts.map
new file mode 100644
index 00000000..8965fd6a
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/ast.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/ast.js b/node_modules/minimatch/dist/esm/ast.js
new file mode 100644
index 00000000..f6395465
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/ast.js
@@ -0,0 +1,841 @@
+// parse a single path portion
+var _a;
+import { parseClass } from './brace-expressions.js';
+import { unescape } from './unescape.js';
+const types = new Set(['!', '?', '+', '*', '@']);
+const isExtglobType = (c) => types.has(c);
+const isExtglobAST = (c) => isExtglobType(c.type);
+// Map of which extglob types can adopt the children of a nested extglob
+//
+// anything but ! can adopt a matching type:
+// +(a|+(b|c)|d) => +(a|b|c|d)
+// *(a|*(b|c)|d) => *(a|b|c|d)
+// @(a|@(b|c)|d) => @(a|b|c|d)
+// ?(a|?(b|c)|d) => ?(a|b|c|d)
+//
+// * can adopt anything, because 0 or repetition is allowed
+// *(a|?(b|c)|d) => *(a|b|c|d)
+// *(a|+(b|c)|d) => *(a|b|c|d)
+// *(a|@(b|c)|d) => *(a|b|c|d)
+//
+// + can adopt @, because 1 or repetition is allowed
+// +(a|@(b|c)|d) => +(a|b|c|d)
+//
+// + and @ CANNOT adopt *, because 0 would be allowed
+// +(a|*(b|c)|d) => would match "", on *(b|c)
+// @(a|*(b|c)|d) => would match "", on *(b|c)
+//
+// + and @ CANNOT adopt ?, because 0 would be allowed
+// +(a|?(b|c)|d) => would match "", on ?(b|c)
+// @(a|?(b|c)|d) => would match "", on ?(b|c)
+//
+// ? can adopt @, because 0 or 1 is allowed
+// ?(a|@(b|c)|d) => ?(a|b|c|d)
+//
+// ? and @ CANNOT adopt * or +, because >1 would be allowed
+// ?(a|*(b|c)|d) => would match bbb on *(b|c)
+// @(a|*(b|c)|d) => would match bbb on *(b|c)
+// ?(a|+(b|c)|d) => would match bbb on +(b|c)
+// @(a|+(b|c)|d) => would match bbb on +(b|c)
+//
+// ! CANNOT adopt ! (nothing else can either)
+// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
+//
+// ! can adopt @
+// !(a|@(b|c)|d) => !(a|b|c|d)
+//
+// ! CANNOT adopt *
+// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
+//
+// ! CANNOT adopt +
+// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
+//
+// ! CANNOT adopt ?
+// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
+const adoptionMap = new Map([
+    ['!', ['@']],
+    ['?', ['?', '@']],
+    ['@', ['@']],
+    ['*', ['*', '+', '?', '@']],
+    ['+', ['+', '@']],
+]);
+// nested extglobs that can be adopted in, but with the addition of
+// a blank '' element.
+const adoptionWithSpaceMap = new Map([
+    ['!', ['?']],
+    ['@', ['?']],
+    ['+', ['?', '*']],
+]);
+// union of the previous two maps
+const adoptionAnyMap = new Map([
+    ['!', ['?', '@']],
+    ['?', ['?', '@']],
+    ['@', ['?', '@']],
+    ['*', ['*', '+', '?', '@']],
+    ['+', ['+', '@', '?', '*']],
+]);
+// Extglobs that can take over their parent if they are the only child
+// the key is parent, value maps child to resulting extglob parent type
+// '@' is omitted because it's a special case. An `@` extglob with a single
+// member can always be usurped by that subpattern.
+const usurpMap = new Map([
+    ['!', new Map([['!', '@']])],
+    [
+        '?',
+        new Map([
+            ['*', '*'],
+            ['+', '*'],
+        ]),
+    ],
+    [
+        '@',
+        new Map([
+            ['!', '!'],
+            ['?', '?'],
+            ['@', '@'],
+            ['*', '*'],
+            ['+', '+'],
+        ]),
+    ],
+    [
+        '+',
+        new Map([
+            ['?', '*'],
+            ['*', '*'],
+        ]),
+    ],
+]);
+// Patterns that get prepended to bind to the start of either the
+// entire string, or just a single path portion, to prevent dots
+// and/or traversal patterns, when needed.
+// Exts don't need the ^ or / bit, because the root binds that already.
+const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
+const startNoDot = '(?!\\.)';
+// characters that indicate a start of pattern needs the "no dots" bit,
+// because a dot *might* be matched. ( is not in the list, because in
+// the case of a child extglob, it will handle the prevention itself.
+const addPatternStart = new Set(['[', '.']);
+// cases where traversal is A-OK, no dot prevention needed
+const justDots = new Set(['..', '.']);
+const reSpecials = new Set('().*{}+?[]^$\\!');
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// any single thing other than /
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// use + when we need to ensure that *something* matches, because the * is
+// the only thing in the path portion.
+const starNoEmpty = qmark + '+?';
+// remove the \ chars that we added if we end up doing a nonmagic compare
+// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
+let ID = 0;
+export class AST {
+    type;
+    #root;
+    #hasMagic;
+    #uflag = false;
+    #parts = [];
+    #parent;
+    #parentIndex;
+    #negs;
+    #filledNegs = false;
+    #options;
+    #toString;
+    // set to true if it's an extglob with no children
+    // (which really means one child of '')
+    #emptyExt = false;
+    id = ++ID;
+    get depth() {
+        return (this.#parent?.depth ?? -1) + 1;
+    }
+    [Symbol.for('nodejs.util.inspect.custom')]() {
+        return {
+            '@@type': 'AST',
+            id: this.id,
+            type: this.type,
+            root: this.#root.id,
+            parent: this.#parent?.id,
+            depth: this.depth,
+            partsLength: this.#parts.length,
+            parts: this.#parts,
+        };
+    }
+    constructor(type, parent, options = {}) {
+        this.type = type;
+        // extglobs are inherently magical
+        if (type)
+            this.#hasMagic = true;
+        this.#parent = parent;
+        this.#root = this.#parent ? this.#parent.#root : this;
+        this.#options = this.#root === this ? options : this.#root.#options;
+        this.#negs = this.#root === this ? [] : this.#root.#negs;
+        if (type === '!' && !this.#root.#filledNegs)
+            this.#negs.push(this);
+        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
+    }
+    get hasMagic() {
+        /* c8 ignore start */
+        if (this.#hasMagic !== undefined)
+            return this.#hasMagic;
+        /* c8 ignore stop */
+        for (const p of this.#parts) {
+            if (typeof p === 'string')
+                continue;
+            if (p.type || p.hasMagic)
+                return (this.#hasMagic = true);
+        }
+        // note: will be undefined until we generate the regexp src and find out
+        return this.#hasMagic;
+    }
+    // reconstructs the pattern
+    toString() {
+        return (this.#toString !== undefined ? this.#toString
+            : !this.type ?
+                (this.#toString = this.#parts.map(p => String(p)).join(''))
+                : (this.#toString =
+                    this.type +
+                        '(' +
+                        this.#parts.map(p => String(p)).join('|') +
+                        ')'));
+    }
+    #fillNegs() {
+        /* c8 ignore start */
+        if (this !== this.#root)
+            throw new Error('should only call on root');
+        if (this.#filledNegs)
+            return this;
+        /* c8 ignore stop */
+        // call toString() once to fill this out
+        this.toString();
+        this.#filledNegs = true;
+        let n;
+        while ((n = this.#negs.pop())) {
+            if (n.type !== '!')
+                continue;
+            // walk up the tree, appending everthing that comes AFTER parentIndex
+            let p = n;
+            let pp = p.#parent;
+            while (pp) {
+                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
+                    for (const part of n.#parts) {
+                        /* c8 ignore start */
+                        if (typeof part === 'string') {
+                            throw new Error('string part in extglob AST??');
+                        }
+                        /* c8 ignore stop */
+                        part.copyIn(pp.#parts[i]);
+                    }
+                }
+                p = pp;
+                pp = p.#parent;
+            }
+        }
+        return this;
+    }
+    push(...parts) {
+        for (const p of parts) {
+            if (p === '')
+                continue;
+            /* c8 ignore start */
+            if (typeof p !== 'string' &&
+                !(p instanceof _a && p.#parent === this)) {
+                throw new Error('invalid part: ' + p);
+            }
+            /* c8 ignore stop */
+            this.#parts.push(p);
+        }
+    }
+    toJSON() {
+        const ret = this.type === null ?
+            this.#parts
+                .slice()
+                .map(p => (typeof p === 'string' ? p : p.toJSON()))
+            : [this.type, ...this.#parts.map(p => p.toJSON())];
+        if (this.isStart() && !this.type)
+            ret.unshift([]);
+        if (this.isEnd() &&
+            (this === this.#root ||
+                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
+            ret.push({});
+        }
+        return ret;
+    }
+    isStart() {
+        if (this.#root === this)
+            return true;
+        // if (this.type) return !!this.#parent?.isStart()
+        if (!this.#parent?.isStart())
+            return false;
+        if (this.#parentIndex === 0)
+            return true;
+        // if everything AHEAD of this is a negation, then it's still the "start"
+        const p = this.#parent;
+        for (let i = 0; i < this.#parentIndex; i++) {
+            const pp = p.#parts[i];
+            if (!(pp instanceof _a && pp.type === '!')) {
+                return false;
+            }
+        }
+        return true;
+    }
+    isEnd() {
+        if (this.#root === this)
+            return true;
+        if (this.#parent?.type === '!')
+            return true;
+        if (!this.#parent?.isEnd())
+            return false;
+        if (!this.type)
+            return this.#parent?.isEnd();
+        // if not root, it'll always have a parent
+        /* c8 ignore start */
+        const pl = this.#parent ? this.#parent.#parts.length : 0;
+        /* c8 ignore stop */
+        return this.#parentIndex === pl - 1;
+    }
+    copyIn(part) {
+        if (typeof part === 'string')
+            this.push(part);
+        else
+            this.push(part.clone(this));
+    }
+    clone(parent) {
+        const c = new _a(this.type, parent);
+        for (const p of this.#parts) {
+            c.copyIn(p);
+        }
+        return c;
+    }
+    static #parseAST(str, ast, pos, opt, extDepth) {
+        const maxDepth = opt.maxExtglobRecursion ?? 2;
+        let escaping = false;
+        let inBrace = false;
+        let braceStart = -1;
+        let braceNeg = false;
+        if (ast.type === null) {
+            // outside of a extglob, append until we find a start
+            let i = pos;
+            let acc = '';
+            while (i < str.length) {
+                const c = str.charAt(i++);
+                // still accumulate escapes at this point, but we do ignore
+                // starts that are escaped
+                if (escaping || c === '\\') {
+                    escaping = !escaping;
+                    acc += c;
+                    continue;
+                }
+                if (inBrace) {
+                    if (i === braceStart + 1) {
+                        if (c === '^' || c === '!') {
+                            braceNeg = true;
+                        }
+                    }
+                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                        inBrace = false;
+                    }
+                    acc += c;
+                    continue;
+                }
+                else if (c === '[') {
+                    inBrace = true;
+                    braceStart = i;
+                    braceNeg = false;
+                    acc += c;
+                    continue;
+                }
+                // we don't have to check for adoption here, because that's
+                // done at the other recursion point.
+                const doRecurse = !opt.noext &&
+                    isExtglobType(c) &&
+                    str.charAt(i) === '(' &&
+                    extDepth <= maxDepth;
+                if (doRecurse) {
+                    ast.push(acc);
+                    acc = '';
+                    const ext = new _a(c, ast);
+                    i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
+                    ast.push(ext);
+                    continue;
+                }
+                acc += c;
+            }
+            ast.push(acc);
+            return i;
+        }
+        // some kind of extglob, pos is at the (
+        // find the next | or )
+        let i = pos + 1;
+        let part = new _a(null, ast);
+        const parts = [];
+        let acc = '';
+        while (i < str.length) {
+            const c = str.charAt(i++);
+            // still accumulate escapes at this point, but we do ignore
+            // starts that are escaped
+            if (escaping || c === '\\') {
+                escaping = !escaping;
+                acc += c;
+                continue;
+            }
+            if (inBrace) {
+                if (i === braceStart + 1) {
+                    if (c === '^' || c === '!') {
+                        braceNeg = true;
+                    }
+                }
+                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                    inBrace = false;
+                }
+                acc += c;
+                continue;
+            }
+            else if (c === '[') {
+                inBrace = true;
+                braceStart = i;
+                braceNeg = false;
+                acc += c;
+                continue;
+            }
+            const doRecurse = !opt.noext &&
+                isExtglobType(c) &&
+                str.charAt(i) === '(' &&
+                /* c8 ignore start - the maxDepth is sufficient here */
+                (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
+            /* c8 ignore stop */
+            if (doRecurse) {
+                const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
+                part.push(acc);
+                acc = '';
+                const ext = new _a(c, part);
+                part.push(ext);
+                i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
+                continue;
+            }
+            if (c === '|') {
+                part.push(acc);
+                acc = '';
+                parts.push(part);
+                part = new _a(null, ast);
+                continue;
+            }
+            if (c === ')') {
+                if (acc === '' && ast.#parts.length === 0) {
+                    ast.#emptyExt = true;
+                }
+                part.push(acc);
+                acc = '';
+                ast.push(...parts, part);
+                return i;
+            }
+            acc += c;
+        }
+        // unfinished extglob
+        // if we got here, it was a malformed extglob! not an extglob, but
+        // maybe something else in there.
+        ast.type = null;
+        ast.#hasMagic = undefined;
+        ast.#parts = [str.substring(pos - 1)];
+        return i;
+    }
+    #canAdoptWithSpace(child) {
+        return this.#canAdopt(child, adoptionWithSpaceMap);
+    }
+    #canAdopt(child, map = adoptionMap) {
+        if (!child ||
+            typeof child !== 'object' ||
+            child.type !== null ||
+            child.#parts.length !== 1 ||
+            this.type === null) {
+            return false;
+        }
+        const gc = child.#parts[0];
+        if (!gc || typeof gc !== 'object' || gc.type === null) {
+            return false;
+        }
+        return this.#canAdoptType(gc.type, map);
+    }
+    #canAdoptType(c, map = adoptionAnyMap) {
+        return !!map.get(this.type)?.includes(c);
+    }
+    #adoptWithSpace(child, index) {
+        const gc = child.#parts[0];
+        const blank = new _a(null, gc, this.options);
+        blank.#parts.push('');
+        gc.push(blank);
+        this.#adopt(child, index);
+    }
+    #adopt(child, index) {
+        const gc = child.#parts[0];
+        this.#parts.splice(index, 1, ...gc.#parts);
+        for (const p of gc.#parts) {
+            if (typeof p === 'object')
+                p.#parent = this;
+        }
+        this.#toString = undefined;
+    }
+    #canUsurpType(c) {
+        const m = usurpMap.get(this.type);
+        return !!m?.has(c);
+    }
+    #canUsurp(child) {
+        if (!child ||
+            typeof child !== 'object' ||
+            child.type !== null ||
+            child.#parts.length !== 1 ||
+            this.type === null ||
+            this.#parts.length !== 1) {
+            return false;
+        }
+        const gc = child.#parts[0];
+        if (!gc || typeof gc !== 'object' || gc.type === null) {
+            return false;
+        }
+        return this.#canUsurpType(gc.type);
+    }
+    #usurp(child) {
+        const m = usurpMap.get(this.type);
+        const gc = child.#parts[0];
+        const nt = m?.get(gc.type);
+        /* c8 ignore start - impossible */
+        if (!nt)
+            return false;
+        /* c8 ignore stop */
+        this.#parts = gc.#parts;
+        for (const p of this.#parts) {
+            if (typeof p === 'object') {
+                p.#parent = this;
+            }
+        }
+        this.type = nt;
+        this.#toString = undefined;
+        this.#emptyExt = false;
+    }
+    static fromGlob(pattern, options = {}) {
+        const ast = new _a(null, undefined, options);
+        _a.#parseAST(pattern, ast, 0, options, 0);
+        return ast;
+    }
+    // returns the regular expression if there's magic, or the unescaped
+    // string if not.
+    toMMPattern() {
+        // should only be called on root
+        /* c8 ignore start */
+        if (this !== this.#root)
+            return this.#root.toMMPattern();
+        /* c8 ignore stop */
+        const glob = this.toString();
+        const [re, body, hasMagic, uflag] = this.toRegExpSource();
+        // if we're in nocase mode, and not nocaseMagicOnly, then we do
+        // still need a regular expression if we have to case-insensitively
+        // match capital/lowercase characters.
+        const anyMagic = hasMagic ||
+            this.#hasMagic ||
+            (this.#options.nocase &&
+                !this.#options.nocaseMagicOnly &&
+                glob.toUpperCase() !== glob.toLowerCase());
+        if (!anyMagic) {
+            return body;
+        }
+        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
+        return Object.assign(new RegExp(`^${re}$`, flags), {
+            _src: re,
+            _glob: glob,
+        });
+    }
+    get options() {
+        return this.#options;
+    }
+    // returns the string match, the regexp source, whether there's magic
+    // in the regexp (so a regular expression is required) and whether or
+    // not the uflag is needed for the regular expression (for posix classes)
+    // TODO: instead of injecting the start/end at this point, just return
+    // the BODY of the regexp, along with the start/end portions suitable
+    // for binding the start/end in either a joined full-path makeRe context
+    // (where we bind to (^|/), or a standalone matchPart context (where
+    // we bind to ^, and not /).  Otherwise slashes get duped!
+    //
+    // In part-matching mode, the start is:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: ^(?!\.\.?$)
+    // - if dots allowed or not possible: ^
+    // - if dots possible and not allowed: ^(?!\.)
+    // end is:
+    // - if not isEnd(): nothing
+    // - else: $
+    //
+    // In full-path matching mode, we put the slash at the START of the
+    // pattern, so start is:
+    // - if first pattern: same as part-matching mode
+    // - if not isStart(): nothing
+    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
+    // - if dots allowed or not possible: /
+    // - if dots possible and not allowed: /(?!\.)
+    // end is:
+    // - if last pattern, same as part-matching mode
+    // - else nothing
+    //
+    // Always put the (?:$|/) on negated tails, though, because that has to be
+    // there to bind the end of the negated pattern portion, and it's easier to
+    // just stick it in now rather than try to inject it later in the middle of
+    // the pattern.
+    //
+    // We can just always return the same end, and leave it up to the caller
+    // to know whether it's going to be used joined or in parts.
+    // And, if the start is adjusted slightly, can do the same there:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
+    // - if dots allowed or not possible: (?:/|^)
+    // - if dots possible and not allowed: (?:/|^)(?!\.)
+    //
+    // But it's better to have a simpler binding without a conditional, for
+    // performance, so probably better to return both start options.
+    //
+    // Then the caller just ignores the end if it's not the first pattern,
+    // and the start always gets applied.
+    //
+    // But that's always going to be $ if it's the ending pattern, or nothing,
+    // so the caller can just attach $ at the end of the pattern when building.
+    //
+    // So the todo is:
+    // - better detect what kind of start is needed
+    // - return both flavors of starting pattern
+    // - attach $ at the end of the pattern when creating the actual RegExp
+    //
+    // Ah, but wait, no, that all only applies to the root when the first pattern
+    // is not an extglob. If the first pattern IS an extglob, then we need all
+    // that dot prevention biz to live in the extglob portions, because eg
+    // +(*|.x*) can match .xy but not .yx.
+    //
+    // So, return the two flavors if it's #root and the first child is not an
+    // AST, otherwise leave it to the child AST to handle it, and there,
+    // use the (?:^|/) style of start binding.
+    //
+    // Even simplified further:
+    // - Since the start for a join is eg /(?!\.) and the start for a part
+    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
+    // or start or whatever) and prepend ^ or / at the Regexp construction.
+    toRegExpSource(allowDot) {
+        const dot = allowDot ?? !!this.#options.dot;
+        if (this.#root === this) {
+            this.#flatten();
+            this.#fillNegs();
+        }
+        if (!isExtglobAST(this)) {
+            const noEmpty = this.isStart() &&
+                this.isEnd() &&
+                !this.#parts.some(s => typeof s !== 'string');
+            const src = this.#parts
+                .map(p => {
+                const [re, _, hasMagic, uflag] = typeof p === 'string' ?
+                    _a.#parseGlob(p, this.#hasMagic, noEmpty)
+                    : p.toRegExpSource(allowDot);
+                this.#hasMagic = this.#hasMagic || hasMagic;
+                this.#uflag = this.#uflag || uflag;
+                return re;
+            })
+                .join('');
+            let start = '';
+            if (this.isStart()) {
+                if (typeof this.#parts[0] === 'string') {
+                    // this is the string that will match the start of the pattern,
+                    // so we need to protect against dots and such.
+                    // '.' and '..' cannot match unless the pattern is that exactly,
+                    // even if it starts with . or dot:true is set.
+                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
+                    if (!dotTravAllowed) {
+                        const aps = addPatternStart;
+                        // check if we have a possibility of matching . or ..,
+                        // and prevent that.
+                        const needNoTrav = 
+                        // dots are allowed, and the pattern starts with [ or .
+                        (dot && aps.has(src.charAt(0))) ||
+                            // the pattern starts with \., and then [ or .
+                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
+                            // the pattern starts with \.\., and then [ or .
+                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
+                        // no need to prevent dots if it can't match a dot, or if a
+                        // sub-pattern will be preventing it anyway.
+                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
+                        start =
+                            needNoTrav ? startNoTraversal
+                                : needNoDot ? startNoDot
+                                    : '';
+                    }
+                }
+            }
+            // append the "end of path portion" pattern to negation tails
+            let end = '';
+            if (this.isEnd() &&
+                this.#root.#filledNegs &&
+                this.#parent?.type === '!') {
+                end = '(?:$|\\/)';
+            }
+            const final = start + src + end;
+            return [
+                final,
+                unescape(src),
+                (this.#hasMagic = !!this.#hasMagic),
+                this.#uflag,
+            ];
+        }
+        // We need to calculate the body *twice* if it's a repeat pattern
+        // at the start, once in nodot mode, then again in dot mode, so a
+        // pattern like *(?) can match 'x.y'
+        const repeated = this.type === '*' || this.type === '+';
+        // some kind of extglob
+        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
+        let body = this.#partsToRegExp(dot);
+        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
+            // invalid extglob, has to at least be *something* present, if it's
+            // the entire path portion.
+            const s = this.toString();
+            const me = this;
+            me.#parts = [s];
+            me.type = null;
+            me.#hasMagic = undefined;
+            return [s, unescape(this.toString()), false, false];
+        }
+        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
+            ''
+            : this.#partsToRegExp(true);
+        if (bodyDotAllowed === body) {
+            bodyDotAllowed = '';
+        }
+        if (bodyDotAllowed) {
+            body = `(?:${body})(?:${bodyDotAllowed})*?`;
+        }
+        // an empty !() is exactly equivalent to a starNoEmpty
+        let final = '';
+        if (this.type === '!' && this.#emptyExt) {
+            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
+        }
+        else {
+            const close = this.type === '!' ?
+                // !() must match something,but !(x) can match ''
+                '))' +
+                    (this.isStart() && !dot && !allowDot ? startNoDot : '') +
+                    star +
+                    ')'
+                : this.type === '@' ? ')'
+                    : this.type === '?' ? ')?'
+                        : this.type === '+' && bodyDotAllowed ? ')'
+                            : this.type === '*' && bodyDotAllowed ? `)?`
+                                : `)${this.type}`;
+            final = start + body + close;
+        }
+        return [
+            final,
+            unescape(body),
+            (this.#hasMagic = !!this.#hasMagic),
+            this.#uflag,
+        ];
+    }
+    #flatten() {
+        if (!isExtglobAST(this)) {
+            for (const p of this.#parts) {
+                if (typeof p === 'object') {
+                    p.#flatten();
+                }
+            }
+        }
+        else {
+            // do up to 10 passes to flatten as much as possible
+            let iterations = 0;
+            let done = false;
+            do {
+                done = true;
+                for (let i = 0; i < this.#parts.length; i++) {
+                    const c = this.#parts[i];
+                    if (typeof c === 'object') {
+                        c.#flatten();
+                        if (this.#canAdopt(c)) {
+                            done = false;
+                            this.#adopt(c, i);
+                        }
+                        else if (this.#canAdoptWithSpace(c)) {
+                            done = false;
+                            this.#adoptWithSpace(c, i);
+                        }
+                        else if (this.#canUsurp(c)) {
+                            done = false;
+                            this.#usurp(c);
+                        }
+                    }
+                }
+            } while (!done && ++iterations < 10);
+        }
+        this.#toString = undefined;
+    }
+    #partsToRegExp(dot) {
+        return this.#parts
+            .map(p => {
+            // extglob ASTs should only contain parent ASTs
+            /* c8 ignore start */
+            if (typeof p === 'string') {
+                throw new Error('string type in extglob ast??');
+            }
+            /* c8 ignore stop */
+            // can ignore hasMagic, because extglobs are already always magic
+            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
+            this.#uflag = this.#uflag || uflag;
+            return re;
+        })
+            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
+            .join('|');
+    }
+    static #parseGlob(glob, hasMagic, noEmpty = false) {
+        let escaping = false;
+        let re = '';
+        let uflag = false;
+        // multiple stars that aren't globstars coalesce into one *
+        let inStar = false;
+        for (let i = 0; i < glob.length; i++) {
+            const c = glob.charAt(i);
+            if (escaping) {
+                escaping = false;
+                re += (reSpecials.has(c) ? '\\' : '') + c;
+                continue;
+            }
+            if (c === '*') {
+                if (inStar)
+                    continue;
+                inStar = true;
+                re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
+                hasMagic = true;
+                continue;
+            }
+            else {
+                inStar = false;
+            }
+            if (c === '\\') {
+                if (i === glob.length - 1) {
+                    re += '\\\\';
+                }
+                else {
+                    escaping = true;
+                }
+                continue;
+            }
+            if (c === '[') {
+                const [src, needUflag, consumed, magic] = parseClass(glob, i);
+                if (consumed) {
+                    re += src;
+                    uflag = uflag || needUflag;
+                    i += consumed - 1;
+                    hasMagic = hasMagic || magic;
+                    continue;
+                }
+            }
+            if (c === '?') {
+                re += qmark;
+                hasMagic = true;
+                continue;
+            }
+            re += regExpEscape(c);
+        }
+        return [re, unescape(glob), !!hasMagic, uflag];
+    }
+}
+_a = AST;
+//# sourceMappingURL=ast.js.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/ast.js.map b/node_modules/minimatch/dist/esm/ast.js.map
new file mode 100644
index 00000000..f5cc3ee9
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/ast.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAAA,8BAA8B;;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAwCxC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC7D,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAoB,EAAE,CAC3D,KAAK,CAAC,GAAG,CAAC,CAAgB,CAAC,CAAA;AAC7B,MAAM,YAAY,GAAG,CAAC,CAAM,EAAoC,EAAE,CAChE,aAAa,CAAC,CAAC,CAAC,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,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAA;gBACzD,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,KAAK,CAAA;YAChB,CAAC;YACD,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC1B,EAAE,IAAI,MAAM,CAAA;gBACd,CAAC;qBAAM,CAAC;oBACN,QAAQ,GAAG,IAAI,CAAA;gBACjB,CAAC;gBACD,SAAQ;YACV,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gBAC7D,IAAI,QAAQ,EAAE,CAAC;oBACb,EAAE,IAAI,GAAG,CAAA;oBACT,KAAK,GAAG,KAAK,IAAI,SAAS,CAAA;oBAC1B,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;oBACjB,QAAQ,GAAG,QAAQ,IAAI,KAAK,CAAA;oBAC5B,SAAQ;gBACV,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,EAAE,IAAI,KAAK,CAAA;gBACX,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n//   1   2 3   4 5 6      1   2    3   46      5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n//                                 v----- .* because there's more following,\n//                                 v    v  otherwise, .+ because it must be\n//                                 v    v  *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n//   copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n  types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n  isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n  ['!', ['@']],\n  ['?', ['?', '@']],\n  ['@', ['@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n  ['!', ['?']],\n  ['@', ['?']],\n  ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n  ['!', ['?', '@']],\n  ['?', ['?', '@']],\n  ['@', ['?', '@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n  ExtglobType,\n  Map\n>([\n  ['!', new Map([['!', '@']])],\n  [\n    '?',\n    new Map([\n      ['*', '*'],\n      ['+', '*'],\n    ]),\n  ],\n  [\n    '@',\n    new Map([\n      ['!', '!'],\n      ['?', '?'],\n      ['@', '@'],\n      ['*', '*'],\n      ['+', '+'],\n    ]),\n  ],\n  [\n    '+',\n    new Map([\n      ['?', '*'],\n      ['*', '*'],\n    ]),\n  ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n  type: ExtglobType | null\n  readonly #root: AST\n\n  #hasMagic?: boolean\n  #uflag: boolean = false\n  #parts: (string | AST)[] = []\n  #parent?: AST\n  #parentIndex: number\n  #negs: AST[]\n  #filledNegs: boolean = false\n  #options: MinimatchOptions\n  #toString?: string\n  // set to true if it's an extglob with no children\n  // (which really means one child of '')\n  #emptyExt: boolean = false\n  id = ++ID\n\n  get depth(): number {\n    return (this.#parent?.depth ?? -1) + 1\n  }\n\n  [Symbol.for('nodejs.util.inspect.custom')]() {\n    return {\n      '@@type': 'AST',\n      id: this.id,\n      type: this.type,\n      root: this.#root.id,\n      parent: this.#parent?.id,\n      depth: this.depth,\n      partsLength: this.#parts.length,\n      parts: this.#parts,\n    }\n  }\n\n  constructor(\n    type: ExtglobType | null,\n    parent?: AST,\n    options: MinimatchOptions = {},\n  ) {\n    this.type = type\n    // extglobs are inherently magical\n    if (type) this.#hasMagic = true\n    this.#parent = parent\n    this.#root = this.#parent ? this.#parent.#root : this\n    this.#options = this.#root === this ? options : this.#root.#options\n    this.#negs = this.#root === this ? [] : this.#root.#negs\n    if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n    this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n  }\n\n  get hasMagic(): boolean | undefined {\n    /* c8 ignore start */\n    if (this.#hasMagic !== undefined) return this.#hasMagic\n    /* c8 ignore stop */\n    for (const p of this.#parts) {\n      if (typeof p === 'string') continue\n      if (p.type || p.hasMagic) return (this.#hasMagic = true)\n    }\n    // note: will be undefined until we generate the regexp src and find out\n    return this.#hasMagic\n  }\n\n  // reconstructs the pattern\n  toString(): string {\n    return (\n      this.#toString !== undefined ? this.#toString\n      : !this.type ?\n        (this.#toString = this.#parts.map(p => String(p)).join(''))\n      : (this.#toString =\n          this.type +\n          '(' +\n          this.#parts.map(p => String(p)).join('|') +\n          ')')\n    )\n  }\n\n  #fillNegs() {\n    /* c8 ignore start */\n    if (this !== this.#root) throw new Error('should only call on root')\n    if (this.#filledNegs) return this\n    /* c8 ignore stop */\n\n    // call toString() once to fill this out\n    this.toString()\n    this.#filledNegs = true\n    let n: AST | undefined\n    while ((n = this.#negs.pop())) {\n      if (n.type !== '!') continue\n      // walk up the tree, appending everthing that comes AFTER parentIndex\n      let p: AST | undefined = n\n      let pp = p.#parent\n      while (pp) {\n        for (\n          let i = p.#parentIndex + 1;\n          !pp.type && i < pp.#parts.length;\n          i++\n        ) {\n          for (const part of n.#parts) {\n            /* c8 ignore start */\n            if (typeof part === 'string') {\n              throw new Error('string part in extglob AST??')\n            }\n            /* c8 ignore stop */\n            part.copyIn(pp.#parts[i])\n          }\n        }\n        p = pp\n        pp = p.#parent\n      }\n    }\n    return this\n  }\n\n  push(...parts: (string | AST)[]) {\n    for (const p of parts) {\n      if (p === '') continue\n      /* c8 ignore start */\n      if (\n        typeof p !== 'string' &&\n        !(p instanceof AST && p.#parent === this)\n      ) {\n        throw new Error('invalid part: ' + p)\n      }\n      /* c8 ignore stop */\n      this.#parts.push(p)\n    }\n  }\n\n  toJSON() {\n    const ret: unknown[] =\n      this.type === null ?\n        this.#parts\n          .slice()\n          .map(p => (typeof p === 'string' ? p : p.toJSON()))\n      : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n    if (this.isStart() && !this.type) ret.unshift([])\n    if (\n      this.isEnd() &&\n      (this === this.#root ||\n        (this.#root.#filledNegs && this.#parent?.type === '!'))\n    ) {\n      ret.push({})\n    }\n    return ret\n  }\n\n  isStart(): boolean {\n    if (this.#root === this) return true\n    // if (this.type) return !!this.#parent?.isStart()\n    if (!this.#parent?.isStart()) return false\n    if (this.#parentIndex === 0) return true\n    // if everything AHEAD of this is a negation, then it's still the \"start\"\n    const p = this.#parent\n    for (let i = 0; i < this.#parentIndex; i++) {\n      const pp = p.#parts[i]\n      if (!(pp instanceof AST && pp.type === '!')) {\n        return false\n      }\n    }\n    return true\n  }\n\n  isEnd(): boolean {\n    if (this.#root === this) return true\n    if (this.#parent?.type === '!') return true\n    if (!this.#parent?.isEnd()) return false\n    if (!this.type) return this.#parent?.isEnd()\n    // if not root, it'll always have a parent\n    /* c8 ignore start */\n    const pl = this.#parent ? this.#parent.#parts.length : 0\n    /* c8 ignore stop */\n    return this.#parentIndex === pl - 1\n  }\n\n  copyIn(part: AST | string) {\n    if (typeof part === 'string') this.push(part)\n    else this.push(part.clone(this))\n  }\n\n  clone(parent: AST) {\n    const c = new AST(this.type, parent)\n    for (const p of this.#parts) {\n      c.copyIn(p)\n    }\n    return c\n  }\n\n  static #parseAST(\n    str: string,\n    ast: AST,\n    pos: number,\n    opt: MinimatchOptions,\n    extDepth: number,\n  ): number {\n    const maxDepth = opt.maxExtglobRecursion ?? 2\n    let escaping = false\n    let inBrace = false\n    let braceStart = -1\n    let braceNeg = false\n    if (ast.type === null) {\n      // outside of a extglob, append until we find a start\n      let i = pos\n      let acc = ''\n      while (i < str.length) {\n        const c = str.charAt(i++)\n        // still accumulate escapes at this point, but we do ignore\n        // starts that are escaped\n        if (escaping || c === '\\\\') {\n          escaping = !escaping\n          acc += c\n          continue\n        }\n\n        if (inBrace) {\n          if (i === braceStart + 1) {\n            if (c === '^' || c === '!') {\n              braceNeg = true\n            }\n          } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n            inBrace = false\n          }\n          acc += c\n          continue\n        } else if (c === '[') {\n          inBrace = true\n          braceStart = i\n          braceNeg = false\n          acc += c\n          continue\n        }\n\n        // we don't have to check for adoption here, because that's\n        // done at the other recursion point.\n        const doRecurse =\n          !opt.noext &&\n          isExtglobType(c) &&\n          str.charAt(i) === '(' &&\n          extDepth <= maxDepth\n        if (doRecurse) {\n          ast.push(acc)\n          acc = ''\n          const ext = new AST(c, ast)\n          i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n          ast.push(ext)\n          continue\n        }\n        acc += c\n      }\n      ast.push(acc)\n      return i\n    }\n\n    // some kind of extglob, pos is at the (\n    // find the next | or )\n    let i = pos + 1\n    let part = new AST(null, ast)\n    const parts: AST[] = []\n    let acc = ''\n    while (i < str.length) {\n      const c = str.charAt(i++)\n      // still accumulate escapes at this point, but we do ignore\n      // starts that are escaped\n      if (escaping || c === '\\\\') {\n        escaping = !escaping\n        acc += c\n        continue\n      }\n\n      if (inBrace) {\n        if (i === braceStart + 1) {\n          if (c === '^' || c === '!') {\n            braceNeg = true\n          }\n        } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n          inBrace = false\n        }\n        acc += c\n        continue\n      } else if (c === '[') {\n        inBrace = true\n        braceStart = i\n        braceNeg = false\n        acc += c\n        continue\n      }\n\n      const doRecurse =\n        !opt.noext &&\n        isExtglobType(c) &&\n        str.charAt(i) === '(' &&\n        /* c8 ignore start - the maxDepth is sufficient here */\n        (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n      /* c8 ignore stop */\n      if (doRecurse) {\n        const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n        part.push(acc)\n        acc = ''\n        const ext = new AST(c, part)\n        part.push(ext)\n        i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n        continue\n      }\n      if (c === '|') {\n        part.push(acc)\n        acc = ''\n        parts.push(part)\n        part = new AST(null, ast)\n        continue\n      }\n      if (c === ')') {\n        if (acc === '' && ast.#parts.length === 0) {\n          ast.#emptyExt = true\n        }\n        part.push(acc)\n        acc = ''\n        ast.push(...parts, part)\n        return i\n      }\n      acc += c\n    }\n\n    // unfinished extglob\n    // if we got here, it was a malformed extglob! not an extglob, but\n    // maybe something else in there.\n    ast.type = null\n    ast.#hasMagic = undefined\n    ast.#parts = [str.substring(pos - 1)]\n    return i\n  }\n\n  #canAdoptWithSpace(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    return this.#canAdopt(child, adoptionWithSpaceMap)\n  }\n\n  #canAdopt(\n    child?: AST | string,\n    map: Map = adoptionMap,\n  ): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canAdoptType(\n      gc.type,\n      map,\n    )\n  }\n  #canAdoptType(\n    c: string,\n    map: Map = adoptionAnyMap,\n  ): c is ExtglobType {\n    return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n  }\n\n  #adoptWithSpace(\n    this: AST & { type: ExtglobType },\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const blank = new AST(null, gc, this.options)\n    blank.#parts.push('')\n    gc.push(blank)\n    this.#adopt(child, index)\n  }\n\n  #adopt(\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    this.#parts.splice(index, 1, ...gc.#parts)\n    for (const p of gc.#parts) {\n      if (typeof p === 'object') p.#parent = this\n    }\n    this.#toString = undefined\n  }\n\n  #canUsurpType(c: string): boolean {\n    const m = usurpMap.get(this.type as ExtglobType)\n    return !!m?.has(c as ExtglobType)\n  }\n\n  #canUsurp(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null ||\n      this.#parts.length !== 1\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n  }\n\n  #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n    const m = usurpMap.get(this.type as ExtglobType)\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const nt = m?.get(gc.type)\n    /* c8 ignore start - impossible */\n    if (!nt) return false\n    /* c8 ignore stop */\n    this.#parts = gc.#parts\n    for (const p of this.#parts) {\n      if (typeof p === 'object') {\n        p.#parent = this\n      }\n    }\n    this.type = nt\n    this.#toString = undefined\n    this.#emptyExt = false\n  }\n\n  static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n    const ast = new AST(null, undefined, options)\n    AST.#parseAST(pattern, ast, 0, options, 0)\n    return ast\n  }\n\n  // returns the regular expression if there's magic, or the unescaped\n  // string if not.\n  toMMPattern(): MMRegExp | string {\n    // should only be called on root\n    /* c8 ignore start */\n    if (this !== this.#root) return this.#root.toMMPattern()\n    /* c8 ignore stop */\n    const glob = this.toString()\n    const [re, body, hasMagic, uflag] = this.toRegExpSource()\n    // if we're in nocase mode, and not nocaseMagicOnly, then we do\n    // still need a regular expression if we have to case-insensitively\n    // match capital/lowercase characters.\n    const anyMagic =\n      hasMagic ||\n      this.#hasMagic ||\n      (this.#options.nocase &&\n        !this.#options.nocaseMagicOnly &&\n        glob.toUpperCase() !== glob.toLowerCase())\n    if (!anyMagic) {\n      return body\n    }\n\n    const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n    return Object.assign(new RegExp(`^${re}$`, flags), {\n      _src: re,\n      _glob: glob,\n    })\n  }\n\n  get options() {\n    return this.#options\n  }\n\n  // returns the string match, the regexp source, whether there's magic\n  // in the regexp (so a regular expression is required) and whether or\n  // not the uflag is needed for the regular expression (for posix classes)\n  // TODO: instead of injecting the start/end at this point, just return\n  // the BODY of the regexp, along with the start/end portions suitable\n  // for binding the start/end in either a joined full-path makeRe context\n  // (where we bind to (^|/), or a standalone matchPart context (where\n  // we bind to ^, and not /).  Otherwise slashes get duped!\n  //\n  // In part-matching mode, the start is:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n  // - if dots allowed or not possible: ^\n  // - if dots possible and not allowed: ^(?!\\.)\n  // end is:\n  // - if not isEnd(): nothing\n  // - else: $\n  //\n  // In full-path matching mode, we put the slash at the START of the\n  // pattern, so start is:\n  // - if first pattern: same as part-matching mode\n  // - if not isStart(): nothing\n  // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n  // - if dots allowed or not possible: /\n  // - if dots possible and not allowed: /(?!\\.)\n  // end is:\n  // - if last pattern, same as part-matching mode\n  // - else nothing\n  //\n  // Always put the (?:$|/) on negated tails, though, because that has to be\n  // there to bind the end of the negated pattern portion, and it's easier to\n  // just stick it in now rather than try to inject it later in the middle of\n  // the pattern.\n  //\n  // We can just always return the same end, and leave it up to the caller\n  // to know whether it's going to be used joined or in parts.\n  // And, if the start is adjusted slightly, can do the same there:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n  // - if dots allowed or not possible: (?:/|^)\n  // - if dots possible and not allowed: (?:/|^)(?!\\.)\n  //\n  // But it's better to have a simpler binding without a conditional, for\n  // performance, so probably better to return both start options.\n  //\n  // Then the caller just ignores the end if it's not the first pattern,\n  // and the start always gets applied.\n  //\n  // But that's always going to be $ if it's the ending pattern, or nothing,\n  // so the caller can just attach $ at the end of the pattern when building.\n  //\n  // So the todo is:\n  // - better detect what kind of start is needed\n  // - return both flavors of starting pattern\n  // - attach $ at the end of the pattern when creating the actual RegExp\n  //\n  // Ah, but wait, no, that all only applies to the root when the first pattern\n  // is not an extglob. If the first pattern IS an extglob, then we need all\n  // that dot prevention biz to live in the extglob portions, because eg\n  // +(*|.x*) can match .xy but not .yx.\n  //\n  // So, return the two flavors if it's #root and the first child is not an\n  // AST, otherwise leave it to the child AST to handle it, and there,\n  // use the (?:^|/) style of start binding.\n  //\n  // Even simplified further:\n  // - Since the start for a join is eg /(?!\\.) and the start for a part\n  // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n  // or start or whatever) and prepend ^ or / at the Regexp construction.\n  toRegExpSource(\n    allowDot?: boolean,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    const dot = allowDot ?? !!this.#options.dot\n    if (this.#root === this) {\n      this.#flatten()\n      this.#fillNegs()\n    }\n    if (!isExtglobAST(this)) {\n      const noEmpty =\n        this.isStart() &&\n        this.isEnd() &&\n        !this.#parts.some(s => typeof s !== 'string')\n      const src = this.#parts\n        .map(p => {\n          const [re, _, hasMagic, uflag] =\n            typeof p === 'string' ?\n              AST.#parseGlob(p, this.#hasMagic, noEmpty)\n            : p.toRegExpSource(allowDot)\n          this.#hasMagic = this.#hasMagic || hasMagic\n          this.#uflag = this.#uflag || uflag\n          return re\n        })\n        .join('')\n\n      let start = ''\n      if (this.isStart()) {\n        if (typeof this.#parts[0] === 'string') {\n          // this is the string that will match the start of the pattern,\n          // so we need to protect against dots and such.\n\n          // '.' and '..' cannot match unless the pattern is that exactly,\n          // even if it starts with . or dot:true is set.\n          const dotTravAllowed =\n            this.#parts.length === 1 && justDots.has(this.#parts[0])\n          if (!dotTravAllowed) {\n            const aps = addPatternStart\n            // check if we have a possibility of matching . or ..,\n            // and prevent that.\n            const needNoTrav =\n              // dots are allowed, and the pattern starts with [ or .\n              (dot && aps.has(src.charAt(0))) ||\n              // the pattern starts with \\., and then [ or .\n              (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n              // the pattern starts with \\.\\., and then [ or .\n              (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n            // no need to prevent dots if it can't match a dot, or if a\n            // sub-pattern will be preventing it anyway.\n            const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n            start =\n              needNoTrav ? startNoTraversal\n              : needNoDot ? startNoDot\n              : ''\n          }\n        }\n      }\n\n      // append the \"end of path portion\" pattern to negation tails\n      let end = ''\n      if (\n        this.isEnd() &&\n        this.#root.#filledNegs &&\n        this.#parent?.type === '!'\n      ) {\n        end = '(?:$|\\\\/)'\n      }\n      const final = start + src + end\n      return [\n        final,\n        unescape(src),\n        (this.#hasMagic = !!this.#hasMagic),\n        this.#uflag,\n      ]\n    }\n\n    // We need to calculate the body *twice* if it's a repeat pattern\n    // at the start, once in nodot mode, then again in dot mode, so a\n    // pattern like *(?) can match 'x.y'\n\n    const repeated = this.type === '*' || this.type === '+'\n    // some kind of extglob\n    const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n    let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n    if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n      // invalid extglob, has to at least be *something* present, if it's\n      // the entire path portion.\n      const s = this.toString()\n      const me = this as AST\n      me.#parts = [s]\n      me.type = null\n      me.#hasMagic = undefined\n      return [s, unescape(this.toString()), false, false]\n    }\n\n    let bodyDotAllowed =\n      !repeated || allowDot || dot || !startNoDot ?\n        ''\n      : this.#partsToRegExp(true)\n    if (bodyDotAllowed === body) {\n      bodyDotAllowed = ''\n    }\n    if (bodyDotAllowed) {\n      body = `(?:${body})(?:${bodyDotAllowed})*?`\n    }\n\n    // an empty !() is exactly equivalent to a starNoEmpty\n    let final = ''\n    if (this.type === '!' && this.#emptyExt) {\n      final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n    } else {\n      const close =\n        this.type === '!' ?\n          // !() must match something,but !(x) can match ''\n          '))' +\n          (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n          star +\n          ')'\n        : this.type === '@' ? ')'\n        : this.type === '?' ? ')?'\n        : this.type === '+' && bodyDotAllowed ? ')'\n        : this.type === '*' && bodyDotAllowed ? `)?`\n        : `)${this.type}`\n      final = start + body + close\n    }\n    return [\n      final,\n      unescape(body),\n      (this.#hasMagic = !!this.#hasMagic),\n      this.#uflag,\n    ]\n  }\n\n  #flatten() {\n    if (!isExtglobAST(this)) {\n      for (const p of this.#parts) {\n        if (typeof p === 'object') {\n          p.#flatten()\n        }\n      }\n    } else {\n      // do up to 10 passes to flatten as much as possible\n      let iterations = 0\n      let done = false\n      do {\n        done = true\n        for (let i = 0; i < this.#parts.length; i++) {\n          const c = this.#parts[i]\n          if (typeof c === 'object') {\n            c.#flatten()\n            if (this.#canAdopt(c)) {\n              done = false\n              this.#adopt(c, i)\n            } else if (this.#canAdoptWithSpace(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n            } else if (this.#canUsurp(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#usurp(c)\n            }\n          }\n        }\n      } while (!done && ++iterations < 10)\n    }\n    this.#toString = undefined\n  }\n\n  #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n    return this.#parts\n      .map(p => {\n        // extglob ASTs should only contain parent ASTs\n        /* c8 ignore start */\n        if (typeof p === 'string') {\n          throw new Error('string type in extglob ast??')\n        }\n        /* c8 ignore stop */\n        // can ignore hasMagic, because extglobs are already always magic\n        const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n        this.#uflag = this.#uflag || uflag\n        return re\n      })\n      .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n      .join('|')\n  }\n\n  static #parseGlob(\n    glob: string,\n    hasMagic: boolean | undefined,\n    noEmpty: boolean = false,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    let escaping = false\n    let re = ''\n    let uflag = false\n    // multiple stars that aren't globstars coalesce into one *\n    let inStar = false\n    for (let i = 0; i < glob.length; i++) {\n      const c = glob.charAt(i)\n      if (escaping) {\n        escaping = false\n        re += (reSpecials.has(c) ? '\\\\' : '') + c\n        continue\n      }\n      if (c === '*') {\n        if (inStar) continue\n        inStar = true\n        re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n        hasMagic = true\n        continue\n      } else {\n        inStar = false\n      }\n      if (c === '\\\\') {\n        if (i === glob.length - 1) {\n          re += '\\\\\\\\'\n        } else {\n          escaping = true\n        }\n        continue\n      }\n      if (c === '[') {\n        const [src, needUflag, consumed, magic] = parseClass(glob, i)\n        if (consumed) {\n          re += src\n          uflag = uflag || needUflag\n          i += consumed - 1\n          hasMagic = hasMagic || magic\n          continue\n        }\n      }\n      if (c === '?') {\n        re += qmark\n        hasMagic = true\n        continue\n      }\n      re += regExpEscape(c)\n    }\n    return [re, unescape(glob), !!hasMagic, uflag]\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/brace-expressions.d.ts b/node_modules/minimatch/dist/esm/brace-expressions.d.ts
new file mode 100644
index 00000000..b1572deb
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/brace-expressions.d.ts
@@ -0,0 +1,8 @@
+export type ParseClassResult = [
+    src: string,
+    uFlag: boolean,
+    consumed: number,
+    hasMagic: boolean
+];
+export declare const parseClass: (glob: string, position: number) => ParseClassResult;
+//# sourceMappingURL=brace-expressions.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map b/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
new file mode 100644
index 00000000..09b4c110
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/brace-expressions.js b/node_modules/minimatch/dist/esm/brace-expressions.js
new file mode 100644
index 00000000..4b49d40b
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/brace-expressions.js
@@ -0,0 +1,146 @@
+// translate the various posix character classes into unicode properties
+// this works across all unicode locales
+// { : [, /u flag required, negated]
+const posixClasses = {
+    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
+    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
+    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
+    '[:blank:]': ['\\p{Zs}\\t', true],
+    '[:cntrl:]': ['\\p{Cc}', true],
+    '[:digit:]': ['\\p{Nd}', true],
+    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
+    '[:lower:]': ['\\p{Ll}', true],
+    '[:print:]': ['\\p{C}', true],
+    '[:punct:]': ['\\p{P}', true],
+    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
+    '[:upper:]': ['\\p{Lu}', true],
+    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
+    '[:xdigit:]': ['A-Fa-f0-9', false],
+};
+// only need to escape a few things inside of brace expressions
+// escapes: [ \ ] -
+const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
+// escape all regexp magic characters
+const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// everything has already been escaped, we just have to join
+const rangesToString = (ranges) => ranges.join('');
+// takes a glob string at a posix brace expression, and returns
+// an equivalent regular expression source, and boolean indicating
+// whether the /u flag needs to be applied, and the number of chars
+// consumed to parse the character class.
+// This also removes out of order ranges, and returns ($.) if the
+// entire class just no good.
+export const parseClass = (glob, position) => {
+    const pos = position;
+    /* c8 ignore start */
+    if (glob.charAt(pos) !== '[') {
+        throw new Error('not in a brace expression');
+    }
+    /* c8 ignore stop */
+    const ranges = [];
+    const negs = [];
+    let i = pos + 1;
+    let sawStart = false;
+    let uflag = false;
+    let escaping = false;
+    let negate = false;
+    let endPos = pos;
+    let rangeStart = '';
+    WHILE: while (i < glob.length) {
+        const c = glob.charAt(i);
+        if ((c === '!' || c === '^') && i === pos + 1) {
+            negate = true;
+            i++;
+            continue;
+        }
+        if (c === ']' && sawStart && !escaping) {
+            endPos = i + 1;
+            break;
+        }
+        sawStart = true;
+        if (c === '\\') {
+            if (!escaping) {
+                escaping = true;
+                i++;
+                continue;
+            }
+            // escaped \ char, fall through and treat like normal char
+        }
+        if (c === '[' && !escaping) {
+            // either a posix class, a collation equivalent, or just a [
+            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
+                if (glob.startsWith(cls, i)) {
+                    // invalid, [a-[] is fine, but not [a-[:alpha]]
+                    if (rangeStart) {
+                        return ['$.', false, glob.length - pos, true];
+                    }
+                    i += cls.length;
+                    if (neg)
+                        negs.push(unip);
+                    else
+                        ranges.push(unip);
+                    uflag = uflag || u;
+                    continue WHILE;
+                }
+            }
+        }
+        // now it's just a normal character, effectively
+        escaping = false;
+        if (rangeStart) {
+            // throw this range away if it's not valid, but others
+            // can still match.
+            if (c > rangeStart) {
+                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
+            }
+            else if (c === rangeStart) {
+                ranges.push(braceEscape(c));
+            }
+            rangeStart = '';
+            i++;
+            continue;
+        }
+        // now might be the start of a range.
+        // can be either c-d or c-] or c] or c] at this point
+        if (glob.startsWith('-]', i + 1)) {
+            ranges.push(braceEscape(c + '-'));
+            i += 2;
+            continue;
+        }
+        if (glob.startsWith('-', i + 1)) {
+            rangeStart = c;
+            i += 2;
+            continue;
+        }
+        // not the start of a range, just a single character
+        ranges.push(braceEscape(c));
+        i++;
+    }
+    if (endPos < i) {
+        // didn't see the end of the class, not a valid class,
+        // but might still be valid as a literal match.
+        return ['', false, 0, false];
+    }
+    // if we got no ranges and no negates, then we have a range that
+    // cannot possibly match anything, and that poisons the whole glob
+    if (!ranges.length && !negs.length) {
+        return ['$.', false, glob.length - pos, true];
+    }
+    // if we got one positive range, and it's a single character, then that's
+    // not actually a magic pattern, it's just that one literal character.
+    // we should not treat that as "magic", we should just return the literal
+    // character. [_] is a perfectly valid way to escape glob magic chars.
+    if (negs.length === 0 &&
+        ranges.length === 1 &&
+        /^\\?.$/.test(ranges[0]) &&
+        !negate) {
+        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
+        return [regexpEscape(r), false, endPos - pos, false];
+    }
+    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
+    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
+    const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
+        : ranges.length ? sranges
+            : snegs;
+    return [comb, uflag, endPos - pos, true];
+};
+//# sourceMappingURL=brace-expressions.js.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/brace-expressions.js.map b/node_modules/minimatch/dist/esm/brace-expressions.js.map
new file mode 100644
index 00000000..184b5a89
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/brace-expressions.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wCAAwC;AAExC,8DAA8D;AAC9D,MAAM,YAAY,GAChB;IACE,WAAW,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC;IAC7C,WAAW,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,UAAU,EAAE,CAAC,6BAA6B,EAAE,IAAI,CAAC;IACjD,YAAY,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;CACnC,CAAA;AAEH,+DAA+D;AAC/D,mBAAmB;AACnB,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,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unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n  {\n    '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n    '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n    '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n    '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n    '[:cntrl:]': ['\\\\p{Cc}', true],\n    '[:digit:]': ['\\\\p{Nd}', true],\n    '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n    '[:lower:]': ['\\\\p{Ll}', true],\n    '[:print:]': ['\\\\p{C}', true],\n    '[:punct:]': ['\\\\p{P}', true],\n    '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n    '[:upper:]': ['\\\\p{Lu}', true],\n    '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n    '[:xdigit:]': ['A-Fa-f0-9', false],\n  }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n  src: string,\n  uFlag: boolean,\n  consumed: number,\n  hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n  glob: string,\n  position: number,\n): ParseClassResult => {\n  const pos = position\n  /* c8 ignore start */\n  if (glob.charAt(pos) !== '[') {\n    throw new Error('not in a brace expression')\n  }\n  /* c8 ignore stop */\n  const ranges: string[] = []\n  const negs: string[] = []\n\n  let i = pos + 1\n  let sawStart = false\n  let uflag = false\n  let escaping = false\n  let negate = false\n  let endPos = pos\n  let rangeStart = ''\n  WHILE: while (i < glob.length) {\n    const c = glob.charAt(i)\n    if ((c === '!' || c === '^') && i === pos + 1) {\n      negate = true\n      i++\n      continue\n    }\n\n    if (c === ']' && sawStart && !escaping) {\n      endPos = i + 1\n      break\n    }\n\n    sawStart = true\n    if (c === '\\\\') {\n      if (!escaping) {\n        escaping = true\n        i++\n        continue\n      }\n      // escaped \\ char, fall through and treat like normal char\n    }\n    if (c === '[' && !escaping) {\n      // either a posix class, a collation equivalent, or just a [\n      for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n        if (glob.startsWith(cls, i)) {\n          // invalid, [a-[] is fine, but not [a-[:alpha]]\n          if (rangeStart) {\n            return ['$.', false, glob.length - pos, true]\n          }\n          i += cls.length\n          if (neg) negs.push(unip)\n          else ranges.push(unip)\n          uflag = uflag || u\n          continue WHILE\n        }\n      }\n    }\n\n    // now it's just a normal character, effectively\n    escaping = false\n    if (rangeStart) {\n      // throw this range away if it's not valid, but others\n      // can still match.\n      if (c > rangeStart) {\n        ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n      } else if (c === rangeStart) {\n        ranges.push(braceEscape(c))\n      }\n      rangeStart = ''\n      i++\n      continue\n    }\n\n    // now might be the start of a range.\n    // can be either c-d or c-] or c] or c] at this point\n    if (glob.startsWith('-]', i + 1)) {\n      ranges.push(braceEscape(c + '-'))\n      i += 2\n      continue\n    }\n    if (glob.startsWith('-', i + 1)) {\n      rangeStart = c\n      i += 2\n      continue\n    }\n\n    // not the start of a range, just a single character\n    ranges.push(braceEscape(c))\n    i++\n  }\n\n  if (endPos < i) {\n    // didn't see the end of the class, not a valid class,\n    // but might still be valid as a literal match.\n    return ['', false, 0, false]\n  }\n\n  // if we got no ranges and no negates, then we have a range that\n  // cannot possibly match anything, and that poisons the whole glob\n  if (!ranges.length && !negs.length) {\n    return ['$.', false, glob.length - pos, true]\n  }\n\n  // if we got one positive range, and it's a single character, then that's\n  // not actually a magic pattern, it's just that one literal character.\n  // we should not treat that as \"magic\", we should just return the literal\n  // character. [_] is a perfectly valid way to escape glob magic chars.\n  if (\n    negs.length === 0 &&\n    ranges.length === 1 &&\n    /^\\\\?.$/.test(ranges[0]) &&\n    !negate\n  ) {\n    const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n    return [regexpEscape(r), false, endPos - pos, false]\n  }\n\n  const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n  const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n  const comb =\n    ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n    : ranges.length ? sranges\n    : snegs\n\n  return [comb, uflag, endPos - pos, true]\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/escape.d.ts b/node_modules/minimatch/dist/esm/escape.d.ts
new file mode 100644
index 00000000..141024a0
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/escape.d.ts
@@ -0,0 +1,15 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ *
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
+ * then braces (`{` and `}`) will be escaped.
+ */
+export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=escape.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/escape.d.ts.map b/node_modules/minimatch/dist/esm/escape.d.ts.map
new file mode 100644
index 00000000..e167e300
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/escape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/escape.js b/node_modules/minimatch/dist/esm/escape.js
new file mode 100644
index 00000000..46d0ec88
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/escape.js
@@ -0,0 +1,26 @@
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ *
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
+ * then braces (`{` and `}`) will be escaped.
+ */
+export const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
+    // don't need to escape +@! because we escape the parens
+    // that make those magic, and escaping ! as [!] isn't valid,
+    // because [!]] is a valid glob class meaning not ']'.
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/[?*()[\]{}]/g, '[$&]')
+            : s.replace(/[?*()[\]\\{}]/g, '\\$&');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/[?*()[\]]/g, '[$&]')
+        : s.replace(/[?*()[\]\\]/g, '\\$&');
+};
+//# sourceMappingURL=escape.js.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/escape.js.map b/node_modules/minimatch/dist/esm/escape.js.map
new file mode 100644
index 00000000..4740508f
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/escape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character.  In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = false,\n  }: Pick = {},\n) => {\n  // don't need to escape +@! because we escape the parens\n  // that make those magic, and escaping ! as [!] isn't valid,\n  // because [!]] is a valid glob class meaning not ']'.\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/[?*()[\\]{}]/g, '[$&]')\n      : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/[?*()[\\]]/g, '[$&]')\n    : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/index.d.ts b/node_modules/minimatch/dist/esm/index.d.ts
new file mode 100644
index 00000000..7e1fc2ed
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/index.d.ts
@@ -0,0 +1,174 @@
+import { AST } from './ast.js';
+export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
+export interface MinimatchOptions {
+    /** do not expand `{x,y}` style braces */
+    nobrace?: boolean;
+    /** do not treat patterns starting with `#` as a comment */
+    nocomment?: boolean;
+    /** do not treat patterns starting with `!` as a negation */
+    nonegate?: boolean;
+    /** print LOTS of debugging output */
+    debug?: boolean;
+    /** treat `**` the same as `*` */
+    noglobstar?: boolean;
+    /** do not expand extglobs like `+(a|b)` */
+    noext?: boolean;
+    /** return the pattern if nothing matches */
+    nonull?: boolean;
+    /** treat `\\` as a path separator, not an escape character */
+    windowsPathsNoEscape?: boolean;
+    /**
+     * inverse of {@link MinimatchOptions.windowsPathsNoEscape}
+     * @deprecated
+     */
+    allowWindowsEscape?: boolean;
+    /**
+     * Compare a partial path to a pattern. As long as the parts
+     * of the path that are present are not contradicted by the
+     * pattern, it will be treated as a match. This is useful in
+     * applications where you're walking through a folder structure,
+     * and don't yet have the full path, but want to ensure that you
+     * do not walk down paths that can never be a match.
+     */
+    partial?: boolean;
+    /** allow matches that start with `.` even if the pattern does not */
+    dot?: boolean;
+    /** ignore case */
+    nocase?: boolean;
+    /** ignore case only in wildcard patterns */
+    nocaseMagicOnly?: boolean;
+    /** consider braces to be "magic" for the purpose of `hasMagic` */
+    magicalBraces?: boolean;
+    /**
+     * If set, then patterns without slashes will be matched
+     * against the basename of the path if it contains slashes.
+     * For example, `a?b` would match the path `/xyz/123/acb`, but
+     * not `/xyz/acb/123`.
+     */
+    matchBase?: boolean;
+    /** invert the results of negated matches */
+    flipNegate?: boolean;
+    /** do not collapse multiple `/` into a single `/` */
+    preserveMultipleSlashes?: boolean;
+    /**
+     * A number indicating the level of optimization that should be done
+     * to the pattern prior to parsing and using it for matches.
+     */
+    optimizationLevel?: number;
+    /** operating system platform */
+    platform?: Platform;
+    /**
+     * When a pattern starts with a UNC path or drive letter, and in
+     * `nocase:true` mode, do not convert the root portions of the
+     * pattern into a case-insensitive regular expression, and instead
+     * leave them as strings.
+     *
+     * This is the default when the platform is `win32` and
+     * `nocase:true` is set.
+     */
+    windowsNoMagicRoot?: boolean;
+    /**
+     * max number of `{...}` patterns to expand. Default 100_000.
+     */
+    braceExpandMax?: number;
+    /**
+     * Max number of non-adjacent `**` patterns to recursively walk down.
+     *
+     * The default of 200 is almost certainly high enough for most purposes,
+     * and can handle absurdly excessive patterns.
+     */
+    maxGlobstarRecursion?: number;
+    /**
+     * Max depth to traverse for nested extglobs like `*(a|b|c)`
+     *
+     * Default is 2, which is quite low, but any higher value
+     * swiftly results in punishing performance impacts. Note
+     * that this is *not*  relevant when the globstar types can
+     * be safely coalesced into a single set.
+     *
+     * For example, `*(a|@(b|c)|d)` would be flattened into
+     * `*(a|b|c|d)`. Thus, many common extglobs will retain good
+     * performance and  never hit this limit, even if they are
+     * excessively deep and complicated.
+     *
+     * If the limit is hit, then the extglob characters are simply
+     * not parsed, and the pattern effectively switches into
+     * `noextglob: true` mode for the contents of that nested
+     * sub-pattern. This will typically _not_ result in a match,
+     * but is considered a valid trade-off for security and
+     * performance.
+     */
+    maxExtglobRecursion?: number;
+}
+export declare const minimatch: {
+    (p: string, pattern: string, options?: MinimatchOptions): boolean;
+    sep: Sep;
+    GLOBSTAR: typeof GLOBSTAR;
+    filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
+    defaults: (def: MinimatchOptions) => typeof minimatch;
+    braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
+    makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
+    match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
+    AST: typeof AST;
+    Minimatch: typeof Minimatch;
+    escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+    unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+};
+export type Sep = '\\' | '/';
+export declare const sep: Sep;
+export declare const GLOBSTAR: unique symbol;
+export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
+export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
+export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
+export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
+export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
+export type MMRegExp = RegExp & {
+    _src?: string;
+    _glob?: string;
+};
+export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
+export type ParseReturn = ParseReturnFiltered | false;
+export declare class Minimatch {
+    #private;
+    options: MinimatchOptions;
+    set: ParseReturnFiltered[][];
+    pattern: string;
+    windowsPathsNoEscape: boolean;
+    nonegate: boolean;
+    negate: boolean;
+    comment: boolean;
+    empty: boolean;
+    preserveMultipleSlashes: boolean;
+    partial: boolean;
+    globSet: string[];
+    globParts: string[][];
+    nocase: boolean;
+    isWindows: boolean;
+    platform: Platform;
+    windowsNoMagicRoot: boolean;
+    maxGlobstarRecursion: number;
+    regexp: false | null | MMRegExp;
+    constructor(pattern: string, options?: MinimatchOptions);
+    hasMagic(): boolean;
+    debug(..._: unknown[]): void;
+    make(): void;
+    preprocess(globParts: string[][]): string[][];
+    adjascentGlobstarOptimize(globParts: string[][]): string[][];
+    levelOneOptimize(globParts: string[][]): string[][];
+    levelTwoFileOptimize(parts: string | string[]): string[];
+    firstPhasePreProcess(globParts: string[][]): string[][];
+    secondPhasePreProcess(globParts: string[][]): string[][];
+    partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
+    parseNegate(): void;
+    matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
+    braceExpand(): string[];
+    parse(pattern: string): ParseReturn;
+    makeRe(): false | MMRegExp;
+    slashSplit(p: string): string[];
+    match(f: string, partial?: boolean): boolean;
+    static defaults(def: MinimatchOptions): typeof Minimatch;
+}
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/index.d.ts.map b/node_modules/minimatch/dist/esm/index.d.ts.map
new file mode 100644
index 00000000..7620db91
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA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AE,gBAAqB;IAqC3D,QAAQ,IAAI,OAAO;IAYnB,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE;IAErB,IAAI;IA8FJ,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA8BhC,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAiB/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAoBtC,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAoE7C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA0F1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE;IAkBxD,UAAU,CACR,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,EACX,YAAY,GAAE,OAAe,GAC5B,KAAK,GAAG,MAAM,EAAE;IA+CnB,WAAW;IAqBX,QAAQ,CACN,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,GAAE,OAAe;IAiX1B,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/index.js b/node_modules/minimatch/dist/esm/index.js
new file mode 100644
index 00000000..a5e6fa88
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/index.js
@@ -0,0 +1,1114 @@
+import { expand } from 'brace-expansion';
+import { assertValidPattern } from './assert-valid-pattern.js';
+import { AST } from './ast.js';
+import { escape } from './escape.js';
+import { unescape } from './unescape.js';
+export const minimatch = (p, pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // shortcut: comments match nothing.
+    if (!options.nocomment && pattern.charAt(0) === '#') {
+        return false;
+    }
+    return new Minimatch(pattern, options).match(p);
+};
+// Optimized checking for the most common glob patterns.
+const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
+const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
+const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
+const starDotExtTestNocase = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
+};
+const starDotExtTestNocaseDot = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => f.toLowerCase().endsWith(ext);
+};
+const starDotStarRE = /^\*+\.\*+$/;
+const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
+const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
+const dotStarRE = /^\.\*+$/;
+const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
+const starRE = /^\*+$/;
+const starTest = (f) => f.length !== 0 && !f.startsWith('.');
+const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
+const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
+const qmarksTestNocase = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestNocaseDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTest = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTestNoExt = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && !f.startsWith('.');
+};
+const qmarksTestNoExtDot = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && f !== '.' && f !== '..';
+};
+/* c8 ignore start */
+const defaultPlatform = (typeof process === 'object' && process ?
+    (typeof process.env === 'object' &&
+        process.env &&
+        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
+        process.platform
+    : 'posix');
+const path = {
+    win32: { sep: '\\' },
+    posix: { sep: '/' },
+};
+/* c8 ignore stop */
+export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
+minimatch.sep = sep;
+export const GLOBSTAR = Symbol('globstar **');
+minimatch.GLOBSTAR = GLOBSTAR;
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
+export const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
+minimatch.filter = filter;
+const ext = (a, b = {}) => Object.assign({}, a, b);
+export const defaults = (def) => {
+    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
+        return minimatch;
+    }
+    const orig = minimatch;
+    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
+    return Object.assign(m, {
+        Minimatch: class Minimatch extends orig.Minimatch {
+            constructor(pattern, options = {}) {
+                super(pattern, ext(def, options));
+            }
+            static defaults(options) {
+                return orig.defaults(ext(def, options)).Minimatch;
+            }
+        },
+        AST: class AST extends orig.AST {
+            /* c8 ignore start */
+            constructor(type, parent, options = {}) {
+                super(type, parent, ext(def, options));
+            }
+            /* c8 ignore stop */
+            static fromGlob(pattern, options = {}) {
+                return orig.AST.fromGlob(pattern, ext(def, options));
+            }
+        },
+        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
+        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
+        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
+        defaults: (options) => orig.defaults(ext(def, options)),
+        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
+        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
+        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
+        sep: orig.sep,
+        GLOBSTAR: GLOBSTAR,
+    });
+};
+minimatch.defaults = defaults;
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+export const braceExpand = (pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // Thanks to Yeting Li  for
+    // improving this regexp to avoid a ReDOS vulnerability.
+    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
+        // shortcut. no need to expand.
+        return [pattern];
+    }
+    return expand(pattern, { max: options.braceExpandMax });
+};
+minimatch.braceExpand = braceExpand;
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
+minimatch.makeRe = makeRe;
+export const match = (list, pattern, options = {}) => {
+    const mm = new Minimatch(pattern, options);
+    list = list.filter(f => mm.match(f));
+    if (mm.options.nonull && !list.length) {
+        list.push(pattern);
+    }
+    return list;
+};
+minimatch.match = match;
+// replace stuff like \* with *
+const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+export class Minimatch {
+    options;
+    set;
+    pattern;
+    windowsPathsNoEscape;
+    nonegate;
+    negate;
+    comment;
+    empty;
+    preserveMultipleSlashes;
+    partial;
+    globSet;
+    globParts;
+    nocase;
+    isWindows;
+    platform;
+    windowsNoMagicRoot;
+    maxGlobstarRecursion;
+    regexp;
+    constructor(pattern, options = {}) {
+        assertValidPattern(pattern);
+        options = options || {};
+        this.options = options;
+        this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
+        this.pattern = pattern;
+        this.platform = options.platform || defaultPlatform;
+        this.isWindows = this.platform === 'win32';
+        // avoid the annoying deprecation flag lol
+        const awe = ('allowWindow' + 'sEscape');
+        this.windowsPathsNoEscape =
+            !!options.windowsPathsNoEscape || options[awe] === false;
+        if (this.windowsPathsNoEscape) {
+            this.pattern = this.pattern.replace(/\\/g, '/');
+        }
+        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
+        this.regexp = null;
+        this.negate = false;
+        this.nonegate = !!options.nonegate;
+        this.comment = false;
+        this.empty = false;
+        this.partial = !!options.partial;
+        this.nocase = !!this.options.nocase;
+        this.windowsNoMagicRoot =
+            options.windowsNoMagicRoot !== undefined ?
+                options.windowsNoMagicRoot
+                : !!(this.isWindows && this.nocase);
+        this.globSet = [];
+        this.globParts = [];
+        this.set = [];
+        // make the set of regexps etc.
+        this.make();
+    }
+    hasMagic() {
+        if (this.options.magicalBraces && this.set.length > 1) {
+            return true;
+        }
+        for (const pattern of this.set) {
+            for (const part of pattern) {
+                if (typeof part !== 'string')
+                    return true;
+            }
+        }
+        return false;
+    }
+    debug(..._) { }
+    make() {
+        const pattern = this.pattern;
+        const options = this.options;
+        // empty patterns and comments match nothing.
+        if (!options.nocomment && pattern.charAt(0) === '#') {
+            this.comment = true;
+            return;
+        }
+        if (!pattern) {
+            this.empty = true;
+            return;
+        }
+        // step 1: figure out negation, etc.
+        this.parseNegate();
+        // step 2: expand braces
+        this.globSet = [...new Set(this.braceExpand())];
+        if (options.debug) {
+            //oxlint-disable-next-line no-console
+            this.debug = (...args) => console.error(...args);
+        }
+        this.debug(this.pattern, this.globSet);
+        // step 3: now we have a set, so turn each one into a series of
+        // path-portion matching patterns.
+        // These will be regexps, except in the case of "**", which is
+        // set to the GLOBSTAR object for globstar behavior,
+        // and will not contain any / characters
+        //
+        // First, we preprocess to make the glob pattern sets a bit simpler
+        // and deduped.  There are some perf-killing patterns that can cause
+        // problems with a glob walk, but we can simplify them down a bit.
+        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
+        this.globParts = this.preprocess(rawGlobParts);
+        this.debug(this.pattern, this.globParts);
+        // glob --> regexps
+        let set = this.globParts.map((s, _, __) => {
+            if (this.isWindows && this.windowsNoMagicRoot) {
+                // check if it's a drive or unc path.
+                const isUNC = s[0] === '' &&
+                    s[1] === '' &&
+                    (s[2] === '?' || !globMagic.test(s[2])) &&
+                    !globMagic.test(s[3]);
+                const isDrive = /^[a-z]:/i.test(s[0]);
+                if (isUNC) {
+                    return [
+                        ...s.slice(0, 4),
+                        ...s.slice(4).map(ss => this.parse(ss)),
+                    ];
+                }
+                else if (isDrive) {
+                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
+                }
+            }
+            return s.map(ss => this.parse(ss));
+        });
+        this.debug(this.pattern, set);
+        // filter out everything that didn't compile properly.
+        this.set = set.filter(s => s.indexOf(false) === -1);
+        // do not treat the ? in UNC paths as magic
+        if (this.isWindows) {
+            for (let i = 0; i < this.set.length; i++) {
+                const p = this.set[i];
+                if (p[0] === '' &&
+                    p[1] === '' &&
+                    this.globParts[i][2] === '?' &&
+                    typeof p[3] === 'string' &&
+                    /^[a-z]:$/i.test(p[3])) {
+                    p[2] = '?';
+                }
+            }
+        }
+        this.debug(this.pattern, this.set);
+    }
+    // various transforms to equivalent pattern sets that are
+    // faster to process in a filesystem walk.  The goal is to
+    // eliminate what we can, and push all ** patterns as far
+    // to the right as possible, even if it increases the number
+    // of patterns that we have to process.
+    preprocess(globParts) {
+        // if we're not in globstar mode, then turn ** into *
+        if (this.options.noglobstar) {
+            for (const partset of globParts) {
+                for (let j = 0; j < partset.length; j++) {
+                    if (partset[j] === '**') {
+                        partset[j] = '*';
+                    }
+                }
+            }
+        }
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            // aggressive optimization for the purpose of fs walking
+            globParts = this.firstPhasePreProcess(globParts);
+            globParts = this.secondPhasePreProcess(globParts);
+        }
+        else if (optimizationLevel >= 1) {
+            // just basic optimizations to remove some .. parts
+            globParts = this.levelOneOptimize(globParts);
+        }
+        else {
+            // just collapse multiple ** portions into one
+            globParts = this.adjascentGlobstarOptimize(globParts);
+        }
+        return globParts;
+    }
+    // just get rid of adjascent ** portions
+    adjascentGlobstarOptimize(globParts) {
+        return globParts.map(parts => {
+            let gs = -1;
+            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
+                let i = gs;
+                while (parts[i + 1] === '**') {
+                    i++;
+                }
+                if (i !== gs) {
+                    parts.splice(gs, i - gs);
+                }
+            }
+            return parts;
+        });
+    }
+    // get rid of adjascent ** and resolve .. portions
+    levelOneOptimize(globParts) {
+        return globParts.map(parts => {
+            parts = parts.reduce((set, part) => {
+                const prev = set[set.length - 1];
+                if (part === '**' && prev === '**') {
+                    return set;
+                }
+                if (part === '..') {
+                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
+                        set.pop();
+                        return set;
+                    }
+                }
+                set.push(part);
+                return set;
+            }, []);
+            return parts.length === 0 ? [''] : parts;
+        });
+    }
+    levelTwoFileOptimize(parts) {
+        if (!Array.isArray(parts)) {
+            parts = this.slashSplit(parts);
+        }
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p &&
+                    p !== '.' &&
+                    p !== '..' &&
+                    p !== '**' &&
+                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        let fileStartIndex = 0;
+        let patternStartIndex = 0;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3
+                : fileDrive ? 0
+                    : undefined;
+            const pdi = patternUNC ? 3
+                : patternDrive ? 0
+                    : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [
+                    file[fdi],
+                    pattern[pdi],
+                ];
+                // start matching at the drive letter index of each
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    patternStartIndex = pdi;
+                    fileStartIndex = fdi;
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // don't need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        if (pattern.includes(GLOBSTAR)) {
+            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
+        }
+        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+    }
+    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
+        // split the pattern into head, tail, and middle of ** delimited parts
+        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
+        const lastgs = pattern.lastIndexOf(GLOBSTAR);
+        // split the pattern up into globstar-delimited sections
+        // the tail has to be at the end, and the others just have
+        // to be found in order from the head.
+        const [head, body, tail] = partial ?
+            [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1),
+                [],
+            ]
+            : [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1, lastgs),
+                pattern.slice(lastgs + 1),
+            ];
+        // check the head, from the current file/pattern index.
+        if (head.length) {
+            const fileHead = file.slice(fileIndex, fileIndex + head.length);
+            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
+                return false;
+            }
+            fileIndex += head.length;
+            patternIndex += head.length;
+        }
+        // now we know the head matches!
+        // if the last portion is not empty, it MUST match the end
+        // check the tail
+        let fileTailMatch = 0;
+        if (tail.length) {
+            // if head + tail > file, then we cannot possibly match
+            if (tail.length + fileIndex > file.length)
+                return false;
+            // try to match the tail
+            let tailStart = file.length - tail.length;
+            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
+                fileTailMatch = tail.length;
+            }
+            else {
+                // affordance for stuff like a/**/* matching a/b/
+                // if the last file portion is '', and there's more to the pattern
+                // then try without the '' bit.
+                if (file[file.length - 1] !== '' ||
+                    fileIndex + tail.length === file.length) {
+                    return false;
+                }
+                tailStart--;
+                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
+                    return false;
+                }
+                fileTailMatch = tail.length + 1;
+            }
+        }
+        // now we know the tail matches!
+        // the middle is zero or more portions wrapped in **, possibly
+        // containing more ** sections.
+        // so a/**/b/**/c/**/d has become **/b/**/c/**
+        // if it's empty, it means a/**/b, just verify we have no bad dots
+        // if there's no tail, so it ends on /**, then we must have *something*
+        // after the head, or it's not a matc
+        if (!body.length) {
+            let sawSome = !!fileTailMatch;
+            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
+                const f = String(file[i]);
+                sawSome = true;
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            // in partial mode, we just need to get past all file parts
+            return partial || sawSome;
+        }
+        // now we know that there's one or more body sections, which can
+        // be matched anywhere from the 0 index (because the head was pruned)
+        // through to the length-fileTailMatch index.
+        // split the body up into sections, and note the minimum index it can
+        // be found at (start with the length of all previous segments)
+        // [section, before, after]
+        const bodySegments = [[[], 0]];
+        let currentBody = bodySegments[0];
+        let nonGsParts = 0;
+        const nonGsPartsSums = [0];
+        for (const b of body) {
+            if (b === GLOBSTAR) {
+                nonGsPartsSums.push(nonGsParts);
+                currentBody = [[], 0];
+                bodySegments.push(currentBody);
+            }
+            else {
+                currentBody[0].push(b);
+                nonGsParts++;
+            }
+        }
+        let i = bodySegments.length - 1;
+        const fileLength = file.length - fileTailMatch;
+        for (const b of bodySegments) {
+            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+        }
+        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+    }
+    // return false for "nope, not matching"
+    // return null for "not matching, cannot keep trying"
+    #matchGlobStarBodySections(file, 
+    // pattern section, last possible position for it
+    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
+        // take the first body segment, and walk from fileIndex to its "after"
+        // value at the end
+        // If it doesn't match at that position, we increment, until we hit
+        // that final possible position, and give up.
+        // If it does match, then advance and try to rest.
+        // If any of them fail we keep walking forward.
+        // this is still a bit recursively painful, but it's more constrained
+        // than previous implementations, because we never test something that
+        // can't possibly be a valid matching condition.
+        const bs = bodySegments[bodyIndex];
+        if (!bs) {
+            // just make sure that there's no bad dots
+            for (let i = fileIndex; i < file.length; i++) {
+                sawTail = true;
+                const f = file[i];
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            return sawTail;
+        }
+        // have a non-globstar body section to test
+        const [body, after] = bs;
+        while (fileIndex <= after) {
+            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
+            // if limit exceeded, no match. intentional false negative,
+            // acceptable break in correctness for security.
+            if (m && globStarDepth < this.maxGlobstarRecursion) {
+                // match! see if the rest match. if so, we're done!
+                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
+                if (sub !== false) {
+                    return sub;
+                }
+            }
+            const f = file[fileIndex];
+            if (f === '.' ||
+                f === '..' ||
+                (!this.options.dot && f.startsWith('.'))) {
+                return false;
+            }
+            fileIndex++;
+        }
+        // walked off. no point continuing
+        return partial || null;
+    }
+    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
+        let fi;
+        let pi;
+        let pl;
+        let fl;
+        for (fi = fileIndex,
+            pi = patternIndex,
+            fl = file.length,
+            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            let p = pattern[pi];
+            let f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false || p === GLOBSTAR) {
+                return false;
+            }
+            /* c8 ignore stop */
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return braceExpand(this.pattern, this.options);
+    }
+    parse(pattern) {
+        assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar ? star
+            : options.dot ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return (typeof p === 'string' ? regExpEscape(p)
+                    : p === GLOBSTAR ? GLOBSTAR
+                        : p._src);
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== GLOBSTAR || prev === GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
+                }
+                else if (next !== GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = GLOBSTAR;
+                }
+            });
+            const filtered = pp.filter(p => p !== GLOBSTAR);
+            // For partial matches, we need to make the pattern match
+            // any prefix of the full path. We do this by generating
+            // alternative patterns that match progressively longer prefixes.
+            if (this.partial && filtered.length >= 1) {
+                const prefixes = [];
+                for (let i = 1; i <= filtered.length; i++) {
+                    prefixes.push(filtered.slice(0, i).join('/'));
+                }
+                return '(?:' + prefixes.join('|') + ')';
+            }
+            return filtered.join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // In partial mode, '/' should always match as it's a valid prefix for any pattern
+        if (this.partial) {
+            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
+        }
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (const pattern of set) {
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore start */
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+/* c8 ignore stop */
+minimatch.AST = AST;
+minimatch.Minimatch = Minimatch;
+minimatch.escape = escape;
+minimatch.unescape = unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/index.js.map b/node_modules/minimatch/dist/esm/index.js.map
new file mode 100644
index 00000000..431b3a15
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAqHxC,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,kBAAkB,CAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACpD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAA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,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YACjD,IAAI,GAAG,EAAE,CAAC;gBACR,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;YACrB,CAAC;QACH,CAAC;QAED,2DAA2D;QAC3D,8BAA8B;QAC9B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AACD,qBAAqB;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,oBAAoB;AACpB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAA;AACnB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AACzB,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/package.json b/node_modules/minimatch/dist/esm/package.json
new file mode 100644
index 00000000..3dbc1ca5
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/node_modules/minimatch/dist/esm/unescape.d.ts b/node_modules/minimatch/dist/esm/unescape.d.ts
new file mode 100644
index 00000000..c4a14473
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/unescape.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=unescape.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/unescape.d.ts.map b/node_modules/minimatch/dist/esm/unescape.d.ts.map
new file mode 100644
index 00000000..09d6eab4
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/unescape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/unescape.js b/node_modules/minimatch/dist/esm/unescape.js
new file mode 100644
index 00000000..19ce86e7
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/unescape.js
@@ -0,0 +1,34 @@
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/\[([^/\\])\]/g, '$1')
+            : s
+                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
+                .replace(/\\([^/])/g, '$1');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/\[([^/\\{}])\]/g, '$1')
+        : s
+            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
+            .replace(/\\([^/{}])/g, '$1');
+};
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/node_modules/minimatch/dist/esm/unescape.js.map b/node_modules/minimatch/dist/esm/unescape.js.map
new file mode 100644
index 00000000..6d507391
--- /dev/null
+++ b/node_modules/minimatch/dist/esm/unescape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json
new file mode 100644
index 00000000..211875c6
--- /dev/null
+++ b/node_modules/minimatch/package.json
@@ -0,0 +1,73 @@
+{
+  "author": "Isaac Z. Schlueter  (http://blog.izs.me)",
+  "name": "minimatch",
+  "description": "a glob matcher in javascript",
+  "version": "10.2.5",
+  "repository": {
+    "type": "git",
+    "url": "git@github.com:isaacs/minimatch"
+  },
+  "main": "./dist/commonjs/index.js",
+  "types": "./dist/commonjs/index.d.ts",
+  "exports": {
+    "./package.json": "./package.json",
+    ".": {
+      "import": {
+        "types": "./dist/esm/index.d.ts",
+        "default": "./dist/esm/index.js"
+      },
+      "require": {
+        "types": "./dist/commonjs/index.d.ts",
+        "default": "./dist/commonjs/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "prepare": "tshy",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "tap",
+    "snap": "tap",
+    "format": "prettier --write .",
+    "benchmark": "node benchmark/index.js",
+    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
+    "lint": "oxlint --fix src test",
+    "postsnap": "npm run lint",
+    "postlint": "npm run format"
+  },
+  "engines": {
+    "node": "18 || 20 || >=22"
+  },
+  "devDependencies": {
+    "@types/node": "^25.5.0",
+    "mkdirp": "^3.0.1",
+    "oxlint": "^1.57.0",
+    "oxlint-tsgolint": "^0.18.1",
+    "prettier": "^3.8.1",
+    "tap": "^21.6.2",
+    "tshy": "^4.0.0",
+    "typedoc": "^0.28.18"
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/isaacs"
+  },
+  "license": "BlueOak-1.0.0",
+  "tshy": {
+    "exports": {
+      "./package.json": "./package.json",
+      ".": "./src/index.ts"
+    },
+    "selfLink": false
+  },
+  "type": "module",
+  "module": "./dist/esm/index.js",
+  "dependencies": {
+    "brace-expansion": "^5.0.5"
+  }
+}
diff --git a/node_modules/minipass/LICENSE.md b/node_modules/minipass/LICENSE.md
new file mode 100644
index 00000000..c5402b95
--- /dev/null
+++ b/node_modules/minipass/LICENSE.md
@@ -0,0 +1,55 @@
+# Blue Oak Model License
+
+Version 1.0.0
+
+## Purpose
+
+This license gives everyone as much permission to work with
+this software as possible, while protecting contributors
+from liability.
+
+## Acceptance
+
+In order to receive this license, you must agree to its
+rules.  The rules of this license are both obligations
+under that agreement and conditions to your license.
+You must not do anything with this software that triggers
+a rule that you cannot or will not follow.
+
+## Copyright
+
+Each contributor licenses you to do everything with this
+software that would otherwise infringe that contributor's
+copyright in it.
+
+## Notices
+
+You must ensure that everyone who gets a copy of
+any part of this software from you, with or without
+changes, also gets the text of this license or a link to
+.
+
+## Excuse
+
+If anyone notifies you in writing that you have not
+complied with [Notices](#notices), you can keep your
+license by taking all practical steps to comply within 30
+days after the notice.  If you do not do so, your license
+ends immediately.
+
+## Patent
+
+Each contributor licenses you to do everything with this
+software that would otherwise infringe any patent claims
+they can license or become able to license.
+
+## Reliability
+
+No contributor can revoke this license.
+
+## No Liability
+
+***As far as the law allows, this software comes as is,
+without any warranty or condition, and no contributor
+will be liable to anyone for any damages related to this
+software or this license, under any kind of legal claim.***
diff --git a/node_modules/minipass/README.md b/node_modules/minipass/README.md
new file mode 100644
index 00000000..11263305
--- /dev/null
+++ b/node_modules/minipass/README.md
@@ -0,0 +1,825 @@
+# minipass
+
+A _very_ minimal implementation of a [PassThrough
+stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough)
+
+[It's very
+fast](https://docs.google.com/spreadsheets/d/1K_HR5oh3r80b8WVMWCPPjfuWXUgfkmhlX7FGI6JJ8tY/edit?usp=sharing)
+for objects, strings, and buffers.
+
+Supports `pipe()`ing (including multi-`pipe()` and backpressure
+transmission), buffering data until either a `data` event handler
+or `pipe()` is added (so you don't lose the first chunk), and
+most other cases where PassThrough is a good idea.
+
+There is a `read()` method, but it's much more efficient to
+consume data from this stream via `'data'` events or by calling
+`pipe()` into some other stream. Calling `read()` requires the
+buffer to be flattened in some cases, which requires copying
+memory.
+
+If you set `objectMode: true` in the options, then whatever is
+written will be emitted. Otherwise, it'll do a minimal amount of
+Buffer copying to ensure proper Streams semantics when `read(n)`
+is called.
+
+`objectMode` can only be set at instantiation. Attempting to
+write something other than a String or Buffer without having set
+`objectMode` in the options will throw an error.
+
+This is not a `through` or `through2` stream. It doesn't
+transform the data, it just passes it right through. If you want
+to transform the data, extend the class, and override the
+`write()` method. Once you're done transforming the data however
+you want, call `super.write()` with the transform output.
+
+For some examples of streams that extend Minipass in various
+ways, check out:
+
+- [minizlib](http://npm.im/minizlib)
+- [fs-minipass](http://npm.im/fs-minipass)
+- [tar](http://npm.im/tar)
+- [minipass-collect](http://npm.im/minipass-collect)
+- [minipass-flush](http://npm.im/minipass-flush)
+- [minipass-pipeline](http://npm.im/minipass-pipeline)
+- [tap](http://npm.im/tap)
+- [tap-parser](http://npm.im/tap-parser)
+- [treport](http://npm.im/treport)
+- [minipass-fetch](http://npm.im/minipass-fetch)
+- [pacote](http://npm.im/pacote)
+- [make-fetch-happen](http://npm.im/make-fetch-happen)
+- [cacache](http://npm.im/cacache)
+- [ssri](http://npm.im/ssri)
+- [npm-registry-fetch](http://npm.im/npm-registry-fetch)
+- [minipass-json-stream](http://npm.im/minipass-json-stream)
+- [minipass-sized](http://npm.im/minipass-sized)
+
+## Usage in TypeScript
+
+The `Minipass` class takes three type template definitions:
+
+- `RType` the type being read, which defaults to `Buffer`. If
+  `RType` is `string`, then the constructor _must_ get an options
+  object specifying either an `encoding` or `objectMode: true`.
+  If it's anything other than `string` or `Buffer`, then it
+  _must_ get an options object specifying `objectMode: true`.
+- `WType` the type being written. If `RType` is `Buffer` or
+  `string`, then this defaults to `ContiguousData` (Buffer,
+  string, ArrayBuffer, or ArrayBufferView). Otherwise, it
+  defaults to `RType`.
+- `Events` type mapping event names to the arguments emitted
+  with that event, which extends `Minipass.Events`.
+
+To declare types for custom events in subclasses, extend the
+third parameter with your own event signatures. For example:
+
+```js
+import { Minipass } from 'minipass'
+
+// a NDJSON stream that emits 'jsonError' when it can't stringify
+export interface Events extends Minipass.Events {
+  jsonError: [e: Error]
+}
+
+export class NDJSONStream extends Minipass {
+  constructor() {
+    super({ objectMode: true })
+  }
+
+  // data is type `any` because that's WType
+  write(data, encoding, cb) {
+    try {
+      const json = JSON.stringify(data)
+      return super.write(json + '\n', encoding, cb)
+    } catch (er) {
+      if (!er instanceof Error) {
+        er = Object.assign(new Error('json stringify failed'), {
+          cause: er,
+        })
+      }
+      // trying to emit with something OTHER than an error will
+      // fail, because we declared the event arguments type.
+      this.emit('jsonError', er)
+    }
+  }
+}
+
+const s = new NDJSONStream()
+s.on('jsonError', e => {
+  // here, TS knows that e is an Error
+})
+```
+
+Emitting/handling events that aren't declared in this way is
+fine, but the arguments will be typed as `unknown`.
+
+## Differences from Node.js Streams
+
+There are several things that make Minipass streams different
+from (and in some ways superior to) Node.js core streams.
+
+Please read these caveats if you are familiar with node-core
+streams and intend to use Minipass streams in your programs.
+
+You can avoid most of these differences entirely (for a very
+small performance penalty) by setting `{async: true}` in the
+constructor options.
+
+### Timing
+
+Minipass streams are designed to support synchronous use-cases.
+Thus, data is emitted as soon as it is available, always. It is
+buffered until read, but no longer. Another way to look at it is
+that Minipass streams are exactly as synchronous as the logic
+that writes into them.
+
+This can be surprising if your code relies on
+`PassThrough.write()` always providing data on the next tick
+rather than the current one, or being able to call `resume()` and
+not have the entire buffer disappear immediately.
+
+However, without this synchronicity guarantee, there would be no
+way for Minipass to achieve the speeds it does, or support the
+synchronous use cases that it does. Simply put, waiting takes
+time.
+
+This non-deferring approach makes Minipass streams much easier to
+reason about, especially in the context of Promises and other
+flow-control mechanisms.
+
+Example:
+
+```js
+// hybrid module, either works
+import { Minipass } from 'minipass'
+// or:
+const { Minipass } = require('minipass')
+
+const stream = new Minipass()
+stream.on('data', () => console.log('data event'))
+console.log('before write')
+stream.write('hello')
+console.log('after write')
+// output:
+// before write
+// data event
+// after write
+```
+
+### Exception: Async Opt-In
+
+If you wish to have a Minipass stream with behavior that more
+closely mimics Node.js core streams, you can set the stream in
+async mode either by setting `async: true` in the constructor
+options, or by setting `stream.async = true` later on.
+
+```js
+// hybrid module, either works
+import { Minipass } from 'minipass'
+// or:
+const { Minipass } = require('minipass')
+
+const asyncStream = new Minipass({ async: true })
+asyncStream.on('data', () => console.log('data event'))
+console.log('before write')
+asyncStream.write('hello')
+console.log('after write')
+// output:
+// before write
+// after write
+// data event <-- this is deferred until the next tick
+```
+
+Switching _out_ of async mode is unsafe, as it could cause data
+corruption, and so is not enabled. Example:
+
+```js
+import { Minipass } from 'minipass'
+const stream = new Minipass({ encoding: 'utf8' })
+stream.on('data', chunk => console.log(chunk))
+stream.async = true
+console.log('before writes')
+stream.write('hello')
+setStreamSyncAgainSomehow(stream) // <-- this doesn't actually exist!
+stream.write('world')
+console.log('after writes')
+// hypothetical output would be:
+// before writes
+// world
+// after writes
+// hello
+// NOT GOOD!
+```
+
+To avoid this problem, once set into async mode, any attempt to
+make the stream sync again will be ignored.
+
+```js
+const { Minipass } = require('minipass')
+const stream = new Minipass({ encoding: 'utf8' })
+stream.on('data', chunk => console.log(chunk))
+stream.async = true
+console.log('before writes')
+stream.write('hello')
+stream.async = false // <-- no-op, stream already async
+stream.write('world')
+console.log('after writes')
+// actual output:
+// before writes
+// after writes
+// hello
+// world
+```
+
+### No High/Low Water Marks
+
+Node.js core streams will optimistically fill up a buffer,
+returning `true` on all writes until the limit is hit, even if
+the data has nowhere to go. Then, they will not attempt to draw
+more data in until the buffer size dips below a minimum value.
+
+Minipass streams are much simpler. The `write()` method will
+return `true` if the data has somewhere to go (which is to say,
+given the timing guarantees, that the data is already there by
+the time `write()` returns).
+
+If the data has nowhere to go, then `write()` returns false, and
+the data sits in a buffer, to be drained out immediately as soon
+as anyone consumes it.
+
+Since nothing is ever buffered unnecessarily, there is much less
+copying data, and less bookkeeping about buffer capacity levels.
+
+### Hazards of Buffering (or: Why Minipass Is So Fast)
+
+Since data written to a Minipass stream is immediately written
+all the way through the pipeline, and `write()` always returns
+true/false based on whether the data was fully flushed,
+backpressure is communicated immediately to the upstream caller.
+This minimizes buffering.
+
+Consider this case:
+
+```js
+const { PassThrough } = require('stream')
+const p1 = new PassThrough({ highWaterMark: 1024 })
+const p2 = new PassThrough({ highWaterMark: 1024 })
+const p3 = new PassThrough({ highWaterMark: 1024 })
+const p4 = new PassThrough({ highWaterMark: 1024 })
+
+p1.pipe(p2).pipe(p3).pipe(p4)
+p4.on('data', () => console.log('made it through'))
+
+// this returns false and buffers, then writes to p2 on next tick (1)
+// p2 returns false and buffers, pausing p1, then writes to p3 on next tick (2)
+// p3 returns false and buffers, pausing p2, then writes to p4 on next tick (3)
+// p4 returns false and buffers, pausing p3, then emits 'data' and 'drain'
+// on next tick (4)
+// p3 sees p4's 'drain' event, and calls resume(), emitting 'resume' and
+// 'drain' on next tick (5)
+// p2 sees p3's 'drain', calls resume(), emits 'resume' and 'drain' on next tick (6)
+// p1 sees p2's 'drain', calls resume(), emits 'resume' and 'drain' on next
+// tick (7)
+
+p1.write(Buffer.alloc(2048)) // returns false
+```
+
+Along the way, the data was buffered and deferred at each stage,
+and multiple event deferrals happened, for an unblocked pipeline
+where it was perfectly safe to write all the way through!
+
+Furthermore, setting a `highWaterMark` of `1024` might lead
+someone reading the code to think an advisory maximum of 1KiB is
+being set for the pipeline. However, the actual advisory
+buffering level is the _sum_ of `highWaterMark` values, since
+each one has its own bucket.
+
+Consider the Minipass case:
+
+```js
+const m1 = new Minipass()
+const m2 = new Minipass()
+const m3 = new Minipass()
+const m4 = new Minipass()
+
+m1.pipe(m2).pipe(m3).pipe(m4)
+m4.on('data', () => console.log('made it through'))
+
+// m1 is flowing, so it writes the data to m2 immediately
+// m2 is flowing, so it writes the data to m3 immediately
+// m3 is flowing, so it writes the data to m4 immediately
+// m4 is flowing, so it fires the 'data' event immediately, returns true
+// m4's write returned true, so m3 is still flowing, returns true
+// m3's write returned true, so m2 is still flowing, returns true
+// m2's write returned true, so m1 is still flowing, returns true
+// No event deferrals or buffering along the way!
+
+m1.write(Buffer.alloc(2048)) // returns true
+```
+
+It is extremely unlikely that you _don't_ want to buffer any data
+written, or _ever_ buffer data that can be flushed all the way
+through. Neither node-core streams nor Minipass ever fail to
+buffer written data, but node-core streams do a lot of
+unnecessary buffering and pausing.
+
+As always, the faster implementation is the one that does less
+stuff and waits less time to do it.
+
+### Immediately emit `end` for empty streams (when not paused)
+
+If a stream is not paused, and `end()` is called before writing
+any data into it, then it will emit `end` immediately.
+
+If you have logic that occurs on the `end` event which you don't
+want to potentially happen immediately (for example, closing file
+descriptors, moving on to the next entry in an archive parse
+stream, etc.) then be sure to call `stream.pause()` on creation,
+and then `stream.resume()` once you are ready to respond to the
+`end` event.
+
+However, this is _usually_ not a problem because:
+
+### Emit `end` When Asked
+
+One hazard of immediately emitting `'end'` is that you may not
+yet have had a chance to add a listener. In order to avoid this
+hazard, Minipass streams safely re-emit the `'end'` event if a
+new listener is added after `'end'` has been emitted.
+
+Ie, if you do `stream.on('end', someFunction)`, and the stream
+has already emitted `end`, then it will call the handler right
+away. (You can think of this somewhat like attaching a new
+`.then(fn)` to a previously-resolved Promise.)
+
+To prevent calling handlers multiple times who would not expect
+multiple ends to occur, all listeners are removed from the
+`'end'` event whenever it is emitted.
+
+### Emit `error` When Asked
+
+The most recent error object passed to the `'error'` event is
+stored on the stream. If a new `'error'` event handler is added,
+and an error was previously emitted, then the event handler will
+be called immediately (or on `process.nextTick` in the case of
+async streams).
+
+This makes it much more difficult to end up trying to interact
+with a broken stream, if the error handler is added after an
+error was previously emitted.
+
+### Impact of "immediate flow" on Tee-streams
+
+A "tee stream" is a stream piping to multiple destinations:
+
+```js
+const tee = new Minipass()
+t.pipe(dest1)
+t.pipe(dest2)
+t.write('foo') // goes to both destinations
+```
+
+Since Minipass streams _immediately_ process any pending data
+through the pipeline when a new pipe destination is added, this
+can have surprising effects, especially when a stream comes in
+from some other function and may or may not have data in its
+buffer.
+
+```js
+// WARNING! WILL LOSE DATA!
+const src = new Minipass()
+src.write('foo')
+src.pipe(dest1) // 'foo' chunk flows to dest1 immediately, and is gone
+src.pipe(dest2) // gets nothing!
+```
+
+One solution is to create a dedicated tee-stream junction that
+pipes to both locations, and then pipe to _that_ instead.
+
+```js
+// Safe example: tee to both places
+const src = new Minipass()
+src.write('foo')
+const tee = new Minipass()
+tee.pipe(dest1)
+tee.pipe(dest2)
+src.pipe(tee) // tee gets 'foo', pipes to both locations
+```
+
+The same caveat applies to `on('data')` event listeners. The
+first one added will _immediately_ receive all of the data,
+leaving nothing for the second:
+
+```js
+// WARNING! WILL LOSE DATA!
+const src = new Minipass()
+src.write('foo')
+src.on('data', handler1) // receives 'foo' right away
+src.on('data', handler2) // nothing to see here!
+```
+
+Using a dedicated tee-stream can be used in this case as well:
+
+```js
+// Safe example: tee to both data handlers
+const src = new Minipass()
+src.write('foo')
+const tee = new Minipass()
+tee.on('data', handler1)
+tee.on('data', handler2)
+src.pipe(tee)
+```
+
+All of the hazards in this section are avoided by setting `{
+async: true }` in the Minipass constructor, or by setting
+`stream.async = true` afterwards. Note that this does add some
+overhead, so should only be done in cases where you are willing
+to lose a bit of performance in order to avoid having to refactor
+program logic.
+
+## USAGE
+
+It's a stream! Use it like a stream and it'll most likely do what
+you want.
+
+```js
+import { Minipass } from 'minipass'
+const mp = new Minipass(options) // options is optional
+mp.write('foo')
+mp.pipe(someOtherStream)
+mp.end('bar')
+```
+
+### OPTIONS
+
+- `encoding` How would you like the data coming _out_ of the
+  stream to be encoded? Accepts any values that can be passed to
+  `Buffer.toString()`.
+- `objectMode` Emit data exactly as it comes in. This will be
+  flipped on by default if you write() something other than a
+  string or Buffer at any point. Setting `objectMode: true` will
+  prevent setting any encoding value.
+- `async` Defaults to `false`. Set to `true` to defer data
+  emission until next tick. This reduces performance slightly,
+  but makes Minipass streams use timing behavior closer to Node
+  core streams. See [Timing](#timing) for more details.
+- `signal` An `AbortSignal` that will cause the stream to unhook
+  itself from everything and become as inert as possible. Note
+  that providing a `signal` parameter will make `'error'` events
+  no longer throw if they are unhandled, but they will still be
+  emitted to handlers if any are attached.
+
+### API
+
+Implements the user-facing portions of Node.js's `Readable` and
+`Writable` streams.
+
+### Methods
+
+- `write(chunk, [encoding], [callback])` - Put data in. (Note
+  that, in the base Minipass class, the same data will come out.)
+  Returns `false` if the stream will buffer the next write, or
+  true if it's still in "flowing" mode.
+- `end([chunk, [encoding]], [callback])` - Signal that you have
+  no more data to write. This will queue an `end` event to be
+  fired when all the data has been consumed.
+- `pause()` - No more data for a while, please. This also
+  prevents `end` from being emitted for empty streams until the
+  stream is resumed.
+- `resume()` - Resume the stream. If there's data in the buffer,
+  it is all discarded. Any buffered events are immediately
+  emitted.
+- `pipe(dest)` - Send all output to the stream provided. When
+  data is emitted, it is immediately written to any and all pipe
+  destinations. (Or written on next tick in `async` mode.)
+- `unpipe(dest)` - Stop piping to the destination stream. This is
+  immediate, meaning that any asynchronously queued data will
+  _not_ make it to the destination when running in `async` mode.
+  - `options.end` - Boolean, end the destination stream when the
+    source stream ends. Default `true`.
+  - `options.proxyErrors` - Boolean, proxy `error` events from
+    the source stream to the destination stream. Note that errors
+    are _not_ proxied after the pipeline terminates, either due
+    to the source emitting `'end'` or manually unpiping with
+    `src.unpipe(dest)`. Default `false`.
+- `on(ev, fn)`, `emit(ev, fn)` - Minipass streams are
+  EventEmitters. Some events are given special treatment,
+  however. (See below under "events".)
+- `promise()` - Returns a Promise that resolves when the stream
+  emits `end`, or rejects if the stream emits `error`.
+- `collect()` - Return a Promise that resolves on `end` with an
+  array containing each chunk of data that was emitted, or
+  rejects if the stream emits `error`. Note that this consumes
+  the stream data.
+- `concat()` - Same as `collect()`, but concatenates the data
+  into a single Buffer object. Will reject the returned promise
+  if the stream is in objectMode, or if it goes into objectMode
+  by the end of the data.
+- `read(n)` - Consume `n` bytes of data out of the buffer. If `n`
+  is not provided, then consume all of it. If `n` bytes are not
+  available, then it returns null. **Note** consuming streams in
+  this way is less efficient, and can lead to unnecessary Buffer
+  copying.
+- `destroy([er])` - Destroy the stream. If an error is provided,
+  then an `'error'` event is emitted. If the stream has a
+  `close()` method, and has not emitted a `'close'` event yet,
+  then `stream.close()` will be called. Any Promises returned by
+  `.promise()`, `.collect()` or `.concat()` will be rejected.
+  After being destroyed, writing to the stream will emit an
+  error. No more data will be emitted if the stream is destroyed,
+  even if it was previously buffered.
+
+### Properties
+
+- `bufferLength` Read-only. Total number of bytes buffered, or in
+  the case of objectMode, the total number of objects.
+- `encoding` Read-only. The encoding that has been set.
+- `flowing` Read-only. Boolean indicating whether a chunk written
+  to the stream will be immediately emitted.
+- `emittedEnd` Read-only. Boolean indicating whether the end-ish
+  events (ie, `end`, `prefinish`, `finish`) have been emitted.
+  Note that listening on any end-ish event will immediateyl
+  re-emit it if it has already been emitted.
+- `writable` Whether the stream is writable. Default `true`. Set
+  to `false` when `end()`
+- `readable` Whether the stream is readable. Default `true`.
+- `pipes` An array of Pipe objects referencing streams that this
+  stream is piping into.
+- `destroyed` A getter that indicates whether the stream was
+  destroyed.
+- `paused` True if the stream has been explicitly paused,
+  otherwise false.
+- `objectMode` Indicates whether the stream is in `objectMode`.
+- `aborted` Readonly property set when the `AbortSignal`
+  dispatches an `abort` event.
+
+### Events
+
+- `data` Emitted when there's data to read. Argument is the data
+  to read. This is never emitted while not flowing. If a listener
+  is attached, that will resume the stream.
+- `end` Emitted when there's no more data to read. This will be
+  emitted immediately for empty streams when `end()` is called.
+  If a listener is attached, and `end` was already emitted, then
+  it will be emitted again. All listeners are removed when `end`
+  is emitted.
+- `prefinish` An end-ish event that follows the same logic as
+  `end` and is emitted in the same conditions where `end` is
+  emitted. Emitted after `'end'`.
+- `finish` An end-ish event that follows the same logic as `end`
+  and is emitted in the same conditions where `end` is emitted.
+  Emitted after `'prefinish'`.
+- `close` An indication that an underlying resource has been
+  released. Minipass does not emit this event, but will defer it
+  until after `end` has been emitted, since it throws off some
+  stream libraries otherwise.
+- `drain` Emitted when the internal buffer empties, and it is
+  again suitable to `write()` into the stream.
+- `readable` Emitted when data is buffered and ready to be read
+  by a consumer.
+- `resume` Emitted when stream changes state from buffering to
+  flowing mode. (Ie, when `resume` is called, `pipe` is called,
+  or a `data` event listener is added.)
+
+### Static Methods
+
+- `Minipass.isStream(stream)` Returns `true` if the argument is a
+  stream, and false otherwise. To be considered a stream, the
+  object must be either an instance of Minipass, or an
+  EventEmitter that has either a `pipe()` method, or both
+  `write()` and `end()` methods. (Pretty much any stream in
+  node-land will return `true` for this.)
+
+## EXAMPLES
+
+Here are some examples of things you can do with Minipass
+streams.
+
+### simple "are you done yet" promise
+
+```js
+mp.promise().then(
+  () => {
+    // stream is finished
+  },
+  er => {
+    // stream emitted an error
+  }
+)
+```
+
+### collecting
+
+```js
+mp.collect().then(all => {
+  // all is an array of all the data emitted
+  // encoding is supported in this case, so
+  // so the result will be a collection of strings if
+  // an encoding is specified, or buffers/objects if not.
+  //
+  // In an async function, you may do
+  // const data = await stream.collect()
+})
+```
+
+### collecting into a single blob
+
+This is a bit slower because it concatenates the data into one
+chunk for you, but if you're going to do it yourself anyway, it's
+convenient this way:
+
+```js
+mp.concat().then(onebigchunk => {
+  // onebigchunk is a string if the stream
+  // had an encoding set, or a buffer otherwise.
+})
+```
+
+### iteration
+
+You can iterate over streams synchronously or asynchronously in
+platforms that support it.
+
+Synchronous iteration will end when the currently available data
+is consumed, even if the `end` event has not been reached. In
+string and buffer mode, the data is concatenated, so unless
+multiple writes are occurring in the same tick as the `read()`,
+sync iteration loops will generally only have a single iteration.
+
+To consume chunks in this way exactly as they have been written,
+with no flattening, create the stream with the `{ objectMode:
+true }` option.
+
+```js
+const mp = new Minipass({ objectMode: true })
+mp.write('a')
+mp.write('b')
+for (let letter of mp) {
+  console.log(letter) // a, b
+}
+mp.write('c')
+mp.write('d')
+for (let letter of mp) {
+  console.log(letter) // c, d
+}
+mp.write('e')
+mp.end()
+for (let letter of mp) {
+  console.log(letter) // e
+}
+for (let letter of mp) {
+  console.log(letter) // nothing
+}
+```
+
+Asynchronous iteration will continue until the end event is reached,
+consuming all of the data.
+
+```js
+const mp = new Minipass({ encoding: 'utf8' })
+
+// some source of some data
+let i = 5
+const inter = setInterval(() => {
+  if (i-- > 0) mp.write(Buffer.from('foo\n', 'utf8'))
+  else {
+    mp.end()
+    clearInterval(inter)
+  }
+}, 100)
+
+// consume the data with asynchronous iteration
+async function consume() {
+  for await (let chunk of mp) {
+    console.log(chunk)
+  }
+  return 'ok'
+}
+
+consume().then(res => console.log(res))
+// logs `foo\n` 5 times, and then `ok`
+```
+
+### subclass that `console.log()`s everything written into it
+
+```js
+class Logger extends Minipass {
+  write(chunk, encoding, callback) {
+    console.log('WRITE', chunk, encoding)
+    return super.write(chunk, encoding, callback)
+  }
+  end(chunk, encoding, callback) {
+    console.log('END', chunk, encoding)
+    return super.end(chunk, encoding, callback)
+  }
+}
+
+someSource.pipe(new Logger()).pipe(someDest)
+```
+
+### same thing, but using an inline anonymous class
+
+```js
+// js classes are fun
+someSource
+  .pipe(
+    new (class extends Minipass {
+      emit(ev, ...data) {
+        // let's also log events, because debugging some weird thing
+        console.log('EMIT', ev)
+        return super.emit(ev, ...data)
+      }
+      write(chunk, encoding, callback) {
+        console.log('WRITE', chunk, encoding)
+        return super.write(chunk, encoding, callback)
+      }
+      end(chunk, encoding, callback) {
+        console.log('END', chunk, encoding)
+        return super.end(chunk, encoding, callback)
+      }
+    })()
+  )
+  .pipe(someDest)
+```
+
+### subclass that defers 'end' for some reason
+
+```js
+class SlowEnd extends Minipass {
+  emit(ev, ...args) {
+    if (ev === 'end') {
+      console.log('going to end, hold on a sec')
+      setTimeout(() => {
+        console.log('ok, ready to end now')
+        super.emit('end', ...args)
+      }, 100)
+      return true
+    } else {
+      return super.emit(ev, ...args)
+    }
+  }
+}
+```
+
+### transform that creates newline-delimited JSON
+
+```js
+class NDJSONEncode extends Minipass {
+  write(obj, cb) {
+    try {
+      // JSON.stringify can throw, emit an error on that
+      return super.write(JSON.stringify(obj) + '\n', 'utf8', cb)
+    } catch (er) {
+      this.emit('error', er)
+    }
+  }
+  end(obj, cb) {
+    if (typeof obj === 'function') {
+      cb = obj
+      obj = undefined
+    }
+    if (obj !== undefined) {
+      this.write(obj)
+    }
+    return super.end(cb)
+  }
+}
+```
+
+### transform that parses newline-delimited JSON
+
+```js
+class NDJSONDecode extends Minipass {
+  constructor(options) {
+    // always be in object mode, as far as Minipass is concerned
+    super({ objectMode: true })
+    this._jsonBuffer = ''
+  }
+  write(chunk, encoding, cb) {
+    if (
+      typeof chunk === 'string' &&
+      typeof encoding === 'string' &&
+      encoding !== 'utf8'
+    ) {
+      chunk = Buffer.from(chunk, encoding).toString()
+    } else if (Buffer.isBuffer(chunk)) {
+      chunk = chunk.toString()
+    }
+    if (typeof encoding === 'function') {
+      cb = encoding
+    }
+    const jsonData = (this._jsonBuffer + chunk).split('\n')
+    this._jsonBuffer = jsonData.pop()
+    for (let i = 0; i < jsonData.length; i++) {
+      try {
+        // JSON.parse can throw, emit an error on that
+        super.write(JSON.parse(jsonData[i]))
+      } catch (er) {
+        this.emit('error', er)
+        continue
+      }
+    }
+    if (cb) cb()
+  }
+}
+```
diff --git a/node_modules/minipass/dist/commonjs/index.d.ts b/node_modules/minipass/dist/commonjs/index.d.ts
new file mode 100644
index 00000000..3e75b578
--- /dev/null
+++ b/node_modules/minipass/dist/commonjs/index.d.ts
@@ -0,0 +1,545 @@
+import { EventEmitter } from 'node:events';
+import { StringDecoder } from 'node:string_decoder';
+/**
+ * Same as StringDecoder, but exposing the `lastNeed` flag on the type
+ */
+type SD = StringDecoder & {
+    lastNeed: boolean;
+};
+export type { SD, Pipe, PipeProxyErrors };
+/**
+ * Return true if the argument is a Minipass stream, Node stream, or something
+ * else that Minipass can interact with.
+ */
+export declare const isStream: (s: any) => s is Minipass | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter & {
+    end(): any;
+    write(chunk: any, ...args: any[]): any;
+}) | (EventEmitter & {
+    pause(): any;
+    resume(): any;
+    pipe(...destArgs: any[]): any;
+}) | (NodeJS.ReadStream & {
+    fd: number;
+}) | (NodeJS.WriteStream & {
+    fd: number;
+});
+/**
+ * Return true if the argument is a valid {@link Minipass.Readable}
+ */
+export declare const isReadable: (s: any) => s is Minipass.Readable;
+/**
+ * Return true if the argument is a valid {@link Minipass.Writable}
+ */
+export declare const isWritable: (s: any) => s is Minipass.Readable;
+declare const EOF: unique symbol;
+declare const MAYBE_EMIT_END: unique symbol;
+declare const EMITTED_END: unique symbol;
+declare const EMITTING_END: unique symbol;
+declare const EMITTED_ERROR: unique symbol;
+declare const CLOSED: unique symbol;
+declare const READ: unique symbol;
+declare const FLUSH: unique symbol;
+declare const FLUSHCHUNK: unique symbol;
+declare const ENCODING: unique symbol;
+declare const DECODER: unique symbol;
+declare const FLOWING: unique symbol;
+declare const PAUSED: unique symbol;
+declare const RESUME: unique symbol;
+declare const BUFFER: unique symbol;
+declare const PIPES: unique symbol;
+declare const BUFFERLENGTH: unique symbol;
+declare const BUFFERPUSH: unique symbol;
+declare const BUFFERSHIFT: unique symbol;
+declare const OBJECTMODE: unique symbol;
+declare const DESTROYED: unique symbol;
+declare const ERROR: unique symbol;
+declare const EMITDATA: unique symbol;
+declare const EMITEND: unique symbol;
+declare const EMITEND2: unique symbol;
+declare const ASYNC: unique symbol;
+declare const ABORT: unique symbol;
+declare const ABORTED: unique symbol;
+declare const SIGNAL: unique symbol;
+declare const DATALISTENERS: unique symbol;
+declare const DISCARDED: unique symbol;
+/**
+ * Options that may be passed to stream.pipe()
+ */
+export interface PipeOptions {
+    /**
+     * end the destination stream when the source stream ends
+     */
+    end?: boolean;
+    /**
+     * proxy errors from the source stream to the destination stream
+     */
+    proxyErrors?: boolean;
+}
+/**
+ * Internal class representing a pipe to a destination stream.
+ *
+ * @internal
+ */
+declare class Pipe {
+    src: Minipass;
+    dest: Minipass;
+    opts: PipeOptions;
+    ondrain: () => any;
+    constructor(src: Minipass, dest: Minipass.Writable, opts: PipeOptions);
+    unpipe(): void;
+    proxyErrors(_er: any): void;
+    end(): void;
+}
+/**
+ * Internal class representing a pipe to a destination stream where
+ * errors are proxied.
+ *
+ * @internal
+ */
+declare class PipeProxyErrors extends Pipe {
+    unpipe(): void;
+    constructor(src: Minipass, dest: Minipass.Writable, opts: PipeOptions);
+}
+export declare namespace Minipass {
+    /**
+     * Encoding used to create a stream that outputs strings rather than
+     * Buffer objects.
+     */
+    export type Encoding = BufferEncoding | 'buffer' | null;
+    /**
+     * Any stream that Minipass can pipe into
+     */
+    export type Writable = Minipass | NodeJS.WriteStream | (NodeJS.WriteStream & {
+        fd: number;
+    }) | (EventEmitter & {
+        end(): any;
+        write(chunk: any, ...args: any[]): any;
+    });
+    /**
+     * Any stream that can be read from
+     */
+    export type Readable = Minipass | NodeJS.ReadStream | (NodeJS.ReadStream & {
+        fd: number;
+    }) | (EventEmitter & {
+        pause(): any;
+        resume(): any;
+        pipe(...destArgs: any[]): any;
+    });
+    /**
+     * Utility type that can be iterated sync or async
+     */
+    export type DualIterable = Iterable & AsyncIterable;
+    type EventArguments = Record;
+    /**
+     * The listing of events that a Minipass class can emit.
+     * Extend this when extending the Minipass class, and pass as
+     * the third template argument.  The key is the name of the event,
+     * and the value is the argument list.
+     *
+     * Any undeclared events will still be allowed, but the handler will get
+     * arguments as `unknown[]`.
+     */
+    export interface Events extends EventArguments {
+        readable: [];
+        data: [chunk: RType];
+        error: [er: unknown];
+        abort: [reason: unknown];
+        drain: [];
+        resume: [];
+        end: [];
+        finish: [];
+        prefinish: [];
+        close: [];
+        [DESTROYED]: [er?: unknown];
+        [ERROR]: [er: unknown];
+    }
+    /**
+     * String or buffer-like data that can be joined and sliced
+     */
+    export type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string;
+    export type BufferOrString = Buffer | string;
+    /**
+     * Options passed to the Minipass constructor.
+     */
+    export type SharedOptions = {
+        /**
+         * Defer all data emission and other events until the end of the
+         * current tick, similar to Node core streams
+         */
+        async?: boolean;
+        /**
+         * A signal which will abort the stream
+         */
+        signal?: AbortSignal;
+        /**
+         * Output string encoding. Set to `null` or `'buffer'` (or omit) to
+         * emit Buffer objects rather than strings.
+         *
+         * Conflicts with `objectMode`
+         */
+        encoding?: BufferEncoding | null | 'buffer';
+        /**
+         * Output data exactly as it was written, supporting non-buffer/string
+         * data (such as arbitrary objects, falsey values, etc.)
+         *
+         * Conflicts with `encoding`
+         */
+        objectMode?: boolean;
+    };
+    /**
+     * Options for a string encoded output
+     */
+    export type EncodingOptions = SharedOptions & {
+        encoding: BufferEncoding;
+        objectMode?: false;
+    };
+    /**
+     * Options for contiguous data buffer output
+     */
+    export type BufferOptions = SharedOptions & {
+        encoding?: null | 'buffer';
+        objectMode?: false;
+    };
+    /**
+     * Options for objectMode arbitrary output
+     */
+    export type ObjectModeOptions = SharedOptions & {
+        objectMode: true;
+        encoding?: null;
+    };
+    /**
+     * Utility type to determine allowed options based on read type
+     */
+    export type Options = ObjectModeOptions | (T extends string ? EncodingOptions : T extends Buffer ? BufferOptions : SharedOptions);
+    export {};
+}
+/**
+ * Main export, the Minipass class
+ *
+ * `RType` is the type of data emitted, defaults to Buffer
+ *
+ * `WType` is the type of data to be written, if RType is buffer or string,
+ * then any {@link Minipass.ContiguousData} is allowed.
+ *
+ * `Events` is the set of event handler signatures that this object
+ * will emit, see {@link Minipass.Events}
+ */
+export declare class Minipass = Minipass.Events> extends EventEmitter implements Minipass.DualIterable {
+    [FLOWING]: boolean;
+    [PAUSED]: boolean;
+    [PIPES]: Pipe[];
+    [BUFFER]: RType[];
+    [OBJECTMODE]: boolean;
+    [ENCODING]: BufferEncoding | null;
+    [ASYNC]: boolean;
+    [DECODER]: SD | null;
+    [EOF]: boolean;
+    [EMITTED_END]: boolean;
+    [EMITTING_END]: boolean;
+    [CLOSED]: boolean;
+    [EMITTED_ERROR]: unknown;
+    [BUFFERLENGTH]: number;
+    [DESTROYED]: boolean;
+    [SIGNAL]?: AbortSignal;
+    [ABORTED]: boolean;
+    [DATALISTENERS]: number;
+    [DISCARDED]: boolean;
+    /**
+     * true if the stream can be written
+     */
+    writable: boolean;
+    /**
+     * true if the stream can be read
+     */
+    readable: boolean;
+    /**
+     * If `RType` is Buffer, then options do not need to be provided.
+     * Otherwise, an options object must be provided to specify either
+     * {@link Minipass.SharedOptions.objectMode} or
+     * {@link Minipass.SharedOptions.encoding}, as appropriate.
+     */
+    constructor(...args: [Minipass.ObjectModeOptions] | (RType extends Buffer ? [] | [Minipass.Options] : [Minipass.Options]));
+    /**
+     * The amount of data stored in the buffer waiting to be read.
+     *
+     * For Buffer strings, this will be the total byte length.
+     * For string encoding streams, this will be the string character length,
+     * according to JavaScript's `string.length` logic.
+     * For objectMode streams, this is a count of the items waiting to be
+     * emitted.
+     */
+    get bufferLength(): number;
+    /**
+     * The `BufferEncoding` currently in use, or `null`
+     */
+    get encoding(): BufferEncoding | null;
+    /**
+     * @deprecated - This is a read only property
+     */
+    set encoding(_enc: BufferEncoding | null);
+    /**
+     * @deprecated - Encoding may only be set at instantiation time
+     */
+    setEncoding(_enc: Minipass.Encoding): void;
+    /**
+     * True if this is an objectMode stream
+     */
+    get objectMode(): boolean;
+    /**
+     * @deprecated - This is a read-only property
+     */
+    set objectMode(_om: boolean);
+    /**
+     * true if this is an async stream
+     */
+    get ['async'](): boolean;
+    /**
+     * Set to true to make this stream async.
+     *
+     * Once set, it cannot be unset, as this would potentially cause incorrect
+     * behavior.  Ie, a sync stream can be made async, but an async stream
+     * cannot be safely made sync.
+     */
+    set ['async'](a: boolean);
+    [ABORT](): void;
+    /**
+     * True if the stream has been aborted.
+     */
+    get aborted(): boolean;
+    /**
+     * No-op setter. Stream aborted status is set via the AbortSignal provided
+     * in the constructor options.
+     */
+    set aborted(_: boolean);
+    /**
+     * Write data into the stream
+     *
+     * If the chunk written is a string, and encoding is not specified, then
+     * `utf8` will be assumed. If the stream encoding matches the encoding of
+     * a written string, and the state of the string decoder allows it, then
+     * the string will be passed through to either the output or the internal
+     * buffer without any processing. Otherwise, it will be turned into a
+     * Buffer object for processing into the desired encoding.
+     *
+     * If provided, `cb` function is called immediately before return for
+     * sync streams, or on next tick for async streams, because for this
+     * base class, a chunk is considered "processed" once it is accepted
+     * and either emitted or buffered. That is, the callback does not indicate
+     * that the chunk has been eventually emitted, though of course child
+     * classes can override this function to do whatever processing is required
+     * and call `super.write(...)` only once processing is completed.
+     */
+    write(chunk: WType, cb?: () => void): boolean;
+    write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean;
+    /**
+     * Low-level explicit read method.
+     *
+     * In objectMode, the argument is ignored, and one item is returned if
+     * available.
+     *
+     * `n` is the number of bytes (or in the case of encoding streams,
+     * characters) to consume. If `n` is not provided, then the entire buffer
+     * is returned, or `null` is returned if no data is available.
+     *
+     * If `n` is greater that the amount of data in the internal buffer,
+     * then `null` is returned.
+     */
+    read(n?: number | null): RType | null;
+    [READ](n: number | null, chunk: RType): RType;
+    /**
+     * End the stream, optionally providing a final write.
+     *
+     * See {@link Minipass#write} for argument descriptions
+     */
+    end(cb?: () => void): this;
+    end(chunk: WType, cb?: () => void): this;
+    end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this;
+    [RESUME](): void;
+    /**
+     * Resume the stream if it is currently in a paused state
+     *
+     * If called when there are no pipe destinations or `data` event listeners,
+     * this will place the stream in a "discarded" state, where all data will
+     * be thrown away. The discarded state is removed if a pipe destination or
+     * data handler is added, if pause() is called, or if any synchronous or
+     * asynchronous iteration is started.
+     */
+    resume(): void;
+    /**
+     * Pause the stream
+     */
+    pause(): void;
+    /**
+     * true if the stream has been forcibly destroyed
+     */
+    get destroyed(): boolean;
+    /**
+     * true if the stream is currently in a flowing state, meaning that
+     * any writes will be immediately emitted.
+     */
+    get flowing(): boolean;
+    /**
+     * true if the stream is currently in a paused state
+     */
+    get paused(): boolean;
+    [BUFFERPUSH](chunk: RType): void;
+    [BUFFERSHIFT](): RType;
+    [FLUSH](noDrain?: boolean): void;
+    [FLUSHCHUNK](chunk: RType): boolean;
+    /**
+     * Pipe all data emitted by this stream into the destination provided.
+     *
+     * Triggers the flow of data.
+     */
+    pipe(dest: W, opts?: PipeOptions): W;
+    /**
+     * Fully unhook a piped destination stream.
+     *
+     * If the destination stream was the only consumer of this stream (ie,
+     * there are no other piped destinations or `'data'` event listeners)
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    unpipe(dest: W): void;
+    /**
+     * Alias for {@link Minipass#on}
+     */
+    addListener(ev: Event, handler: (...args: Events[Event]) => any): this;
+    /**
+     * Mostly identical to `EventEmitter.on`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * - Adding a 'data' event handler will trigger the flow of data
+     *
+     * - Adding a 'readable' event handler when there is data waiting to be read
+     *   will cause 'readable' to be emitted immediately.
+     *
+     * - Adding an 'endish' event handler ('end', 'finish', etc.) which has
+     *   already passed will cause the event to be emitted immediately and all
+     *   handlers removed.
+     *
+     * - Adding an 'error' event handler after an error has been emitted will
+     *   cause the event to be re-emitted immediately with the error previously
+     *   raised.
+     */
+    on(ev: Event, handler: (...args: Events[Event]) => any): this;
+    /**
+     * Alias for {@link Minipass#off}
+     */
+    removeListener(ev: Event, handler: (...args: Events[Event]) => any): this;
+    /**
+     * Mostly identical to `EventEmitter.off`
+     *
+     * If a 'data' event handler is removed, and it was the last consumer
+     * (ie, there are no pipe destinations or other 'data' event listeners),
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    off(ev: Event, handler: (...args: Events[Event]) => any): this;
+    /**
+     * Mostly identical to `EventEmitter.removeAllListeners`
+     *
+     * If all 'data' event handlers are removed, and they were the last consumer
+     * (ie, there are no pipe destinations), then the flow of data will stop
+     * until there is another consumer or {@link Minipass#resume} is explicitly
+     * called.
+     */
+    removeAllListeners(ev?: Event): this;
+    /**
+     * true if the 'end' event has been emitted
+     */
+    get emittedEnd(): boolean;
+    [MAYBE_EMIT_END](): void;
+    /**
+     * Mostly identical to `EventEmitter.emit`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * If the stream has been destroyed, and the event is something other
+     * than 'close' or 'error', then `false` is returned and no handlers
+     * are called.
+     *
+     * If the event is 'end', and has already been emitted, then the event
+     * is ignored. If the stream is in a paused or non-flowing state, then
+     * the event will be deferred until data flow resumes. If the stream is
+     * async, then handlers will be called on the next tick rather than
+     * immediately.
+     *
+     * If the event is 'close', and 'end' has not yet been emitted, then
+     * the event will be deferred until after 'end' is emitted.
+     *
+     * If the event is 'error', and an AbortSignal was provided for the stream,
+     * and there are no listeners, then the event is ignored, matching the
+     * behavior of node core streams in the presense of an AbortSignal.
+     *
+     * If the event is 'finish' or 'prefinish', then all listeners will be
+     * removed after emitting the event, to prevent double-firing.
+     */
+    emit(ev: Event, ...args: Events[Event]): boolean;
+    [EMITDATA](data: RType): boolean;
+    [EMITEND](): boolean;
+    [EMITEND2](): boolean;
+    /**
+     * Return a Promise that resolves to an array of all emitted data once
+     * the stream ends.
+     */
+    collect(): Promise;
+    /**
+     * Return a Promise that resolves to the concatenation of all emitted data
+     * once the stream ends.
+     *
+     * Not allowed on objectMode streams.
+     */
+    concat(): Promise;
+    /**
+     * Return a void Promise that resolves once the stream ends.
+     */
+    promise(): Promise;
+    /**
+     * Asynchronous `for await of` iteration.
+     *
+     * This will continue emitting all chunks until the stream terminates.
+     */
+    [Symbol.asyncIterator](): AsyncGenerator;
+    /**
+     * Synchronous `for of` iteration.
+     *
+     * The iteration will terminate when the internal buffer runs out, even
+     * if the stream has not yet terminated.
+     */
+    [Symbol.iterator](): Generator;
+    /**
+     * Destroy a stream, preventing it from being used for any further purpose.
+     *
+     * If the stream has a `close()` method, then it will be called on
+     * destruction.
+     *
+     * After destruction, any attempt to write data, read data, or emit most
+     * events will be ignored.
+     *
+     * If an error argument is provided, then it will be emitted in an
+     * 'error' event.
+     */
+    destroy(er?: unknown): this;
+    /**
+     * Alias for {@link isStream}
+     *
+     * Former export location, maintained for backwards compatibility.
+     *
+     * @deprecated
+     */
+    static get isStream(): (s: any) => s is Minipass | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter & {
+        end(): any;
+        write(chunk: any, ...args: any[]): any;
+    }) | (EventEmitter & {
+        pause(): any;
+        resume(): any;
+        pipe(...destArgs: any[]): any;
+    }) | (NodeJS.ReadStream & {
+        fd: number;
+    }) | (NodeJS.WriteStream & {
+        fd: number;
+    });
+}
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minipass/dist/commonjs/index.d.ts.map b/node_modules/minipass/dist/commonjs/index.d.ts.map
new file mode 100644
index 00000000..7bce611b
--- /dev/null
+++ b/node_modules/minipass/dist/commonjs/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;GAEG;AACH,KAAK,EAAE,GAAG,aAAa,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAA;AAE/C,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAA;AAEzC;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;EAQH,CAAA;AAElB;;GAEG;AACH,eAAO,MAAM,UAAU,oCAM2C,CAAA;AAElE;;GAEG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;IAED;;;;;;OAMG;IACH,MAAM,KAAK,QAAQ;;;;;;;;;;;OAElB;CACF","sourcesContent":["const proc =\n  typeof process === 'object' && process\n    ? process\n    : {\n        stdout: null,\n        stderr: null,\n      }\nimport { EventEmitter } from 'node:events'\nimport Stream from 'node:stream'\nimport { StringDecoder } from 'node:string_decoder'\n\n/**\n * Same as StringDecoder, but exposing the `lastNeed` flag on the type\n */\ntype SD = StringDecoder & { lastNeed: boolean }\n\nexport type { SD, Pipe, PipeProxyErrors }\n\n/**\n * Return true if the argument is a Minipass stream, Node stream, or something\n * else that Minipass can interact with.\n */\nexport const isStream = (\n  s: any\n): s is Minipass.Readable | Minipass.Writable =>\n  !!s &&\n  typeof s === 'object' &&\n  (s instanceof Minipass ||\n    s instanceof Stream ||\n    isReadable(s) ||\n    isWritable(s))\n\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\nexport const isReadable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Readable).pipe === 'function' &&\n  // node core Writable streams have a pipe() method, but it throws\n  (s as Minipass.Readable).pipe !== Stream.Writable.prototype.pipe\n\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\nexport const isWritable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Writable).write === 'function' &&\n  typeof (s as Minipass.Writable).end === 'function'\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFER = Symbol('buffer')\nconst PIPES = Symbol('pipes')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed')\n// internal event when stream has an error\nconst ERROR = Symbol('error')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\nconst ABORT = Symbol('abort')\nconst ABORTED = Symbol('aborted')\nconst SIGNAL = Symbol('signal')\nconst DATALISTENERS = Symbol('dataListeners')\nconst DISCARDED = Symbol('discarded')\n\nconst defer = (fn: (...a: any[]) => any) => Promise.resolve().then(fn)\nconst nodefer = (fn: (...a: any[]) => any) => fn()\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\ntype EndishEvent = 'end' | 'finish' | 'prefinish'\nconst isEndish = (ev: any): ev is EndishEvent =>\n  ev === 'end' || ev === 'finish' || ev === 'prefinish'\n\nconst isArrayBufferLike = (b: any): b is ArrayBufferLike =>\n  b instanceof ArrayBuffer ||\n  (!!b &&\n    typeof b === 'object' &&\n    b.constructor &&\n    b.constructor.name === 'ArrayBuffer' &&\n    b.byteLength >= 0)\n\nconst isArrayBufferView = (b: any): b is ArrayBufferView =>\n  !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\n/**\n * Options that may be passed to stream.pipe()\n */\nexport interface PipeOptions {\n  /**\n   * end the destination stream when the source stream ends\n   */\n  end?: boolean\n  /**\n   * proxy errors from the source stream to the destination stream\n   */\n  proxyErrors?: boolean\n}\n\n/**\n * Internal class representing a pipe to a destination stream.\n *\n * @internal\n */\nclass Pipe {\n  src: Minipass\n  dest: Minipass\n  opts: PipeOptions\n  ondrain: () => any\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    this.src = src\n    this.dest = dest as Minipass\n    this.opts = opts\n    this.ondrain = () => src[RESUME]()\n    this.dest.on('drain', this.ondrain)\n  }\n  unpipe() {\n    this.dest.removeListener('drain', this.ondrain)\n  }\n  // only here for the prototype\n  /* c8 ignore start */\n  proxyErrors(_er: any) {}\n  /* c8 ignore stop */\n  end() {\n    this.unpipe()\n    if (this.opts.end) this.dest.end()\n  }\n}\n\n/**\n * Internal class representing a pipe to a destination stream where\n * errors are proxied.\n *\n * @internal\n */\nclass PipeProxyErrors extends Pipe {\n  unpipe() {\n    this.src.removeListener('error', this.proxyErrors)\n    super.unpipe()\n  }\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    super(src, dest, opts)\n    this.proxyErrors = (er: Error) => this.dest.emit('error', er)\n    src.on('error', this.proxyErrors)\n  }\n}\n\nexport namespace Minipass {\n  /**\n   * Encoding used to create a stream that outputs strings rather than\n   * Buffer objects.\n   */\n  export type Encoding = BufferEncoding | 'buffer' | null\n\n  /**\n   * Any stream that Minipass can pipe into\n   */\n  export type Writable =\n    | Minipass\n    | NodeJS.WriteStream\n    | (NodeJS.WriteStream & { fd: number })\n    | (EventEmitter & {\n        end(): any\n        write(chunk: any, ...args: any[]): any\n      })\n\n  /**\n   * Any stream that can be read from\n   */\n  export type Readable =\n    | Minipass\n    | NodeJS.ReadStream\n    | (NodeJS.ReadStream & { fd: number })\n    | (EventEmitter & {\n        pause(): any\n        resume(): any\n        pipe(...destArgs: any[]): any\n      })\n\n  /**\n   * Utility type that can be iterated sync or async\n   */\n  export type DualIterable = Iterable & AsyncIterable\n\n  type EventArguments = Record\n\n  /**\n   * The listing of events that a Minipass class can emit.\n   * Extend this when extending the Minipass class, and pass as\n   * the third template argument.  The key is the name of the event,\n   * and the value is the argument list.\n   *\n   * Any undeclared events will still be allowed, but the handler will get\n   * arguments as `unknown[]`.\n   */\n  export interface Events\n    extends EventArguments {\n    readable: []\n    data: [chunk: RType]\n    error: [er: unknown]\n    abort: [reason: unknown]\n    drain: []\n    resume: []\n    end: []\n    finish: []\n    prefinish: []\n    close: []\n    [DESTROYED]: [er?: unknown]\n    [ERROR]: [er: unknown]\n  }\n\n  /**\n   * String or buffer-like data that can be joined and sliced\n   */\n  export type ContiguousData =\n    | Buffer\n    | ArrayBufferLike\n    | ArrayBufferView\n    | string\n  export type BufferOrString = Buffer | string\n\n  /**\n   * Options passed to the Minipass constructor.\n   */\n  export type SharedOptions = {\n    /**\n     * Defer all data emission and other events until the end of the\n     * current tick, similar to Node core streams\n     */\n    async?: boolean\n    /**\n     * A signal which will abort the stream\n     */\n    signal?: AbortSignal\n    /**\n     * Output string encoding. Set to `null` or `'buffer'` (or omit) to\n     * emit Buffer objects rather than strings.\n     *\n     * Conflicts with `objectMode`\n     */\n    encoding?: BufferEncoding | null | 'buffer'\n    /**\n     * Output data exactly as it was written, supporting non-buffer/string\n     * data (such as arbitrary objects, falsey values, etc.)\n     *\n     * Conflicts with `encoding`\n     */\n    objectMode?: boolean\n  }\n\n  /**\n   * Options for a string encoded output\n   */\n  export type EncodingOptions = SharedOptions & {\n    encoding: BufferEncoding\n    objectMode?: false\n  }\n\n  /**\n   * Options for contiguous data buffer output\n   */\n  export type BufferOptions = SharedOptions & {\n    encoding?: null | 'buffer'\n    objectMode?: false\n  }\n\n  /**\n   * Options for objectMode arbitrary output\n   */\n  export type ObjectModeOptions = SharedOptions & {\n    objectMode: true\n    encoding?: null\n  }\n\n  /**\n   * Utility type to determine allowed options based on read type\n   */\n  export type Options =\n    | ObjectModeOptions\n    | (T extends string\n        ? EncodingOptions\n        : T extends Buffer\n        ? BufferOptions\n        : SharedOptions)\n}\n\nconst isObjectModeOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.ObjectModeOptions => !!o.objectMode\n\nconst isEncodingOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.EncodingOptions =>\n  !o.objectMode && !!o.encoding && o.encoding !== 'buffer'\n\n/**\n * Main export, the Minipass class\n *\n * `RType` is the type of data emitted, defaults to Buffer\n *\n * `WType` is the type of data to be written, if RType is buffer or string,\n * then any {@link Minipass.ContiguousData} is allowed.\n *\n * `Events` is the set of event handler signatures that this object\n * will emit, see {@link Minipass.Events}\n */\nexport class Minipass<\n    RType extends unknown = Buffer,\n    WType extends unknown = RType extends Minipass.BufferOrString\n      ? Minipass.ContiguousData\n      : RType,\n    Events extends Minipass.Events = Minipass.Events\n  >\n  extends EventEmitter\n  implements Minipass.DualIterable\n{\n  [FLOWING]: boolean = false;\n  [PAUSED]: boolean = false;\n  [PIPES]: Pipe[] = [];\n  [BUFFER]: RType[] = [];\n  [OBJECTMODE]: boolean;\n  [ENCODING]: BufferEncoding | null;\n  [ASYNC]: boolean;\n  [DECODER]: SD | null;\n  [EOF]: boolean = false;\n  [EMITTED_END]: boolean = false;\n  [EMITTING_END]: boolean = false;\n  [CLOSED]: boolean = false;\n  [EMITTED_ERROR]: unknown = null;\n  [BUFFERLENGTH]: number = 0;\n  [DESTROYED]: boolean = false;\n  [SIGNAL]?: AbortSignal;\n  [ABORTED]: boolean = false;\n  [DATALISTENERS]: number = 0;\n  [DISCARDED]: boolean = false\n\n  /**\n   * true if the stream can be written\n   */\n  writable: boolean = true\n  /**\n   * true if the stream can be read\n   */\n  readable: boolean = true\n\n  /**\n   * If `RType` is Buffer, then options do not need to be provided.\n   * Otherwise, an options object must be provided to specify either\n   * {@link Minipass.SharedOptions.objectMode} or\n   * {@link Minipass.SharedOptions.encoding}, as appropriate.\n   */\n  constructor(\n    ...args:\n      | [Minipass.ObjectModeOptions]\n      | (RType extends Buffer\n          ? [] | [Minipass.Options]\n          : [Minipass.Options])\n  ) {\n    const options: Minipass.Options = (args[0] ||\n      {}) as Minipass.Options\n    super()\n    if (options.objectMode && typeof options.encoding === 'string') {\n      throw new TypeError(\n        'Encoding and objectMode may not be used together'\n      )\n    }\n    if (isObjectModeOptions(options)) {\n      this[OBJECTMODE] = true\n      this[ENCODING] = null\n    } else if (isEncodingOptions(options)) {\n      this[ENCODING] = options.encoding\n      this[OBJECTMODE] = false\n    } else {\n      this[OBJECTMODE] = false\n      this[ENCODING] = null\n    }\n    this[ASYNC] = !!options.async\n    this[DECODER] = this[ENCODING]\n      ? (new StringDecoder(this[ENCODING]) as SD)\n      : null\n\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposeBuffer === true) {\n      Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })\n    }\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposePipes === true) {\n      Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })\n    }\n\n    const { signal } = options\n    if (signal) {\n      this[SIGNAL] = signal\n      if (signal.aborted) {\n        this[ABORT]()\n      } else {\n        signal.addEventListener('abort', () => this[ABORT]())\n      }\n    }\n  }\n\n  /**\n   * The amount of data stored in the buffer waiting to be read.\n   *\n   * For Buffer strings, this will be the total byte length.\n   * For string encoding streams, this will be the string character length,\n   * according to JavaScript's `string.length` logic.\n   * For objectMode streams, this is a count of the items waiting to be\n   * emitted.\n   */\n  get bufferLength() {\n    return this[BUFFERLENGTH]\n  }\n\n  /**\n   * The `BufferEncoding` currently in use, or `null`\n   */\n  get encoding() {\n    return this[ENCODING]\n  }\n\n  /**\n   * @deprecated - This is a read only property\n   */\n  set encoding(_enc) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * @deprecated - Encoding may only be set at instantiation time\n   */\n  setEncoding(_enc: Minipass.Encoding) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * True if this is an objectMode stream\n   */\n  get objectMode() {\n    return this[OBJECTMODE]\n  }\n\n  /**\n   * @deprecated - This is a read-only property\n   */\n  set objectMode(_om) {\n    throw new Error('objectMode must be set at instantiation time')\n  }\n\n  /**\n   * true if this is an async stream\n   */\n  get ['async'](): boolean {\n    return this[ASYNC]\n  }\n  /**\n   * Set to true to make this stream async.\n   *\n   * Once set, it cannot be unset, as this would potentially cause incorrect\n   * behavior.  Ie, a sync stream can be made async, but an async stream\n   * cannot be safely made sync.\n   */\n  set ['async'](a: boolean) {\n    this[ASYNC] = this[ASYNC] || !!a\n  }\n\n  // drop everything and get out of the flow completely\n  [ABORT]() {\n    this[ABORTED] = true\n    this.emit('abort', this[SIGNAL]?.reason)\n    this.destroy(this[SIGNAL]?.reason)\n  }\n\n  /**\n   * True if the stream has been aborted.\n   */\n  get aborted() {\n    return this[ABORTED]\n  }\n  /**\n   * No-op setter. Stream aborted status is set via the AbortSignal provided\n   * in the constructor options.\n   */\n  set aborted(_) {}\n\n  /**\n   * Write data into the stream\n   *\n   * If the chunk written is a string, and encoding is not specified, then\n   * `utf8` will be assumed. If the stream encoding matches the encoding of\n   * a written string, and the state of the string decoder allows it, then\n   * the string will be passed through to either the output or the internal\n   * buffer without any processing. Otherwise, it will be turned into a\n   * Buffer object for processing into the desired encoding.\n   *\n   * If provided, `cb` function is called immediately before return for\n   * sync streams, or on next tick for async streams, because for this\n   * base class, a chunk is considered \"processed\" once it is accepted\n   * and either emitted or buffered. That is, the callback does not indicate\n   * that the chunk has been eventually emitted, though of course child\n   * classes can override this function to do whatever processing is required\n   * and call `super.write(...)` only once processing is completed.\n   */\n  write(chunk: WType, cb?: () => void): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding,\n    cb?: () => void\n  ): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): boolean {\n    if (this[ABORTED]) return false\n    if (this[EOF]) throw new Error('write after end')\n\n    if (this[DESTROYED]) {\n      this.emit(\n        'error',\n        Object.assign(\n          new Error('Cannot call write after a stream was destroyed'),\n          { code: 'ERR_STREAM_DESTROYED' }\n        )\n      )\n      return true\n    }\n\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n\n    if (!encoding) encoding = 'utf8'\n\n    const fn = this[ASYNC] ? defer : nodefer\n\n    // convert array buffers and typed array views into buffers\n    // at some point in the future, we may want to do the opposite!\n    // leave strings and buffers as-is\n    // anything is only allowed if in object mode, so throw\n    if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n      if (isArrayBufferView(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(\n          chunk.buffer,\n          chunk.byteOffset,\n          chunk.byteLength\n        )\n      } else if (isArrayBufferLike(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(chunk)\n      } else if (typeof chunk !== 'string') {\n        throw new Error(\n          'Non-contiguous data written to non-objectMode stream'\n        )\n      }\n    }\n\n    // handle object mode up front, since it's simpler\n    // this yields better performance, fewer checks later.\n    if (this[OBJECTMODE]) {\n      // maybe impossible?\n      /* c8 ignore start */\n      if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n      /* c8 ignore stop */\n\n      if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n      else this[BUFFERPUSH](chunk as unknown as RType)\n\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n      if (cb) fn(cb)\n\n      return this[FLOWING]\n    }\n\n    // at this point the chunk is a buffer or string\n    // don't buffer it up or send it to the decoder\n    if (!(chunk as Minipass.BufferOrString).length) {\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n      if (cb) fn(cb)\n      return this[FLOWING]\n    }\n\n    // fast-path writing strings of same encoding to a stream with\n    // an empty buffer, skipping the buffer/decoder dance\n    if (\n      typeof chunk === 'string' &&\n      // unless it is a string already ready for us to use\n      !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)\n    ) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = Buffer.from(chunk, encoding)\n    }\n\n    if (Buffer.isBuffer(chunk) && this[ENCODING]) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = this[DECODER].write(chunk)\n    }\n\n    // Note: flushing CAN potentially switch us into not-flowing mode\n    if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n    if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n    else this[BUFFERPUSH](chunk as unknown as RType)\n\n    if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n    if (cb) fn(cb)\n\n    return this[FLOWING]\n  }\n\n  /**\n   * Low-level explicit read method.\n   *\n   * In objectMode, the argument is ignored, and one item is returned if\n   * available.\n   *\n   * `n` is the number of bytes (or in the case of encoding streams,\n   * characters) to consume. If `n` is not provided, then the entire buffer\n   * is returned, or `null` is returned if no data is available.\n   *\n   * If `n` is greater that the amount of data in the internal buffer,\n   * then `null` is returned.\n   */\n  read(n?: number | null): RType | null {\n    if (this[DESTROYED]) return null\n    this[DISCARDED] = false\n\n    if (\n      this[BUFFERLENGTH] === 0 ||\n      n === 0 ||\n      (n && n > this[BUFFERLENGTH])\n    ) {\n      this[MAYBE_EMIT_END]()\n      return null\n    }\n\n    if (this[OBJECTMODE]) n = null\n\n    if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n      // not object mode, so if we have an encoding, then RType is string\n      // otherwise, must be Buffer\n      this[BUFFER] = [\n        (this[ENCODING]\n          ? this[BUFFER].join('')\n          : Buffer.concat(\n              this[BUFFER] as Buffer[],\n              this[BUFFERLENGTH]\n            )) as RType,\n      ]\n    }\n\n    const ret = this[READ](n || null, this[BUFFER][0] as RType)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [READ](n: number | null, chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERSHIFT]()\n    else {\n      const c = chunk as Minipass.BufferOrString\n      if (n === c.length || n === null) this[BUFFERSHIFT]()\n      else if (typeof c === 'string') {\n        this[BUFFER][0] = c.slice(n) as RType\n        chunk = c.slice(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      } else {\n        this[BUFFER][0] = c.subarray(n) as RType\n        chunk = c.subarray(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      }\n    }\n\n    this.emit('data', chunk)\n\n    if (!this[BUFFER].length && !this[EOF]) this.emit('drain')\n\n    return chunk\n  }\n\n  /**\n   * End the stream, optionally providing a final write.\n   *\n   * See {@link Minipass#write} for argument descriptions\n   */\n  end(cb?: () => void): this\n  end(chunk: WType, cb?: () => void): this\n  end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this\n  end(\n    chunk?: WType | (() => void),\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): this {\n    if (typeof chunk === 'function') {\n      cb = chunk as () => void\n      chunk = undefined\n    }\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n    if (chunk !== undefined) this.write(chunk, encoding)\n    if (cb) this.once('end', cb)\n    this[EOF] = true\n    this.writable = false\n\n    // if we haven't written anything, then go ahead and emit,\n    // even if we're not reading.\n    // we'll re-emit if a new 'end' listener is added anyway.\n    // This makes MP more suitable to write-only use cases.\n    if (this[FLOWING] || !this[PAUSED]) this[MAYBE_EMIT_END]()\n    return this\n  }\n\n  // don't let the internal resume be overwritten\n  [RESUME]() {\n    if (this[DESTROYED]) return\n\n    if (!this[DATALISTENERS] && !this[PIPES].length) {\n      this[DISCARDED] = true\n    }\n    this[PAUSED] = false\n    this[FLOWING] = true\n    this.emit('resume')\n    if (this[BUFFER].length) this[FLUSH]()\n    else if (this[EOF]) this[MAYBE_EMIT_END]()\n    else this.emit('drain')\n  }\n\n  /**\n   * Resume the stream if it is currently in a paused state\n   *\n   * If called when there are no pipe destinations or `data` event listeners,\n   * this will place the stream in a \"discarded\" state, where all data will\n   * be thrown away. The discarded state is removed if a pipe destination or\n   * data handler is added, if pause() is called, or if any synchronous or\n   * asynchronous iteration is started.\n   */\n  resume() {\n    return this[RESUME]()\n  }\n\n  /**\n   * Pause the stream\n   */\n  pause() {\n    this[FLOWING] = false\n    this[PAUSED] = true\n    this[DISCARDED] = false\n  }\n\n  /**\n   * true if the stream has been forcibly destroyed\n   */\n  get destroyed() {\n    return this[DESTROYED]\n  }\n\n  /**\n   * true if the stream is currently in a flowing state, meaning that\n   * any writes will be immediately emitted.\n   */\n  get flowing() {\n    return this[FLOWING]\n  }\n\n  /**\n   * true if the stream is currently in a paused state\n   */\n  get paused() {\n    return this[PAUSED]\n  }\n\n  [BUFFERPUSH](chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1\n    else this[BUFFERLENGTH] += (chunk as Minipass.BufferOrString).length\n    this[BUFFER].push(chunk)\n  }\n\n  [BUFFERSHIFT](): RType {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1\n    else\n      this[BUFFERLENGTH] -= (\n        this[BUFFER][0] as Minipass.BufferOrString\n      ).length\n    return this[BUFFER].shift() as RType\n  }\n\n  [FLUSH](noDrain: boolean = false) {\n    do {} while (\n      this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&\n      this[BUFFER].length\n    )\n\n    if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')\n  }\n\n  [FLUSHCHUNK](chunk: RType) {\n    this.emit('data', chunk)\n    return this[FLOWING]\n  }\n\n  /**\n   * Pipe all data emitted by this stream into the destination provided.\n   *\n   * Triggers the flow of data.\n   */\n  pipe(dest: W, opts?: PipeOptions): W {\n    if (this[DESTROYED]) return dest\n    this[DISCARDED] = false\n\n    const ended = this[EMITTED_END]\n    opts = opts || {}\n    if (dest === proc.stdout || dest === proc.stderr) opts.end = false\n    else opts.end = opts.end !== false\n    opts.proxyErrors = !!opts.proxyErrors\n\n    // piping an ended stream ends immediately\n    if (ended) {\n      if (opts.end) dest.end()\n    } else {\n      // \"as\" here just ignores the WType, which pipes don't care about,\n      // since they're only consuming from us, and writing to the dest\n      this[PIPES].push(\n        !opts.proxyErrors\n          ? new Pipe(this as Minipass, dest, opts)\n          : new PipeProxyErrors(this as Minipass, dest, opts)\n      )\n      if (this[ASYNC]) defer(() => this[RESUME]())\n      else this[RESUME]()\n    }\n\n    return dest\n  }\n\n  /**\n   * Fully unhook a piped destination stream.\n   *\n   * If the destination stream was the only consumer of this stream (ie,\n   * there are no other piped destinations or `'data'` event listeners)\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  unpipe(dest: W) {\n    const p = this[PIPES].find(p => p.dest === dest)\n    if (p) {\n      if (this[PIPES].length === 1) {\n        if (this[FLOWING] && this[DATALISTENERS] === 0) {\n          this[FLOWING] = false\n        }\n        this[PIPES] = []\n      } else this[PIPES].splice(this[PIPES].indexOf(p), 1)\n      p.unpipe()\n    }\n  }\n\n  /**\n   * Alias for {@link Minipass#on}\n   */\n  addListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    return this.on(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.on`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * - Adding a 'data' event handler will trigger the flow of data\n   *\n   * - Adding a 'readable' event handler when there is data waiting to be read\n   *   will cause 'readable' to be emitted immediately.\n   *\n   * - Adding an 'endish' event handler ('end', 'finish', etc.) which has\n   *   already passed will cause the event to be emitted immediately and all\n   *   handlers removed.\n   *\n   * - Adding an 'error' event handler after an error has been emitted will\n   *   cause the event to be re-emitted immediately with the error previously\n   *   raised.\n   */\n  on(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    const ret = super.on(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    if (ev === 'data') {\n      this[DISCARDED] = false\n      this[DATALISTENERS]++\n      if (!this[PIPES].length && !this[FLOWING]) {\n        this[RESUME]()\n      }\n    } else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {\n      super.emit('readable')\n    } else if (isEndish(ev) && this[EMITTED_END]) {\n      super.emit(ev)\n      this.removeAllListeners(ev)\n    } else if (ev === 'error' && this[EMITTED_ERROR]) {\n      const h = handler as (...a: Events['error']) => any\n      if (this[ASYNC]) defer(() => h.call(this, this[EMITTED_ERROR]))\n      else h.call(this, this[EMITTED_ERROR])\n    }\n    return ret\n  }\n\n  /**\n   * Alias for {@link Minipass#off}\n   */\n  removeListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    return this.off(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.off`\n   *\n   * If a 'data' event handler is removed, and it was the last consumer\n   * (ie, there are no pipe destinations or other 'data' event listeners),\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  off(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    const ret = super.off(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    // if we previously had listeners, and now we don't, and we don't\n    // have any pipes, then stop the flow, unless it's been explicitly\n    // put in a discarded flowing state via stream.resume().\n    if (ev === 'data') {\n      this[DATALISTENERS] = this.listeners('data').length\n      if (\n        this[DATALISTENERS] === 0 &&\n        !this[DISCARDED] &&\n        !this[PIPES].length\n      ) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.removeAllListeners`\n   *\n   * If all 'data' event handlers are removed, and they were the last consumer\n   * (ie, there are no pipe destinations), then the flow of data will stop\n   * until there is another consumer or {@link Minipass#resume} is explicitly\n   * called.\n   */\n  removeAllListeners(ev?: Event) {\n    const ret = super.removeAllListeners(ev as string | symbol | undefined)\n    if (ev === 'data' || ev === undefined) {\n      this[DATALISTENERS] = 0\n      if (!this[DISCARDED] && !this[PIPES].length) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * true if the 'end' event has been emitted\n   */\n  get emittedEnd() {\n    return this[EMITTED_END]\n  }\n\n  [MAYBE_EMIT_END]() {\n    if (\n      !this[EMITTING_END] &&\n      !this[EMITTED_END] &&\n      !this[DESTROYED] &&\n      this[BUFFER].length === 0 &&\n      this[EOF]\n    ) {\n      this[EMITTING_END] = true\n      this.emit('end')\n      this.emit('prefinish')\n      this.emit('finish')\n      if (this[CLOSED]) this.emit('close')\n      this[EMITTING_END] = false\n    }\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.emit`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * If the stream has been destroyed, and the event is something other\n   * than 'close' or 'error', then `false` is returned and no handlers\n   * are called.\n   *\n   * If the event is 'end', and has already been emitted, then the event\n   * is ignored. If the stream is in a paused or non-flowing state, then\n   * the event will be deferred until data flow resumes. If the stream is\n   * async, then handlers will be called on the next tick rather than\n   * immediately.\n   *\n   * If the event is 'close', and 'end' has not yet been emitted, then\n   * the event will be deferred until after 'end' is emitted.\n   *\n   * If the event is 'error', and an AbortSignal was provided for the stream,\n   * and there are no listeners, then the event is ignored, matching the\n   * behavior of node core streams in the presense of an AbortSignal.\n   *\n   * If the event is 'finish' or 'prefinish', then all listeners will be\n   * removed after emitting the event, to prevent double-firing.\n   */\n  emit(\n    ev: Event,\n    ...args: Events[Event]\n  ): boolean {\n    const data = args[0]\n    // error and close are only events allowed after calling destroy()\n    if (\n      ev !== 'error' &&\n      ev !== 'close' &&\n      ev !== DESTROYED &&\n      this[DESTROYED]\n    ) {\n      return false\n    } else if (ev === 'data') {\n      return !this[OBJECTMODE] && !data\n        ? false\n        : this[ASYNC]\n        ? (defer(() => this[EMITDATA](data as RType)), true)\n        : this[EMITDATA](data as RType)\n    } else if (ev === 'end') {\n      return this[EMITEND]()\n    } else if (ev === 'close') {\n      this[CLOSED] = true\n      // don't emit close before 'end' and 'finish'\n      if (!this[EMITTED_END] && !this[DESTROYED]) return false\n      const ret = super.emit('close')\n      this.removeAllListeners('close')\n      return ret\n    } else if (ev === 'error') {\n      this[EMITTED_ERROR] = data\n      super.emit(ERROR, data)\n      const ret =\n        !this[SIGNAL] || this.listeners('error').length\n          ? super.emit('error', data)\n          : false\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'resume') {\n      const ret = super.emit('resume')\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'finish' || ev === 'prefinish') {\n      const ret = super.emit(ev)\n      this.removeAllListeners(ev)\n      return ret\n    }\n\n    // Some other unknown event\n    const ret = super.emit(ev as string, ...args)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITDATA](data: RType) {\n    for (const p of this[PIPES]) {\n      if (p.dest.write(data as RType) === false) this.pause()\n    }\n    const ret = this[DISCARDED] ? false : super.emit('data', data)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITEND]() {\n    if (this[EMITTED_END]) return false\n\n    this[EMITTED_END] = true\n    this.readable = false\n    return this[ASYNC]\n      ? (defer(() => this[EMITEND2]()), true)\n      : this[EMITEND2]()\n  }\n\n  [EMITEND2]() {\n    if (this[DECODER]) {\n      const data = this[DECODER].end()\n      if (data) {\n        for (const p of this[PIPES]) {\n          p.dest.write(data as RType)\n        }\n        if (!this[DISCARDED]) super.emit('data', data)\n      }\n    }\n\n    for (const p of this[PIPES]) {\n      p.end()\n    }\n    const ret = super.emit('end')\n    this.removeAllListeners('end')\n    return ret\n  }\n\n  /**\n   * Return a Promise that resolves to an array of all emitted data once\n   * the stream ends.\n   */\n  async collect(): Promise {\n    const buf: RType[] & { dataLength: number } = Object.assign([], {\n      dataLength: 0,\n    })\n    if (!this[OBJECTMODE]) buf.dataLength = 0\n    // set the promise first, in case an error is raised\n    // by triggering the flow here.\n    const p = this.promise()\n    this.on('data', c => {\n      buf.push(c)\n      if (!this[OBJECTMODE])\n        buf.dataLength += (c as Minipass.BufferOrString).length\n    })\n    await p\n    return buf\n  }\n\n  /**\n   * Return a Promise that resolves to the concatenation of all emitted data\n   * once the stream ends.\n   *\n   * Not allowed on objectMode streams.\n   */\n  async concat(): Promise {\n    if (this[OBJECTMODE]) {\n      throw new Error('cannot concat in objectMode')\n    }\n    const buf = await this.collect()\n    return (\n      this[ENCODING]\n        ? buf.join('')\n        : Buffer.concat(buf as Buffer[], buf.dataLength)\n    ) as RType\n  }\n\n  /**\n   * Return a void Promise that resolves once the stream ends.\n   */\n  async promise(): Promise {\n    return new Promise((resolve, reject) => {\n      this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n      this.on('error', er => reject(er))\n      this.on('end', () => resolve())\n    })\n  }\n\n  /**\n   * Asynchronous `for await of` iteration.\n   *\n   * This will continue emitting all chunks until the stream terminates.\n   */\n  [Symbol.asyncIterator](): AsyncGenerator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = async (): Promise> => {\n      this.pause()\n      stopped = true\n      return { value: undefined, done: true }\n    }\n    const next = (): Promise> => {\n      if (stopped) return stop()\n      const res = this.read()\n      if (res !== null) return Promise.resolve({ done: false, value: res })\n\n      if (this[EOF]) return stop()\n\n      let resolve!: (res: IteratorResult) => void\n      let reject!: (er: unknown) => void\n      const onerr = (er: unknown) => {\n        this.off('data', ondata)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        reject(er)\n      }\n      const ondata = (value: RType) => {\n        this.off('error', onerr)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        this.pause()\n        resolve({ value, done: !!this[EOF] })\n      }\n      const onend = () => {\n        this.off('error', onerr)\n        this.off('data', ondata)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        resolve({ done: true, value: undefined })\n      }\n      const ondestroy = () => onerr(new Error('stream destroyed'))\n      return new Promise>((res, rej) => {\n        reject = rej\n        resolve = res\n        this.once(DESTROYED, ondestroy)\n        this.once('error', onerr)\n        this.once('end', onend)\n        this.once('data', ondata)\n      })\n    }\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.asyncIterator]() {\n        return this\n      },\n      [Symbol.asyncDispose]: async () => {},\n    }\n  }\n\n  /**\n   * Synchronous `for of` iteration.\n   *\n   * The iteration will terminate when the internal buffer runs out, even\n   * if the stream has not yet terminated.\n   */\n  [Symbol.iterator](): Generator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = (): IteratorReturnResult => {\n      this.pause()\n      this.off(ERROR, stop)\n      this.off(DESTROYED, stop)\n      this.off('end', stop)\n      stopped = true\n      return { done: true, value: undefined }\n    }\n\n    const next = (): IteratorResult => {\n      if (stopped) return stop()\n      const value = this.read()\n      return value === null ? stop() : { done: false, value }\n    }\n\n    this.once('end', stop)\n    this.once(ERROR, stop)\n    this.once(DESTROYED, stop)\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.iterator]() {\n        return this\n      },\n      [Symbol.dispose]: () => {},\n    }\n  }\n\n  /**\n   * Destroy a stream, preventing it from being used for any further purpose.\n   *\n   * If the stream has a `close()` method, then it will be called on\n   * destruction.\n   *\n   * After destruction, any attempt to write data, read data, or emit most\n   * events will be ignored.\n   *\n   * If an error argument is provided, then it will be emitted in an\n   * 'error' event.\n   */\n  destroy(er?: unknown) {\n    if (this[DESTROYED]) {\n      if (er) this.emit('error', er)\n      else this.emit(DESTROYED)\n      return this\n    }\n\n    this[DESTROYED] = true\n    this[DISCARDED] = true\n\n    // throw away all buffered data, it's never coming out\n    this[BUFFER].length = 0\n    this[BUFFERLENGTH] = 0\n\n    const wc = this as Minipass & {\n      close?: () => void\n    }\n    if (typeof wc.close === 'function' && !this[CLOSED]) wc.close()\n\n    if (er) this.emit('error', er)\n    // if no error to emit, still reject pending promises\n    else this.emit(DESTROYED)\n\n    return this\n  }\n\n  /**\n   * Alias for {@link isStream}\n   *\n   * Former export location, maintained for backwards compatibility.\n   *\n   * @deprecated\n   */\n  static get isStream() {\n    return isStream\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minipass/dist/commonjs/index.js b/node_modules/minipass/dist/commonjs/index.js
new file mode 100644
index 00000000..91f3a5cf
--- /dev/null
+++ b/node_modules/minipass/dist/commonjs/index.js
@@ -0,0 +1,1038 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Minipass = exports.isWritable = exports.isReadable = exports.isStream = void 0;
+const proc = typeof process === 'object' && process
+    ? process
+    : {
+        stdout: null,
+        stderr: null,
+    };
+const node_events_1 = require("node:events");
+const node_stream_1 = __importDefault(require("node:stream"));
+const node_string_decoder_1 = require("node:string_decoder");
+/**
+ * Return true if the argument is a Minipass stream, Node stream, or something
+ * else that Minipass can interact with.
+ */
+const isStream = (s) => !!s &&
+    typeof s === 'object' &&
+    (s instanceof Minipass ||
+        s instanceof node_stream_1.default ||
+        (0, exports.isReadable)(s) ||
+        (0, exports.isWritable)(s))
+/**
+ * Return true if the argument is a valid {@link Minipass.Readable}
+ */
+;
+exports.isStream = isStream;
+/**
+ * Return true if the argument is a valid {@link Minipass.Readable}
+ */
+const isReadable = (s) => !!s &&
+    typeof s === 'object' &&
+    s instanceof node_events_1.EventEmitter &&
+    typeof s.pipe === 'function' &&
+    // node core Writable streams have a pipe() method, but it throws
+    s.pipe !== node_stream_1.default.Writable.prototype.pipe
+/**
+ * Return true if the argument is a valid {@link Minipass.Writable}
+ */
+;
+exports.isReadable = isReadable;
+/**
+ * Return true if the argument is a valid {@link Minipass.Writable}
+ */
+const isWritable = (s) => !!s &&
+    typeof s === 'object' &&
+    s instanceof node_events_1.EventEmitter &&
+    typeof s.write === 'function' &&
+    typeof s.end === 'function';
+exports.isWritable = isWritable;
+const EOF = Symbol('EOF');
+const MAYBE_EMIT_END = Symbol('maybeEmitEnd');
+const EMITTED_END = Symbol('emittedEnd');
+const EMITTING_END = Symbol('emittingEnd');
+const EMITTED_ERROR = Symbol('emittedError');
+const CLOSED = Symbol('closed');
+const READ = Symbol('read');
+const FLUSH = Symbol('flush');
+const FLUSHCHUNK = Symbol('flushChunk');
+const ENCODING = Symbol('encoding');
+const DECODER = Symbol('decoder');
+const FLOWING = Symbol('flowing');
+const PAUSED = Symbol('paused');
+const RESUME = Symbol('resume');
+const BUFFER = Symbol('buffer');
+const PIPES = Symbol('pipes');
+const BUFFERLENGTH = Symbol('bufferLength');
+const BUFFERPUSH = Symbol('bufferPush');
+const BUFFERSHIFT = Symbol('bufferShift');
+const OBJECTMODE = Symbol('objectMode');
+// internal event when stream is destroyed
+const DESTROYED = Symbol('destroyed');
+// internal event when stream has an error
+const ERROR = Symbol('error');
+const EMITDATA = Symbol('emitData');
+const EMITEND = Symbol('emitEnd');
+const EMITEND2 = Symbol('emitEnd2');
+const ASYNC = Symbol('async');
+const ABORT = Symbol('abort');
+const ABORTED = Symbol('aborted');
+const SIGNAL = Symbol('signal');
+const DATALISTENERS = Symbol('dataListeners');
+const DISCARDED = Symbol('discarded');
+const defer = (fn) => Promise.resolve().then(fn);
+const nodefer = (fn) => fn();
+const isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish';
+const isArrayBufferLike = (b) => b instanceof ArrayBuffer ||
+    (!!b &&
+        typeof b === 'object' &&
+        b.constructor &&
+        b.constructor.name === 'ArrayBuffer' &&
+        b.byteLength >= 0);
+const isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
+/**
+ * Internal class representing a pipe to a destination stream.
+ *
+ * @internal
+ */
+class Pipe {
+    src;
+    dest;
+    opts;
+    ondrain;
+    constructor(src, dest, opts) {
+        this.src = src;
+        this.dest = dest;
+        this.opts = opts;
+        this.ondrain = () => src[RESUME]();
+        this.dest.on('drain', this.ondrain);
+    }
+    unpipe() {
+        this.dest.removeListener('drain', this.ondrain);
+    }
+    // only here for the prototype
+    /* c8 ignore start */
+    proxyErrors(_er) { }
+    /* c8 ignore stop */
+    end() {
+        this.unpipe();
+        if (this.opts.end)
+            this.dest.end();
+    }
+}
+/**
+ * Internal class representing a pipe to a destination stream where
+ * errors are proxied.
+ *
+ * @internal
+ */
+class PipeProxyErrors extends Pipe {
+    unpipe() {
+        this.src.removeListener('error', this.proxyErrors);
+        super.unpipe();
+    }
+    constructor(src, dest, opts) {
+        super(src, dest, opts);
+        this.proxyErrors = (er) => this.dest.emit('error', er);
+        src.on('error', this.proxyErrors);
+    }
+}
+const isObjectModeOptions = (o) => !!o.objectMode;
+const isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== 'buffer';
+/**
+ * Main export, the Minipass class
+ *
+ * `RType` is the type of data emitted, defaults to Buffer
+ *
+ * `WType` is the type of data to be written, if RType is buffer or string,
+ * then any {@link Minipass.ContiguousData} is allowed.
+ *
+ * `Events` is the set of event handler signatures that this object
+ * will emit, see {@link Minipass.Events}
+ */
+class Minipass extends node_events_1.EventEmitter {
+    [FLOWING] = false;
+    [PAUSED] = false;
+    [PIPES] = [];
+    [BUFFER] = [];
+    [OBJECTMODE];
+    [ENCODING];
+    [ASYNC];
+    [DECODER];
+    [EOF] = false;
+    [EMITTED_END] = false;
+    [EMITTING_END] = false;
+    [CLOSED] = false;
+    [EMITTED_ERROR] = null;
+    [BUFFERLENGTH] = 0;
+    [DESTROYED] = false;
+    [SIGNAL];
+    [ABORTED] = false;
+    [DATALISTENERS] = 0;
+    [DISCARDED] = false;
+    /**
+     * true if the stream can be written
+     */
+    writable = true;
+    /**
+     * true if the stream can be read
+     */
+    readable = true;
+    /**
+     * If `RType` is Buffer, then options do not need to be provided.
+     * Otherwise, an options object must be provided to specify either
+     * {@link Minipass.SharedOptions.objectMode} or
+     * {@link Minipass.SharedOptions.encoding}, as appropriate.
+     */
+    constructor(...args) {
+        const options = (args[0] ||
+            {});
+        super();
+        if (options.objectMode && typeof options.encoding === 'string') {
+            throw new TypeError('Encoding and objectMode may not be used together');
+        }
+        if (isObjectModeOptions(options)) {
+            this[OBJECTMODE] = true;
+            this[ENCODING] = null;
+        }
+        else if (isEncodingOptions(options)) {
+            this[ENCODING] = options.encoding;
+            this[OBJECTMODE] = false;
+        }
+        else {
+            this[OBJECTMODE] = false;
+            this[ENCODING] = null;
+        }
+        this[ASYNC] = !!options.async;
+        this[DECODER] = this[ENCODING]
+            ? new node_string_decoder_1.StringDecoder(this[ENCODING])
+            : null;
+        //@ts-ignore - private option for debugging and testing
+        if (options && options.debugExposeBuffer === true) {
+            Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] });
+        }
+        //@ts-ignore - private option for debugging and testing
+        if (options && options.debugExposePipes === true) {
+            Object.defineProperty(this, 'pipes', { get: () => this[PIPES] });
+        }
+        const { signal } = options;
+        if (signal) {
+            this[SIGNAL] = signal;
+            if (signal.aborted) {
+                this[ABORT]();
+            }
+            else {
+                signal.addEventListener('abort', () => this[ABORT]());
+            }
+        }
+    }
+    /**
+     * The amount of data stored in the buffer waiting to be read.
+     *
+     * For Buffer strings, this will be the total byte length.
+     * For string encoding streams, this will be the string character length,
+     * according to JavaScript's `string.length` logic.
+     * For objectMode streams, this is a count of the items waiting to be
+     * emitted.
+     */
+    get bufferLength() {
+        return this[BUFFERLENGTH];
+    }
+    /**
+     * The `BufferEncoding` currently in use, or `null`
+     */
+    get encoding() {
+        return this[ENCODING];
+    }
+    /**
+     * @deprecated - This is a read only property
+     */
+    set encoding(_enc) {
+        throw new Error('Encoding must be set at instantiation time');
+    }
+    /**
+     * @deprecated - Encoding may only be set at instantiation time
+     */
+    setEncoding(_enc) {
+        throw new Error('Encoding must be set at instantiation time');
+    }
+    /**
+     * True if this is an objectMode stream
+     */
+    get objectMode() {
+        return this[OBJECTMODE];
+    }
+    /**
+     * @deprecated - This is a read-only property
+     */
+    set objectMode(_om) {
+        throw new Error('objectMode must be set at instantiation time');
+    }
+    /**
+     * true if this is an async stream
+     */
+    get ['async']() {
+        return this[ASYNC];
+    }
+    /**
+     * Set to true to make this stream async.
+     *
+     * Once set, it cannot be unset, as this would potentially cause incorrect
+     * behavior.  Ie, a sync stream can be made async, but an async stream
+     * cannot be safely made sync.
+     */
+    set ['async'](a) {
+        this[ASYNC] = this[ASYNC] || !!a;
+    }
+    // drop everything and get out of the flow completely
+    [ABORT]() {
+        this[ABORTED] = true;
+        this.emit('abort', this[SIGNAL]?.reason);
+        this.destroy(this[SIGNAL]?.reason);
+    }
+    /**
+     * True if the stream has been aborted.
+     */
+    get aborted() {
+        return this[ABORTED];
+    }
+    /**
+     * No-op setter. Stream aborted status is set via the AbortSignal provided
+     * in the constructor options.
+     */
+    set aborted(_) { }
+    write(chunk, encoding, cb) {
+        if (this[ABORTED])
+            return false;
+        if (this[EOF])
+            throw new Error('write after end');
+        if (this[DESTROYED]) {
+            this.emit('error', Object.assign(new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' }));
+            return true;
+        }
+        if (typeof encoding === 'function') {
+            cb = encoding;
+            encoding = 'utf8';
+        }
+        if (!encoding)
+            encoding = 'utf8';
+        const fn = this[ASYNC] ? defer : nodefer;
+        // convert array buffers and typed array views into buffers
+        // at some point in the future, we may want to do the opposite!
+        // leave strings and buffers as-is
+        // anything is only allowed if in object mode, so throw
+        if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
+            if (isArrayBufferView(chunk)) {
+                //@ts-ignore - sinful unsafe type changing
+                chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
+            }
+            else if (isArrayBufferLike(chunk)) {
+                //@ts-ignore - sinful unsafe type changing
+                chunk = Buffer.from(chunk);
+            }
+            else if (typeof chunk !== 'string') {
+                throw new Error('Non-contiguous data written to non-objectMode stream');
+            }
+        }
+        // handle object mode up front, since it's simpler
+        // this yields better performance, fewer checks later.
+        if (this[OBJECTMODE]) {
+            // maybe impossible?
+            /* c8 ignore start */
+            if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
+                this[FLUSH](true);
+            /* c8 ignore stop */
+            if (this[FLOWING])
+                this.emit('data', chunk);
+            else
+                this[BUFFERPUSH](chunk);
+            if (this[BUFFERLENGTH] !== 0)
+                this.emit('readable');
+            if (cb)
+                fn(cb);
+            return this[FLOWING];
+        }
+        // at this point the chunk is a buffer or string
+        // don't buffer it up or send it to the decoder
+        if (!chunk.length) {
+            if (this[BUFFERLENGTH] !== 0)
+                this.emit('readable');
+            if (cb)
+                fn(cb);
+            return this[FLOWING];
+        }
+        // fast-path writing strings of same encoding to a stream with
+        // an empty buffer, skipping the buffer/decoder dance
+        if (typeof chunk === 'string' &&
+            // unless it is a string already ready for us to use
+            !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) {
+            //@ts-ignore - sinful unsafe type change
+            chunk = Buffer.from(chunk, encoding);
+        }
+        if (Buffer.isBuffer(chunk) && this[ENCODING]) {
+            //@ts-ignore - sinful unsafe type change
+            chunk = this[DECODER].write(chunk);
+        }
+        // Note: flushing CAN potentially switch us into not-flowing mode
+        if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
+            this[FLUSH](true);
+        if (this[FLOWING])
+            this.emit('data', chunk);
+        else
+            this[BUFFERPUSH](chunk);
+        if (this[BUFFERLENGTH] !== 0)
+            this.emit('readable');
+        if (cb)
+            fn(cb);
+        return this[FLOWING];
+    }
+    /**
+     * Low-level explicit read method.
+     *
+     * In objectMode, the argument is ignored, and one item is returned if
+     * available.
+     *
+     * `n` is the number of bytes (or in the case of encoding streams,
+     * characters) to consume. If `n` is not provided, then the entire buffer
+     * is returned, or `null` is returned if no data is available.
+     *
+     * If `n` is greater that the amount of data in the internal buffer,
+     * then `null` is returned.
+     */
+    read(n) {
+        if (this[DESTROYED])
+            return null;
+        this[DISCARDED] = false;
+        if (this[BUFFERLENGTH] === 0 ||
+            n === 0 ||
+            (n && n > this[BUFFERLENGTH])) {
+            this[MAYBE_EMIT_END]();
+            return null;
+        }
+        if (this[OBJECTMODE])
+            n = null;
+        if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
+            // not object mode, so if we have an encoding, then RType is string
+            // otherwise, must be Buffer
+            this[BUFFER] = [
+                (this[ENCODING]
+                    ? this[BUFFER].join('')
+                    : Buffer.concat(this[BUFFER], this[BUFFERLENGTH])),
+            ];
+        }
+        const ret = this[READ](n || null, this[BUFFER][0]);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [READ](n, chunk) {
+        if (this[OBJECTMODE])
+            this[BUFFERSHIFT]();
+        else {
+            const c = chunk;
+            if (n === c.length || n === null)
+                this[BUFFERSHIFT]();
+            else if (typeof c === 'string') {
+                this[BUFFER][0] = c.slice(n);
+                chunk = c.slice(0, n);
+                this[BUFFERLENGTH] -= n;
+            }
+            else {
+                this[BUFFER][0] = c.subarray(n);
+                chunk = c.subarray(0, n);
+                this[BUFFERLENGTH] -= n;
+            }
+        }
+        this.emit('data', chunk);
+        if (!this[BUFFER].length && !this[EOF])
+            this.emit('drain');
+        return chunk;
+    }
+    end(chunk, encoding, cb) {
+        if (typeof chunk === 'function') {
+            cb = chunk;
+            chunk = undefined;
+        }
+        if (typeof encoding === 'function') {
+            cb = encoding;
+            encoding = 'utf8';
+        }
+        if (chunk !== undefined)
+            this.write(chunk, encoding);
+        if (cb)
+            this.once('end', cb);
+        this[EOF] = true;
+        this.writable = false;
+        // if we haven't written anything, then go ahead and emit,
+        // even if we're not reading.
+        // we'll re-emit if a new 'end' listener is added anyway.
+        // This makes MP more suitable to write-only use cases.
+        if (this[FLOWING] || !this[PAUSED])
+            this[MAYBE_EMIT_END]();
+        return this;
+    }
+    // don't let the internal resume be overwritten
+    [RESUME]() {
+        if (this[DESTROYED])
+            return;
+        if (!this[DATALISTENERS] && !this[PIPES].length) {
+            this[DISCARDED] = true;
+        }
+        this[PAUSED] = false;
+        this[FLOWING] = true;
+        this.emit('resume');
+        if (this[BUFFER].length)
+            this[FLUSH]();
+        else if (this[EOF])
+            this[MAYBE_EMIT_END]();
+        else
+            this.emit('drain');
+    }
+    /**
+     * Resume the stream if it is currently in a paused state
+     *
+     * If called when there are no pipe destinations or `data` event listeners,
+     * this will place the stream in a "discarded" state, where all data will
+     * be thrown away. The discarded state is removed if a pipe destination or
+     * data handler is added, if pause() is called, or if any synchronous or
+     * asynchronous iteration is started.
+     */
+    resume() {
+        return this[RESUME]();
+    }
+    /**
+     * Pause the stream
+     */
+    pause() {
+        this[FLOWING] = false;
+        this[PAUSED] = true;
+        this[DISCARDED] = false;
+    }
+    /**
+     * true if the stream has been forcibly destroyed
+     */
+    get destroyed() {
+        return this[DESTROYED];
+    }
+    /**
+     * true if the stream is currently in a flowing state, meaning that
+     * any writes will be immediately emitted.
+     */
+    get flowing() {
+        return this[FLOWING];
+    }
+    /**
+     * true if the stream is currently in a paused state
+     */
+    get paused() {
+        return this[PAUSED];
+    }
+    [BUFFERPUSH](chunk) {
+        if (this[OBJECTMODE])
+            this[BUFFERLENGTH] += 1;
+        else
+            this[BUFFERLENGTH] += chunk.length;
+        this[BUFFER].push(chunk);
+    }
+    [BUFFERSHIFT]() {
+        if (this[OBJECTMODE])
+            this[BUFFERLENGTH] -= 1;
+        else
+            this[BUFFERLENGTH] -= this[BUFFER][0].length;
+        return this[BUFFER].shift();
+    }
+    [FLUSH](noDrain = false) {
+        do { } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&
+            this[BUFFER].length);
+        if (!noDrain && !this[BUFFER].length && !this[EOF])
+            this.emit('drain');
+    }
+    [FLUSHCHUNK](chunk) {
+        this.emit('data', chunk);
+        return this[FLOWING];
+    }
+    /**
+     * Pipe all data emitted by this stream into the destination provided.
+     *
+     * Triggers the flow of data.
+     */
+    pipe(dest, opts) {
+        if (this[DESTROYED])
+            return dest;
+        this[DISCARDED] = false;
+        const ended = this[EMITTED_END];
+        opts = opts || {};
+        if (dest === proc.stdout || dest === proc.stderr)
+            opts.end = false;
+        else
+            opts.end = opts.end !== false;
+        opts.proxyErrors = !!opts.proxyErrors;
+        // piping an ended stream ends immediately
+        if (ended) {
+            if (opts.end)
+                dest.end();
+        }
+        else {
+            // "as" here just ignores the WType, which pipes don't care about,
+            // since they're only consuming from us, and writing to the dest
+            this[PIPES].push(!opts.proxyErrors
+                ? new Pipe(this, dest, opts)
+                : new PipeProxyErrors(this, dest, opts));
+            if (this[ASYNC])
+                defer(() => this[RESUME]());
+            else
+                this[RESUME]();
+        }
+        return dest;
+    }
+    /**
+     * Fully unhook a piped destination stream.
+     *
+     * If the destination stream was the only consumer of this stream (ie,
+     * there are no other piped destinations or `'data'` event listeners)
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    unpipe(dest) {
+        const p = this[PIPES].find(p => p.dest === dest);
+        if (p) {
+            if (this[PIPES].length === 1) {
+                if (this[FLOWING] && this[DATALISTENERS] === 0) {
+                    this[FLOWING] = false;
+                }
+                this[PIPES] = [];
+            }
+            else
+                this[PIPES].splice(this[PIPES].indexOf(p), 1);
+            p.unpipe();
+        }
+    }
+    /**
+     * Alias for {@link Minipass#on}
+     */
+    addListener(ev, handler) {
+        return this.on(ev, handler);
+    }
+    /**
+     * Mostly identical to `EventEmitter.on`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * - Adding a 'data' event handler will trigger the flow of data
+     *
+     * - Adding a 'readable' event handler when there is data waiting to be read
+     *   will cause 'readable' to be emitted immediately.
+     *
+     * - Adding an 'endish' event handler ('end', 'finish', etc.) which has
+     *   already passed will cause the event to be emitted immediately and all
+     *   handlers removed.
+     *
+     * - Adding an 'error' event handler after an error has been emitted will
+     *   cause the event to be re-emitted immediately with the error previously
+     *   raised.
+     */
+    on(ev, handler) {
+        const ret = super.on(ev, handler);
+        if (ev === 'data') {
+            this[DISCARDED] = false;
+            this[DATALISTENERS]++;
+            if (!this[PIPES].length && !this[FLOWING]) {
+                this[RESUME]();
+            }
+        }
+        else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {
+            super.emit('readable');
+        }
+        else if (isEndish(ev) && this[EMITTED_END]) {
+            super.emit(ev);
+            this.removeAllListeners(ev);
+        }
+        else if (ev === 'error' && this[EMITTED_ERROR]) {
+            const h = handler;
+            if (this[ASYNC])
+                defer(() => h.call(this, this[EMITTED_ERROR]));
+            else
+                h.call(this, this[EMITTED_ERROR]);
+        }
+        return ret;
+    }
+    /**
+     * Alias for {@link Minipass#off}
+     */
+    removeListener(ev, handler) {
+        return this.off(ev, handler);
+    }
+    /**
+     * Mostly identical to `EventEmitter.off`
+     *
+     * If a 'data' event handler is removed, and it was the last consumer
+     * (ie, there are no pipe destinations or other 'data' event listeners),
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    off(ev, handler) {
+        const ret = super.off(ev, handler);
+        // if we previously had listeners, and now we don't, and we don't
+        // have any pipes, then stop the flow, unless it's been explicitly
+        // put in a discarded flowing state via stream.resume().
+        if (ev === 'data') {
+            this[DATALISTENERS] = this.listeners('data').length;
+            if (this[DATALISTENERS] === 0 &&
+                !this[DISCARDED] &&
+                !this[PIPES].length) {
+                this[FLOWING] = false;
+            }
+        }
+        return ret;
+    }
+    /**
+     * Mostly identical to `EventEmitter.removeAllListeners`
+     *
+     * If all 'data' event handlers are removed, and they were the last consumer
+     * (ie, there are no pipe destinations), then the flow of data will stop
+     * until there is another consumer or {@link Minipass#resume} is explicitly
+     * called.
+     */
+    removeAllListeners(ev) {
+        const ret = super.removeAllListeners(ev);
+        if (ev === 'data' || ev === undefined) {
+            this[DATALISTENERS] = 0;
+            if (!this[DISCARDED] && !this[PIPES].length) {
+                this[FLOWING] = false;
+            }
+        }
+        return ret;
+    }
+    /**
+     * true if the 'end' event has been emitted
+     */
+    get emittedEnd() {
+        return this[EMITTED_END];
+    }
+    [MAYBE_EMIT_END]() {
+        if (!this[EMITTING_END] &&
+            !this[EMITTED_END] &&
+            !this[DESTROYED] &&
+            this[BUFFER].length === 0 &&
+            this[EOF]) {
+            this[EMITTING_END] = true;
+            this.emit('end');
+            this.emit('prefinish');
+            this.emit('finish');
+            if (this[CLOSED])
+                this.emit('close');
+            this[EMITTING_END] = false;
+        }
+    }
+    /**
+     * Mostly identical to `EventEmitter.emit`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * If the stream has been destroyed, and the event is something other
+     * than 'close' or 'error', then `false` is returned and no handlers
+     * are called.
+     *
+     * If the event is 'end', and has already been emitted, then the event
+     * is ignored. If the stream is in a paused or non-flowing state, then
+     * the event will be deferred until data flow resumes. If the stream is
+     * async, then handlers will be called on the next tick rather than
+     * immediately.
+     *
+     * If the event is 'close', and 'end' has not yet been emitted, then
+     * the event will be deferred until after 'end' is emitted.
+     *
+     * If the event is 'error', and an AbortSignal was provided for the stream,
+     * and there are no listeners, then the event is ignored, matching the
+     * behavior of node core streams in the presense of an AbortSignal.
+     *
+     * If the event is 'finish' or 'prefinish', then all listeners will be
+     * removed after emitting the event, to prevent double-firing.
+     */
+    emit(ev, ...args) {
+        const data = args[0];
+        // error and close are only events allowed after calling destroy()
+        if (ev !== 'error' &&
+            ev !== 'close' &&
+            ev !== DESTROYED &&
+            this[DESTROYED]) {
+            return false;
+        }
+        else if (ev === 'data') {
+            return !this[OBJECTMODE] && !data
+                ? false
+                : this[ASYNC]
+                    ? (defer(() => this[EMITDATA](data)), true)
+                    : this[EMITDATA](data);
+        }
+        else if (ev === 'end') {
+            return this[EMITEND]();
+        }
+        else if (ev === 'close') {
+            this[CLOSED] = true;
+            // don't emit close before 'end' and 'finish'
+            if (!this[EMITTED_END] && !this[DESTROYED])
+                return false;
+            const ret = super.emit('close');
+            this.removeAllListeners('close');
+            return ret;
+        }
+        else if (ev === 'error') {
+            this[EMITTED_ERROR] = data;
+            super.emit(ERROR, data);
+            const ret = !this[SIGNAL] || this.listeners('error').length
+                ? super.emit('error', data)
+                : false;
+            this[MAYBE_EMIT_END]();
+            return ret;
+        }
+        else if (ev === 'resume') {
+            const ret = super.emit('resume');
+            this[MAYBE_EMIT_END]();
+            return ret;
+        }
+        else if (ev === 'finish' || ev === 'prefinish') {
+            const ret = super.emit(ev);
+            this.removeAllListeners(ev);
+            return ret;
+        }
+        // Some other unknown event
+        const ret = super.emit(ev, ...args);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [EMITDATA](data) {
+        for (const p of this[PIPES]) {
+            if (p.dest.write(data) === false)
+                this.pause();
+        }
+        const ret = this[DISCARDED] ? false : super.emit('data', data);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [EMITEND]() {
+        if (this[EMITTED_END])
+            return false;
+        this[EMITTED_END] = true;
+        this.readable = false;
+        return this[ASYNC]
+            ? (defer(() => this[EMITEND2]()), true)
+            : this[EMITEND2]();
+    }
+    [EMITEND2]() {
+        if (this[DECODER]) {
+            const data = this[DECODER].end();
+            if (data) {
+                for (const p of this[PIPES]) {
+                    p.dest.write(data);
+                }
+                if (!this[DISCARDED])
+                    super.emit('data', data);
+            }
+        }
+        for (const p of this[PIPES]) {
+            p.end();
+        }
+        const ret = super.emit('end');
+        this.removeAllListeners('end');
+        return ret;
+    }
+    /**
+     * Return a Promise that resolves to an array of all emitted data once
+     * the stream ends.
+     */
+    async collect() {
+        const buf = Object.assign([], {
+            dataLength: 0,
+        });
+        if (!this[OBJECTMODE])
+            buf.dataLength = 0;
+        // set the promise first, in case an error is raised
+        // by triggering the flow here.
+        const p = this.promise();
+        this.on('data', c => {
+            buf.push(c);
+            if (!this[OBJECTMODE])
+                buf.dataLength += c.length;
+        });
+        await p;
+        return buf;
+    }
+    /**
+     * Return a Promise that resolves to the concatenation of all emitted data
+     * once the stream ends.
+     *
+     * Not allowed on objectMode streams.
+     */
+    async concat() {
+        if (this[OBJECTMODE]) {
+            throw new Error('cannot concat in objectMode');
+        }
+        const buf = await this.collect();
+        return (this[ENCODING]
+            ? buf.join('')
+            : Buffer.concat(buf, buf.dataLength));
+    }
+    /**
+     * Return a void Promise that resolves once the stream ends.
+     */
+    async promise() {
+        return new Promise((resolve, reject) => {
+            this.on(DESTROYED, () => reject(new Error('stream destroyed')));
+            this.on('error', er => reject(er));
+            this.on('end', () => resolve());
+        });
+    }
+    /**
+     * Asynchronous `for await of` iteration.
+     *
+     * This will continue emitting all chunks until the stream terminates.
+     */
+    [Symbol.asyncIterator]() {
+        // set this up front, in case the consumer doesn't call next()
+        // right away.
+        this[DISCARDED] = false;
+        let stopped = false;
+        const stop = async () => {
+            this.pause();
+            stopped = true;
+            return { value: undefined, done: true };
+        };
+        const next = () => {
+            if (stopped)
+                return stop();
+            const res = this.read();
+            if (res !== null)
+                return Promise.resolve({ done: false, value: res });
+            if (this[EOF])
+                return stop();
+            let resolve;
+            let reject;
+            const onerr = (er) => {
+                this.off('data', ondata);
+                this.off('end', onend);
+                this.off(DESTROYED, ondestroy);
+                stop();
+                reject(er);
+            };
+            const ondata = (value) => {
+                this.off('error', onerr);
+                this.off('end', onend);
+                this.off(DESTROYED, ondestroy);
+                this.pause();
+                resolve({ value, done: !!this[EOF] });
+            };
+            const onend = () => {
+                this.off('error', onerr);
+                this.off('data', ondata);
+                this.off(DESTROYED, ondestroy);
+                stop();
+                resolve({ done: true, value: undefined });
+            };
+            const ondestroy = () => onerr(new Error('stream destroyed'));
+            return new Promise((res, rej) => {
+                reject = rej;
+                resolve = res;
+                this.once(DESTROYED, ondestroy);
+                this.once('error', onerr);
+                this.once('end', onend);
+                this.once('data', ondata);
+            });
+        };
+        return {
+            next,
+            throw: stop,
+            return: stop,
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            [Symbol.asyncDispose]: async () => { },
+        };
+    }
+    /**
+     * Synchronous `for of` iteration.
+     *
+     * The iteration will terminate when the internal buffer runs out, even
+     * if the stream has not yet terminated.
+     */
+    [Symbol.iterator]() {
+        // set this up front, in case the consumer doesn't call next()
+        // right away.
+        this[DISCARDED] = false;
+        let stopped = false;
+        const stop = () => {
+            this.pause();
+            this.off(ERROR, stop);
+            this.off(DESTROYED, stop);
+            this.off('end', stop);
+            stopped = true;
+            return { done: true, value: undefined };
+        };
+        const next = () => {
+            if (stopped)
+                return stop();
+            const value = this.read();
+            return value === null ? stop() : { done: false, value };
+        };
+        this.once('end', stop);
+        this.once(ERROR, stop);
+        this.once(DESTROYED, stop);
+        return {
+            next,
+            throw: stop,
+            return: stop,
+            [Symbol.iterator]() {
+                return this;
+            },
+            [Symbol.dispose]: () => { },
+        };
+    }
+    /**
+     * Destroy a stream, preventing it from being used for any further purpose.
+     *
+     * If the stream has a `close()` method, then it will be called on
+     * destruction.
+     *
+     * After destruction, any attempt to write data, read data, or emit most
+     * events will be ignored.
+     *
+     * If an error argument is provided, then it will be emitted in an
+     * 'error' event.
+     */
+    destroy(er) {
+        if (this[DESTROYED]) {
+            if (er)
+                this.emit('error', er);
+            else
+                this.emit(DESTROYED);
+            return this;
+        }
+        this[DESTROYED] = true;
+        this[DISCARDED] = true;
+        // throw away all buffered data, it's never coming out
+        this[BUFFER].length = 0;
+        this[BUFFERLENGTH] = 0;
+        const wc = this;
+        if (typeof wc.close === 'function' && !this[CLOSED])
+            wc.close();
+        if (er)
+            this.emit('error', er);
+        // if no error to emit, still reject pending promises
+        else
+            this.emit(DESTROYED);
+        return this;
+    }
+    /**
+     * Alias for {@link isStream}
+     *
+     * Former export location, maintained for backwards compatibility.
+     *
+     * @deprecated
+     */
+    static get isStream() {
+        return exports.isStream;
+    }
+}
+exports.Minipass = Minipass;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/minipass/dist/commonjs/index.js.map b/node_modules/minipass/dist/commonjs/index.js.map
new file mode 100644
index 00000000..1687b4c9
--- /dev/null
+++ b/node_modules/minipass/dist/commonjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO;IACpC,CAAC,CAAC,OAAO;IACT,CAAC,CAAC;QACE,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACb,CAAA;AACP,6CAA0C;AAC1C,8DAAgC;AAChC,6DAAmD;AASnD;;;GAGG;AACI,MAAM,QAAQ,GAAG,CACtB,CAAM,EACsC,EAAE,CAC9C,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,CAAC,YAAY,QAAQ;QACpB,CAAC,YAAY,qBAAM;QACnB,IAAA,QAAA,UAAU,EAAC,CAAC,CAAC;QACb,IAAA,QAAA,UAAU,EAAC,CAAC,CAAC,CAAC;AAElB;;GAEG;AAJe,CAAA;AARL,QAAA,QAAQ,GAAR,QAAQ,CAQH;AAElB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A,CAChB;CACF","sourcesContent":["const proc =\n  typeof process === 'object' && process\n    ? process\n    : {\n        stdout: null,\n        stderr: null,\n      }\nimport { EventEmitter } from 'node:events'\nimport Stream from 'node:stream'\nimport { StringDecoder } from 'node:string_decoder'\n\n/**\n * Same as StringDecoder, but exposing the `lastNeed` flag on the type\n */\ntype SD = StringDecoder & { lastNeed: boolean }\n\nexport type { SD, Pipe, PipeProxyErrors }\n\n/**\n * Return true if the argument is a Minipass stream, Node stream, or something\n * else that Minipass can interact with.\n */\nexport const isStream = (\n  s: any\n): s is Minipass.Readable | Minipass.Writable =>\n  !!s &&\n  typeof s === 'object' &&\n  (s instanceof Minipass ||\n    s instanceof Stream ||\n    isReadable(s) ||\n    isWritable(s))\n\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\nexport const isReadable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Readable).pipe === 'function' &&\n  // node core Writable streams have a pipe() method, but it throws\n  (s as Minipass.Readable).pipe !== Stream.Writable.prototype.pipe\n\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\nexport const isWritable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Writable).write === 'function' &&\n  typeof (s as Minipass.Writable).end === 'function'\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFER = Symbol('buffer')\nconst PIPES = Symbol('pipes')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed')\n// internal event when stream has an error\nconst ERROR = Symbol('error')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\nconst ABORT = Symbol('abort')\nconst ABORTED = Symbol('aborted')\nconst SIGNAL = Symbol('signal')\nconst DATALISTENERS = Symbol('dataListeners')\nconst DISCARDED = Symbol('discarded')\n\nconst defer = (fn: (...a: any[]) => any) => Promise.resolve().then(fn)\nconst nodefer = (fn: (...a: any[]) => any) => fn()\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\ntype EndishEvent = 'end' | 'finish' | 'prefinish'\nconst isEndish = (ev: any): ev is EndishEvent =>\n  ev === 'end' || ev === 'finish' || ev === 'prefinish'\n\nconst isArrayBufferLike = (b: any): b is ArrayBufferLike =>\n  b instanceof ArrayBuffer ||\n  (!!b &&\n    typeof b === 'object' &&\n    b.constructor &&\n    b.constructor.name === 'ArrayBuffer' &&\n    b.byteLength >= 0)\n\nconst isArrayBufferView = (b: any): b is ArrayBufferView =>\n  !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\n/**\n * Options that may be passed to stream.pipe()\n */\nexport interface PipeOptions {\n  /**\n   * end the destination stream when the source stream ends\n   */\n  end?: boolean\n  /**\n   * proxy errors from the source stream to the destination stream\n   */\n  proxyErrors?: boolean\n}\n\n/**\n * Internal class representing a pipe to a destination stream.\n *\n * @internal\n */\nclass Pipe {\n  src: Minipass\n  dest: Minipass\n  opts: PipeOptions\n  ondrain: () => any\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    this.src = src\n    this.dest = dest as Minipass\n    this.opts = opts\n    this.ondrain = () => src[RESUME]()\n    this.dest.on('drain', this.ondrain)\n  }\n  unpipe() {\n    this.dest.removeListener('drain', this.ondrain)\n  }\n  // only here for the prototype\n  /* c8 ignore start */\n  proxyErrors(_er: any) {}\n  /* c8 ignore stop */\n  end() {\n    this.unpipe()\n    if (this.opts.end) this.dest.end()\n  }\n}\n\n/**\n * Internal class representing a pipe to a destination stream where\n * errors are proxied.\n *\n * @internal\n */\nclass PipeProxyErrors extends Pipe {\n  unpipe() {\n    this.src.removeListener('error', this.proxyErrors)\n    super.unpipe()\n  }\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    super(src, dest, opts)\n    this.proxyErrors = (er: Error) => this.dest.emit('error', er)\n    src.on('error', this.proxyErrors)\n  }\n}\n\nexport namespace Minipass {\n  /**\n   * Encoding used to create a stream that outputs strings rather than\n   * Buffer objects.\n   */\n  export type Encoding = BufferEncoding | 'buffer' | null\n\n  /**\n   * Any stream that Minipass can pipe into\n   */\n  export type Writable =\n    | Minipass\n    | NodeJS.WriteStream\n    | (NodeJS.WriteStream & { fd: number })\n    | (EventEmitter & {\n        end(): any\n        write(chunk: any, ...args: any[]): any\n      })\n\n  /**\n   * Any stream that can be read from\n   */\n  export type Readable =\n    | Minipass\n    | NodeJS.ReadStream\n    | (NodeJS.ReadStream & { fd: number })\n    | (EventEmitter & {\n        pause(): any\n        resume(): any\n        pipe(...destArgs: any[]): any\n      })\n\n  /**\n   * Utility type that can be iterated sync or async\n   */\n  export type DualIterable = Iterable & AsyncIterable\n\n  type EventArguments = Record\n\n  /**\n   * The listing of events that a Minipass class can emit.\n   * Extend this when extending the Minipass class, and pass as\n   * the third template argument.  The key is the name of the event,\n   * and the value is the argument list.\n   *\n   * Any undeclared events will still be allowed, but the handler will get\n   * arguments as `unknown[]`.\n   */\n  export interface Events\n    extends EventArguments {\n    readable: []\n    data: [chunk: RType]\n    error: [er: unknown]\n    abort: [reason: unknown]\n    drain: []\n    resume: []\n    end: []\n    finish: []\n    prefinish: []\n    close: []\n    [DESTROYED]: [er?: unknown]\n    [ERROR]: [er: unknown]\n  }\n\n  /**\n   * String or buffer-like data that can be joined and sliced\n   */\n  export type ContiguousData =\n    | Buffer\n    | ArrayBufferLike\n    | ArrayBufferView\n    | string\n  export type BufferOrString = Buffer | string\n\n  /**\n   * Options passed to the Minipass constructor.\n   */\n  export type SharedOptions = {\n    /**\n     * Defer all data emission and other events until the end of the\n     * current tick, similar to Node core streams\n     */\n    async?: boolean\n    /**\n     * A signal which will abort the stream\n     */\n    signal?: AbortSignal\n    /**\n     * Output string encoding. Set to `null` or `'buffer'` (or omit) to\n     * emit Buffer objects rather than strings.\n     *\n     * Conflicts with `objectMode`\n     */\n    encoding?: BufferEncoding | null | 'buffer'\n    /**\n     * Output data exactly as it was written, supporting non-buffer/string\n     * data (such as arbitrary objects, falsey values, etc.)\n     *\n     * Conflicts with `encoding`\n     */\n    objectMode?: boolean\n  }\n\n  /**\n   * Options for a string encoded output\n   */\n  export type EncodingOptions = SharedOptions & {\n    encoding: BufferEncoding\n    objectMode?: false\n  }\n\n  /**\n   * Options for contiguous data buffer output\n   */\n  export type BufferOptions = SharedOptions & {\n    encoding?: null | 'buffer'\n    objectMode?: false\n  }\n\n  /**\n   * Options for objectMode arbitrary output\n   */\n  export type ObjectModeOptions = SharedOptions & {\n    objectMode: true\n    encoding?: null\n  }\n\n  /**\n   * Utility type to determine allowed options based on read type\n   */\n  export type Options =\n    | ObjectModeOptions\n    | (T extends string\n        ? EncodingOptions\n        : T extends Buffer\n        ? BufferOptions\n        : SharedOptions)\n}\n\nconst isObjectModeOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.ObjectModeOptions => !!o.objectMode\n\nconst isEncodingOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.EncodingOptions =>\n  !o.objectMode && !!o.encoding && o.encoding !== 'buffer'\n\n/**\n * Main export, the Minipass class\n *\n * `RType` is the type of data emitted, defaults to Buffer\n *\n * `WType` is the type of data to be written, if RType is buffer or string,\n * then any {@link Minipass.ContiguousData} is allowed.\n *\n * `Events` is the set of event handler signatures that this object\n * will emit, see {@link Minipass.Events}\n */\nexport class Minipass<\n    RType extends unknown = Buffer,\n    WType extends unknown = RType extends Minipass.BufferOrString\n      ? Minipass.ContiguousData\n      : RType,\n    Events extends Minipass.Events = Minipass.Events\n  >\n  extends EventEmitter\n  implements Minipass.DualIterable\n{\n  [FLOWING]: boolean = false;\n  [PAUSED]: boolean = false;\n  [PIPES]: Pipe[] = [];\n  [BUFFER]: RType[] = [];\n  [OBJECTMODE]: boolean;\n  [ENCODING]: BufferEncoding | null;\n  [ASYNC]: boolean;\n  [DECODER]: SD | null;\n  [EOF]: boolean = false;\n  [EMITTED_END]: boolean = false;\n  [EMITTING_END]: boolean = false;\n  [CLOSED]: boolean = false;\n  [EMITTED_ERROR]: unknown = null;\n  [BUFFERLENGTH]: number = 0;\n  [DESTROYED]: boolean = false;\n  [SIGNAL]?: AbortSignal;\n  [ABORTED]: boolean = false;\n  [DATALISTENERS]: number = 0;\n  [DISCARDED]: boolean = false\n\n  /**\n   * true if the stream can be written\n   */\n  writable: boolean = true\n  /**\n   * true if the stream can be read\n   */\n  readable: boolean = true\n\n  /**\n   * If `RType` is Buffer, then options do not need to be provided.\n   * Otherwise, an options object must be provided to specify either\n   * {@link Minipass.SharedOptions.objectMode} or\n   * {@link Minipass.SharedOptions.encoding}, as appropriate.\n   */\n  constructor(\n    ...args:\n      | [Minipass.ObjectModeOptions]\n      | (RType extends Buffer\n          ? [] | [Minipass.Options]\n          : [Minipass.Options])\n  ) {\n    const options: Minipass.Options = (args[0] ||\n      {}) as Minipass.Options\n    super()\n    if (options.objectMode && typeof options.encoding === 'string') {\n      throw new TypeError(\n        'Encoding and objectMode may not be used together'\n      )\n    }\n    if (isObjectModeOptions(options)) {\n      this[OBJECTMODE] = true\n      this[ENCODING] = null\n    } else if (isEncodingOptions(options)) {\n      this[ENCODING] = options.encoding\n      this[OBJECTMODE] = false\n    } else {\n      this[OBJECTMODE] = false\n      this[ENCODING] = null\n    }\n    this[ASYNC] = !!options.async\n    this[DECODER] = this[ENCODING]\n      ? (new StringDecoder(this[ENCODING]) as SD)\n      : null\n\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposeBuffer === true) {\n      Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })\n    }\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposePipes === true) {\n      Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })\n    }\n\n    const { signal } = options\n    if (signal) {\n      this[SIGNAL] = signal\n      if (signal.aborted) {\n        this[ABORT]()\n      } else {\n        signal.addEventListener('abort', () => this[ABORT]())\n      }\n    }\n  }\n\n  /**\n   * The amount of data stored in the buffer waiting to be read.\n   *\n   * For Buffer strings, this will be the total byte length.\n   * For string encoding streams, this will be the string character length,\n   * according to JavaScript's `string.length` logic.\n   * For objectMode streams, this is a count of the items waiting to be\n   * emitted.\n   */\n  get bufferLength() {\n    return this[BUFFERLENGTH]\n  }\n\n  /**\n   * The `BufferEncoding` currently in use, or `null`\n   */\n  get encoding() {\n    return this[ENCODING]\n  }\n\n  /**\n   * @deprecated - This is a read only property\n   */\n  set encoding(_enc) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * @deprecated - Encoding may only be set at instantiation time\n   */\n  setEncoding(_enc: Minipass.Encoding) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * True if this is an objectMode stream\n   */\n  get objectMode() {\n    return this[OBJECTMODE]\n  }\n\n  /**\n   * @deprecated - This is a read-only property\n   */\n  set objectMode(_om) {\n    throw new Error('objectMode must be set at instantiation time')\n  }\n\n  /**\n   * true if this is an async stream\n   */\n  get ['async'](): boolean {\n    return this[ASYNC]\n  }\n  /**\n   * Set to true to make this stream async.\n   *\n   * Once set, it cannot be unset, as this would potentially cause incorrect\n   * behavior.  Ie, a sync stream can be made async, but an async stream\n   * cannot be safely made sync.\n   */\n  set ['async'](a: boolean) {\n    this[ASYNC] = this[ASYNC] || !!a\n  }\n\n  // drop everything and get out of the flow completely\n  [ABORT]() {\n    this[ABORTED] = true\n    this.emit('abort', this[SIGNAL]?.reason)\n    this.destroy(this[SIGNAL]?.reason)\n  }\n\n  /**\n   * True if the stream has been aborted.\n   */\n  get aborted() {\n    return this[ABORTED]\n  }\n  /**\n   * No-op setter. Stream aborted status is set via the AbortSignal provided\n   * in the constructor options.\n   */\n  set aborted(_) {}\n\n  /**\n   * Write data into the stream\n   *\n   * If the chunk written is a string, and encoding is not specified, then\n   * `utf8` will be assumed. If the stream encoding matches the encoding of\n   * a written string, and the state of the string decoder allows it, then\n   * the string will be passed through to either the output or the internal\n   * buffer without any processing. Otherwise, it will be turned into a\n   * Buffer object for processing into the desired encoding.\n   *\n   * If provided, `cb` function is called immediately before return for\n   * sync streams, or on next tick for async streams, because for this\n   * base class, a chunk is considered \"processed\" once it is accepted\n   * and either emitted or buffered. That is, the callback does not indicate\n   * that the chunk has been eventually emitted, though of course child\n   * classes can override this function to do whatever processing is required\n   * and call `super.write(...)` only once processing is completed.\n   */\n  write(chunk: WType, cb?: () => void): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding,\n    cb?: () => void\n  ): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): boolean {\n    if (this[ABORTED]) return false\n    if (this[EOF]) throw new Error('write after end')\n\n    if (this[DESTROYED]) {\n      this.emit(\n        'error',\n        Object.assign(\n          new Error('Cannot call write after a stream was destroyed'),\n          { code: 'ERR_STREAM_DESTROYED' }\n        )\n      )\n      return true\n    }\n\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n\n    if (!encoding) encoding = 'utf8'\n\n    const fn = this[ASYNC] ? defer : nodefer\n\n    // convert array buffers and typed array views into buffers\n    // at some point in the future, we may want to do the opposite!\n    // leave strings and buffers as-is\n    // anything is only allowed if in object mode, so throw\n    if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n      if (isArrayBufferView(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(\n          chunk.buffer,\n          chunk.byteOffset,\n          chunk.byteLength\n        )\n      } else if (isArrayBufferLike(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(chunk)\n      } else if (typeof chunk !== 'string') {\n        throw new Error(\n          'Non-contiguous data written to non-objectMode stream'\n        )\n      }\n    }\n\n    // handle object mode up front, since it's simpler\n    // this yields better performance, fewer checks later.\n    if (this[OBJECTMODE]) {\n      // maybe impossible?\n      /* c8 ignore start */\n      if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n      /* c8 ignore stop */\n\n      if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n      else this[BUFFERPUSH](chunk as unknown as RType)\n\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n      if (cb) fn(cb)\n\n      return this[FLOWING]\n    }\n\n    // at this point the chunk is a buffer or string\n    // don't buffer it up or send it to the decoder\n    if (!(chunk as Minipass.BufferOrString).length) {\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n      if (cb) fn(cb)\n      return this[FLOWING]\n    }\n\n    // fast-path writing strings of same encoding to a stream with\n    // an empty buffer, skipping the buffer/decoder dance\n    if (\n      typeof chunk === 'string' &&\n      // unless it is a string already ready for us to use\n      !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)\n    ) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = Buffer.from(chunk, encoding)\n    }\n\n    if (Buffer.isBuffer(chunk) && this[ENCODING]) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = this[DECODER].write(chunk)\n    }\n\n    // Note: flushing CAN potentially switch us into not-flowing mode\n    if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n    if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n    else this[BUFFERPUSH](chunk as unknown as RType)\n\n    if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n    if (cb) fn(cb)\n\n    return this[FLOWING]\n  }\n\n  /**\n   * Low-level explicit read method.\n   *\n   * In objectMode, the argument is ignored, and one item is returned if\n   * available.\n   *\n   * `n` is the number of bytes (or in the case of encoding streams,\n   * characters) to consume. If `n` is not provided, then the entire buffer\n   * is returned, or `null` is returned if no data is available.\n   *\n   * If `n` is greater that the amount of data in the internal buffer,\n   * then `null` is returned.\n   */\n  read(n?: number | null): RType | null {\n    if (this[DESTROYED]) return null\n    this[DISCARDED] = false\n\n    if (\n      this[BUFFERLENGTH] === 0 ||\n      n === 0 ||\n      (n && n > this[BUFFERLENGTH])\n    ) {\n      this[MAYBE_EMIT_END]()\n      return null\n    }\n\n    if (this[OBJECTMODE]) n = null\n\n    if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n      // not object mode, so if we have an encoding, then RType is string\n      // otherwise, must be Buffer\n      this[BUFFER] = [\n        (this[ENCODING]\n          ? this[BUFFER].join('')\n          : Buffer.concat(\n              this[BUFFER] as Buffer[],\n              this[BUFFERLENGTH]\n            )) as RType,\n      ]\n    }\n\n    const ret = this[READ](n || null, this[BUFFER][0] as RType)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [READ](n: number | null, chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERSHIFT]()\n    else {\n      const c = chunk as Minipass.BufferOrString\n      if (n === c.length || n === null) this[BUFFERSHIFT]()\n      else if (typeof c === 'string') {\n        this[BUFFER][0] = c.slice(n) as RType\n        chunk = c.slice(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      } else {\n        this[BUFFER][0] = c.subarray(n) as RType\n        chunk = c.subarray(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      }\n    }\n\n    this.emit('data', chunk)\n\n    if (!this[BUFFER].length && !this[EOF]) this.emit('drain')\n\n    return chunk\n  }\n\n  /**\n   * End the stream, optionally providing a final write.\n   *\n   * See {@link Minipass#write} for argument descriptions\n   */\n  end(cb?: () => void): this\n  end(chunk: WType, cb?: () => void): this\n  end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this\n  end(\n    chunk?: WType | (() => void),\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): this {\n    if (typeof chunk === 'function') {\n      cb = chunk as () => void\n      chunk = undefined\n    }\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n    if (chunk !== undefined) this.write(chunk, encoding)\n    if (cb) this.once('end', cb)\n    this[EOF] = true\n    this.writable = false\n\n    // if we haven't written anything, then go ahead and emit,\n    // even if we're not reading.\n    // we'll re-emit if a new 'end' listener is added anyway.\n    // This makes MP more suitable to write-only use cases.\n    if (this[FLOWING] || !this[PAUSED]) this[MAYBE_EMIT_END]()\n    return this\n  }\n\n  // don't let the internal resume be overwritten\n  [RESUME]() {\n    if (this[DESTROYED]) return\n\n    if (!this[DATALISTENERS] && !this[PIPES].length) {\n      this[DISCARDED] = true\n    }\n    this[PAUSED] = false\n    this[FLOWING] = true\n    this.emit('resume')\n    if (this[BUFFER].length) this[FLUSH]()\n    else if (this[EOF]) this[MAYBE_EMIT_END]()\n    else this.emit('drain')\n  }\n\n  /**\n   * Resume the stream if it is currently in a paused state\n   *\n   * If called when there are no pipe destinations or `data` event listeners,\n   * this will place the stream in a \"discarded\" state, where all data will\n   * be thrown away. The discarded state is removed if a pipe destination or\n   * data handler is added, if pause() is called, or if any synchronous or\n   * asynchronous iteration is started.\n   */\n  resume() {\n    return this[RESUME]()\n  }\n\n  /**\n   * Pause the stream\n   */\n  pause() {\n    this[FLOWING] = false\n    this[PAUSED] = true\n    this[DISCARDED] = false\n  }\n\n  /**\n   * true if the stream has been forcibly destroyed\n   */\n  get destroyed() {\n    return this[DESTROYED]\n  }\n\n  /**\n   * true if the stream is currently in a flowing state, meaning that\n   * any writes will be immediately emitted.\n   */\n  get flowing() {\n    return this[FLOWING]\n  }\n\n  /**\n   * true if the stream is currently in a paused state\n   */\n  get paused() {\n    return this[PAUSED]\n  }\n\n  [BUFFERPUSH](chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1\n    else this[BUFFERLENGTH] += (chunk as Minipass.BufferOrString).length\n    this[BUFFER].push(chunk)\n  }\n\n  [BUFFERSHIFT](): RType {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1\n    else\n      this[BUFFERLENGTH] -= (\n        this[BUFFER][0] as Minipass.BufferOrString\n      ).length\n    return this[BUFFER].shift() as RType\n  }\n\n  [FLUSH](noDrain: boolean = false) {\n    do {} while (\n      this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&\n      this[BUFFER].length\n    )\n\n    if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')\n  }\n\n  [FLUSHCHUNK](chunk: RType) {\n    this.emit('data', chunk)\n    return this[FLOWING]\n  }\n\n  /**\n   * Pipe all data emitted by this stream into the destination provided.\n   *\n   * Triggers the flow of data.\n   */\n  pipe(dest: W, opts?: PipeOptions): W {\n    if (this[DESTROYED]) return dest\n    this[DISCARDED] = false\n\n    const ended = this[EMITTED_END]\n    opts = opts || {}\n    if (dest === proc.stdout || dest === proc.stderr) opts.end = false\n    else opts.end = opts.end !== false\n    opts.proxyErrors = !!opts.proxyErrors\n\n    // piping an ended stream ends immediately\n    if (ended) {\n      if (opts.end) dest.end()\n    } else {\n      // \"as\" here just ignores the WType, which pipes don't care about,\n      // since they're only consuming from us, and writing to the dest\n      this[PIPES].push(\n        !opts.proxyErrors\n          ? new Pipe(this as Minipass, dest, opts)\n          : new PipeProxyErrors(this as Minipass, dest, opts)\n      )\n      if (this[ASYNC]) defer(() => this[RESUME]())\n      else this[RESUME]()\n    }\n\n    return dest\n  }\n\n  /**\n   * Fully unhook a piped destination stream.\n   *\n   * If the destination stream was the only consumer of this stream (ie,\n   * there are no other piped destinations or `'data'` event listeners)\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  unpipe(dest: W) {\n    const p = this[PIPES].find(p => p.dest === dest)\n    if (p) {\n      if (this[PIPES].length === 1) {\n        if (this[FLOWING] && this[DATALISTENERS] === 0) {\n          this[FLOWING] = false\n        }\n        this[PIPES] = []\n      } else this[PIPES].splice(this[PIPES].indexOf(p), 1)\n      p.unpipe()\n    }\n  }\n\n  /**\n   * Alias for {@link Minipass#on}\n   */\n  addListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    return this.on(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.on`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * - Adding a 'data' event handler will trigger the flow of data\n   *\n   * - Adding a 'readable' event handler when there is data waiting to be read\n   *   will cause 'readable' to be emitted immediately.\n   *\n   * - Adding an 'endish' event handler ('end', 'finish', etc.) which has\n   *   already passed will cause the event to be emitted immediately and all\n   *   handlers removed.\n   *\n   * - Adding an 'error' event handler after an error has been emitted will\n   *   cause the event to be re-emitted immediately with the error previously\n   *   raised.\n   */\n  on(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    const ret = super.on(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    if (ev === 'data') {\n      this[DISCARDED] = false\n      this[DATALISTENERS]++\n      if (!this[PIPES].length && !this[FLOWING]) {\n        this[RESUME]()\n      }\n    } else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {\n      super.emit('readable')\n    } else if (isEndish(ev) && this[EMITTED_END]) {\n      super.emit(ev)\n      this.removeAllListeners(ev)\n    } else if (ev === 'error' && this[EMITTED_ERROR]) {\n      const h = handler as (...a: Events['error']) => any\n      if (this[ASYNC]) defer(() => h.call(this, this[EMITTED_ERROR]))\n      else h.call(this, this[EMITTED_ERROR])\n    }\n    return ret\n  }\n\n  /**\n   * Alias for {@link Minipass#off}\n   */\n  removeListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    return this.off(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.off`\n   *\n   * If a 'data' event handler is removed, and it was the last consumer\n   * (ie, there are no pipe destinations or other 'data' event listeners),\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  off(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    const ret = super.off(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    // if we previously had listeners, and now we don't, and we don't\n    // have any pipes, then stop the flow, unless it's been explicitly\n    // put in a discarded flowing state via stream.resume().\n    if (ev === 'data') {\n      this[DATALISTENERS] = this.listeners('data').length\n      if (\n        this[DATALISTENERS] === 0 &&\n        !this[DISCARDED] &&\n        !this[PIPES].length\n      ) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.removeAllListeners`\n   *\n   * If all 'data' event handlers are removed, and they were the last consumer\n   * (ie, there are no pipe destinations), then the flow of data will stop\n   * until there is another consumer or {@link Minipass#resume} is explicitly\n   * called.\n   */\n  removeAllListeners(ev?: Event) {\n    const ret = super.removeAllListeners(ev as string | symbol | undefined)\n    if (ev === 'data' || ev === undefined) {\n      this[DATALISTENERS] = 0\n      if (!this[DISCARDED] && !this[PIPES].length) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * true if the 'end' event has been emitted\n   */\n  get emittedEnd() {\n    return this[EMITTED_END]\n  }\n\n  [MAYBE_EMIT_END]() {\n    if (\n      !this[EMITTING_END] &&\n      !this[EMITTED_END] &&\n      !this[DESTROYED] &&\n      this[BUFFER].length === 0 &&\n      this[EOF]\n    ) {\n      this[EMITTING_END] = true\n      this.emit('end')\n      this.emit('prefinish')\n      this.emit('finish')\n      if (this[CLOSED]) this.emit('close')\n      this[EMITTING_END] = false\n    }\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.emit`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * If the stream has been destroyed, and the event is something other\n   * than 'close' or 'error', then `false` is returned and no handlers\n   * are called.\n   *\n   * If the event is 'end', and has already been emitted, then the event\n   * is ignored. If the stream is in a paused or non-flowing state, then\n   * the event will be deferred until data flow resumes. If the stream is\n   * async, then handlers will be called on the next tick rather than\n   * immediately.\n   *\n   * If the event is 'close', and 'end' has not yet been emitted, then\n   * the event will be deferred until after 'end' is emitted.\n   *\n   * If the event is 'error', and an AbortSignal was provided for the stream,\n   * and there are no listeners, then the event is ignored, matching the\n   * behavior of node core streams in the presense of an AbortSignal.\n   *\n   * If the event is 'finish' or 'prefinish', then all listeners will be\n   * removed after emitting the event, to prevent double-firing.\n   */\n  emit(\n    ev: Event,\n    ...args: Events[Event]\n  ): boolean {\n    const data = args[0]\n    // error and close are only events allowed after calling destroy()\n    if (\n      ev !== 'error' &&\n      ev !== 'close' &&\n      ev !== DESTROYED &&\n      this[DESTROYED]\n    ) {\n      return false\n    } else if (ev === 'data') {\n      return !this[OBJECTMODE] && !data\n        ? false\n        : this[ASYNC]\n        ? (defer(() => this[EMITDATA](data as RType)), true)\n        : this[EMITDATA](data as RType)\n    } else if (ev === 'end') {\n      return this[EMITEND]()\n    } else if (ev === 'close') {\n      this[CLOSED] = true\n      // don't emit close before 'end' and 'finish'\n      if (!this[EMITTED_END] && !this[DESTROYED]) return false\n      const ret = super.emit('close')\n      this.removeAllListeners('close')\n      return ret\n    } else if (ev === 'error') {\n      this[EMITTED_ERROR] = data\n      super.emit(ERROR, data)\n      const ret =\n        !this[SIGNAL] || this.listeners('error').length\n          ? super.emit('error', data)\n          : false\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'resume') {\n      const ret = super.emit('resume')\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'finish' || ev === 'prefinish') {\n      const ret = super.emit(ev)\n      this.removeAllListeners(ev)\n      return ret\n    }\n\n    // Some other unknown event\n    const ret = super.emit(ev as string, ...args)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITDATA](data: RType) {\n    for (const p of this[PIPES]) {\n      if (p.dest.write(data as RType) === false) this.pause()\n    }\n    const ret = this[DISCARDED] ? false : super.emit('data', data)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITEND]() {\n    if (this[EMITTED_END]) return false\n\n    this[EMITTED_END] = true\n    this.readable = false\n    return this[ASYNC]\n      ? (defer(() => this[EMITEND2]()), true)\n      : this[EMITEND2]()\n  }\n\n  [EMITEND2]() {\n    if (this[DECODER]) {\n      const data = this[DECODER].end()\n      if (data) {\n        for (const p of this[PIPES]) {\n          p.dest.write(data as RType)\n        }\n        if (!this[DISCARDED]) super.emit('data', data)\n      }\n    }\n\n    for (const p of this[PIPES]) {\n      p.end()\n    }\n    const ret = super.emit('end')\n    this.removeAllListeners('end')\n    return ret\n  }\n\n  /**\n   * Return a Promise that resolves to an array of all emitted data once\n   * the stream ends.\n   */\n  async collect(): Promise {\n    const buf: RType[] & { dataLength: number } = Object.assign([], {\n      dataLength: 0,\n    })\n    if (!this[OBJECTMODE]) buf.dataLength = 0\n    // set the promise first, in case an error is raised\n    // by triggering the flow here.\n    const p = this.promise()\n    this.on('data', c => {\n      buf.push(c)\n      if (!this[OBJECTMODE])\n        buf.dataLength += (c as Minipass.BufferOrString).length\n    })\n    await p\n    return buf\n  }\n\n  /**\n   * Return a Promise that resolves to the concatenation of all emitted data\n   * once the stream ends.\n   *\n   * Not allowed on objectMode streams.\n   */\n  async concat(): Promise {\n    if (this[OBJECTMODE]) {\n      throw new Error('cannot concat in objectMode')\n    }\n    const buf = await this.collect()\n    return (\n      this[ENCODING]\n        ? buf.join('')\n        : Buffer.concat(buf as Buffer[], buf.dataLength)\n    ) as RType\n  }\n\n  /**\n   * Return a void Promise that resolves once the stream ends.\n   */\n  async promise(): Promise {\n    return new Promise((resolve, reject) => {\n      this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n      this.on('error', er => reject(er))\n      this.on('end', () => resolve())\n    })\n  }\n\n  /**\n   * Asynchronous `for await of` iteration.\n   *\n   * This will continue emitting all chunks until the stream terminates.\n   */\n  [Symbol.asyncIterator](): AsyncGenerator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = async (): Promise> => {\n      this.pause()\n      stopped = true\n      return { value: undefined, done: true }\n    }\n    const next = (): Promise> => {\n      if (stopped) return stop()\n      const res = this.read()\n      if (res !== null) return Promise.resolve({ done: false, value: res })\n\n      if (this[EOF]) return stop()\n\n      let resolve!: (res: IteratorResult) => void\n      let reject!: (er: unknown) => void\n      const onerr = (er: unknown) => {\n        this.off('data', ondata)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        reject(er)\n      }\n      const ondata = (value: RType) => {\n        this.off('error', onerr)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        this.pause()\n        resolve({ value, done: !!this[EOF] })\n      }\n      const onend = () => {\n        this.off('error', onerr)\n        this.off('data', ondata)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        resolve({ done: true, value: undefined })\n      }\n      const ondestroy = () => onerr(new Error('stream destroyed'))\n      return new Promise>((res, rej) => {\n        reject = rej\n        resolve = res\n        this.once(DESTROYED, ondestroy)\n        this.once('error', onerr)\n        this.once('end', onend)\n        this.once('data', ondata)\n      })\n    }\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.asyncIterator]() {\n        return this\n      },\n      [Symbol.asyncDispose]: async () => {},\n    }\n  }\n\n  /**\n   * Synchronous `for of` iteration.\n   *\n   * The iteration will terminate when the internal buffer runs out, even\n   * if the stream has not yet terminated.\n   */\n  [Symbol.iterator](): Generator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = (): IteratorReturnResult => {\n      this.pause()\n      this.off(ERROR, stop)\n      this.off(DESTROYED, stop)\n      this.off('end', stop)\n      stopped = true\n      return { done: true, value: undefined }\n    }\n\n    const next = (): IteratorResult => {\n      if (stopped) return stop()\n      const value = this.read()\n      return value === null ? stop() : { done: false, value }\n    }\n\n    this.once('end', stop)\n    this.once(ERROR, stop)\n    this.once(DESTROYED, stop)\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.iterator]() {\n        return this\n      },\n      [Symbol.dispose]: () => {},\n    }\n  }\n\n  /**\n   * Destroy a stream, preventing it from being used for any further purpose.\n   *\n   * If the stream has a `close()` method, then it will be called on\n   * destruction.\n   *\n   * After destruction, any attempt to write data, read data, or emit most\n   * events will be ignored.\n   *\n   * If an error argument is provided, then it will be emitted in an\n   * 'error' event.\n   */\n  destroy(er?: unknown) {\n    if (this[DESTROYED]) {\n      if (er) this.emit('error', er)\n      else this.emit(DESTROYED)\n      return this\n    }\n\n    this[DESTROYED] = true\n    this[DISCARDED] = true\n\n    // throw away all buffered data, it's never coming out\n    this[BUFFER].length = 0\n    this[BUFFERLENGTH] = 0\n\n    const wc = this as Minipass & {\n      close?: () => void\n    }\n    if (typeof wc.close === 'function' && !this[CLOSED]) wc.close()\n\n    if (er) this.emit('error', er)\n    // if no error to emit, still reject pending promises\n    else this.emit(DESTROYED)\n\n    return this\n  }\n\n  /**\n   * Alias for {@link isStream}\n   *\n   * Former export location, maintained for backwards compatibility.\n   *\n   * @deprecated\n   */\n  static get isStream() {\n    return isStream\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minipass/dist/commonjs/package.json b/node_modules/minipass/dist/commonjs/package.json
new file mode 100644
index 00000000..5bbefffb
--- /dev/null
+++ b/node_modules/minipass/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
diff --git a/node_modules/minipass/dist/esm/index.d.ts b/node_modules/minipass/dist/esm/index.d.ts
new file mode 100644
index 00000000..3e75b578
--- /dev/null
+++ b/node_modules/minipass/dist/esm/index.d.ts
@@ -0,0 +1,545 @@
+import { EventEmitter } from 'node:events';
+import { StringDecoder } from 'node:string_decoder';
+/**
+ * Same as StringDecoder, but exposing the `lastNeed` flag on the type
+ */
+type SD = StringDecoder & {
+    lastNeed: boolean;
+};
+export type { SD, Pipe, PipeProxyErrors };
+/**
+ * Return true if the argument is a Minipass stream, Node stream, or something
+ * else that Minipass can interact with.
+ */
+export declare const isStream: (s: any) => s is Minipass | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter & {
+    end(): any;
+    write(chunk: any, ...args: any[]): any;
+}) | (EventEmitter & {
+    pause(): any;
+    resume(): any;
+    pipe(...destArgs: any[]): any;
+}) | (NodeJS.ReadStream & {
+    fd: number;
+}) | (NodeJS.WriteStream & {
+    fd: number;
+});
+/**
+ * Return true if the argument is a valid {@link Minipass.Readable}
+ */
+export declare const isReadable: (s: any) => s is Minipass.Readable;
+/**
+ * Return true if the argument is a valid {@link Minipass.Writable}
+ */
+export declare const isWritable: (s: any) => s is Minipass.Readable;
+declare const EOF: unique symbol;
+declare const MAYBE_EMIT_END: unique symbol;
+declare const EMITTED_END: unique symbol;
+declare const EMITTING_END: unique symbol;
+declare const EMITTED_ERROR: unique symbol;
+declare const CLOSED: unique symbol;
+declare const READ: unique symbol;
+declare const FLUSH: unique symbol;
+declare const FLUSHCHUNK: unique symbol;
+declare const ENCODING: unique symbol;
+declare const DECODER: unique symbol;
+declare const FLOWING: unique symbol;
+declare const PAUSED: unique symbol;
+declare const RESUME: unique symbol;
+declare const BUFFER: unique symbol;
+declare const PIPES: unique symbol;
+declare const BUFFERLENGTH: unique symbol;
+declare const BUFFERPUSH: unique symbol;
+declare const BUFFERSHIFT: unique symbol;
+declare const OBJECTMODE: unique symbol;
+declare const DESTROYED: unique symbol;
+declare const ERROR: unique symbol;
+declare const EMITDATA: unique symbol;
+declare const EMITEND: unique symbol;
+declare const EMITEND2: unique symbol;
+declare const ASYNC: unique symbol;
+declare const ABORT: unique symbol;
+declare const ABORTED: unique symbol;
+declare const SIGNAL: unique symbol;
+declare const DATALISTENERS: unique symbol;
+declare const DISCARDED: unique symbol;
+/**
+ * Options that may be passed to stream.pipe()
+ */
+export interface PipeOptions {
+    /**
+     * end the destination stream when the source stream ends
+     */
+    end?: boolean;
+    /**
+     * proxy errors from the source stream to the destination stream
+     */
+    proxyErrors?: boolean;
+}
+/**
+ * Internal class representing a pipe to a destination stream.
+ *
+ * @internal
+ */
+declare class Pipe {
+    src: Minipass;
+    dest: Minipass;
+    opts: PipeOptions;
+    ondrain: () => any;
+    constructor(src: Minipass, dest: Minipass.Writable, opts: PipeOptions);
+    unpipe(): void;
+    proxyErrors(_er: any): void;
+    end(): void;
+}
+/**
+ * Internal class representing a pipe to a destination stream where
+ * errors are proxied.
+ *
+ * @internal
+ */
+declare class PipeProxyErrors extends Pipe {
+    unpipe(): void;
+    constructor(src: Minipass, dest: Minipass.Writable, opts: PipeOptions);
+}
+export declare namespace Minipass {
+    /**
+     * Encoding used to create a stream that outputs strings rather than
+     * Buffer objects.
+     */
+    export type Encoding = BufferEncoding | 'buffer' | null;
+    /**
+     * Any stream that Minipass can pipe into
+     */
+    export type Writable = Minipass | NodeJS.WriteStream | (NodeJS.WriteStream & {
+        fd: number;
+    }) | (EventEmitter & {
+        end(): any;
+        write(chunk: any, ...args: any[]): any;
+    });
+    /**
+     * Any stream that can be read from
+     */
+    export type Readable = Minipass | NodeJS.ReadStream | (NodeJS.ReadStream & {
+        fd: number;
+    }) | (EventEmitter & {
+        pause(): any;
+        resume(): any;
+        pipe(...destArgs: any[]): any;
+    });
+    /**
+     * Utility type that can be iterated sync or async
+     */
+    export type DualIterable = Iterable & AsyncIterable;
+    type EventArguments = Record;
+    /**
+     * The listing of events that a Minipass class can emit.
+     * Extend this when extending the Minipass class, and pass as
+     * the third template argument.  The key is the name of the event,
+     * and the value is the argument list.
+     *
+     * Any undeclared events will still be allowed, but the handler will get
+     * arguments as `unknown[]`.
+     */
+    export interface Events extends EventArguments {
+        readable: [];
+        data: [chunk: RType];
+        error: [er: unknown];
+        abort: [reason: unknown];
+        drain: [];
+        resume: [];
+        end: [];
+        finish: [];
+        prefinish: [];
+        close: [];
+        [DESTROYED]: [er?: unknown];
+        [ERROR]: [er: unknown];
+    }
+    /**
+     * String or buffer-like data that can be joined and sliced
+     */
+    export type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string;
+    export type BufferOrString = Buffer | string;
+    /**
+     * Options passed to the Minipass constructor.
+     */
+    export type SharedOptions = {
+        /**
+         * Defer all data emission and other events until the end of the
+         * current tick, similar to Node core streams
+         */
+        async?: boolean;
+        /**
+         * A signal which will abort the stream
+         */
+        signal?: AbortSignal;
+        /**
+         * Output string encoding. Set to `null` or `'buffer'` (or omit) to
+         * emit Buffer objects rather than strings.
+         *
+         * Conflicts with `objectMode`
+         */
+        encoding?: BufferEncoding | null | 'buffer';
+        /**
+         * Output data exactly as it was written, supporting non-buffer/string
+         * data (such as arbitrary objects, falsey values, etc.)
+         *
+         * Conflicts with `encoding`
+         */
+        objectMode?: boolean;
+    };
+    /**
+     * Options for a string encoded output
+     */
+    export type EncodingOptions = SharedOptions & {
+        encoding: BufferEncoding;
+        objectMode?: false;
+    };
+    /**
+     * Options for contiguous data buffer output
+     */
+    export type BufferOptions = SharedOptions & {
+        encoding?: null | 'buffer';
+        objectMode?: false;
+    };
+    /**
+     * Options for objectMode arbitrary output
+     */
+    export type ObjectModeOptions = SharedOptions & {
+        objectMode: true;
+        encoding?: null;
+    };
+    /**
+     * Utility type to determine allowed options based on read type
+     */
+    export type Options = ObjectModeOptions | (T extends string ? EncodingOptions : T extends Buffer ? BufferOptions : SharedOptions);
+    export {};
+}
+/**
+ * Main export, the Minipass class
+ *
+ * `RType` is the type of data emitted, defaults to Buffer
+ *
+ * `WType` is the type of data to be written, if RType is buffer or string,
+ * then any {@link Minipass.ContiguousData} is allowed.
+ *
+ * `Events` is the set of event handler signatures that this object
+ * will emit, see {@link Minipass.Events}
+ */
+export declare class Minipass = Minipass.Events> extends EventEmitter implements Minipass.DualIterable {
+    [FLOWING]: boolean;
+    [PAUSED]: boolean;
+    [PIPES]: Pipe[];
+    [BUFFER]: RType[];
+    [OBJECTMODE]: boolean;
+    [ENCODING]: BufferEncoding | null;
+    [ASYNC]: boolean;
+    [DECODER]: SD | null;
+    [EOF]: boolean;
+    [EMITTED_END]: boolean;
+    [EMITTING_END]: boolean;
+    [CLOSED]: boolean;
+    [EMITTED_ERROR]: unknown;
+    [BUFFERLENGTH]: number;
+    [DESTROYED]: boolean;
+    [SIGNAL]?: AbortSignal;
+    [ABORTED]: boolean;
+    [DATALISTENERS]: number;
+    [DISCARDED]: boolean;
+    /**
+     * true if the stream can be written
+     */
+    writable: boolean;
+    /**
+     * true if the stream can be read
+     */
+    readable: boolean;
+    /**
+     * If `RType` is Buffer, then options do not need to be provided.
+     * Otherwise, an options object must be provided to specify either
+     * {@link Minipass.SharedOptions.objectMode} or
+     * {@link Minipass.SharedOptions.encoding}, as appropriate.
+     */
+    constructor(...args: [Minipass.ObjectModeOptions] | (RType extends Buffer ? [] | [Minipass.Options] : [Minipass.Options]));
+    /**
+     * The amount of data stored in the buffer waiting to be read.
+     *
+     * For Buffer strings, this will be the total byte length.
+     * For string encoding streams, this will be the string character length,
+     * according to JavaScript's `string.length` logic.
+     * For objectMode streams, this is a count of the items waiting to be
+     * emitted.
+     */
+    get bufferLength(): number;
+    /**
+     * The `BufferEncoding` currently in use, or `null`
+     */
+    get encoding(): BufferEncoding | null;
+    /**
+     * @deprecated - This is a read only property
+     */
+    set encoding(_enc: BufferEncoding | null);
+    /**
+     * @deprecated - Encoding may only be set at instantiation time
+     */
+    setEncoding(_enc: Minipass.Encoding): void;
+    /**
+     * True if this is an objectMode stream
+     */
+    get objectMode(): boolean;
+    /**
+     * @deprecated - This is a read-only property
+     */
+    set objectMode(_om: boolean);
+    /**
+     * true if this is an async stream
+     */
+    get ['async'](): boolean;
+    /**
+     * Set to true to make this stream async.
+     *
+     * Once set, it cannot be unset, as this would potentially cause incorrect
+     * behavior.  Ie, a sync stream can be made async, but an async stream
+     * cannot be safely made sync.
+     */
+    set ['async'](a: boolean);
+    [ABORT](): void;
+    /**
+     * True if the stream has been aborted.
+     */
+    get aborted(): boolean;
+    /**
+     * No-op setter. Stream aborted status is set via the AbortSignal provided
+     * in the constructor options.
+     */
+    set aborted(_: boolean);
+    /**
+     * Write data into the stream
+     *
+     * If the chunk written is a string, and encoding is not specified, then
+     * `utf8` will be assumed. If the stream encoding matches the encoding of
+     * a written string, and the state of the string decoder allows it, then
+     * the string will be passed through to either the output or the internal
+     * buffer without any processing. Otherwise, it will be turned into a
+     * Buffer object for processing into the desired encoding.
+     *
+     * If provided, `cb` function is called immediately before return for
+     * sync streams, or on next tick for async streams, because for this
+     * base class, a chunk is considered "processed" once it is accepted
+     * and either emitted or buffered. That is, the callback does not indicate
+     * that the chunk has been eventually emitted, though of course child
+     * classes can override this function to do whatever processing is required
+     * and call `super.write(...)` only once processing is completed.
+     */
+    write(chunk: WType, cb?: () => void): boolean;
+    write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean;
+    /**
+     * Low-level explicit read method.
+     *
+     * In objectMode, the argument is ignored, and one item is returned if
+     * available.
+     *
+     * `n` is the number of bytes (or in the case of encoding streams,
+     * characters) to consume. If `n` is not provided, then the entire buffer
+     * is returned, or `null` is returned if no data is available.
+     *
+     * If `n` is greater that the amount of data in the internal buffer,
+     * then `null` is returned.
+     */
+    read(n?: number | null): RType | null;
+    [READ](n: number | null, chunk: RType): RType;
+    /**
+     * End the stream, optionally providing a final write.
+     *
+     * See {@link Minipass#write} for argument descriptions
+     */
+    end(cb?: () => void): this;
+    end(chunk: WType, cb?: () => void): this;
+    end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this;
+    [RESUME](): void;
+    /**
+     * Resume the stream if it is currently in a paused state
+     *
+     * If called when there are no pipe destinations or `data` event listeners,
+     * this will place the stream in a "discarded" state, where all data will
+     * be thrown away. The discarded state is removed if a pipe destination or
+     * data handler is added, if pause() is called, or if any synchronous or
+     * asynchronous iteration is started.
+     */
+    resume(): void;
+    /**
+     * Pause the stream
+     */
+    pause(): void;
+    /**
+     * true if the stream has been forcibly destroyed
+     */
+    get destroyed(): boolean;
+    /**
+     * true if the stream is currently in a flowing state, meaning that
+     * any writes will be immediately emitted.
+     */
+    get flowing(): boolean;
+    /**
+     * true if the stream is currently in a paused state
+     */
+    get paused(): boolean;
+    [BUFFERPUSH](chunk: RType): void;
+    [BUFFERSHIFT](): RType;
+    [FLUSH](noDrain?: boolean): void;
+    [FLUSHCHUNK](chunk: RType): boolean;
+    /**
+     * Pipe all data emitted by this stream into the destination provided.
+     *
+     * Triggers the flow of data.
+     */
+    pipe(dest: W, opts?: PipeOptions): W;
+    /**
+     * Fully unhook a piped destination stream.
+     *
+     * If the destination stream was the only consumer of this stream (ie,
+     * there are no other piped destinations or `'data'` event listeners)
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    unpipe(dest: W): void;
+    /**
+     * Alias for {@link Minipass#on}
+     */
+    addListener(ev: Event, handler: (...args: Events[Event]) => any): this;
+    /**
+     * Mostly identical to `EventEmitter.on`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * - Adding a 'data' event handler will trigger the flow of data
+     *
+     * - Adding a 'readable' event handler when there is data waiting to be read
+     *   will cause 'readable' to be emitted immediately.
+     *
+     * - Adding an 'endish' event handler ('end', 'finish', etc.) which has
+     *   already passed will cause the event to be emitted immediately and all
+     *   handlers removed.
+     *
+     * - Adding an 'error' event handler after an error has been emitted will
+     *   cause the event to be re-emitted immediately with the error previously
+     *   raised.
+     */
+    on(ev: Event, handler: (...args: Events[Event]) => any): this;
+    /**
+     * Alias for {@link Minipass#off}
+     */
+    removeListener(ev: Event, handler: (...args: Events[Event]) => any): this;
+    /**
+     * Mostly identical to `EventEmitter.off`
+     *
+     * If a 'data' event handler is removed, and it was the last consumer
+     * (ie, there are no pipe destinations or other 'data' event listeners),
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    off(ev: Event, handler: (...args: Events[Event]) => any): this;
+    /**
+     * Mostly identical to `EventEmitter.removeAllListeners`
+     *
+     * If all 'data' event handlers are removed, and they were the last consumer
+     * (ie, there are no pipe destinations), then the flow of data will stop
+     * until there is another consumer or {@link Minipass#resume} is explicitly
+     * called.
+     */
+    removeAllListeners(ev?: Event): this;
+    /**
+     * true if the 'end' event has been emitted
+     */
+    get emittedEnd(): boolean;
+    [MAYBE_EMIT_END](): void;
+    /**
+     * Mostly identical to `EventEmitter.emit`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * If the stream has been destroyed, and the event is something other
+     * than 'close' or 'error', then `false` is returned and no handlers
+     * are called.
+     *
+     * If the event is 'end', and has already been emitted, then the event
+     * is ignored. If the stream is in a paused or non-flowing state, then
+     * the event will be deferred until data flow resumes. If the stream is
+     * async, then handlers will be called on the next tick rather than
+     * immediately.
+     *
+     * If the event is 'close', and 'end' has not yet been emitted, then
+     * the event will be deferred until after 'end' is emitted.
+     *
+     * If the event is 'error', and an AbortSignal was provided for the stream,
+     * and there are no listeners, then the event is ignored, matching the
+     * behavior of node core streams in the presense of an AbortSignal.
+     *
+     * If the event is 'finish' or 'prefinish', then all listeners will be
+     * removed after emitting the event, to prevent double-firing.
+     */
+    emit(ev: Event, ...args: Events[Event]): boolean;
+    [EMITDATA](data: RType): boolean;
+    [EMITEND](): boolean;
+    [EMITEND2](): boolean;
+    /**
+     * Return a Promise that resolves to an array of all emitted data once
+     * the stream ends.
+     */
+    collect(): Promise;
+    /**
+     * Return a Promise that resolves to the concatenation of all emitted data
+     * once the stream ends.
+     *
+     * Not allowed on objectMode streams.
+     */
+    concat(): Promise;
+    /**
+     * Return a void Promise that resolves once the stream ends.
+     */
+    promise(): Promise;
+    /**
+     * Asynchronous `for await of` iteration.
+     *
+     * This will continue emitting all chunks until the stream terminates.
+     */
+    [Symbol.asyncIterator](): AsyncGenerator;
+    /**
+     * Synchronous `for of` iteration.
+     *
+     * The iteration will terminate when the internal buffer runs out, even
+     * if the stream has not yet terminated.
+     */
+    [Symbol.iterator](): Generator;
+    /**
+     * Destroy a stream, preventing it from being used for any further purpose.
+     *
+     * If the stream has a `close()` method, then it will be called on
+     * destruction.
+     *
+     * After destruction, any attempt to write data, read data, or emit most
+     * events will be ignored.
+     *
+     * If an error argument is provided, then it will be emitted in an
+     * 'error' event.
+     */
+    destroy(er?: unknown): this;
+    /**
+     * Alias for {@link isStream}
+     *
+     * Former export location, maintained for backwards compatibility.
+     *
+     * @deprecated
+     */
+    static get isStream(): (s: any) => s is Minipass | NodeJS.ReadStream | NodeJS.WriteStream | (EventEmitter & {
+        end(): any;
+        write(chunk: any, ...args: any[]): any;
+    }) | (EventEmitter & {
+        pause(): any;
+        resume(): any;
+        pipe(...destArgs: any[]): any;
+    }) | (NodeJS.ReadStream & {
+        fd: number;
+    }) | (NodeJS.WriteStream & {
+        fd: number;
+    });
+}
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/minipass/dist/esm/index.d.ts.map b/node_modules/minipass/dist/esm/index.d.ts.map
new file mode 100644
index 00000000..7bce611b
--- /dev/null
+++ b/node_modules/minipass/dist/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD;;GAEG;AACH,KAAK,EAAE,GAAG,aAAa,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAA;AAE/C,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAA;AAEzC;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;EAQH,CAAA;AAElB;;GAEG;AACH,eAAO,MAAM,UAAU,oCAM2C,CAAA;AAElE;;GAEG;AACH,eAAO,MAAM,UAAU,oCAK6B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AK,QAAQ;;;;;;;;;;;OAElB;CACF","sourcesContent":["const proc =\n  typeof process === 'object' && process\n    ? process\n    : {\n        stdout: null,\n        stderr: null,\n      }\nimport { EventEmitter } from 'node:events'\nimport Stream from 'node:stream'\nimport { StringDecoder } from 'node:string_decoder'\n\n/**\n * Same as StringDecoder, but exposing the `lastNeed` flag on the type\n */\ntype SD = StringDecoder & { lastNeed: boolean }\n\nexport type { SD, Pipe, PipeProxyErrors }\n\n/**\n * Return true if the argument is a Minipass stream, Node stream, or something\n * else that Minipass can interact with.\n */\nexport const isStream = (\n  s: any\n): s is Minipass.Readable | Minipass.Writable =>\n  !!s &&\n  typeof s === 'object' &&\n  (s instanceof Minipass ||\n    s instanceof Stream ||\n    isReadable(s) ||\n    isWritable(s))\n\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\nexport const isReadable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Readable).pipe === 'function' &&\n  // node core Writable streams have a pipe() method, but it throws\n  (s as Minipass.Readable).pipe !== Stream.Writable.prototype.pipe\n\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\nexport const isWritable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Writable).write === 'function' &&\n  typeof (s as Minipass.Writable).end === 'function'\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFER = Symbol('buffer')\nconst PIPES = Symbol('pipes')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed')\n// internal event when stream has an error\nconst ERROR = Symbol('error')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\nconst ABORT = Symbol('abort')\nconst ABORTED = Symbol('aborted')\nconst SIGNAL = Symbol('signal')\nconst DATALISTENERS = Symbol('dataListeners')\nconst DISCARDED = Symbol('discarded')\n\nconst defer = (fn: (...a: any[]) => any) => Promise.resolve().then(fn)\nconst nodefer = (fn: (...a: any[]) => any) => fn()\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\ntype EndishEvent = 'end' | 'finish' | 'prefinish'\nconst isEndish = (ev: any): ev is EndishEvent =>\n  ev === 'end' || ev === 'finish' || ev === 'prefinish'\n\nconst isArrayBufferLike = (b: any): b is ArrayBufferLike =>\n  b instanceof ArrayBuffer ||\n  (!!b &&\n    typeof b === 'object' &&\n    b.constructor &&\n    b.constructor.name === 'ArrayBuffer' &&\n    b.byteLength >= 0)\n\nconst isArrayBufferView = (b: any): b is ArrayBufferView =>\n  !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\n/**\n * Options that may be passed to stream.pipe()\n */\nexport interface PipeOptions {\n  /**\n   * end the destination stream when the source stream ends\n   */\n  end?: boolean\n  /**\n   * proxy errors from the source stream to the destination stream\n   */\n  proxyErrors?: boolean\n}\n\n/**\n * Internal class representing a pipe to a destination stream.\n *\n * @internal\n */\nclass Pipe {\n  src: Minipass\n  dest: Minipass\n  opts: PipeOptions\n  ondrain: () => any\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    this.src = src\n    this.dest = dest as Minipass\n    this.opts = opts\n    this.ondrain = () => src[RESUME]()\n    this.dest.on('drain', this.ondrain)\n  }\n  unpipe() {\n    this.dest.removeListener('drain', this.ondrain)\n  }\n  // only here for the prototype\n  /* c8 ignore start */\n  proxyErrors(_er: any) {}\n  /* c8 ignore stop */\n  end() {\n    this.unpipe()\n    if (this.opts.end) this.dest.end()\n  }\n}\n\n/**\n * Internal class representing a pipe to a destination stream where\n * errors are proxied.\n *\n * @internal\n */\nclass PipeProxyErrors extends Pipe {\n  unpipe() {\n    this.src.removeListener('error', this.proxyErrors)\n    super.unpipe()\n  }\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    super(src, dest, opts)\n    this.proxyErrors = (er: Error) => this.dest.emit('error', er)\n    src.on('error', this.proxyErrors)\n  }\n}\n\nexport namespace Minipass {\n  /**\n   * Encoding used to create a stream that outputs strings rather than\n   * Buffer objects.\n   */\n  export type Encoding = BufferEncoding | 'buffer' | null\n\n  /**\n   * Any stream that Minipass can pipe into\n   */\n  export type Writable =\n    | Minipass\n    | NodeJS.WriteStream\n    | (NodeJS.WriteStream & { fd: number })\n    | (EventEmitter & {\n        end(): any\n        write(chunk: any, ...args: any[]): any\n      })\n\n  /**\n   * Any stream that can be read from\n   */\n  export type Readable =\n    | Minipass\n    | NodeJS.ReadStream\n    | (NodeJS.ReadStream & { fd: number })\n    | (EventEmitter & {\n        pause(): any\n        resume(): any\n        pipe(...destArgs: any[]): any\n      })\n\n  /**\n   * Utility type that can be iterated sync or async\n   */\n  export type DualIterable = Iterable & AsyncIterable\n\n  type EventArguments = Record\n\n  /**\n   * The listing of events that a Minipass class can emit.\n   * Extend this when extending the Minipass class, and pass as\n   * the third template argument.  The key is the name of the event,\n   * and the value is the argument list.\n   *\n   * Any undeclared events will still be allowed, but the handler will get\n   * arguments as `unknown[]`.\n   */\n  export interface Events\n    extends EventArguments {\n    readable: []\n    data: [chunk: RType]\n    error: [er: unknown]\n    abort: [reason: unknown]\n    drain: []\n    resume: []\n    end: []\n    finish: []\n    prefinish: []\n    close: []\n    [DESTROYED]: [er?: unknown]\n    [ERROR]: [er: unknown]\n  }\n\n  /**\n   * String or buffer-like data that can be joined and sliced\n   */\n  export type ContiguousData =\n    | Buffer\n    | ArrayBufferLike\n    | ArrayBufferView\n    | string\n  export type BufferOrString = Buffer | string\n\n  /**\n   * Options passed to the Minipass constructor.\n   */\n  export type SharedOptions = {\n    /**\n     * Defer all data emission and other events until the end of the\n     * current tick, similar to Node core streams\n     */\n    async?: boolean\n    /**\n     * A signal which will abort the stream\n     */\n    signal?: AbortSignal\n    /**\n     * Output string encoding. Set to `null` or `'buffer'` (or omit) to\n     * emit Buffer objects rather than strings.\n     *\n     * Conflicts with `objectMode`\n     */\n    encoding?: BufferEncoding | null | 'buffer'\n    /**\n     * Output data exactly as it was written, supporting non-buffer/string\n     * data (such as arbitrary objects, falsey values, etc.)\n     *\n     * Conflicts with `encoding`\n     */\n    objectMode?: boolean\n  }\n\n  /**\n   * Options for a string encoded output\n   */\n  export type EncodingOptions = SharedOptions & {\n    encoding: BufferEncoding\n    objectMode?: false\n  }\n\n  /**\n   * Options for contiguous data buffer output\n   */\n  export type BufferOptions = SharedOptions & {\n    encoding?: null | 'buffer'\n    objectMode?: false\n  }\n\n  /**\n   * Options for objectMode arbitrary output\n   */\n  export type ObjectModeOptions = SharedOptions & {\n    objectMode: true\n    encoding?: null\n  }\n\n  /**\n   * Utility type to determine allowed options based on read type\n   */\n  export type Options =\n    | ObjectModeOptions\n    | (T extends string\n        ? EncodingOptions\n        : T extends Buffer\n        ? BufferOptions\n        : SharedOptions)\n}\n\nconst isObjectModeOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.ObjectModeOptions => !!o.objectMode\n\nconst isEncodingOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.EncodingOptions =>\n  !o.objectMode && !!o.encoding && o.encoding !== 'buffer'\n\n/**\n * Main export, the Minipass class\n *\n * `RType` is the type of data emitted, defaults to Buffer\n *\n * `WType` is the type of data to be written, if RType is buffer or string,\n * then any {@link Minipass.ContiguousData} is allowed.\n *\n * `Events` is the set of event handler signatures that this object\n * will emit, see {@link Minipass.Events}\n */\nexport class Minipass<\n    RType extends unknown = Buffer,\n    WType extends unknown = RType extends Minipass.BufferOrString\n      ? Minipass.ContiguousData\n      : RType,\n    Events extends Minipass.Events = Minipass.Events\n  >\n  extends EventEmitter\n  implements Minipass.DualIterable\n{\n  [FLOWING]: boolean = false;\n  [PAUSED]: boolean = false;\n  [PIPES]: Pipe[] = [];\n  [BUFFER]: RType[] = [];\n  [OBJECTMODE]: boolean;\n  [ENCODING]: BufferEncoding | null;\n  [ASYNC]: boolean;\n  [DECODER]: SD | null;\n  [EOF]: boolean = false;\n  [EMITTED_END]: boolean = false;\n  [EMITTING_END]: boolean = false;\n  [CLOSED]: boolean = false;\n  [EMITTED_ERROR]: unknown = null;\n  [BUFFERLENGTH]: number = 0;\n  [DESTROYED]: boolean = false;\n  [SIGNAL]?: AbortSignal;\n  [ABORTED]: boolean = false;\n  [DATALISTENERS]: number = 0;\n  [DISCARDED]: boolean = false\n\n  /**\n   * true if the stream can be written\n   */\n  writable: boolean = true\n  /**\n   * true if the stream can be read\n   */\n  readable: boolean = true\n\n  /**\n   * If `RType` is Buffer, then options do not need to be provided.\n   * Otherwise, an options object must be provided to specify either\n   * {@link Minipass.SharedOptions.objectMode} or\n   * {@link Minipass.SharedOptions.encoding}, as appropriate.\n   */\n  constructor(\n    ...args:\n      | [Minipass.ObjectModeOptions]\n      | (RType extends Buffer\n          ? [] | [Minipass.Options]\n          : [Minipass.Options])\n  ) {\n    const options: Minipass.Options = (args[0] ||\n      {}) as Minipass.Options\n    super()\n    if (options.objectMode && typeof options.encoding === 'string') {\n      throw new TypeError(\n        'Encoding and objectMode may not be used together'\n      )\n    }\n    if (isObjectModeOptions(options)) {\n      this[OBJECTMODE] = true\n      this[ENCODING] = null\n    } else if (isEncodingOptions(options)) {\n      this[ENCODING] = options.encoding\n      this[OBJECTMODE] = false\n    } else {\n      this[OBJECTMODE] = false\n      this[ENCODING] = null\n    }\n    this[ASYNC] = !!options.async\n    this[DECODER] = this[ENCODING]\n      ? (new StringDecoder(this[ENCODING]) as SD)\n      : null\n\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposeBuffer === true) {\n      Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })\n    }\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposePipes === true) {\n      Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })\n    }\n\n    const { signal } = options\n    if (signal) {\n      this[SIGNAL] = signal\n      if (signal.aborted) {\n        this[ABORT]()\n      } else {\n        signal.addEventListener('abort', () => this[ABORT]())\n      }\n    }\n  }\n\n  /**\n   * The amount of data stored in the buffer waiting to be read.\n   *\n   * For Buffer strings, this will be the total byte length.\n   * For string encoding streams, this will be the string character length,\n   * according to JavaScript's `string.length` logic.\n   * For objectMode streams, this is a count of the items waiting to be\n   * emitted.\n   */\n  get bufferLength() {\n    return this[BUFFERLENGTH]\n  }\n\n  /**\n   * The `BufferEncoding` currently in use, or `null`\n   */\n  get encoding() {\n    return this[ENCODING]\n  }\n\n  /**\n   * @deprecated - This is a read only property\n   */\n  set encoding(_enc) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * @deprecated - Encoding may only be set at instantiation time\n   */\n  setEncoding(_enc: Minipass.Encoding) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * True if this is an objectMode stream\n   */\n  get objectMode() {\n    return this[OBJECTMODE]\n  }\n\n  /**\n   * @deprecated - This is a read-only property\n   */\n  set objectMode(_om) {\n    throw new Error('objectMode must be set at instantiation time')\n  }\n\n  /**\n   * true if this is an async stream\n   */\n  get ['async'](): boolean {\n    return this[ASYNC]\n  }\n  /**\n   * Set to true to make this stream async.\n   *\n   * Once set, it cannot be unset, as this would potentially cause incorrect\n   * behavior.  Ie, a sync stream can be made async, but an async stream\n   * cannot be safely made sync.\n   */\n  set ['async'](a: boolean) {\n    this[ASYNC] = this[ASYNC] || !!a\n  }\n\n  // drop everything and get out of the flow completely\n  [ABORT]() {\n    this[ABORTED] = true\n    this.emit('abort', this[SIGNAL]?.reason)\n    this.destroy(this[SIGNAL]?.reason)\n  }\n\n  /**\n   * True if the stream has been aborted.\n   */\n  get aborted() {\n    return this[ABORTED]\n  }\n  /**\n   * No-op setter. Stream aborted status is set via the AbortSignal provided\n   * in the constructor options.\n   */\n  set aborted(_) {}\n\n  /**\n   * Write data into the stream\n   *\n   * If the chunk written is a string, and encoding is not specified, then\n   * `utf8` will be assumed. If the stream encoding matches the encoding of\n   * a written string, and the state of the string decoder allows it, then\n   * the string will be passed through to either the output or the internal\n   * buffer without any processing. Otherwise, it will be turned into a\n   * Buffer object for processing into the desired encoding.\n   *\n   * If provided, `cb` function is called immediately before return for\n   * sync streams, or on next tick for async streams, because for this\n   * base class, a chunk is considered \"processed\" once it is accepted\n   * and either emitted or buffered. That is, the callback does not indicate\n   * that the chunk has been eventually emitted, though of course child\n   * classes can override this function to do whatever processing is required\n   * and call `super.write(...)` only once processing is completed.\n   */\n  write(chunk: WType, cb?: () => void): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding,\n    cb?: () => void\n  ): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): boolean {\n    if (this[ABORTED]) return false\n    if (this[EOF]) throw new Error('write after end')\n\n    if (this[DESTROYED]) {\n      this.emit(\n        'error',\n        Object.assign(\n          new Error('Cannot call write after a stream was destroyed'),\n          { code: 'ERR_STREAM_DESTROYED' }\n        )\n      )\n      return true\n    }\n\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n\n    if (!encoding) encoding = 'utf8'\n\n    const fn = this[ASYNC] ? defer : nodefer\n\n    // convert array buffers and typed array views into buffers\n    // at some point in the future, we may want to do the opposite!\n    // leave strings and buffers as-is\n    // anything is only allowed if in object mode, so throw\n    if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n      if (isArrayBufferView(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(\n          chunk.buffer,\n          chunk.byteOffset,\n          chunk.byteLength\n        )\n      } else if (isArrayBufferLike(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(chunk)\n      } else if (typeof chunk !== 'string') {\n        throw new Error(\n          'Non-contiguous data written to non-objectMode stream'\n        )\n      }\n    }\n\n    // handle object mode up front, since it's simpler\n    // this yields better performance, fewer checks later.\n    if (this[OBJECTMODE]) {\n      // maybe impossible?\n      /* c8 ignore start */\n      if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n      /* c8 ignore stop */\n\n      if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n      else this[BUFFERPUSH](chunk as unknown as RType)\n\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n      if (cb) fn(cb)\n\n      return this[FLOWING]\n    }\n\n    // at this point the chunk is a buffer or string\n    // don't buffer it up or send it to the decoder\n    if (!(chunk as Minipass.BufferOrString).length) {\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n      if (cb) fn(cb)\n      return this[FLOWING]\n    }\n\n    // fast-path writing strings of same encoding to a stream with\n    // an empty buffer, skipping the buffer/decoder dance\n    if (\n      typeof chunk === 'string' &&\n      // unless it is a string already ready for us to use\n      !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)\n    ) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = Buffer.from(chunk, encoding)\n    }\n\n    if (Buffer.isBuffer(chunk) && this[ENCODING]) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = this[DECODER].write(chunk)\n    }\n\n    // Note: flushing CAN potentially switch us into not-flowing mode\n    if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n    if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n    else this[BUFFERPUSH](chunk as unknown as RType)\n\n    if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n    if (cb) fn(cb)\n\n    return this[FLOWING]\n  }\n\n  /**\n   * Low-level explicit read method.\n   *\n   * In objectMode, the argument is ignored, and one item is returned if\n   * available.\n   *\n   * `n` is the number of bytes (or in the case of encoding streams,\n   * characters) to consume. If `n` is not provided, then the entire buffer\n   * is returned, or `null` is returned if no data is available.\n   *\n   * If `n` is greater that the amount of data in the internal buffer,\n   * then `null` is returned.\n   */\n  read(n?: number | null): RType | null {\n    if (this[DESTROYED]) return null\n    this[DISCARDED] = false\n\n    if (\n      this[BUFFERLENGTH] === 0 ||\n      n === 0 ||\n      (n && n > this[BUFFERLENGTH])\n    ) {\n      this[MAYBE_EMIT_END]()\n      return null\n    }\n\n    if (this[OBJECTMODE]) n = null\n\n    if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n      // not object mode, so if we have an encoding, then RType is string\n      // otherwise, must be Buffer\n      this[BUFFER] = [\n        (this[ENCODING]\n          ? this[BUFFER].join('')\n          : Buffer.concat(\n              this[BUFFER] as Buffer[],\n              this[BUFFERLENGTH]\n            )) as RType,\n      ]\n    }\n\n    const ret = this[READ](n || null, this[BUFFER][0] as RType)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [READ](n: number | null, chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERSHIFT]()\n    else {\n      const c = chunk as Minipass.BufferOrString\n      if (n === c.length || n === null) this[BUFFERSHIFT]()\n      else if (typeof c === 'string') {\n        this[BUFFER][0] = c.slice(n) as RType\n        chunk = c.slice(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      } else {\n        this[BUFFER][0] = c.subarray(n) as RType\n        chunk = c.subarray(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      }\n    }\n\n    this.emit('data', chunk)\n\n    if (!this[BUFFER].length && !this[EOF]) this.emit('drain')\n\n    return chunk\n  }\n\n  /**\n   * End the stream, optionally providing a final write.\n   *\n   * See {@link Minipass#write} for argument descriptions\n   */\n  end(cb?: () => void): this\n  end(chunk: WType, cb?: () => void): this\n  end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this\n  end(\n    chunk?: WType | (() => void),\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): this {\n    if (typeof chunk === 'function') {\n      cb = chunk as () => void\n      chunk = undefined\n    }\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n    if (chunk !== undefined) this.write(chunk, encoding)\n    if (cb) this.once('end', cb)\n    this[EOF] = true\n    this.writable = false\n\n    // if we haven't written anything, then go ahead and emit,\n    // even if we're not reading.\n    // we'll re-emit if a new 'end' listener is added anyway.\n    // This makes MP more suitable to write-only use cases.\n    if (this[FLOWING] || !this[PAUSED]) this[MAYBE_EMIT_END]()\n    return this\n  }\n\n  // don't let the internal resume be overwritten\n  [RESUME]() {\n    if (this[DESTROYED]) return\n\n    if (!this[DATALISTENERS] && !this[PIPES].length) {\n      this[DISCARDED] = true\n    }\n    this[PAUSED] = false\n    this[FLOWING] = true\n    this.emit('resume')\n    if (this[BUFFER].length) this[FLUSH]()\n    else if (this[EOF]) this[MAYBE_EMIT_END]()\n    else this.emit('drain')\n  }\n\n  /**\n   * Resume the stream if it is currently in a paused state\n   *\n   * If called when there are no pipe destinations or `data` event listeners,\n   * this will place the stream in a \"discarded\" state, where all data will\n   * be thrown away. The discarded state is removed if a pipe destination or\n   * data handler is added, if pause() is called, or if any synchronous or\n   * asynchronous iteration is started.\n   */\n  resume() {\n    return this[RESUME]()\n  }\n\n  /**\n   * Pause the stream\n   */\n  pause() {\n    this[FLOWING] = false\n    this[PAUSED] = true\n    this[DISCARDED] = false\n  }\n\n  /**\n   * true if the stream has been forcibly destroyed\n   */\n  get destroyed() {\n    return this[DESTROYED]\n  }\n\n  /**\n   * true if the stream is currently in a flowing state, meaning that\n   * any writes will be immediately emitted.\n   */\n  get flowing() {\n    return this[FLOWING]\n  }\n\n  /**\n   * true if the stream is currently in a paused state\n   */\n  get paused() {\n    return this[PAUSED]\n  }\n\n  [BUFFERPUSH](chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1\n    else this[BUFFERLENGTH] += (chunk as Minipass.BufferOrString).length\n    this[BUFFER].push(chunk)\n  }\n\n  [BUFFERSHIFT](): RType {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1\n    else\n      this[BUFFERLENGTH] -= (\n        this[BUFFER][0] as Minipass.BufferOrString\n      ).length\n    return this[BUFFER].shift() as RType\n  }\n\n  [FLUSH](noDrain: boolean = false) {\n    do {} while (\n      this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&\n      this[BUFFER].length\n    )\n\n    if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')\n  }\n\n  [FLUSHCHUNK](chunk: RType) {\n    this.emit('data', chunk)\n    return this[FLOWING]\n  }\n\n  /**\n   * Pipe all data emitted by this stream into the destination provided.\n   *\n   * Triggers the flow of data.\n   */\n  pipe(dest: W, opts?: PipeOptions): W {\n    if (this[DESTROYED]) return dest\n    this[DISCARDED] = false\n\n    const ended = this[EMITTED_END]\n    opts = opts || {}\n    if (dest === proc.stdout || dest === proc.stderr) opts.end = false\n    else opts.end = opts.end !== false\n    opts.proxyErrors = !!opts.proxyErrors\n\n    // piping an ended stream ends immediately\n    if (ended) {\n      if (opts.end) dest.end()\n    } else {\n      // \"as\" here just ignores the WType, which pipes don't care about,\n      // since they're only consuming from us, and writing to the dest\n      this[PIPES].push(\n        !opts.proxyErrors\n          ? new Pipe(this as Minipass, dest, opts)\n          : new PipeProxyErrors(this as Minipass, dest, opts)\n      )\n      if (this[ASYNC]) defer(() => this[RESUME]())\n      else this[RESUME]()\n    }\n\n    return dest\n  }\n\n  /**\n   * Fully unhook a piped destination stream.\n   *\n   * If the destination stream was the only consumer of this stream (ie,\n   * there are no other piped destinations or `'data'` event listeners)\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  unpipe(dest: W) {\n    const p = this[PIPES].find(p => p.dest === dest)\n    if (p) {\n      if (this[PIPES].length === 1) {\n        if (this[FLOWING] && this[DATALISTENERS] === 0) {\n          this[FLOWING] = false\n        }\n        this[PIPES] = []\n      } else this[PIPES].splice(this[PIPES].indexOf(p), 1)\n      p.unpipe()\n    }\n  }\n\n  /**\n   * Alias for {@link Minipass#on}\n   */\n  addListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    return this.on(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.on`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * - Adding a 'data' event handler will trigger the flow of data\n   *\n   * - Adding a 'readable' event handler when there is data waiting to be read\n   *   will cause 'readable' to be emitted immediately.\n   *\n   * - Adding an 'endish' event handler ('end', 'finish', etc.) which has\n   *   already passed will cause the event to be emitted immediately and all\n   *   handlers removed.\n   *\n   * - Adding an 'error' event handler after an error has been emitted will\n   *   cause the event to be re-emitted immediately with the error previously\n   *   raised.\n   */\n  on(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    const ret = super.on(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    if (ev === 'data') {\n      this[DISCARDED] = false\n      this[DATALISTENERS]++\n      if (!this[PIPES].length && !this[FLOWING]) {\n        this[RESUME]()\n      }\n    } else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {\n      super.emit('readable')\n    } else if (isEndish(ev) && this[EMITTED_END]) {\n      super.emit(ev)\n      this.removeAllListeners(ev)\n    } else if (ev === 'error' && this[EMITTED_ERROR]) {\n      const h = handler as (...a: Events['error']) => any\n      if (this[ASYNC]) defer(() => h.call(this, this[EMITTED_ERROR]))\n      else h.call(this, this[EMITTED_ERROR])\n    }\n    return ret\n  }\n\n  /**\n   * Alias for {@link Minipass#off}\n   */\n  removeListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    return this.off(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.off`\n   *\n   * If a 'data' event handler is removed, and it was the last consumer\n   * (ie, there are no pipe destinations or other 'data' event listeners),\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  off(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    const ret = super.off(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    // if we previously had listeners, and now we don't, and we don't\n    // have any pipes, then stop the flow, unless it's been explicitly\n    // put in a discarded flowing state via stream.resume().\n    if (ev === 'data') {\n      this[DATALISTENERS] = this.listeners('data').length\n      if (\n        this[DATALISTENERS] === 0 &&\n        !this[DISCARDED] &&\n        !this[PIPES].length\n      ) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.removeAllListeners`\n   *\n   * If all 'data' event handlers are removed, and they were the last consumer\n   * (ie, there are no pipe destinations), then the flow of data will stop\n   * until there is another consumer or {@link Minipass#resume} is explicitly\n   * called.\n   */\n  removeAllListeners(ev?: Event) {\n    const ret = super.removeAllListeners(ev as string | symbol | undefined)\n    if (ev === 'data' || ev === undefined) {\n      this[DATALISTENERS] = 0\n      if (!this[DISCARDED] && !this[PIPES].length) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * true if the 'end' event has been emitted\n   */\n  get emittedEnd() {\n    return this[EMITTED_END]\n  }\n\n  [MAYBE_EMIT_END]() {\n    if (\n      !this[EMITTING_END] &&\n      !this[EMITTED_END] &&\n      !this[DESTROYED] &&\n      this[BUFFER].length === 0 &&\n      this[EOF]\n    ) {\n      this[EMITTING_END] = true\n      this.emit('end')\n      this.emit('prefinish')\n      this.emit('finish')\n      if (this[CLOSED]) this.emit('close')\n      this[EMITTING_END] = false\n    }\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.emit`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * If the stream has been destroyed, and the event is something other\n   * than 'close' or 'error', then `false` is returned and no handlers\n   * are called.\n   *\n   * If the event is 'end', and has already been emitted, then the event\n   * is ignored. If the stream is in a paused or non-flowing state, then\n   * the event will be deferred until data flow resumes. If the stream is\n   * async, then handlers will be called on the next tick rather than\n   * immediately.\n   *\n   * If the event is 'close', and 'end' has not yet been emitted, then\n   * the event will be deferred until after 'end' is emitted.\n   *\n   * If the event is 'error', and an AbortSignal was provided for the stream,\n   * and there are no listeners, then the event is ignored, matching the\n   * behavior of node core streams in the presense of an AbortSignal.\n   *\n   * If the event is 'finish' or 'prefinish', then all listeners will be\n   * removed after emitting the event, to prevent double-firing.\n   */\n  emit(\n    ev: Event,\n    ...args: Events[Event]\n  ): boolean {\n    const data = args[0]\n    // error and close are only events allowed after calling destroy()\n    if (\n      ev !== 'error' &&\n      ev !== 'close' &&\n      ev !== DESTROYED &&\n      this[DESTROYED]\n    ) {\n      return false\n    } else if (ev === 'data') {\n      return !this[OBJECTMODE] && !data\n        ? false\n        : this[ASYNC]\n        ? (defer(() => this[EMITDATA](data as RType)), true)\n        : this[EMITDATA](data as RType)\n    } else if (ev === 'end') {\n      return this[EMITEND]()\n    } else if (ev === 'close') {\n      this[CLOSED] = true\n      // don't emit close before 'end' and 'finish'\n      if (!this[EMITTED_END] && !this[DESTROYED]) return false\n      const ret = super.emit('close')\n      this.removeAllListeners('close')\n      return ret\n    } else if (ev === 'error') {\n      this[EMITTED_ERROR] = data\n      super.emit(ERROR, data)\n      const ret =\n        !this[SIGNAL] || this.listeners('error').length\n          ? super.emit('error', data)\n          : false\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'resume') {\n      const ret = super.emit('resume')\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'finish' || ev === 'prefinish') {\n      const ret = super.emit(ev)\n      this.removeAllListeners(ev)\n      return ret\n    }\n\n    // Some other unknown event\n    const ret = super.emit(ev as string, ...args)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITDATA](data: RType) {\n    for (const p of this[PIPES]) {\n      if (p.dest.write(data as RType) === false) this.pause()\n    }\n    const ret = this[DISCARDED] ? false : super.emit('data', data)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITEND]() {\n    if (this[EMITTED_END]) return false\n\n    this[EMITTED_END] = true\n    this.readable = false\n    return this[ASYNC]\n      ? (defer(() => this[EMITEND2]()), true)\n      : this[EMITEND2]()\n  }\n\n  [EMITEND2]() {\n    if (this[DECODER]) {\n      const data = this[DECODER].end()\n      if (data) {\n        for (const p of this[PIPES]) {\n          p.dest.write(data as RType)\n        }\n        if (!this[DISCARDED]) super.emit('data', data)\n      }\n    }\n\n    for (const p of this[PIPES]) {\n      p.end()\n    }\n    const ret = super.emit('end')\n    this.removeAllListeners('end')\n    return ret\n  }\n\n  /**\n   * Return a Promise that resolves to an array of all emitted data once\n   * the stream ends.\n   */\n  async collect(): Promise {\n    const buf: RType[] & { dataLength: number } = Object.assign([], {\n      dataLength: 0,\n    })\n    if (!this[OBJECTMODE]) buf.dataLength = 0\n    // set the promise first, in case an error is raised\n    // by triggering the flow here.\n    const p = this.promise()\n    this.on('data', c => {\n      buf.push(c)\n      if (!this[OBJECTMODE])\n        buf.dataLength += (c as Minipass.BufferOrString).length\n    })\n    await p\n    return buf\n  }\n\n  /**\n   * Return a Promise that resolves to the concatenation of all emitted data\n   * once the stream ends.\n   *\n   * Not allowed on objectMode streams.\n   */\n  async concat(): Promise {\n    if (this[OBJECTMODE]) {\n      throw new Error('cannot concat in objectMode')\n    }\n    const buf = await this.collect()\n    return (\n      this[ENCODING]\n        ? buf.join('')\n        : Buffer.concat(buf as Buffer[], buf.dataLength)\n    ) as RType\n  }\n\n  /**\n   * Return a void Promise that resolves once the stream ends.\n   */\n  async promise(): Promise {\n    return new Promise((resolve, reject) => {\n      this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n      this.on('error', er => reject(er))\n      this.on('end', () => resolve())\n    })\n  }\n\n  /**\n   * Asynchronous `for await of` iteration.\n   *\n   * This will continue emitting all chunks until the stream terminates.\n   */\n  [Symbol.asyncIterator](): AsyncGenerator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = async (): Promise> => {\n      this.pause()\n      stopped = true\n      return { value: undefined, done: true }\n    }\n    const next = (): Promise> => {\n      if (stopped) return stop()\n      const res = this.read()\n      if (res !== null) return Promise.resolve({ done: false, value: res })\n\n      if (this[EOF]) return stop()\n\n      let resolve!: (res: IteratorResult) => void\n      let reject!: (er: unknown) => void\n      const onerr = (er: unknown) => {\n        this.off('data', ondata)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        reject(er)\n      }\n      const ondata = (value: RType) => {\n        this.off('error', onerr)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        this.pause()\n        resolve({ value, done: !!this[EOF] })\n      }\n      const onend = () => {\n        this.off('error', onerr)\n        this.off('data', ondata)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        resolve({ done: true, value: undefined })\n      }\n      const ondestroy = () => onerr(new Error('stream destroyed'))\n      return new Promise>((res, rej) => {\n        reject = rej\n        resolve = res\n        this.once(DESTROYED, ondestroy)\n        this.once('error', onerr)\n        this.once('end', onend)\n        this.once('data', ondata)\n      })\n    }\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.asyncIterator]() {\n        return this\n      },\n      [Symbol.asyncDispose]: async () => {},\n    }\n  }\n\n  /**\n   * Synchronous `for of` iteration.\n   *\n   * The iteration will terminate when the internal buffer runs out, even\n   * if the stream has not yet terminated.\n   */\n  [Symbol.iterator](): Generator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = (): IteratorReturnResult => {\n      this.pause()\n      this.off(ERROR, stop)\n      this.off(DESTROYED, stop)\n      this.off('end', stop)\n      stopped = true\n      return { done: true, value: undefined }\n    }\n\n    const next = (): IteratorResult => {\n      if (stopped) return stop()\n      const value = this.read()\n      return value === null ? stop() : { done: false, value }\n    }\n\n    this.once('end', stop)\n    this.once(ERROR, stop)\n    this.once(DESTROYED, stop)\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.iterator]() {\n        return this\n      },\n      [Symbol.dispose]: () => {},\n    }\n  }\n\n  /**\n   * Destroy a stream, preventing it from being used for any further purpose.\n   *\n   * If the stream has a `close()` method, then it will be called on\n   * destruction.\n   *\n   * After destruction, any attempt to write data, read data, or emit most\n   * events will be ignored.\n   *\n   * If an error argument is provided, then it will be emitted in an\n   * 'error' event.\n   */\n  destroy(er?: unknown) {\n    if (this[DESTROYED]) {\n      if (er) this.emit('error', er)\n      else this.emit(DESTROYED)\n      return this\n    }\n\n    this[DESTROYED] = true\n    this[DISCARDED] = true\n\n    // throw away all buffered data, it's never coming out\n    this[BUFFER].length = 0\n    this[BUFFERLENGTH] = 0\n\n    const wc = this as Minipass & {\n      close?: () => void\n    }\n    if (typeof wc.close === 'function' && !this[CLOSED]) wc.close()\n\n    if (er) this.emit('error', er)\n    // if no error to emit, still reject pending promises\n    else this.emit(DESTROYED)\n\n    return this\n  }\n\n  /**\n   * Alias for {@link isStream}\n   *\n   * Former export location, maintained for backwards compatibility.\n   *\n   * @deprecated\n   */\n  static get isStream() {\n    return isStream\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minipass/dist/esm/index.js b/node_modules/minipass/dist/esm/index.js
new file mode 100644
index 00000000..5df55461
--- /dev/null
+++ b/node_modules/minipass/dist/esm/index.js
@@ -0,0 +1,1020 @@
+const proc = typeof process === 'object' && process
+    ? process
+    : {
+        stdout: null,
+        stderr: null,
+    };
+import { EventEmitter } from 'node:events';
+import Stream from 'node:stream';
+import { StringDecoder } from 'node:string_decoder';
+/**
+ * Return true if the argument is a Minipass stream, Node stream, or something
+ * else that Minipass can interact with.
+ */
+export const isStream = (s) => !!s &&
+    typeof s === 'object' &&
+    (s instanceof Minipass ||
+        s instanceof Stream ||
+        isReadable(s) ||
+        isWritable(s));
+/**
+ * Return true if the argument is a valid {@link Minipass.Readable}
+ */
+export const isReadable = (s) => !!s &&
+    typeof s === 'object' &&
+    s instanceof EventEmitter &&
+    typeof s.pipe === 'function' &&
+    // node core Writable streams have a pipe() method, but it throws
+    s.pipe !== Stream.Writable.prototype.pipe;
+/**
+ * Return true if the argument is a valid {@link Minipass.Writable}
+ */
+export const isWritable = (s) => !!s &&
+    typeof s === 'object' &&
+    s instanceof EventEmitter &&
+    typeof s.write === 'function' &&
+    typeof s.end === 'function';
+const EOF = Symbol('EOF');
+const MAYBE_EMIT_END = Symbol('maybeEmitEnd');
+const EMITTED_END = Symbol('emittedEnd');
+const EMITTING_END = Symbol('emittingEnd');
+const EMITTED_ERROR = Symbol('emittedError');
+const CLOSED = Symbol('closed');
+const READ = Symbol('read');
+const FLUSH = Symbol('flush');
+const FLUSHCHUNK = Symbol('flushChunk');
+const ENCODING = Symbol('encoding');
+const DECODER = Symbol('decoder');
+const FLOWING = Symbol('flowing');
+const PAUSED = Symbol('paused');
+const RESUME = Symbol('resume');
+const BUFFER = Symbol('buffer');
+const PIPES = Symbol('pipes');
+const BUFFERLENGTH = Symbol('bufferLength');
+const BUFFERPUSH = Symbol('bufferPush');
+const BUFFERSHIFT = Symbol('bufferShift');
+const OBJECTMODE = Symbol('objectMode');
+// internal event when stream is destroyed
+const DESTROYED = Symbol('destroyed');
+// internal event when stream has an error
+const ERROR = Symbol('error');
+const EMITDATA = Symbol('emitData');
+const EMITEND = Symbol('emitEnd');
+const EMITEND2 = Symbol('emitEnd2');
+const ASYNC = Symbol('async');
+const ABORT = Symbol('abort');
+const ABORTED = Symbol('aborted');
+const SIGNAL = Symbol('signal');
+const DATALISTENERS = Symbol('dataListeners');
+const DISCARDED = Symbol('discarded');
+const defer = (fn) => Promise.resolve().then(fn);
+const nodefer = (fn) => fn();
+const isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish';
+const isArrayBufferLike = (b) => b instanceof ArrayBuffer ||
+    (!!b &&
+        typeof b === 'object' &&
+        b.constructor &&
+        b.constructor.name === 'ArrayBuffer' &&
+        b.byteLength >= 0);
+const isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
+/**
+ * Internal class representing a pipe to a destination stream.
+ *
+ * @internal
+ */
+class Pipe {
+    src;
+    dest;
+    opts;
+    ondrain;
+    constructor(src, dest, opts) {
+        this.src = src;
+        this.dest = dest;
+        this.opts = opts;
+        this.ondrain = () => src[RESUME]();
+        this.dest.on('drain', this.ondrain);
+    }
+    unpipe() {
+        this.dest.removeListener('drain', this.ondrain);
+    }
+    // only here for the prototype
+    /* c8 ignore start */
+    proxyErrors(_er) { }
+    /* c8 ignore stop */
+    end() {
+        this.unpipe();
+        if (this.opts.end)
+            this.dest.end();
+    }
+}
+/**
+ * Internal class representing a pipe to a destination stream where
+ * errors are proxied.
+ *
+ * @internal
+ */
+class PipeProxyErrors extends Pipe {
+    unpipe() {
+        this.src.removeListener('error', this.proxyErrors);
+        super.unpipe();
+    }
+    constructor(src, dest, opts) {
+        super(src, dest, opts);
+        this.proxyErrors = (er) => this.dest.emit('error', er);
+        src.on('error', this.proxyErrors);
+    }
+}
+const isObjectModeOptions = (o) => !!o.objectMode;
+const isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== 'buffer';
+/**
+ * Main export, the Minipass class
+ *
+ * `RType` is the type of data emitted, defaults to Buffer
+ *
+ * `WType` is the type of data to be written, if RType is buffer or string,
+ * then any {@link Minipass.ContiguousData} is allowed.
+ *
+ * `Events` is the set of event handler signatures that this object
+ * will emit, see {@link Minipass.Events}
+ */
+export class Minipass extends EventEmitter {
+    [FLOWING] = false;
+    [PAUSED] = false;
+    [PIPES] = [];
+    [BUFFER] = [];
+    [OBJECTMODE];
+    [ENCODING];
+    [ASYNC];
+    [DECODER];
+    [EOF] = false;
+    [EMITTED_END] = false;
+    [EMITTING_END] = false;
+    [CLOSED] = false;
+    [EMITTED_ERROR] = null;
+    [BUFFERLENGTH] = 0;
+    [DESTROYED] = false;
+    [SIGNAL];
+    [ABORTED] = false;
+    [DATALISTENERS] = 0;
+    [DISCARDED] = false;
+    /**
+     * true if the stream can be written
+     */
+    writable = true;
+    /**
+     * true if the stream can be read
+     */
+    readable = true;
+    /**
+     * If `RType` is Buffer, then options do not need to be provided.
+     * Otherwise, an options object must be provided to specify either
+     * {@link Minipass.SharedOptions.objectMode} or
+     * {@link Minipass.SharedOptions.encoding}, as appropriate.
+     */
+    constructor(...args) {
+        const options = (args[0] ||
+            {});
+        super();
+        if (options.objectMode && typeof options.encoding === 'string') {
+            throw new TypeError('Encoding and objectMode may not be used together');
+        }
+        if (isObjectModeOptions(options)) {
+            this[OBJECTMODE] = true;
+            this[ENCODING] = null;
+        }
+        else if (isEncodingOptions(options)) {
+            this[ENCODING] = options.encoding;
+            this[OBJECTMODE] = false;
+        }
+        else {
+            this[OBJECTMODE] = false;
+            this[ENCODING] = null;
+        }
+        this[ASYNC] = !!options.async;
+        this[DECODER] = this[ENCODING]
+            ? new StringDecoder(this[ENCODING])
+            : null;
+        //@ts-ignore - private option for debugging and testing
+        if (options && options.debugExposeBuffer === true) {
+            Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] });
+        }
+        //@ts-ignore - private option for debugging and testing
+        if (options && options.debugExposePipes === true) {
+            Object.defineProperty(this, 'pipes', { get: () => this[PIPES] });
+        }
+        const { signal } = options;
+        if (signal) {
+            this[SIGNAL] = signal;
+            if (signal.aborted) {
+                this[ABORT]();
+            }
+            else {
+                signal.addEventListener('abort', () => this[ABORT]());
+            }
+        }
+    }
+    /**
+     * The amount of data stored in the buffer waiting to be read.
+     *
+     * For Buffer strings, this will be the total byte length.
+     * For string encoding streams, this will be the string character length,
+     * according to JavaScript's `string.length` logic.
+     * For objectMode streams, this is a count of the items waiting to be
+     * emitted.
+     */
+    get bufferLength() {
+        return this[BUFFERLENGTH];
+    }
+    /**
+     * The `BufferEncoding` currently in use, or `null`
+     */
+    get encoding() {
+        return this[ENCODING];
+    }
+    /**
+     * @deprecated - This is a read only property
+     */
+    set encoding(_enc) {
+        throw new Error('Encoding must be set at instantiation time');
+    }
+    /**
+     * @deprecated - Encoding may only be set at instantiation time
+     */
+    setEncoding(_enc) {
+        throw new Error('Encoding must be set at instantiation time');
+    }
+    /**
+     * True if this is an objectMode stream
+     */
+    get objectMode() {
+        return this[OBJECTMODE];
+    }
+    /**
+     * @deprecated - This is a read-only property
+     */
+    set objectMode(_om) {
+        throw new Error('objectMode must be set at instantiation time');
+    }
+    /**
+     * true if this is an async stream
+     */
+    get ['async']() {
+        return this[ASYNC];
+    }
+    /**
+     * Set to true to make this stream async.
+     *
+     * Once set, it cannot be unset, as this would potentially cause incorrect
+     * behavior.  Ie, a sync stream can be made async, but an async stream
+     * cannot be safely made sync.
+     */
+    set ['async'](a) {
+        this[ASYNC] = this[ASYNC] || !!a;
+    }
+    // drop everything and get out of the flow completely
+    [ABORT]() {
+        this[ABORTED] = true;
+        this.emit('abort', this[SIGNAL]?.reason);
+        this.destroy(this[SIGNAL]?.reason);
+    }
+    /**
+     * True if the stream has been aborted.
+     */
+    get aborted() {
+        return this[ABORTED];
+    }
+    /**
+     * No-op setter. Stream aborted status is set via the AbortSignal provided
+     * in the constructor options.
+     */
+    set aborted(_) { }
+    write(chunk, encoding, cb) {
+        if (this[ABORTED])
+            return false;
+        if (this[EOF])
+            throw new Error('write after end');
+        if (this[DESTROYED]) {
+            this.emit('error', Object.assign(new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' }));
+            return true;
+        }
+        if (typeof encoding === 'function') {
+            cb = encoding;
+            encoding = 'utf8';
+        }
+        if (!encoding)
+            encoding = 'utf8';
+        const fn = this[ASYNC] ? defer : nodefer;
+        // convert array buffers and typed array views into buffers
+        // at some point in the future, we may want to do the opposite!
+        // leave strings and buffers as-is
+        // anything is only allowed if in object mode, so throw
+        if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
+            if (isArrayBufferView(chunk)) {
+                //@ts-ignore - sinful unsafe type changing
+                chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
+            }
+            else if (isArrayBufferLike(chunk)) {
+                //@ts-ignore - sinful unsafe type changing
+                chunk = Buffer.from(chunk);
+            }
+            else if (typeof chunk !== 'string') {
+                throw new Error('Non-contiguous data written to non-objectMode stream');
+            }
+        }
+        // handle object mode up front, since it's simpler
+        // this yields better performance, fewer checks later.
+        if (this[OBJECTMODE]) {
+            // maybe impossible?
+            /* c8 ignore start */
+            if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
+                this[FLUSH](true);
+            /* c8 ignore stop */
+            if (this[FLOWING])
+                this.emit('data', chunk);
+            else
+                this[BUFFERPUSH](chunk);
+            if (this[BUFFERLENGTH] !== 0)
+                this.emit('readable');
+            if (cb)
+                fn(cb);
+            return this[FLOWING];
+        }
+        // at this point the chunk is a buffer or string
+        // don't buffer it up or send it to the decoder
+        if (!chunk.length) {
+            if (this[BUFFERLENGTH] !== 0)
+                this.emit('readable');
+            if (cb)
+                fn(cb);
+            return this[FLOWING];
+        }
+        // fast-path writing strings of same encoding to a stream with
+        // an empty buffer, skipping the buffer/decoder dance
+        if (typeof chunk === 'string' &&
+            // unless it is a string already ready for us to use
+            !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) {
+            //@ts-ignore - sinful unsafe type change
+            chunk = Buffer.from(chunk, encoding);
+        }
+        if (Buffer.isBuffer(chunk) && this[ENCODING]) {
+            //@ts-ignore - sinful unsafe type change
+            chunk = this[DECODER].write(chunk);
+        }
+        // Note: flushing CAN potentially switch us into not-flowing mode
+        if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
+            this[FLUSH](true);
+        if (this[FLOWING])
+            this.emit('data', chunk);
+        else
+            this[BUFFERPUSH](chunk);
+        if (this[BUFFERLENGTH] !== 0)
+            this.emit('readable');
+        if (cb)
+            fn(cb);
+        return this[FLOWING];
+    }
+    /**
+     * Low-level explicit read method.
+     *
+     * In objectMode, the argument is ignored, and one item is returned if
+     * available.
+     *
+     * `n` is the number of bytes (or in the case of encoding streams,
+     * characters) to consume. If `n` is not provided, then the entire buffer
+     * is returned, or `null` is returned if no data is available.
+     *
+     * If `n` is greater that the amount of data in the internal buffer,
+     * then `null` is returned.
+     */
+    read(n) {
+        if (this[DESTROYED])
+            return null;
+        this[DISCARDED] = false;
+        if (this[BUFFERLENGTH] === 0 ||
+            n === 0 ||
+            (n && n > this[BUFFERLENGTH])) {
+            this[MAYBE_EMIT_END]();
+            return null;
+        }
+        if (this[OBJECTMODE])
+            n = null;
+        if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
+            // not object mode, so if we have an encoding, then RType is string
+            // otherwise, must be Buffer
+            this[BUFFER] = [
+                (this[ENCODING]
+                    ? this[BUFFER].join('')
+                    : Buffer.concat(this[BUFFER], this[BUFFERLENGTH])),
+            ];
+        }
+        const ret = this[READ](n || null, this[BUFFER][0]);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [READ](n, chunk) {
+        if (this[OBJECTMODE])
+            this[BUFFERSHIFT]();
+        else {
+            const c = chunk;
+            if (n === c.length || n === null)
+                this[BUFFERSHIFT]();
+            else if (typeof c === 'string') {
+                this[BUFFER][0] = c.slice(n);
+                chunk = c.slice(0, n);
+                this[BUFFERLENGTH] -= n;
+            }
+            else {
+                this[BUFFER][0] = c.subarray(n);
+                chunk = c.subarray(0, n);
+                this[BUFFERLENGTH] -= n;
+            }
+        }
+        this.emit('data', chunk);
+        if (!this[BUFFER].length && !this[EOF])
+            this.emit('drain');
+        return chunk;
+    }
+    end(chunk, encoding, cb) {
+        if (typeof chunk === 'function') {
+            cb = chunk;
+            chunk = undefined;
+        }
+        if (typeof encoding === 'function') {
+            cb = encoding;
+            encoding = 'utf8';
+        }
+        if (chunk !== undefined)
+            this.write(chunk, encoding);
+        if (cb)
+            this.once('end', cb);
+        this[EOF] = true;
+        this.writable = false;
+        // if we haven't written anything, then go ahead and emit,
+        // even if we're not reading.
+        // we'll re-emit if a new 'end' listener is added anyway.
+        // This makes MP more suitable to write-only use cases.
+        if (this[FLOWING] || !this[PAUSED])
+            this[MAYBE_EMIT_END]();
+        return this;
+    }
+    // don't let the internal resume be overwritten
+    [RESUME]() {
+        if (this[DESTROYED])
+            return;
+        if (!this[DATALISTENERS] && !this[PIPES].length) {
+            this[DISCARDED] = true;
+        }
+        this[PAUSED] = false;
+        this[FLOWING] = true;
+        this.emit('resume');
+        if (this[BUFFER].length)
+            this[FLUSH]();
+        else if (this[EOF])
+            this[MAYBE_EMIT_END]();
+        else
+            this.emit('drain');
+    }
+    /**
+     * Resume the stream if it is currently in a paused state
+     *
+     * If called when there are no pipe destinations or `data` event listeners,
+     * this will place the stream in a "discarded" state, where all data will
+     * be thrown away. The discarded state is removed if a pipe destination or
+     * data handler is added, if pause() is called, or if any synchronous or
+     * asynchronous iteration is started.
+     */
+    resume() {
+        return this[RESUME]();
+    }
+    /**
+     * Pause the stream
+     */
+    pause() {
+        this[FLOWING] = false;
+        this[PAUSED] = true;
+        this[DISCARDED] = false;
+    }
+    /**
+     * true if the stream has been forcibly destroyed
+     */
+    get destroyed() {
+        return this[DESTROYED];
+    }
+    /**
+     * true if the stream is currently in a flowing state, meaning that
+     * any writes will be immediately emitted.
+     */
+    get flowing() {
+        return this[FLOWING];
+    }
+    /**
+     * true if the stream is currently in a paused state
+     */
+    get paused() {
+        return this[PAUSED];
+    }
+    [BUFFERPUSH](chunk) {
+        if (this[OBJECTMODE])
+            this[BUFFERLENGTH] += 1;
+        else
+            this[BUFFERLENGTH] += chunk.length;
+        this[BUFFER].push(chunk);
+    }
+    [BUFFERSHIFT]() {
+        if (this[OBJECTMODE])
+            this[BUFFERLENGTH] -= 1;
+        else
+            this[BUFFERLENGTH] -= this[BUFFER][0].length;
+        return this[BUFFER].shift();
+    }
+    [FLUSH](noDrain = false) {
+        do { } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&
+            this[BUFFER].length);
+        if (!noDrain && !this[BUFFER].length && !this[EOF])
+            this.emit('drain');
+    }
+    [FLUSHCHUNK](chunk) {
+        this.emit('data', chunk);
+        return this[FLOWING];
+    }
+    /**
+     * Pipe all data emitted by this stream into the destination provided.
+     *
+     * Triggers the flow of data.
+     */
+    pipe(dest, opts) {
+        if (this[DESTROYED])
+            return dest;
+        this[DISCARDED] = false;
+        const ended = this[EMITTED_END];
+        opts = opts || {};
+        if (dest === proc.stdout || dest === proc.stderr)
+            opts.end = false;
+        else
+            opts.end = opts.end !== false;
+        opts.proxyErrors = !!opts.proxyErrors;
+        // piping an ended stream ends immediately
+        if (ended) {
+            if (opts.end)
+                dest.end();
+        }
+        else {
+            // "as" here just ignores the WType, which pipes don't care about,
+            // since they're only consuming from us, and writing to the dest
+            this[PIPES].push(!opts.proxyErrors
+                ? new Pipe(this, dest, opts)
+                : new PipeProxyErrors(this, dest, opts));
+            if (this[ASYNC])
+                defer(() => this[RESUME]());
+            else
+                this[RESUME]();
+        }
+        return dest;
+    }
+    /**
+     * Fully unhook a piped destination stream.
+     *
+     * If the destination stream was the only consumer of this stream (ie,
+     * there are no other piped destinations or `'data'` event listeners)
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    unpipe(dest) {
+        const p = this[PIPES].find(p => p.dest === dest);
+        if (p) {
+            if (this[PIPES].length === 1) {
+                if (this[FLOWING] && this[DATALISTENERS] === 0) {
+                    this[FLOWING] = false;
+                }
+                this[PIPES] = [];
+            }
+            else
+                this[PIPES].splice(this[PIPES].indexOf(p), 1);
+            p.unpipe();
+        }
+    }
+    /**
+     * Alias for {@link Minipass#on}
+     */
+    addListener(ev, handler) {
+        return this.on(ev, handler);
+    }
+    /**
+     * Mostly identical to `EventEmitter.on`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * - Adding a 'data' event handler will trigger the flow of data
+     *
+     * - Adding a 'readable' event handler when there is data waiting to be read
+     *   will cause 'readable' to be emitted immediately.
+     *
+     * - Adding an 'endish' event handler ('end', 'finish', etc.) which has
+     *   already passed will cause the event to be emitted immediately and all
+     *   handlers removed.
+     *
+     * - Adding an 'error' event handler after an error has been emitted will
+     *   cause the event to be re-emitted immediately with the error previously
+     *   raised.
+     */
+    on(ev, handler) {
+        const ret = super.on(ev, handler);
+        if (ev === 'data') {
+            this[DISCARDED] = false;
+            this[DATALISTENERS]++;
+            if (!this[PIPES].length && !this[FLOWING]) {
+                this[RESUME]();
+            }
+        }
+        else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {
+            super.emit('readable');
+        }
+        else if (isEndish(ev) && this[EMITTED_END]) {
+            super.emit(ev);
+            this.removeAllListeners(ev);
+        }
+        else if (ev === 'error' && this[EMITTED_ERROR]) {
+            const h = handler;
+            if (this[ASYNC])
+                defer(() => h.call(this, this[EMITTED_ERROR]));
+            else
+                h.call(this, this[EMITTED_ERROR]);
+        }
+        return ret;
+    }
+    /**
+     * Alias for {@link Minipass#off}
+     */
+    removeListener(ev, handler) {
+        return this.off(ev, handler);
+    }
+    /**
+     * Mostly identical to `EventEmitter.off`
+     *
+     * If a 'data' event handler is removed, and it was the last consumer
+     * (ie, there are no pipe destinations or other 'data' event listeners),
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    off(ev, handler) {
+        const ret = super.off(ev, handler);
+        // if we previously had listeners, and now we don't, and we don't
+        // have any pipes, then stop the flow, unless it's been explicitly
+        // put in a discarded flowing state via stream.resume().
+        if (ev === 'data') {
+            this[DATALISTENERS] = this.listeners('data').length;
+            if (this[DATALISTENERS] === 0 &&
+                !this[DISCARDED] &&
+                !this[PIPES].length) {
+                this[FLOWING] = false;
+            }
+        }
+        return ret;
+    }
+    /**
+     * Mostly identical to `EventEmitter.removeAllListeners`
+     *
+     * If all 'data' event handlers are removed, and they were the last consumer
+     * (ie, there are no pipe destinations), then the flow of data will stop
+     * until there is another consumer or {@link Minipass#resume} is explicitly
+     * called.
+     */
+    removeAllListeners(ev) {
+        const ret = super.removeAllListeners(ev);
+        if (ev === 'data' || ev === undefined) {
+            this[DATALISTENERS] = 0;
+            if (!this[DISCARDED] && !this[PIPES].length) {
+                this[FLOWING] = false;
+            }
+        }
+        return ret;
+    }
+    /**
+     * true if the 'end' event has been emitted
+     */
+    get emittedEnd() {
+        return this[EMITTED_END];
+    }
+    [MAYBE_EMIT_END]() {
+        if (!this[EMITTING_END] &&
+            !this[EMITTED_END] &&
+            !this[DESTROYED] &&
+            this[BUFFER].length === 0 &&
+            this[EOF]) {
+            this[EMITTING_END] = true;
+            this.emit('end');
+            this.emit('prefinish');
+            this.emit('finish');
+            if (this[CLOSED])
+                this.emit('close');
+            this[EMITTING_END] = false;
+        }
+    }
+    /**
+     * Mostly identical to `EventEmitter.emit`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * If the stream has been destroyed, and the event is something other
+     * than 'close' or 'error', then `false` is returned and no handlers
+     * are called.
+     *
+     * If the event is 'end', and has already been emitted, then the event
+     * is ignored. If the stream is in a paused or non-flowing state, then
+     * the event will be deferred until data flow resumes. If the stream is
+     * async, then handlers will be called on the next tick rather than
+     * immediately.
+     *
+     * If the event is 'close', and 'end' has not yet been emitted, then
+     * the event will be deferred until after 'end' is emitted.
+     *
+     * If the event is 'error', and an AbortSignal was provided for the stream,
+     * and there are no listeners, then the event is ignored, matching the
+     * behavior of node core streams in the presense of an AbortSignal.
+     *
+     * If the event is 'finish' or 'prefinish', then all listeners will be
+     * removed after emitting the event, to prevent double-firing.
+     */
+    emit(ev, ...args) {
+        const data = args[0];
+        // error and close are only events allowed after calling destroy()
+        if (ev !== 'error' &&
+            ev !== 'close' &&
+            ev !== DESTROYED &&
+            this[DESTROYED]) {
+            return false;
+        }
+        else if (ev === 'data') {
+            return !this[OBJECTMODE] && !data
+                ? false
+                : this[ASYNC]
+                    ? (defer(() => this[EMITDATA](data)), true)
+                    : this[EMITDATA](data);
+        }
+        else if (ev === 'end') {
+            return this[EMITEND]();
+        }
+        else if (ev === 'close') {
+            this[CLOSED] = true;
+            // don't emit close before 'end' and 'finish'
+            if (!this[EMITTED_END] && !this[DESTROYED])
+                return false;
+            const ret = super.emit('close');
+            this.removeAllListeners('close');
+            return ret;
+        }
+        else if (ev === 'error') {
+            this[EMITTED_ERROR] = data;
+            super.emit(ERROR, data);
+            const ret = !this[SIGNAL] || this.listeners('error').length
+                ? super.emit('error', data)
+                : false;
+            this[MAYBE_EMIT_END]();
+            return ret;
+        }
+        else if (ev === 'resume') {
+            const ret = super.emit('resume');
+            this[MAYBE_EMIT_END]();
+            return ret;
+        }
+        else if (ev === 'finish' || ev === 'prefinish') {
+            const ret = super.emit(ev);
+            this.removeAllListeners(ev);
+            return ret;
+        }
+        // Some other unknown event
+        const ret = super.emit(ev, ...args);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [EMITDATA](data) {
+        for (const p of this[PIPES]) {
+            if (p.dest.write(data) === false)
+                this.pause();
+        }
+        const ret = this[DISCARDED] ? false : super.emit('data', data);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [EMITEND]() {
+        if (this[EMITTED_END])
+            return false;
+        this[EMITTED_END] = true;
+        this.readable = false;
+        return this[ASYNC]
+            ? (defer(() => this[EMITEND2]()), true)
+            : this[EMITEND2]();
+    }
+    [EMITEND2]() {
+        if (this[DECODER]) {
+            const data = this[DECODER].end();
+            if (data) {
+                for (const p of this[PIPES]) {
+                    p.dest.write(data);
+                }
+                if (!this[DISCARDED])
+                    super.emit('data', data);
+            }
+        }
+        for (const p of this[PIPES]) {
+            p.end();
+        }
+        const ret = super.emit('end');
+        this.removeAllListeners('end');
+        return ret;
+    }
+    /**
+     * Return a Promise that resolves to an array of all emitted data once
+     * the stream ends.
+     */
+    async collect() {
+        const buf = Object.assign([], {
+            dataLength: 0,
+        });
+        if (!this[OBJECTMODE])
+            buf.dataLength = 0;
+        // set the promise first, in case an error is raised
+        // by triggering the flow here.
+        const p = this.promise();
+        this.on('data', c => {
+            buf.push(c);
+            if (!this[OBJECTMODE])
+                buf.dataLength += c.length;
+        });
+        await p;
+        return buf;
+    }
+    /**
+     * Return a Promise that resolves to the concatenation of all emitted data
+     * once the stream ends.
+     *
+     * Not allowed on objectMode streams.
+     */
+    async concat() {
+        if (this[OBJECTMODE]) {
+            throw new Error('cannot concat in objectMode');
+        }
+        const buf = await this.collect();
+        return (this[ENCODING]
+            ? buf.join('')
+            : Buffer.concat(buf, buf.dataLength));
+    }
+    /**
+     * Return a void Promise that resolves once the stream ends.
+     */
+    async promise() {
+        return new Promise((resolve, reject) => {
+            this.on(DESTROYED, () => reject(new Error('stream destroyed')));
+            this.on('error', er => reject(er));
+            this.on('end', () => resolve());
+        });
+    }
+    /**
+     * Asynchronous `for await of` iteration.
+     *
+     * This will continue emitting all chunks until the stream terminates.
+     */
+    [Symbol.asyncIterator]() {
+        // set this up front, in case the consumer doesn't call next()
+        // right away.
+        this[DISCARDED] = false;
+        let stopped = false;
+        const stop = async () => {
+            this.pause();
+            stopped = true;
+            return { value: undefined, done: true };
+        };
+        const next = () => {
+            if (stopped)
+                return stop();
+            const res = this.read();
+            if (res !== null)
+                return Promise.resolve({ done: false, value: res });
+            if (this[EOF])
+                return stop();
+            let resolve;
+            let reject;
+            const onerr = (er) => {
+                this.off('data', ondata);
+                this.off('end', onend);
+                this.off(DESTROYED, ondestroy);
+                stop();
+                reject(er);
+            };
+            const ondata = (value) => {
+                this.off('error', onerr);
+                this.off('end', onend);
+                this.off(DESTROYED, ondestroy);
+                this.pause();
+                resolve({ value, done: !!this[EOF] });
+            };
+            const onend = () => {
+                this.off('error', onerr);
+                this.off('data', ondata);
+                this.off(DESTROYED, ondestroy);
+                stop();
+                resolve({ done: true, value: undefined });
+            };
+            const ondestroy = () => onerr(new Error('stream destroyed'));
+            return new Promise((res, rej) => {
+                reject = rej;
+                resolve = res;
+                this.once(DESTROYED, ondestroy);
+                this.once('error', onerr);
+                this.once('end', onend);
+                this.once('data', ondata);
+            });
+        };
+        return {
+            next,
+            throw: stop,
+            return: stop,
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+            [Symbol.asyncDispose]: async () => { },
+        };
+    }
+    /**
+     * Synchronous `for of` iteration.
+     *
+     * The iteration will terminate when the internal buffer runs out, even
+     * if the stream has not yet terminated.
+     */
+    [Symbol.iterator]() {
+        // set this up front, in case the consumer doesn't call next()
+        // right away.
+        this[DISCARDED] = false;
+        let stopped = false;
+        const stop = () => {
+            this.pause();
+            this.off(ERROR, stop);
+            this.off(DESTROYED, stop);
+            this.off('end', stop);
+            stopped = true;
+            return { done: true, value: undefined };
+        };
+        const next = () => {
+            if (stopped)
+                return stop();
+            const value = this.read();
+            return value === null ? stop() : { done: false, value };
+        };
+        this.once('end', stop);
+        this.once(ERROR, stop);
+        this.once(DESTROYED, stop);
+        return {
+            next,
+            throw: stop,
+            return: stop,
+            [Symbol.iterator]() {
+                return this;
+            },
+            [Symbol.dispose]: () => { },
+        };
+    }
+    /**
+     * Destroy a stream, preventing it from being used for any further purpose.
+     *
+     * If the stream has a `close()` method, then it will be called on
+     * destruction.
+     *
+     * After destruction, any attempt to write data, read data, or emit most
+     * events will be ignored.
+     *
+     * If an error argument is provided, then it will be emitted in an
+     * 'error' event.
+     */
+    destroy(er) {
+        if (this[DESTROYED]) {
+            if (er)
+                this.emit('error', er);
+            else
+                this.emit(DESTROYED);
+            return this;
+        }
+        this[DESTROYED] = true;
+        this[DISCARDED] = true;
+        // throw away all buffered data, it's never coming out
+        this[BUFFER].length = 0;
+        this[BUFFERLENGTH] = 0;
+        const wc = this;
+        if (typeof wc.close === 'function' && !this[CLOSED])
+            wc.close();
+        if (er)
+            this.emit('error', er);
+        // if no error to emit, still reject pending promises
+        else
+            this.emit(DESTROYED);
+        return this;
+    }
+    /**
+     * Alias for {@link isStream}
+     *
+     * Former export location, maintained for backwards compatibility.
+     *
+     * @deprecated
+     */
+    static get isStream() {
+        return isStream;
+    }
+}
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/minipass/dist/esm/index.js.map b/node_modules/minipass/dist/esm/index.js.map
new file mode 100644
index 00000000..4d87920c
--- /dev/null
+++ b/node_modules/minipass/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO;IACpC,CAAC,CAAC,OAAO;IACT,CAAC,CAAC;QACE,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;KACb,CAAA;AACP,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AASnD;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAM,EACsC,EAAE,CAC9C,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,CAAC,YAAY,QAAQ;QACpB,CAAC,YAAY,MAAM;QACnB,UAAU,CAAC,CAAC,CAAC;QACb,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;AAElB;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAM,EAA0B,EAAE,CAC3D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,CAAC,YAAY,YAAY;IACzB,OAAQ,CAAuB,CAAC,IAAI,KAAK,UAAU;IACnD,iEAAiE;IAChE,CAAuB,CAAC,IAAI,KAAK,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAA;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAM,EAA0B,EAAE,CAC3D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,KAAK,QAAQ;IACrB,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,EAAE,CAAC,CAAA;;gBACzB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACzB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAA;QACtB,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAA;QAEtB,sDAAsD;QACtD,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;QACvB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;QAEtB,MAAM,EAAE,GAAG,IAEV,CAAA;QACD,IAAI,OAAO,EAAE,CAAC,KAAK,KAAK,UAAU,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;YAAE,EAAE,CAAC,KAAK,EAAE,CAAA;QAE/D,IAAI,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAC9B,qDAAqD;;YAChD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAEzB,OAAO,IAAI,CAAA;IAAA,CACZ;IAED;;;;;;OAMG;IACH,MAAM,KAAK,QAAQ,GAAG;QACpB,OAAO,QAAQ,CAAA;IAAA,CAChB;CACF","sourcesContent":["const proc =\n  typeof process === 'object' && process\n    ? process\n    : {\n        stdout: null,\n        stderr: null,\n      }\nimport { EventEmitter } from 'node:events'\nimport Stream from 'node:stream'\nimport { StringDecoder } from 'node:string_decoder'\n\n/**\n * Same as StringDecoder, but exposing the `lastNeed` flag on the type\n */\ntype SD = StringDecoder & { lastNeed: boolean }\n\nexport type { SD, Pipe, PipeProxyErrors }\n\n/**\n * Return true if the argument is a Minipass stream, Node stream, or something\n * else that Minipass can interact with.\n */\nexport const isStream = (\n  s: any\n): s is Minipass.Readable | Minipass.Writable =>\n  !!s &&\n  typeof s === 'object' &&\n  (s instanceof Minipass ||\n    s instanceof Stream ||\n    isReadable(s) ||\n    isWritable(s))\n\n/**\n * Return true if the argument is a valid {@link Minipass.Readable}\n */\nexport const isReadable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Readable).pipe === 'function' &&\n  // node core Writable streams have a pipe() method, but it throws\n  (s as Minipass.Readable).pipe !== Stream.Writable.prototype.pipe\n\n/**\n * Return true if the argument is a valid {@link Minipass.Writable}\n */\nexport const isWritable = (s: any): s is Minipass.Readable =>\n  !!s &&\n  typeof s === 'object' &&\n  s instanceof EventEmitter &&\n  typeof (s as Minipass.Writable).write === 'function' &&\n  typeof (s as Minipass.Writable).end === 'function'\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFER = Symbol('buffer')\nconst PIPES = Symbol('pipes')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed')\n// internal event when stream has an error\nconst ERROR = Symbol('error')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\nconst ABORT = Symbol('abort')\nconst ABORTED = Symbol('aborted')\nconst SIGNAL = Symbol('signal')\nconst DATALISTENERS = Symbol('dataListeners')\nconst DISCARDED = Symbol('discarded')\n\nconst defer = (fn: (...a: any[]) => any) => Promise.resolve().then(fn)\nconst nodefer = (fn: (...a: any[]) => any) => fn()\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\ntype EndishEvent = 'end' | 'finish' | 'prefinish'\nconst isEndish = (ev: any): ev is EndishEvent =>\n  ev === 'end' || ev === 'finish' || ev === 'prefinish'\n\nconst isArrayBufferLike = (b: any): b is ArrayBufferLike =>\n  b instanceof ArrayBuffer ||\n  (!!b &&\n    typeof b === 'object' &&\n    b.constructor &&\n    b.constructor.name === 'ArrayBuffer' &&\n    b.byteLength >= 0)\n\nconst isArrayBufferView = (b: any): b is ArrayBufferView =>\n  !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\n/**\n * Options that may be passed to stream.pipe()\n */\nexport interface PipeOptions {\n  /**\n   * end the destination stream when the source stream ends\n   */\n  end?: boolean\n  /**\n   * proxy errors from the source stream to the destination stream\n   */\n  proxyErrors?: boolean\n}\n\n/**\n * Internal class representing a pipe to a destination stream.\n *\n * @internal\n */\nclass Pipe {\n  src: Minipass\n  dest: Minipass\n  opts: PipeOptions\n  ondrain: () => any\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    this.src = src\n    this.dest = dest as Minipass\n    this.opts = opts\n    this.ondrain = () => src[RESUME]()\n    this.dest.on('drain', this.ondrain)\n  }\n  unpipe() {\n    this.dest.removeListener('drain', this.ondrain)\n  }\n  // only here for the prototype\n  /* c8 ignore start */\n  proxyErrors(_er: any) {}\n  /* c8 ignore stop */\n  end() {\n    this.unpipe()\n    if (this.opts.end) this.dest.end()\n  }\n}\n\n/**\n * Internal class representing a pipe to a destination stream where\n * errors are proxied.\n *\n * @internal\n */\nclass PipeProxyErrors extends Pipe {\n  unpipe() {\n    this.src.removeListener('error', this.proxyErrors)\n    super.unpipe()\n  }\n  constructor(\n    src: Minipass,\n    dest: Minipass.Writable,\n    opts: PipeOptions\n  ) {\n    super(src, dest, opts)\n    this.proxyErrors = (er: Error) => this.dest.emit('error', er)\n    src.on('error', this.proxyErrors)\n  }\n}\n\nexport namespace Minipass {\n  /**\n   * Encoding used to create a stream that outputs strings rather than\n   * Buffer objects.\n   */\n  export type Encoding = BufferEncoding | 'buffer' | null\n\n  /**\n   * Any stream that Minipass can pipe into\n   */\n  export type Writable =\n    | Minipass\n    | NodeJS.WriteStream\n    | (NodeJS.WriteStream & { fd: number })\n    | (EventEmitter & {\n        end(): any\n        write(chunk: any, ...args: any[]): any\n      })\n\n  /**\n   * Any stream that can be read from\n   */\n  export type Readable =\n    | Minipass\n    | NodeJS.ReadStream\n    | (NodeJS.ReadStream & { fd: number })\n    | (EventEmitter & {\n        pause(): any\n        resume(): any\n        pipe(...destArgs: any[]): any\n      })\n\n  /**\n   * Utility type that can be iterated sync or async\n   */\n  export type DualIterable = Iterable & AsyncIterable\n\n  type EventArguments = Record\n\n  /**\n   * The listing of events that a Minipass class can emit.\n   * Extend this when extending the Minipass class, and pass as\n   * the third template argument.  The key is the name of the event,\n   * and the value is the argument list.\n   *\n   * Any undeclared events will still be allowed, but the handler will get\n   * arguments as `unknown[]`.\n   */\n  export interface Events\n    extends EventArguments {\n    readable: []\n    data: [chunk: RType]\n    error: [er: unknown]\n    abort: [reason: unknown]\n    drain: []\n    resume: []\n    end: []\n    finish: []\n    prefinish: []\n    close: []\n    [DESTROYED]: [er?: unknown]\n    [ERROR]: [er: unknown]\n  }\n\n  /**\n   * String or buffer-like data that can be joined and sliced\n   */\n  export type ContiguousData =\n    | Buffer\n    | ArrayBufferLike\n    | ArrayBufferView\n    | string\n  export type BufferOrString = Buffer | string\n\n  /**\n   * Options passed to the Minipass constructor.\n   */\n  export type SharedOptions = {\n    /**\n     * Defer all data emission and other events until the end of the\n     * current tick, similar to Node core streams\n     */\n    async?: boolean\n    /**\n     * A signal which will abort the stream\n     */\n    signal?: AbortSignal\n    /**\n     * Output string encoding. Set to `null` or `'buffer'` (or omit) to\n     * emit Buffer objects rather than strings.\n     *\n     * Conflicts with `objectMode`\n     */\n    encoding?: BufferEncoding | null | 'buffer'\n    /**\n     * Output data exactly as it was written, supporting non-buffer/string\n     * data (such as arbitrary objects, falsey values, etc.)\n     *\n     * Conflicts with `encoding`\n     */\n    objectMode?: boolean\n  }\n\n  /**\n   * Options for a string encoded output\n   */\n  export type EncodingOptions = SharedOptions & {\n    encoding: BufferEncoding\n    objectMode?: false\n  }\n\n  /**\n   * Options for contiguous data buffer output\n   */\n  export type BufferOptions = SharedOptions & {\n    encoding?: null | 'buffer'\n    objectMode?: false\n  }\n\n  /**\n   * Options for objectMode arbitrary output\n   */\n  export type ObjectModeOptions = SharedOptions & {\n    objectMode: true\n    encoding?: null\n  }\n\n  /**\n   * Utility type to determine allowed options based on read type\n   */\n  export type Options =\n    | ObjectModeOptions\n    | (T extends string\n        ? EncodingOptions\n        : T extends Buffer\n        ? BufferOptions\n        : SharedOptions)\n}\n\nconst isObjectModeOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.ObjectModeOptions => !!o.objectMode\n\nconst isEncodingOptions = (\n  o: Minipass.SharedOptions\n): o is Minipass.EncodingOptions =>\n  !o.objectMode && !!o.encoding && o.encoding !== 'buffer'\n\n/**\n * Main export, the Minipass class\n *\n * `RType` is the type of data emitted, defaults to Buffer\n *\n * `WType` is the type of data to be written, if RType is buffer or string,\n * then any {@link Minipass.ContiguousData} is allowed.\n *\n * `Events` is the set of event handler signatures that this object\n * will emit, see {@link Minipass.Events}\n */\nexport class Minipass<\n    RType extends unknown = Buffer,\n    WType extends unknown = RType extends Minipass.BufferOrString\n      ? Minipass.ContiguousData\n      : RType,\n    Events extends Minipass.Events = Minipass.Events\n  >\n  extends EventEmitter\n  implements Minipass.DualIterable\n{\n  [FLOWING]: boolean = false;\n  [PAUSED]: boolean = false;\n  [PIPES]: Pipe[] = [];\n  [BUFFER]: RType[] = [];\n  [OBJECTMODE]: boolean;\n  [ENCODING]: BufferEncoding | null;\n  [ASYNC]: boolean;\n  [DECODER]: SD | null;\n  [EOF]: boolean = false;\n  [EMITTED_END]: boolean = false;\n  [EMITTING_END]: boolean = false;\n  [CLOSED]: boolean = false;\n  [EMITTED_ERROR]: unknown = null;\n  [BUFFERLENGTH]: number = 0;\n  [DESTROYED]: boolean = false;\n  [SIGNAL]?: AbortSignal;\n  [ABORTED]: boolean = false;\n  [DATALISTENERS]: number = 0;\n  [DISCARDED]: boolean = false\n\n  /**\n   * true if the stream can be written\n   */\n  writable: boolean = true\n  /**\n   * true if the stream can be read\n   */\n  readable: boolean = true\n\n  /**\n   * If `RType` is Buffer, then options do not need to be provided.\n   * Otherwise, an options object must be provided to specify either\n   * {@link Minipass.SharedOptions.objectMode} or\n   * {@link Minipass.SharedOptions.encoding}, as appropriate.\n   */\n  constructor(\n    ...args:\n      | [Minipass.ObjectModeOptions]\n      | (RType extends Buffer\n          ? [] | [Minipass.Options]\n          : [Minipass.Options])\n  ) {\n    const options: Minipass.Options = (args[0] ||\n      {}) as Minipass.Options\n    super()\n    if (options.objectMode && typeof options.encoding === 'string') {\n      throw new TypeError(\n        'Encoding and objectMode may not be used together'\n      )\n    }\n    if (isObjectModeOptions(options)) {\n      this[OBJECTMODE] = true\n      this[ENCODING] = null\n    } else if (isEncodingOptions(options)) {\n      this[ENCODING] = options.encoding\n      this[OBJECTMODE] = false\n    } else {\n      this[OBJECTMODE] = false\n      this[ENCODING] = null\n    }\n    this[ASYNC] = !!options.async\n    this[DECODER] = this[ENCODING]\n      ? (new StringDecoder(this[ENCODING]) as SD)\n      : null\n\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposeBuffer === true) {\n      Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })\n    }\n    //@ts-ignore - private option for debugging and testing\n    if (options && options.debugExposePipes === true) {\n      Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })\n    }\n\n    const { signal } = options\n    if (signal) {\n      this[SIGNAL] = signal\n      if (signal.aborted) {\n        this[ABORT]()\n      } else {\n        signal.addEventListener('abort', () => this[ABORT]())\n      }\n    }\n  }\n\n  /**\n   * The amount of data stored in the buffer waiting to be read.\n   *\n   * For Buffer strings, this will be the total byte length.\n   * For string encoding streams, this will be the string character length,\n   * according to JavaScript's `string.length` logic.\n   * For objectMode streams, this is a count of the items waiting to be\n   * emitted.\n   */\n  get bufferLength() {\n    return this[BUFFERLENGTH]\n  }\n\n  /**\n   * The `BufferEncoding` currently in use, or `null`\n   */\n  get encoding() {\n    return this[ENCODING]\n  }\n\n  /**\n   * @deprecated - This is a read only property\n   */\n  set encoding(_enc) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * @deprecated - Encoding may only be set at instantiation time\n   */\n  setEncoding(_enc: Minipass.Encoding) {\n    throw new Error('Encoding must be set at instantiation time')\n  }\n\n  /**\n   * True if this is an objectMode stream\n   */\n  get objectMode() {\n    return this[OBJECTMODE]\n  }\n\n  /**\n   * @deprecated - This is a read-only property\n   */\n  set objectMode(_om) {\n    throw new Error('objectMode must be set at instantiation time')\n  }\n\n  /**\n   * true if this is an async stream\n   */\n  get ['async'](): boolean {\n    return this[ASYNC]\n  }\n  /**\n   * Set to true to make this stream async.\n   *\n   * Once set, it cannot be unset, as this would potentially cause incorrect\n   * behavior.  Ie, a sync stream can be made async, but an async stream\n   * cannot be safely made sync.\n   */\n  set ['async'](a: boolean) {\n    this[ASYNC] = this[ASYNC] || !!a\n  }\n\n  // drop everything and get out of the flow completely\n  [ABORT]() {\n    this[ABORTED] = true\n    this.emit('abort', this[SIGNAL]?.reason)\n    this.destroy(this[SIGNAL]?.reason)\n  }\n\n  /**\n   * True if the stream has been aborted.\n   */\n  get aborted() {\n    return this[ABORTED]\n  }\n  /**\n   * No-op setter. Stream aborted status is set via the AbortSignal provided\n   * in the constructor options.\n   */\n  set aborted(_) {}\n\n  /**\n   * Write data into the stream\n   *\n   * If the chunk written is a string, and encoding is not specified, then\n   * `utf8` will be assumed. If the stream encoding matches the encoding of\n   * a written string, and the state of the string decoder allows it, then\n   * the string will be passed through to either the output or the internal\n   * buffer without any processing. Otherwise, it will be turned into a\n   * Buffer object for processing into the desired encoding.\n   *\n   * If provided, `cb` function is called immediately before return for\n   * sync streams, or on next tick for async streams, because for this\n   * base class, a chunk is considered \"processed\" once it is accepted\n   * and either emitted or buffered. That is, the callback does not indicate\n   * that the chunk has been eventually emitted, though of course child\n   * classes can override this function to do whatever processing is required\n   * and call `super.write(...)` only once processing is completed.\n   */\n  write(chunk: WType, cb?: () => void): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding,\n    cb?: () => void\n  ): boolean\n  write(\n    chunk: WType,\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): boolean {\n    if (this[ABORTED]) return false\n    if (this[EOF]) throw new Error('write after end')\n\n    if (this[DESTROYED]) {\n      this.emit(\n        'error',\n        Object.assign(\n          new Error('Cannot call write after a stream was destroyed'),\n          { code: 'ERR_STREAM_DESTROYED' }\n        )\n      )\n      return true\n    }\n\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n\n    if (!encoding) encoding = 'utf8'\n\n    const fn = this[ASYNC] ? defer : nodefer\n\n    // convert array buffers and typed array views into buffers\n    // at some point in the future, we may want to do the opposite!\n    // leave strings and buffers as-is\n    // anything is only allowed if in object mode, so throw\n    if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n      if (isArrayBufferView(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(\n          chunk.buffer,\n          chunk.byteOffset,\n          chunk.byteLength\n        )\n      } else if (isArrayBufferLike(chunk)) {\n        //@ts-ignore - sinful unsafe type changing\n        chunk = Buffer.from(chunk)\n      } else if (typeof chunk !== 'string') {\n        throw new Error(\n          'Non-contiguous data written to non-objectMode stream'\n        )\n      }\n    }\n\n    // handle object mode up front, since it's simpler\n    // this yields better performance, fewer checks later.\n    if (this[OBJECTMODE]) {\n      // maybe impossible?\n      /* c8 ignore start */\n      if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n      /* c8 ignore stop */\n\n      if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n      else this[BUFFERPUSH](chunk as unknown as RType)\n\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n      if (cb) fn(cb)\n\n      return this[FLOWING]\n    }\n\n    // at this point the chunk is a buffer or string\n    // don't buffer it up or send it to the decoder\n    if (!(chunk as Minipass.BufferOrString).length) {\n      if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n      if (cb) fn(cb)\n      return this[FLOWING]\n    }\n\n    // fast-path writing strings of same encoding to a stream with\n    // an empty buffer, skipping the buffer/decoder dance\n    if (\n      typeof chunk === 'string' &&\n      // unless it is a string already ready for us to use\n      !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)\n    ) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = Buffer.from(chunk, encoding)\n    }\n\n    if (Buffer.isBuffer(chunk) && this[ENCODING]) {\n      //@ts-ignore - sinful unsafe type change\n      chunk = this[DECODER].write(chunk)\n    }\n\n    // Note: flushing CAN potentially switch us into not-flowing mode\n    if (this[FLOWING] && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n    if (this[FLOWING]) this.emit('data', chunk as unknown as RType)\n    else this[BUFFERPUSH](chunk as unknown as RType)\n\n    if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n    if (cb) fn(cb)\n\n    return this[FLOWING]\n  }\n\n  /**\n   * Low-level explicit read method.\n   *\n   * In objectMode, the argument is ignored, and one item is returned if\n   * available.\n   *\n   * `n` is the number of bytes (or in the case of encoding streams,\n   * characters) to consume. If `n` is not provided, then the entire buffer\n   * is returned, or `null` is returned if no data is available.\n   *\n   * If `n` is greater that the amount of data in the internal buffer,\n   * then `null` is returned.\n   */\n  read(n?: number | null): RType | null {\n    if (this[DESTROYED]) return null\n    this[DISCARDED] = false\n\n    if (\n      this[BUFFERLENGTH] === 0 ||\n      n === 0 ||\n      (n && n > this[BUFFERLENGTH])\n    ) {\n      this[MAYBE_EMIT_END]()\n      return null\n    }\n\n    if (this[OBJECTMODE]) n = null\n\n    if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n      // not object mode, so if we have an encoding, then RType is string\n      // otherwise, must be Buffer\n      this[BUFFER] = [\n        (this[ENCODING]\n          ? this[BUFFER].join('')\n          : Buffer.concat(\n              this[BUFFER] as Buffer[],\n              this[BUFFERLENGTH]\n            )) as RType,\n      ]\n    }\n\n    const ret = this[READ](n || null, this[BUFFER][0] as RType)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [READ](n: number | null, chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERSHIFT]()\n    else {\n      const c = chunk as Minipass.BufferOrString\n      if (n === c.length || n === null) this[BUFFERSHIFT]()\n      else if (typeof c === 'string') {\n        this[BUFFER][0] = c.slice(n) as RType\n        chunk = c.slice(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      } else {\n        this[BUFFER][0] = c.subarray(n) as RType\n        chunk = c.subarray(0, n) as RType\n        this[BUFFERLENGTH] -= n\n      }\n    }\n\n    this.emit('data', chunk)\n\n    if (!this[BUFFER].length && !this[EOF]) this.emit('drain')\n\n    return chunk\n  }\n\n  /**\n   * End the stream, optionally providing a final write.\n   *\n   * See {@link Minipass#write} for argument descriptions\n   */\n  end(cb?: () => void): this\n  end(chunk: WType, cb?: () => void): this\n  end(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): this\n  end(\n    chunk?: WType | (() => void),\n    encoding?: Minipass.Encoding | (() => void),\n    cb?: () => void\n  ): this {\n    if (typeof chunk === 'function') {\n      cb = chunk as () => void\n      chunk = undefined\n    }\n    if (typeof encoding === 'function') {\n      cb = encoding\n      encoding = 'utf8'\n    }\n    if (chunk !== undefined) this.write(chunk, encoding)\n    if (cb) this.once('end', cb)\n    this[EOF] = true\n    this.writable = false\n\n    // if we haven't written anything, then go ahead and emit,\n    // even if we're not reading.\n    // we'll re-emit if a new 'end' listener is added anyway.\n    // This makes MP more suitable to write-only use cases.\n    if (this[FLOWING] || !this[PAUSED]) this[MAYBE_EMIT_END]()\n    return this\n  }\n\n  // don't let the internal resume be overwritten\n  [RESUME]() {\n    if (this[DESTROYED]) return\n\n    if (!this[DATALISTENERS] && !this[PIPES].length) {\n      this[DISCARDED] = true\n    }\n    this[PAUSED] = false\n    this[FLOWING] = true\n    this.emit('resume')\n    if (this[BUFFER].length) this[FLUSH]()\n    else if (this[EOF]) this[MAYBE_EMIT_END]()\n    else this.emit('drain')\n  }\n\n  /**\n   * Resume the stream if it is currently in a paused state\n   *\n   * If called when there are no pipe destinations or `data` event listeners,\n   * this will place the stream in a \"discarded\" state, where all data will\n   * be thrown away. The discarded state is removed if a pipe destination or\n   * data handler is added, if pause() is called, or if any synchronous or\n   * asynchronous iteration is started.\n   */\n  resume() {\n    return this[RESUME]()\n  }\n\n  /**\n   * Pause the stream\n   */\n  pause() {\n    this[FLOWING] = false\n    this[PAUSED] = true\n    this[DISCARDED] = false\n  }\n\n  /**\n   * true if the stream has been forcibly destroyed\n   */\n  get destroyed() {\n    return this[DESTROYED]\n  }\n\n  /**\n   * true if the stream is currently in a flowing state, meaning that\n   * any writes will be immediately emitted.\n   */\n  get flowing() {\n    return this[FLOWING]\n  }\n\n  /**\n   * true if the stream is currently in a paused state\n   */\n  get paused() {\n    return this[PAUSED]\n  }\n\n  [BUFFERPUSH](chunk: RType) {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1\n    else this[BUFFERLENGTH] += (chunk as Minipass.BufferOrString).length\n    this[BUFFER].push(chunk)\n  }\n\n  [BUFFERSHIFT](): RType {\n    if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1\n    else\n      this[BUFFERLENGTH] -= (\n        this[BUFFER][0] as Minipass.BufferOrString\n      ).length\n    return this[BUFFER].shift() as RType\n  }\n\n  [FLUSH](noDrain: boolean = false) {\n    do {} while (\n      this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&\n      this[BUFFER].length\n    )\n\n    if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')\n  }\n\n  [FLUSHCHUNK](chunk: RType) {\n    this.emit('data', chunk)\n    return this[FLOWING]\n  }\n\n  /**\n   * Pipe all data emitted by this stream into the destination provided.\n   *\n   * Triggers the flow of data.\n   */\n  pipe(dest: W, opts?: PipeOptions): W {\n    if (this[DESTROYED]) return dest\n    this[DISCARDED] = false\n\n    const ended = this[EMITTED_END]\n    opts = opts || {}\n    if (dest === proc.stdout || dest === proc.stderr) opts.end = false\n    else opts.end = opts.end !== false\n    opts.proxyErrors = !!opts.proxyErrors\n\n    // piping an ended stream ends immediately\n    if (ended) {\n      if (opts.end) dest.end()\n    } else {\n      // \"as\" here just ignores the WType, which pipes don't care about,\n      // since they're only consuming from us, and writing to the dest\n      this[PIPES].push(\n        !opts.proxyErrors\n          ? new Pipe(this as Minipass, dest, opts)\n          : new PipeProxyErrors(this as Minipass, dest, opts)\n      )\n      if (this[ASYNC]) defer(() => this[RESUME]())\n      else this[RESUME]()\n    }\n\n    return dest\n  }\n\n  /**\n   * Fully unhook a piped destination stream.\n   *\n   * If the destination stream was the only consumer of this stream (ie,\n   * there are no other piped destinations or `'data'` event listeners)\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  unpipe(dest: W) {\n    const p = this[PIPES].find(p => p.dest === dest)\n    if (p) {\n      if (this[PIPES].length === 1) {\n        if (this[FLOWING] && this[DATALISTENERS] === 0) {\n          this[FLOWING] = false\n        }\n        this[PIPES] = []\n      } else this[PIPES].splice(this[PIPES].indexOf(p), 1)\n      p.unpipe()\n    }\n  }\n\n  /**\n   * Alias for {@link Minipass#on}\n   */\n  addListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    return this.on(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.on`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * - Adding a 'data' event handler will trigger the flow of data\n   *\n   * - Adding a 'readable' event handler when there is data waiting to be read\n   *   will cause 'readable' to be emitted immediately.\n   *\n   * - Adding an 'endish' event handler ('end', 'finish', etc.) which has\n   *   already passed will cause the event to be emitted immediately and all\n   *   handlers removed.\n   *\n   * - Adding an 'error' event handler after an error has been emitted will\n   *   cause the event to be re-emitted immediately with the error previously\n   *   raised.\n   */\n  on(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ): this {\n    const ret = super.on(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    if (ev === 'data') {\n      this[DISCARDED] = false\n      this[DATALISTENERS]++\n      if (!this[PIPES].length && !this[FLOWING]) {\n        this[RESUME]()\n      }\n    } else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {\n      super.emit('readable')\n    } else if (isEndish(ev) && this[EMITTED_END]) {\n      super.emit(ev)\n      this.removeAllListeners(ev)\n    } else if (ev === 'error' && this[EMITTED_ERROR]) {\n      const h = handler as (...a: Events['error']) => any\n      if (this[ASYNC]) defer(() => h.call(this, this[EMITTED_ERROR]))\n      else h.call(this, this[EMITTED_ERROR])\n    }\n    return ret\n  }\n\n  /**\n   * Alias for {@link Minipass#off}\n   */\n  removeListener(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    return this.off(ev, handler)\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.off`\n   *\n   * If a 'data' event handler is removed, and it was the last consumer\n   * (ie, there are no pipe destinations or other 'data' event listeners),\n   * then the flow of data will stop until there is another consumer or\n   * {@link Minipass#resume} is explicitly called.\n   */\n  off(\n    ev: Event,\n    handler: (...args: Events[Event]) => any\n  ) {\n    const ret = super.off(\n      ev as string | symbol,\n      handler as (...a: any[]) => any\n    )\n    // if we previously had listeners, and now we don't, and we don't\n    // have any pipes, then stop the flow, unless it's been explicitly\n    // put in a discarded flowing state via stream.resume().\n    if (ev === 'data') {\n      this[DATALISTENERS] = this.listeners('data').length\n      if (\n        this[DATALISTENERS] === 0 &&\n        !this[DISCARDED] &&\n        !this[PIPES].length\n      ) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.removeAllListeners`\n   *\n   * If all 'data' event handlers are removed, and they were the last consumer\n   * (ie, there are no pipe destinations), then the flow of data will stop\n   * until there is another consumer or {@link Minipass#resume} is explicitly\n   * called.\n   */\n  removeAllListeners(ev?: Event) {\n    const ret = super.removeAllListeners(ev as string | symbol | undefined)\n    if (ev === 'data' || ev === undefined) {\n      this[DATALISTENERS] = 0\n      if (!this[DISCARDED] && !this[PIPES].length) {\n        this[FLOWING] = false\n      }\n    }\n    return ret\n  }\n\n  /**\n   * true if the 'end' event has been emitted\n   */\n  get emittedEnd() {\n    return this[EMITTED_END]\n  }\n\n  [MAYBE_EMIT_END]() {\n    if (\n      !this[EMITTING_END] &&\n      !this[EMITTED_END] &&\n      !this[DESTROYED] &&\n      this[BUFFER].length === 0 &&\n      this[EOF]\n    ) {\n      this[EMITTING_END] = true\n      this.emit('end')\n      this.emit('prefinish')\n      this.emit('finish')\n      if (this[CLOSED]) this.emit('close')\n      this[EMITTING_END] = false\n    }\n  }\n\n  /**\n   * Mostly identical to `EventEmitter.emit`, with the following\n   * behavior differences to prevent data loss and unnecessary hangs:\n   *\n   * If the stream has been destroyed, and the event is something other\n   * than 'close' or 'error', then `false` is returned and no handlers\n   * are called.\n   *\n   * If the event is 'end', and has already been emitted, then the event\n   * is ignored. If the stream is in a paused or non-flowing state, then\n   * the event will be deferred until data flow resumes. If the stream is\n   * async, then handlers will be called on the next tick rather than\n   * immediately.\n   *\n   * If the event is 'close', and 'end' has not yet been emitted, then\n   * the event will be deferred until after 'end' is emitted.\n   *\n   * If the event is 'error', and an AbortSignal was provided for the stream,\n   * and there are no listeners, then the event is ignored, matching the\n   * behavior of node core streams in the presense of an AbortSignal.\n   *\n   * If the event is 'finish' or 'prefinish', then all listeners will be\n   * removed after emitting the event, to prevent double-firing.\n   */\n  emit(\n    ev: Event,\n    ...args: Events[Event]\n  ): boolean {\n    const data = args[0]\n    // error and close are only events allowed after calling destroy()\n    if (\n      ev !== 'error' &&\n      ev !== 'close' &&\n      ev !== DESTROYED &&\n      this[DESTROYED]\n    ) {\n      return false\n    } else if (ev === 'data') {\n      return !this[OBJECTMODE] && !data\n        ? false\n        : this[ASYNC]\n        ? (defer(() => this[EMITDATA](data as RType)), true)\n        : this[EMITDATA](data as RType)\n    } else if (ev === 'end') {\n      return this[EMITEND]()\n    } else if (ev === 'close') {\n      this[CLOSED] = true\n      // don't emit close before 'end' and 'finish'\n      if (!this[EMITTED_END] && !this[DESTROYED]) return false\n      const ret = super.emit('close')\n      this.removeAllListeners('close')\n      return ret\n    } else if (ev === 'error') {\n      this[EMITTED_ERROR] = data\n      super.emit(ERROR, data)\n      const ret =\n        !this[SIGNAL] || this.listeners('error').length\n          ? super.emit('error', data)\n          : false\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'resume') {\n      const ret = super.emit('resume')\n      this[MAYBE_EMIT_END]()\n      return ret\n    } else if (ev === 'finish' || ev === 'prefinish') {\n      const ret = super.emit(ev)\n      this.removeAllListeners(ev)\n      return ret\n    }\n\n    // Some other unknown event\n    const ret = super.emit(ev as string, ...args)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITDATA](data: RType) {\n    for (const p of this[PIPES]) {\n      if (p.dest.write(data as RType) === false) this.pause()\n    }\n    const ret = this[DISCARDED] ? false : super.emit('data', data)\n    this[MAYBE_EMIT_END]()\n    return ret\n  }\n\n  [EMITEND]() {\n    if (this[EMITTED_END]) return false\n\n    this[EMITTED_END] = true\n    this.readable = false\n    return this[ASYNC]\n      ? (defer(() => this[EMITEND2]()), true)\n      : this[EMITEND2]()\n  }\n\n  [EMITEND2]() {\n    if (this[DECODER]) {\n      const data = this[DECODER].end()\n      if (data) {\n        for (const p of this[PIPES]) {\n          p.dest.write(data as RType)\n        }\n        if (!this[DISCARDED]) super.emit('data', data)\n      }\n    }\n\n    for (const p of this[PIPES]) {\n      p.end()\n    }\n    const ret = super.emit('end')\n    this.removeAllListeners('end')\n    return ret\n  }\n\n  /**\n   * Return a Promise that resolves to an array of all emitted data once\n   * the stream ends.\n   */\n  async collect(): Promise {\n    const buf: RType[] & { dataLength: number } = Object.assign([], {\n      dataLength: 0,\n    })\n    if (!this[OBJECTMODE]) buf.dataLength = 0\n    // set the promise first, in case an error is raised\n    // by triggering the flow here.\n    const p = this.promise()\n    this.on('data', c => {\n      buf.push(c)\n      if (!this[OBJECTMODE])\n        buf.dataLength += (c as Minipass.BufferOrString).length\n    })\n    await p\n    return buf\n  }\n\n  /**\n   * Return a Promise that resolves to the concatenation of all emitted data\n   * once the stream ends.\n   *\n   * Not allowed on objectMode streams.\n   */\n  async concat(): Promise {\n    if (this[OBJECTMODE]) {\n      throw new Error('cannot concat in objectMode')\n    }\n    const buf = await this.collect()\n    return (\n      this[ENCODING]\n        ? buf.join('')\n        : Buffer.concat(buf as Buffer[], buf.dataLength)\n    ) as RType\n  }\n\n  /**\n   * Return a void Promise that resolves once the stream ends.\n   */\n  async promise(): Promise {\n    return new Promise((resolve, reject) => {\n      this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n      this.on('error', er => reject(er))\n      this.on('end', () => resolve())\n    })\n  }\n\n  /**\n   * Asynchronous `for await of` iteration.\n   *\n   * This will continue emitting all chunks until the stream terminates.\n   */\n  [Symbol.asyncIterator](): AsyncGenerator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = async (): Promise> => {\n      this.pause()\n      stopped = true\n      return { value: undefined, done: true }\n    }\n    const next = (): Promise> => {\n      if (stopped) return stop()\n      const res = this.read()\n      if (res !== null) return Promise.resolve({ done: false, value: res })\n\n      if (this[EOF]) return stop()\n\n      let resolve!: (res: IteratorResult) => void\n      let reject!: (er: unknown) => void\n      const onerr = (er: unknown) => {\n        this.off('data', ondata)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        reject(er)\n      }\n      const ondata = (value: RType) => {\n        this.off('error', onerr)\n        this.off('end', onend)\n        this.off(DESTROYED, ondestroy)\n        this.pause()\n        resolve({ value, done: !!this[EOF] })\n      }\n      const onend = () => {\n        this.off('error', onerr)\n        this.off('data', ondata)\n        this.off(DESTROYED, ondestroy)\n        stop()\n        resolve({ done: true, value: undefined })\n      }\n      const ondestroy = () => onerr(new Error('stream destroyed'))\n      return new Promise>((res, rej) => {\n        reject = rej\n        resolve = res\n        this.once(DESTROYED, ondestroy)\n        this.once('error', onerr)\n        this.once('end', onend)\n        this.once('data', ondata)\n      })\n    }\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.asyncIterator]() {\n        return this\n      },\n      [Symbol.asyncDispose]: async () => {},\n    }\n  }\n\n  /**\n   * Synchronous `for of` iteration.\n   *\n   * The iteration will terminate when the internal buffer runs out, even\n   * if the stream has not yet terminated.\n   */\n  [Symbol.iterator](): Generator {\n    // set this up front, in case the consumer doesn't call next()\n    // right away.\n    this[DISCARDED] = false\n    let stopped = false\n    const stop = (): IteratorReturnResult => {\n      this.pause()\n      this.off(ERROR, stop)\n      this.off(DESTROYED, stop)\n      this.off('end', stop)\n      stopped = true\n      return { done: true, value: undefined }\n    }\n\n    const next = (): IteratorResult => {\n      if (stopped) return stop()\n      const value = this.read()\n      return value === null ? stop() : { done: false, value }\n    }\n\n    this.once('end', stop)\n    this.once(ERROR, stop)\n    this.once(DESTROYED, stop)\n\n    return {\n      next,\n      throw: stop,\n      return: stop,\n      [Symbol.iterator]() {\n        return this\n      },\n      [Symbol.dispose]: () => {},\n    }\n  }\n\n  /**\n   * Destroy a stream, preventing it from being used for any further purpose.\n   *\n   * If the stream has a `close()` method, then it will be called on\n   * destruction.\n   *\n   * After destruction, any attempt to write data, read data, or emit most\n   * events will be ignored.\n   *\n   * If an error argument is provided, then it will be emitted in an\n   * 'error' event.\n   */\n  destroy(er?: unknown) {\n    if (this[DESTROYED]) {\n      if (er) this.emit('error', er)\n      else this.emit(DESTROYED)\n      return this\n    }\n\n    this[DESTROYED] = true\n    this[DISCARDED] = true\n\n    // throw away all buffered data, it's never coming out\n    this[BUFFER].length = 0\n    this[BUFFERLENGTH] = 0\n\n    const wc = this as Minipass & {\n      close?: () => void\n    }\n    if (typeof wc.close === 'function' && !this[CLOSED]) wc.close()\n\n    if (er) this.emit('error', er)\n    // if no error to emit, still reject pending promises\n    else this.emit(DESTROYED)\n\n    return this\n  }\n\n  /**\n   * Alias for {@link isStream}\n   *\n   * Former export location, maintained for backwards compatibility.\n   *\n   * @deprecated\n   */\n  static get isStream() {\n    return isStream\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/minipass/dist/esm/package.json b/node_modules/minipass/dist/esm/package.json
new file mode 100644
index 00000000..3dbc1ca5
--- /dev/null
+++ b/node_modules/minipass/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/node_modules/minipass/package.json b/node_modules/minipass/package.json
new file mode 100644
index 00000000..800f215c
--- /dev/null
+++ b/node_modules/minipass/package.json
@@ -0,0 +1,77 @@
+{
+  "name": "minipass",
+  "version": "7.1.3",
+  "description": "minimal implementation of a PassThrough stream",
+  "main": "./dist/commonjs/index.js",
+  "types": "./dist/commonjs/index.d.ts",
+  "module": "./dist/esm/index.js",
+  "type": "module",
+  "tshy": {
+    "selfLink": false,
+    "compiler": "tsgo",
+    "exports": {
+      "./package.json": "./package.json",
+      ".": "./src/index.ts"
+    }
+  },
+  "exports": {
+    "./package.json": "./package.json",
+    ".": {
+      "import": {
+        "types": "./dist/esm/index.d.ts",
+        "default": "./dist/esm/index.js"
+      },
+      "require": {
+        "types": "./dist/commonjs/index.d.ts",
+        "default": "./dist/commonjs/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "prepare": "tshy",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "tap",
+    "snap": "tap",
+    "format": "prettier --write . --loglevel warn",
+    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
+  },
+  "prettier": {
+    "semi": false,
+    "printWidth": 75,
+    "tabWidth": 2,
+    "useTabs": false,
+    "singleQuote": true,
+    "jsxSingleQuote": false,
+    "bracketSameLine": true,
+    "arrowParens": "avoid",
+    "endOfLine": "lf"
+  },
+  "devDependencies": {
+    "@types/end-of-stream": "^1.4.2",
+    "@types/node": "^25.2.3",
+    "end-of-stream": "^1.4.0",
+    "node-abort-controller": "^3.1.1",
+    "prettier": "^3.8.1",
+    "tap": "^21.6.1",
+    "through2": "^2.0.3",
+    "tshy": "^3.3.2",
+    "typedoc": "^0.28.17"
+  },
+  "repository": "https://github.com/isaacs/minipass",
+  "keywords": [
+    "passthrough",
+    "stream"
+  ],
+  "author": "Isaac Z. Schlueter  (http://blog.izs.me/)",
+  "license": "BlueOak-1.0.0",
+  "engines": {
+    "node": ">=16 || 14 >=14.17"
+  }
+}
diff --git a/node_modules/mkdirp/LICENSE b/node_modules/mkdirp/LICENSE
new file mode 100644
index 00000000..0a034db7
--- /dev/null
+++ b/node_modules/mkdirp/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2011-2023 James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me)
+
+This project is free software released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/mkdirp/dist/cjs/package.json b/node_modules/mkdirp/dist/cjs/package.json
new file mode 100644
index 00000000..9d04a66e
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/package.json
@@ -0,0 +1,91 @@
+{
+    "name": "mkdirp",
+    "description": "Recursively mkdir, like `mkdir -p`",
+    "version": "3.0.1",
+    "keywords": [
+        "mkdir",
+        "directory",
+        "make dir",
+        "make",
+        "dir",
+        "recursive",
+        "native"
+    ],
+    "bin": "./dist/cjs/src/bin.js",
+    "main": "./dist/cjs/src/index.js",
+    "module": "./dist/mjs/index.js",
+    "types": "./dist/mjs/index.d.ts",
+    "exports": {
+        ".": {
+            "import": {
+                "types": "./dist/mjs/index.d.ts",
+                "default": "./dist/mjs/index.js"
+            },
+            "require": {
+                "types": "./dist/cjs/src/index.d.ts",
+                "default": "./dist/cjs/src/index.js"
+            }
+        }
+    },
+    "files": [
+        "dist"
+    ],
+    "scripts": {
+        "preversion": "npm test",
+        "postversion": "npm publish",
+        "prepublishOnly": "git push origin --follow-tags",
+        "preprepare": "rm -rf dist",
+        "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
+        "postprepare": "bash fixup.sh",
+        "pretest": "npm run prepare",
+        "presnap": "npm run prepare",
+        "test": "c8 tap",
+        "snap": "c8 tap",
+        "format": "prettier --write . --loglevel warn",
+        "benchmark": "node benchmark/index.js",
+        "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts"
+    },
+    "prettier": {
+        "semi": false,
+        "printWidth": 80,
+        "tabWidth": 2,
+        "useTabs": false,
+        "singleQuote": true,
+        "jsxSingleQuote": false,
+        "bracketSameLine": true,
+        "arrowParens": "avoid",
+        "endOfLine": "lf"
+    },
+    "devDependencies": {
+        "@types/brace-expansion": "^1.1.0",
+        "@types/node": "^18.11.9",
+        "@types/tap": "^15.0.7",
+        "c8": "^7.12.0",
+        "eslint-config-prettier": "^8.6.0",
+        "prettier": "^2.8.2",
+        "tap": "^16.3.3",
+        "ts-node": "^10.9.1",
+        "typedoc": "^0.23.21",
+        "typescript": "^4.9.3"
+    },
+    "tap": {
+        "coverage": false,
+        "node-arg": [
+            "--no-warnings",
+            "--loader",
+            "ts-node/esm"
+        ],
+        "ts": false
+    },
+    "funding": {
+        "url": "https://github.com/sponsors/isaacs"
+    },
+    "repository": {
+        "type": "git",
+        "url": "https://github.com/isaacs/node-mkdirp.git"
+    },
+    "license": "MIT",
+    "engines": {
+        "node": ">=10"
+    }
+}
diff --git a/node_modules/mkdirp/dist/cjs/src/bin.d.ts b/node_modules/mkdirp/dist/cjs/src/bin.d.ts
new file mode 100644
index 00000000..34e00522
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/bin.d.ts
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+export {};
+//# sourceMappingURL=bin.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/bin.d.ts.map b/node_modules/mkdirp/dist/cjs/src/bin.d.ts.map
new file mode 100644
index 00000000..c10c656e
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/bin.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../../src/bin.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/bin.js b/node_modules/mkdirp/dist/cjs/src/bin.js
new file mode 100644
index 00000000..757aae1f
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/bin.js
@@ -0,0 +1,80 @@
+#!/usr/bin/env node
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const package_json_1 = require("../package.json");
+const usage = () => `
+usage: mkdirp [DIR1,DIR2..] {OPTIONS}
+
+  Create each supplied directory including any necessary parent directories
+  that don't yet exist.
+
+  If the directory already exists, do nothing.
+
+OPTIONS are:
+
+  -m       If a directory needs to be created, set the mode as an octal
+  --mode=  permission string.
+
+  -v --version   Print the mkdirp version number
+
+  -h --help      Print this helpful banner
+
+  -p --print     Print the first directories created for each path provided
+
+  --manual       Use manual implementation, even if native is available
+`;
+const dirs = [];
+const opts = {};
+let doPrint = false;
+let dashdash = false;
+let manual = false;
+for (const arg of process.argv.slice(2)) {
+    if (dashdash)
+        dirs.push(arg);
+    else if (arg === '--')
+        dashdash = true;
+    else if (arg === '--manual')
+        manual = true;
+    else if (/^-h/.test(arg) || /^--help/.test(arg)) {
+        console.log(usage());
+        process.exit(0);
+    }
+    else if (arg === '-v' || arg === '--version') {
+        console.log(package_json_1.version);
+        process.exit(0);
+    }
+    else if (arg === '-p' || arg === '--print') {
+        doPrint = true;
+    }
+    else if (/^-m/.test(arg) || /^--mode=/.test(arg)) {
+        // these don't get covered in CI, but work locally
+        // weird because the tests below show as passing in the output.
+        /* c8 ignore start */
+        const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8);
+        if (isNaN(mode)) {
+            console.error(`invalid mode argument: ${arg}\nMust be an octal number.`);
+            process.exit(1);
+        }
+        /* c8 ignore stop */
+        opts.mode = mode;
+    }
+    else
+        dirs.push(arg);
+}
+const index_js_1 = require("./index.js");
+const impl = manual ? index_js_1.mkdirp.manual : index_js_1.mkdirp;
+if (dirs.length === 0) {
+    console.error(usage());
+}
+// these don't get covered in CI, but work locally
+/* c8 ignore start */
+Promise.all(dirs.map(dir => impl(dir, opts)))
+    .then(made => (doPrint ? made.forEach(m => m && console.log(m)) : null))
+    .catch(er => {
+    console.error(er.message);
+    if (er.code)
+        console.error('  code: ' + er.code);
+    process.exit(1);
+});
+/* c8 ignore stop */
+//# sourceMappingURL=bin.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/bin.js.map b/node_modules/mkdirp/dist/cjs/src/bin.js.map
new file mode 100644
index 00000000..d9929530
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/bin.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../../src/bin.ts"],"names":[],"mappings":";;;AAEA,kDAAyC;AAGzC,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;CAoBnB,CAAA;AAED,MAAM,IAAI,GAAa,EAAE,CAAA;AACzB,MAAM,IAAI,GAAkB,EAAE,CAAA;AAC9B,IAAI,OAAO,GAAY,KAAK,CAAA;AAC5B,IAAI,QAAQ,GAAG,KAAK,CAAA;AACpB,IAAI,MAAM,GAAG,KAAK,CAAA;AAClB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACvC,IAAI,QAAQ;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACvB,IAAI,GAAG,KAAK,IAAI;QAAE,QAAQ,GAAG,IAAI,CAAA;SACjC,IAAI,GAAG,KAAK,UAAU;QAAE,MAAM,GAAG,IAAI,CAAA;SACrC,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC/C,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;SAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,WAAW,EAAE;QAC9C,OAAO,CAAC,GAAG,CAAC,sBAAO,CAAC,CAAA;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KAChB;SAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE;QAC5C,OAAO,GAAG,IAAI,CAAA;KACf;SAAM,IAAI,KAAK,CAAC,IAAI,CA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CAAC,UAAU,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;IAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA;AACJ,oBAAoB","sourcesContent":["#!/usr/bin/env node\n\nimport { version } from '../package.json'\nimport { MkdirpOptions } from './opts-arg.js'\n\nconst usage = () => `\nusage: mkdirp [DIR1,DIR2..] {OPTIONS}\n\n  Create each supplied directory including any necessary parent directories\n  that don't yet exist.\n\n  If the directory already exists, do nothing.\n\nOPTIONS are:\n\n  -m       If a directory needs to be created, set the mode as an octal\n  --mode=  permission string.\n\n  -v --version   Print the mkdirp version number\n\n  -h --help      Print this helpful banner\n\n  -p --print     Print the first directories created for each path provided\n\n  --manual       Use manual implementation, even if native is available\n`\n\nconst dirs: string[] = []\nconst opts: MkdirpOptions = {}\nlet doPrint: boolean = false\nlet dashdash = false\nlet manual = false\nfor (const arg of process.argv.slice(2)) {\n  if (dashdash) dirs.push(arg)\n  else if (arg === '--') dashdash = true\n  else if (arg === '--manual') manual = true\n  else if (/^-h/.test(arg) || /^--help/.test(arg)) {\n    console.log(usage())\n    process.exit(0)\n  } else if (arg === '-v' || arg === '--version') {\n    console.log(version)\n    process.exit(0)\n  } else if (arg === '-p' || arg === '--print') {\n    doPrint = true\n  } else if (/^-m/.test(arg) || /^--mode=/.test(arg)) {\n    // these don't get covered in CI, but work locally\n    // weird because the tests below show as passing in the output.\n    /* c8 ignore start */\n    const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8)\n    if (isNaN(mode)) {\n      console.error(`invalid mode argument: ${arg}\\nMust be an octal number.`)\n      process.exit(1)\n    }\n    /* c8 ignore stop */\n    opts.mode = mode\n  } else dirs.push(arg)\n}\n\nimport { mkdirp } from './index.js'\nconst impl = manual ? mkdirp.manual : mkdirp\nif (dirs.length === 0) {\n  console.error(usage())\n}\n\n// these don't get covered in CI, but work locally\n/* c8 ignore start */\nPromise.all(dirs.map(dir => impl(dir, opts)))\n  .then(made => (doPrint ? made.forEach(m => m && console.log(m)) : null))\n  .catch(er => {\n    console.error(er.message)\n    if (er.code) console.error('  code: ' + er.code)\n    process.exit(1)\n  })\n/* c8 ignore stop */\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/find-made.d.ts b/node_modules/mkdirp/dist/cjs/src/find-made.d.ts
new file mode 100644
index 00000000..e47794b3
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/find-made.d.ts
@@ -0,0 +1,4 @@
+import { MkdirpOptionsResolved } from './opts-arg.js';
+export declare const findMade: (opts: MkdirpOptionsResolved, parent: string, path?: string) => Promise;
+export declare const findMadeSync: (opts: MkdirpOptionsResolved, parent: string, path?: string) => undefined | string;
+//# sourceMappingURL=find-made.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/find-made.d.ts.map b/node_modules/mkdirp/dist/cjs/src/find-made.d.ts.map
new file mode 100644
index 00000000..00d5d1a4
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/find-made.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"find-made.d.ts","sourceRoot":"","sources":["../../../src/find-made.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAErD,eAAO,MAAM,QAAQ,SACb,qBAAqB,UACnB,MAAM,SACP,MAAM,KACZ,QAAQ,SAAS,GAAG,MAAM,CAe5B,CAAA;AAED,eAAO,MAAM,YAAY,SACjB,qBAAqB,UACnB,MAAM,SACP,MAAM,KACZ,SAAS,GAAG,MAad,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/find-made.js b/node_modules/mkdirp/dist/cjs/src/find-made.js
new file mode 100644
index 00000000..e831ef27
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/find-made.js
@@ -0,0 +1,35 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.findMadeSync = exports.findMade = void 0;
+const path_1 = require("path");
+const findMade = async (opts, parent, path) => {
+    // we never want the 'made' return value to be a root directory
+    if (path === parent) {
+        return;
+    }
+    return opts.statAsync(parent).then(st => (st.isDirectory() ? path : undefined), // will fail later
+    // will fail later
+    er => {
+        const fer = er;
+        return fer && fer.code === 'ENOENT'
+            ? (0, exports.findMade)(opts, (0, path_1.dirname)(parent), parent)
+            : undefined;
+    });
+};
+exports.findMade = findMade;
+const findMadeSync = (opts, parent, path) => {
+    if (path === parent) {
+        return undefined;
+    }
+    try {
+        return opts.statSync(parent).isDirectory() ? path : undefined;
+    }
+    catch (er) {
+        const fer = er;
+        return fer && fer.code === 'ENOENT'
+            ? (0, exports.findMadeSync)(opts, (0, path_1.dirname)(parent), parent)
+            : undefined;
+    }
+};
+exports.findMadeSync = findMadeSync;
+//# sourceMappingURL=find-made.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/find-made.js.map b/node_modules/mkdirp/dist/cjs/src/find-made.js.map
new file mode 100644
index 00000000..30a0d663
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/find-made.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"find-made.js","sourceRoot":"","sources":["../../../src/find-made.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAGvB,MAAM,QAAQ,GAAG,KAAK,EAC3B,IAA2B,EAC3B,MAAc,EACd,IAAa,EACgB,EAAE;IAC/B,+DAA+D;IAC/D,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAM;KACP;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAChC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,kBAAkB;IAC/D,AAD6C,kBAAkB;IAC/D,EAAE,CAAC,EAAE;QACH,MAAM,GAAG,GAAG,EAA2B,CAAA;QACvC,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;YACjC,CAAC,CAAC,IAAA,gBAAQ,EAAC,IAAI,EAAE,IAAA,cAAO,EAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YACzC,CAAC,CAAC,SAAS,CAAA;IACf,CAAC,CACF,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB;AAEM,MAAM,YAAY,GAAG,CAC1B,IAA2B,EAC3B,MAAc,EACd,IAAa,EACO,EAAE;IACtB,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAO,SAAS,CAAA;KACjB;IAED,IAAI;QACF,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;KAC9D;IAAC,OAAO,EAAE,EAAE;QACX,MAAM,GAAG,GAAG,EAA2B,CAAA;QACvC,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;YACjC,CAAC,CAAC,IAAA,oBAAY,EAAC,IAAI,EAAE,IAAA,cAAO,EAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YAC7C,CAAC,CAAC,SAAS,CAAA;KACd;AACH,CAAC,CAAA;AAjBY,QAAA,YAAY,gBAiBxB","sourcesContent":["import { dirname } from 'path'\nimport { MkdirpOptionsResolved } from './opts-arg.js'\n\nexport const findMade = async (\n  opts: MkdirpOptionsResolved,\n  parent: string,\n  path?: string\n): Promise => {\n  // we never want the 'made' return value to be a root directory\n  if (path === parent) {\n    return\n  }\n\n  return opts.statAsync(parent).then(\n    st => (st.isDirectory() ? path : undefined), // will fail later\n    er => {\n      const fer = er as NodeJS.ErrnoException\n      return fer && fer.code === 'ENOENT'\n        ? findMade(opts, dirname(parent), parent)\n        : undefined\n    }\n  )\n}\n\nexport const findMadeSync = (\n  opts: MkdirpOptionsResolved,\n  parent: string,\n  path?: string\n): undefined | string => {\n  if (path === parent) {\n    return undefined\n  }\n\n  try {\n    return opts.statSync(parent).isDirectory() ? path : undefined\n  } catch (er) {\n    const fer = er as NodeJS.ErrnoException\n    return fer && fer.code === 'ENOENT'\n      ? findMadeSync(opts, dirname(parent), parent)\n      : undefined\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/index.d.ts b/node_modules/mkdirp/dist/cjs/src/index.d.ts
new file mode 100644
index 00000000..fc9e43b3
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/index.d.ts
@@ -0,0 +1,39 @@
+import { MkdirpOptions } from './opts-arg.js';
+export { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js';
+export { mkdirpNative, mkdirpNativeSync } from './mkdirp-native.js';
+export { useNative, useNativeSync } from './use-native.js';
+export declare const mkdirpSync: (path: string, opts?: MkdirpOptions) => string | void;
+export declare const sync: (path: string, opts?: MkdirpOptions) => string | void;
+export declare const manual: ((path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => Promise) & {
+    sync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+};
+export declare const manualSync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+export declare const native: ((path: string, options?: MkdirpOptions | undefined) => Promise) & {
+    sync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+};
+export declare const nativeSync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+export declare const mkdirp: ((path: string, opts?: MkdirpOptions) => Promise) & {
+    mkdirpSync: (path: string, opts?: MkdirpOptions) => string | void;
+    mkdirpNative: ((path: string, options?: MkdirpOptions | undefined) => Promise) & {
+        sync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+    };
+    mkdirpNativeSync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+    mkdirpManual: ((path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => Promise) & {
+        sync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+    };
+    mkdirpManualSync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+    sync: (path: string, opts?: MkdirpOptions) => string | void;
+    native: ((path: string, options?: MkdirpOptions | undefined) => Promise) & {
+        sync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+    };
+    nativeSync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+    manual: ((path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => Promise) & {
+        sync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+    };
+    manualSync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+    useNative: ((opts?: MkdirpOptions | undefined) => boolean) & {
+        sync: (opts?: MkdirpOptions | undefined) => boolean;
+    };
+    useNativeSync: (opts?: MkdirpOptions | undefined) => boolean;
+};
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/index.d.ts.map b/node_modules/mkdirp/dist/cjs/src/index.d.ts.map
new file mode 100644
index 00000000..0e915bbc
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAA;AAItD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG1D,eAAO,MAAM,UAAU,SAAU,MAAM,SAAS,aAAa,kBAM5D,CAAA;AAED,eAAO,MAAM,IAAI,SARgB,MAAM,SAAS,aAAa,kBAQ/B,CAAA;AAC9B,eAAO,MAAM,MAAM;;CAAe,CAAA;AAClC,eAAO,MAAM,UAAU,oHAAmB,CAAA;AAC1C,eAAO,MAAM,MAAM;;CAAe,CAAA;AAClC,eAAO,MAAM,UAAU,kFAAmB,CAAA;AAC1C,eAAO,MAAM,MAAM,UACJ,MAAM,SAAS,aAAa;uBAdV,MAAM,SAAS,aAAa;;;;;;;;;iBAA5B,MAAM,SAAS,aAAa;;;;;;;;;;;;;CAoC5D,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/index.js b/node_modules/mkdirp/dist/cjs/src/index.js
new file mode 100644
index 00000000..ab9dc62c
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/index.js
@@ -0,0 +1,53 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.mkdirp = exports.nativeSync = exports.native = exports.manualSync = exports.manual = exports.sync = exports.mkdirpSync = exports.useNativeSync = exports.useNative = exports.mkdirpNativeSync = exports.mkdirpNative = exports.mkdirpManualSync = exports.mkdirpManual = void 0;
+const mkdirp_manual_js_1 = require("./mkdirp-manual.js");
+const mkdirp_native_js_1 = require("./mkdirp-native.js");
+const opts_arg_js_1 = require("./opts-arg.js");
+const path_arg_js_1 = require("./path-arg.js");
+const use_native_js_1 = require("./use-native.js");
+/* c8 ignore start */
+var mkdirp_manual_js_2 = require("./mkdirp-manual.js");
+Object.defineProperty(exports, "mkdirpManual", { enumerable: true, get: function () { return mkdirp_manual_js_2.mkdirpManual; } });
+Object.defineProperty(exports, "mkdirpManualSync", { enumerable: true, get: function () { return mkdirp_manual_js_2.mkdirpManualSync; } });
+var mkdirp_native_js_2 = require("./mkdirp-native.js");
+Object.defineProperty(exports, "mkdirpNative", { enumerable: true, get: function () { return mkdirp_native_js_2.mkdirpNative; } });
+Object.defineProperty(exports, "mkdirpNativeSync", { enumerable: true, get: function () { return mkdirp_native_js_2.mkdirpNativeSync; } });
+var use_native_js_2 = require("./use-native.js");
+Object.defineProperty(exports, "useNative", { enumerable: true, get: function () { return use_native_js_2.useNative; } });
+Object.defineProperty(exports, "useNativeSync", { enumerable: true, get: function () { return use_native_js_2.useNativeSync; } });
+/* c8 ignore stop */
+const mkdirpSync = (path, opts) => {
+    path = (0, path_arg_js_1.pathArg)(path);
+    const resolved = (0, opts_arg_js_1.optsArg)(opts);
+    return (0, use_native_js_1.useNativeSync)(resolved)
+        ? (0, mkdirp_native_js_1.mkdirpNativeSync)(path, resolved)
+        : (0, mkdirp_manual_js_1.mkdirpManualSync)(path, resolved);
+};
+exports.mkdirpSync = mkdirpSync;
+exports.sync = exports.mkdirpSync;
+exports.manual = mkdirp_manual_js_1.mkdirpManual;
+exports.manualSync = mkdirp_manual_js_1.mkdirpManualSync;
+exports.native = mkdirp_native_js_1.mkdirpNative;
+exports.nativeSync = mkdirp_native_js_1.mkdirpNativeSync;
+exports.mkdirp = Object.assign(async (path, opts) => {
+    path = (0, path_arg_js_1.pathArg)(path);
+    const resolved = (0, opts_arg_js_1.optsArg)(opts);
+    return (0, use_native_js_1.useNative)(resolved)
+        ? (0, mkdirp_native_js_1.mkdirpNative)(path, resolved)
+        : (0, mkdirp_manual_js_1.mkdirpManual)(path, resolved);
+}, {
+    mkdirpSync: exports.mkdirpSync,
+    mkdirpNative: mkdirp_native_js_1.mkdirpNative,
+    mkdirpNativeSync: mkdirp_native_js_1.mkdirpNativeSync,
+    mkdirpManual: mkdirp_manual_js_1.mkdirpManual,
+    mkdirpManualSync: mkdirp_manual_js_1.mkdirpManualSync,
+    sync: exports.mkdirpSync,
+    native: mkdirp_native_js_1.mkdirpNative,
+    nativeSync: mkdirp_native_js_1.mkdirpNativeSync,
+    manual: mkdirp_manual_js_1.mkdirpManual,
+    manualSync: mkdirp_manual_js_1.mkdirpManualSync,
+    useNative: use_native_js_1.useNative,
+    useNativeSync: use_native_js_1.useNativeSync,
+});
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/index.js.map b/node_modules/mkdirp/dist/cjs/src/index.js.map
new file mode 100644
index 00000000..fdb57267
--- /dev/null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9B,OAAO,IAAA,yBAAS,EAAC,QAAQ,CAAC;QACxB,CAAC,CAAC,IAAA,+BAAY,EAAC,IAAI,EAAE,QAAQ,CAAC;QAC9B,CAAC,CAAC,IAAA,+BAAY,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAClC,CAAC,EACD;IACE,UAAU,EAAV,kBAAU;IACV,YAAY,EAAZ,+BAAY;IACZ,gBAAgB,EAAhB,mCAAgB;IAChB,YAAY,EAAZ,+BAAY;IACZ,gBAAgB,EAAhB,mCAAgB;IAEhB,IAAI,EAAE,kBAAU;IAChB,MAAM,EAAE,+BAAY;IACpB,UAAU,EAAE,mCAAgB;IAC5B,MAAM,EAAE,+BAAY;IACpB,UAAU,EAAE,mCAAgB;IAC5B,SAAS,EAAT,yBAAS;IACT,aAAa,EAAb,6BAAa;CACd,CACF,CAAA","sourcesContent":["import { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js'\nimport { mkdirpNative, mkdirpNativeSync } from './mkdirp-native.js'\nimport { MkdirpOptions, optsArg } from './opts-arg.js'\nimport { pathArg } from './path-arg.js'\nimport { useNative, useNativeSync } from './use-native.js'\n/* c8 ignore start */\nexport { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js'\nexport { mkdirpNative, mkdirpNativeSync } from './mkdirp-native.js'\nexport { useNative, useNativeSync } from './use-native.js'\n/* c8 ignore stop */\n\nexport const mkdirpSync = (path: string, opts?: MkdirpOptions) => {\n  path = pathArg(path)\n  const resolved = optsArg(opts)\n  return useNativeSync(resolved)\n    ? mkdirpNativeSync(path, resolved)\n    : mkdirpManualSync(path, resolved)\n}\n\nexport const sync = mkdirpSync\nexport const manual = mkdirpManual\nexport const manualSync = mkdirpManualSync\nexport const native = mkdirpNative\nexport const nativeSync = mkdirpNativeSync\nexport const mkdirp = Object.assign(\n  async (path: string, opts?: MkdirpOptions) => {\n    path = pathArg(path)\n    const resolved = optsArg(opts)\n    return useNative(resolved)\n      ? mkdirpNative(path, resolved)\n      : mkdirpManual(path, resolved)\n  },\n  {\n    mkdirpSync,\n    mkdirpNative,\n    mkdirpNativeSync,\n    mkdirpManual,\n    mkdirpManualSync,\n\n    sync: mkdirpSync,\n    native: mkdirpNative,\n    nativeSync: mkdirpNativeSync,\n    manual: mkdirpManual,\n    manualSync: mkdirpManualSync,\n    useNative,\n    useNativeSync,\n  }\n)\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.d.ts b/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.d.ts
new file mode 100644
index 00000000..e49cdf9f
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.d.ts
@@ -0,0 +1,6 @@
+import { MkdirpOptions } from './opts-arg.js';
+export declare const mkdirpManualSync: (path: string, options?: MkdirpOptions, made?: string | undefined | void) => string | undefined | void;
+export declare const mkdirpManual: ((path: string, options?: MkdirpOptions, made?: string | undefined | void) => Promise) & {
+    sync: (path: string, options?: MkdirpOptions, made?: string | undefined | void) => string | undefined | void;
+};
+//# sourceMappingURL=mkdirp-manual.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.d.ts.map b/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.d.ts.map
new file mode 100644
index 00000000..9301bab1
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mkdirp-manual.d.ts","sourceRoot":"","sources":["../../../src/mkdirp-manual.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,gBAAgB,SACrB,MAAM,YACF,aAAa,SAChB,MAAM,GAAG,SAAS,GAAG,IAAI,KAC/B,MAAM,GAAG,SAAS,GAAG,IAmCvB,CAAA;AAED,eAAO,MAAM,YAAY,UAEf,MAAM,YACF,aAAa,SAChB,MAAM,GAAG,SAAS,GAAG,IAAI,KAC/B,QAAQ,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;iBA7C/B,MAAM,YACF,aAAa,SAChB,MAAM,GAAG,SAAS,GAAG,IAAI,KAC/B,MAAM,GAAG,SAAS,GAAG,IAAI;CAqF3B,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.js b/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.js
new file mode 100644
index 00000000..d9bd1d8b
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.js
@@ -0,0 +1,79 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.mkdirpManual = exports.mkdirpManualSync = void 0;
+const path_1 = require("path");
+const opts_arg_js_1 = require("./opts-arg.js");
+const mkdirpManualSync = (path, options, made) => {
+    const parent = (0, path_1.dirname)(path);
+    const opts = { ...(0, opts_arg_js_1.optsArg)(options), recursive: false };
+    if (parent === path) {
+        try {
+            return opts.mkdirSync(path, opts);
+        }
+        catch (er) {
+            // swallowed by recursive implementation on posix systems
+            // any other error is a failure
+            const fer = er;
+            if (fer && fer.code !== 'EISDIR') {
+                throw er;
+            }
+            return;
+        }
+    }
+    try {
+        opts.mkdirSync(path, opts);
+        return made || path;
+    }
+    catch (er) {
+        const fer = er;
+        if (fer && fer.code === 'ENOENT') {
+            return (0, exports.mkdirpManualSync)(path, opts, (0, exports.mkdirpManualSync)(parent, opts, made));
+        }
+        if (fer && fer.code !== 'EEXIST' && fer && fer.code !== 'EROFS') {
+            throw er;
+        }
+        try {
+            if (!opts.statSync(path).isDirectory())
+                throw er;
+        }
+        catch (_) {
+            throw er;
+        }
+    }
+};
+exports.mkdirpManualSync = mkdirpManualSync;
+exports.mkdirpManual = Object.assign(async (path, options, made) => {
+    const opts = (0, opts_arg_js_1.optsArg)(options);
+    opts.recursive = false;
+    const parent = (0, path_1.dirname)(path);
+    if (parent === path) {
+        return opts.mkdirAsync(path, opts).catch(er => {
+            // swallowed by recursive implementation on posix systems
+            // any other error is a failure
+            const fer = er;
+            if (fer && fer.code !== 'EISDIR') {
+                throw er;
+            }
+        });
+    }
+    return opts.mkdirAsync(path, opts).then(() => made || path, async (er) => {
+        const fer = er;
+        if (fer && fer.code === 'ENOENT') {
+            return (0, exports.mkdirpManual)(parent, opts).then((made) => (0, exports.mkdirpManual)(path, opts, made));
+        }
+        if (fer && fer.code !== 'EEXIST' && fer.code !== 'EROFS') {
+            throw er;
+        }
+        return opts.statAsync(path).then(st => {
+            if (st.isDirectory()) {
+                return made;
+            }
+            else {
+                throw er;
+            }
+        }, () => {
+            throw er;
+        });
+    });
+}, { sync: exports.mkdirpManualSync });
+//# sourceMappingURL=mkdirp-manual.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.js.map b/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.js.map
new file mode 100644
index 00000000..ff7ba24d
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/mkdirp-manual.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"mkdirp-manual.js","sourceRoot":"","sources":["../../../src/mkdirp-manual.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAC9B,+CAAsD;AAE/C,MAAM,gBAAgB,GAAG,CAC9B,IAAY,EACZ,OAAuB,EACvB,IAAgC,EACL,EAAE;IAC7B,MAAM,MAAM,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,IAAI,GAAG,EAAE,GAAG,IAAA,qBAAO,EAAC,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;IAEtD,IAAI,MAAM,KAAK,IAAI,EAAE;QACnB,IAAI;YACF,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;SAClC;QAAC,OAAO,EAAE,EAAE;YACX,yDAAyD;YACzD,+BAA+B;YAC/B,MAAM,GAAG,GAAG,EAA2B,CAAA;YACvC,IAAI,GAAG,IAAI,GAAG,CAAC,IA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/B,MAAM,GAAG,GAAG,EAA2B,CAAA;YACvC,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAChC,MAAM,EAAE,CAAA;aACT;QACH,CAAC,CAAC,CAAA;KACH;IAED,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CACrC,GAAG,EAAE,CAAC,IAAI,IAAI,IAAI,EAClB,KAAK,EAAC,EAAE,EAAC,EAAE;QACT,MAAM,GAAG,GAAG,EAA2B,CAAA;QACvC,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;YAChC,OAAO,IAAA,oBAAY,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,CACpC,CAAC,IAAgC,EAAE,EAAE,CAAC,IAAA,oBAAY,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CACrE,CAAA;SACF;QACD,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE;YACxD,MAAM,EAAE,CAAA;SACT;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAC9B,EAAE,CAAC,EAAE;YACH,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE;gBACpB,OAAO,IAAI,CAAA;aACZ;iBAAM;gBACL,MAAM,EAAE,CAAA;aACT;QACH,CAAC,EACD,GAAG,EAAE;YACH,MAAM,EAAE,CAAA;QACV,CAAC,CACF,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC,EACD,EAAE,IAAI,EAAE,wBAAgB,EAAE,CAC3B,CAAA","sourcesContent":["import { dirname } from 'path'\nimport { MkdirpOptions, optsArg } from './opts-arg.js'\n\nexport const mkdirpManualSync = (\n  path: string,\n  options?: MkdirpOptions,\n  made?: string | undefined | void\n): string | undefined | void => {\n  const parent = dirname(path)\n  const opts = { ...optsArg(options), recursive: false }\n\n  if (parent === path) {\n    try {\n      return opts.mkdirSync(path, opts)\n    } catch (er) {\n      // swallowed by recursive implementation on posix systems\n      // any other error is a failure\n      const fer = er as NodeJS.ErrnoException\n      if (fer && fer.code !== 'EISDIR') {\n        throw er\n      }\n      return\n    }\n  }\n\n  try {\n    opts.mkdirSync(path, opts)\n    return made || path\n  } catch (er) {\n    const fer = er as NodeJS.ErrnoException\n    if (fer && fer.code === 'ENOENT') {\n      return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made))\n    }\n    if (fer && fer.code !== 'EEXIST' && fer && fer.code !== 'EROFS') {\n      throw er\n    }\n    try {\n      if (!opts.statSync(path).isDirectory()) throw er\n    } catch (_) {\n      throw er\n    }\n  }\n}\n\nexport const mkdirpManual = Object.assign(\n  async (\n    path: string,\n    options?: MkdirpOptions,\n    made?: string | undefined | void\n  ): Promise => {\n    const opts = optsArg(options)\n    opts.recursive = false\n    const parent = dirname(path)\n    if (parent === path) {\n      return opts.mkdirAsync(path, opts).catch(er => {\n        // swallowed by recursive implementation on posix systems\n        // any other error is a failure\n        const fer = er as NodeJS.ErrnoException\n        if (fer && fer.code !== 'EISDIR') {\n          throw er\n        }\n      })\n    }\n\n    return opts.mkdirAsync(path, opts).then(\n      () => made || path,\n      async er => {\n        const fer = er as NodeJS.ErrnoException\n        if (fer && fer.code === 'ENOENT') {\n          return mkdirpManual(parent, opts).then(\n            (made?: string | undefined | void) => mkdirpManual(path, opts, made)\n          )\n        }\n        if (fer && fer.code !== 'EEXIST' && fer.code !== 'EROFS') {\n          throw er\n        }\n        return opts.statAsync(path).then(\n          st => {\n            if (st.isDirectory()) {\n              return made\n            } else {\n              throw er\n            }\n          },\n          () => {\n            throw er\n          }\n        )\n      }\n    )\n  },\n  { sync: mkdirpManualSync }\n)\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/mkdirp-native.d.ts b/node_modules/mkdirp/dist/cjs/src/mkdirp-native.d.ts
new file mode 100644
index 00000000..28b64814
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/mkdirp-native.d.ts
@@ -0,0 +1,6 @@
+import { MkdirpOptions } from './opts-arg.js';
+export declare const mkdirpNativeSync: (path: string, options?: MkdirpOptions) => string | void | undefined;
+export declare const mkdirpNative: ((path: string, options?: MkdirpOptions) => Promise) & {
+    sync: (path: string, options?: MkdirpOptions) => string | void | undefined;
+};
+//# sourceMappingURL=mkdirp-native.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/mkdirp-native.d.ts.map b/node_modules/mkdirp/dist/cjs/src/mkdirp-native.d.ts.map
new file mode 100644
index 00000000..379c0f65
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/mkdirp-native.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mkdirp-native.d.ts","sourceRoot":"","sources":["../../../src/mkdirp-native.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,gBAAgB,SACrB,MAAM,YACF,aAAa,KACtB,MAAM,GAAG,IAAI,GAAG,SAoBlB,CAAA;AAED,eAAO,MAAM,YAAY,UAEf,MAAM,YACF,aAAa,KACtB,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;iBA5B/B,MAAM,YACF,aAAa,KACtB,MAAM,GAAG,IAAI,GAAG,SAAS;CAgD3B,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/mkdirp-native.js b/node_modules/mkdirp/dist/cjs/src/mkdirp-native.js
new file mode 100644
index 00000000..9f00567d
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/mkdirp-native.js
@@ -0,0 +1,50 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.mkdirpNative = exports.mkdirpNativeSync = void 0;
+const path_1 = require("path");
+const find_made_js_1 = require("./find-made.js");
+const mkdirp_manual_js_1 = require("./mkdirp-manual.js");
+const opts_arg_js_1 = require("./opts-arg.js");
+const mkdirpNativeSync = (path, options) => {
+    const opts = (0, opts_arg_js_1.optsArg)(options);
+    opts.recursive = true;
+    const parent = (0, path_1.dirname)(path);
+    if (parent === path) {
+        return opts.mkdirSync(path, opts);
+    }
+    const made = (0, find_made_js_1.findMadeSync)(opts, path);
+    try {
+        opts.mkdirSync(path, opts);
+        return made;
+    }
+    catch (er) {
+        const fer = er;
+        if (fer && fer.code === 'ENOENT') {
+            return (0, mkdirp_manual_js_1.mkdirpManualSync)(path, opts);
+        }
+        else {
+            throw er;
+        }
+    }
+};
+exports.mkdirpNativeSync = mkdirpNativeSync;
+exports.mkdirpNative = Object.assign(async (path, options) => {
+    const opts = { ...(0, opts_arg_js_1.optsArg)(options), recursive: true };
+    const parent = (0, path_1.dirname)(path);
+    if (parent === path) {
+        return await opts.mkdirAsync(path, opts);
+    }
+    return (0, find_made_js_1.findMade)(opts, path).then((made) => opts
+        .mkdirAsync(path, opts)
+        .then(m => made || m)
+        .catch(er => {
+        const fer = er;
+        if (fer && fer.code === 'ENOENT') {
+            return (0, mkdirp_manual_js_1.mkdirpManual)(path, opts);
+        }
+        else {
+            throw er;
+        }
+    }));
+}, { sync: exports.mkdirpNativeSync });
+//# sourceMappingURL=mkdirp-native.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/mkdirp-native.js.map b/node_modules/mkdirp/dist/cjs/src/mkdirp-native.js.map
new file mode 100644
index 00000000..1f889ee9
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/mkdirp-native.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"mkdirp-native.js","sourceRoot":"","sources":["../../../src/mkdirp-native.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAC9B,iDAAuD;AACvD,yDAAmE;AACnE,+CAAsD;AAE/C,MAAM,gBAAgB,GAAG,CAC9B,IAAY,EACZ,OAAuB,EACI,EAAE;IAC7B,MAAM,IAAI,GAAG,IAAA,qBAAO,EAAC,OAAO,CAAC,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,IAAI,IAAI,CAAC,CAAC;SACpB,KAAK,CAAC,EAAE,CAAC,EAAE;QACV,MAAM,GAAG,GAAG,EAA2B,CAAA;QACvC,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;YAChC,OAAO,IAAA,+BAAY,EAAC,IAAI,EAAE,IAAI,CAAC,CAAA;SAChC;aAAM;YACL,MAAM,EAAE,CAAA;SACT;IACH,CAAC,CAAC,CACL,CAAA;AACH,CAAC,EACD,EAAE,IAAI,EAAE,wBAAgB,EAAE,CAC3B,CAAA","sourcesContent":["import { dirname } from 'path'\nimport { findMade, findMadeSync } from './find-made.js'\nimport { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js'\nimport { MkdirpOptions, optsArg } from './opts-arg.js'\n\nexport const mkdirpNativeSync = (\n  path: string,\n  options?: MkdirpOptions\n): string | void | undefined => {\n  const opts = optsArg(options)\n  opts.recursive = true\n  const parent = dirname(path)\n  if (parent === path) {\n    return opts.mkdirSync(path, opts)\n  }\n\n  const made = findMadeSync(opts, path)\n  try {\n    opts.mkdirSync(path, opts)\n    return made\n  } catch (er) {\n    const fer = er as NodeJS.ErrnoException\n    if (fer && fer.code === 'ENOENT') {\n      return mkdirpManualSync(path, opts)\n    } else {\n      throw er\n    }\n  }\n}\n\nexport const mkdirpNative = Object.assign(\n  async (\n    path: string,\n    options?: MkdirpOptions\n  ): Promise => {\n    const opts = { ...optsArg(options), recursive: true }\n    const parent = dirname(path)\n    if (parent === path) {\n      return await opts.mkdirAsync(path, opts)\n    }\n\n    return findMade(opts, path).then((made?: string | undefined) =>\n      opts\n        .mkdirAsync(path, opts)\n        .then(m => made || m)\n        .catch(er => {\n          const fer = er as NodeJS.ErrnoException\n          if (fer && fer.code === 'ENOENT') {\n            return mkdirpManual(path, opts)\n          } else {\n            throw er\n          }\n        })\n    )\n  },\n  { sync: mkdirpNativeSync }\n)\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/opts-arg.d.ts b/node_modules/mkdirp/dist/cjs/src/opts-arg.d.ts
new file mode 100644
index 00000000..73d076b3
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/opts-arg.d.ts
@@ -0,0 +1,42 @@
+/// 
+/// 
+import { MakeDirectoryOptions, Stats } from 'fs';
+export interface FsProvider {
+    stat?: (path: string, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any) => any;
+    mkdir?: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }, callback: (err: NodeJS.ErrnoException | null, made?: string) => any) => any;
+    statSync?: (path: string) => Stats;
+    mkdirSync?: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }) => string | undefined;
+}
+interface Options extends FsProvider {
+    mode?: number | string;
+    fs?: FsProvider;
+    mkdirAsync?: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }) => Promise;
+    statAsync?: (path: string) => Promise;
+}
+export type MkdirpOptions = Options | number | string;
+export interface MkdirpOptionsResolved {
+    mode: number;
+    fs: FsProvider;
+    mkdirAsync: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }) => Promise;
+    statAsync: (path: string) => Promise;
+    stat: (path: string, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any) => any;
+    mkdir: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }, callback: (err: NodeJS.ErrnoException | null, made?: string) => any) => any;
+    statSync: (path: string) => Stats;
+    mkdirSync: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }) => string | undefined;
+    recursive?: boolean;
+}
+export declare const optsArg: (opts?: MkdirpOptions) => MkdirpOptionsResolved;
+export {};
+//# sourceMappingURL=opts-arg.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/opts-arg.d.ts.map b/node_modules/mkdirp/dist/cjs/src/opts-arg.d.ts.map
new file mode 100644
index 00000000..e5751617
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/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,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAErD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,UAAU,CAAA;IACd,UAAU,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,oBAAoB,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,KACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAChC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAAA;IAC3C,IAAI,EAAE,CACJ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,KAAK,GAAG,KAC/D,GAAG,CAAA;IACR,KAAK,EAAE,CACL,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,oBAAoB,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,EACpD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,GAAG,KAChE,GAAG,CAAA;IACR,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAA;IACjC,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,oBAAoB,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,KACjD,MAAM,GAAG,SAAS,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,OAAO,UAAW,aAAa,KAAG,qBA2C9C,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/opts-arg.js b/node_modules/mkdirp/dist/cjs/src/opts-arg.js
new file mode 100644
index 00000000..e8f486c0
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/opts-arg.js
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.optsArg = void 0;
+const fs_1 = require("fs");
+const optsArg = (opts) => {
+    if (!opts) {
+        opts = { mode: 0o777 };
+    }
+    else if (typeof opts === 'object') {
+        opts = { mode: 0o777, ...opts };
+    }
+    else if (typeof opts === 'number') {
+        opts = { mode: opts };
+    }
+    else if (typeof opts === 'string') {
+        opts = { mode: parseInt(opts, 8) };
+    }
+    else {
+        throw new TypeError('invalid options argument');
+    }
+    const resolved = opts;
+    const optsFs = opts.fs || {};
+    opts.mkdir = opts.mkdir || optsFs.mkdir || fs_1.mkdir;
+    opts.mkdirAsync = opts.mkdirAsync
+        ? opts.mkdirAsync
+        : async (path, options) => {
+            return new Promise((res, rej) => resolved.mkdir(path, options, (er, made) => er ? rej(er) : res(made)));
+        };
+    opts.stat = opts.stat || optsFs.stat || fs_1.stat;
+    opts.statAsync = opts.statAsync
+        ? opts.statAsync
+        : async (path) => new Promise((res, rej) => resolved.stat(path, (err, stats) => (err ? rej(err) : res(stats))));
+    opts.statSync = opts.statSync || optsFs.statSync || fs_1.statSync;
+    opts.mkdirSync = opts.mkdirSync || optsFs.mkdirSync || fs_1.mkdirSync;
+    return resolved;
+};
+exports.optsArg = optsArg;
+//# sourceMappingURL=opts-arg.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/opts-arg.js.map b/node_modules/mkdirp/dist/cjs/src/opts-arg.js.map
new file mode 100644
index 00000000..fd5590f4
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/opts-arg.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"opts-arg.js","sourceRoot":"","sources":["../../../src/opts-arg.ts"],"names":[],"mappings":";;;AAAA,2BAOW;AAwDJ,MAAM,OAAO,GAAG,CAAC,IAAoB,EAAyB,EAAE;IACrE,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE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,SAAS;QAChB,CAAC,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CACrB,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CACvB,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CACnE,CAAA;IAEP,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,aAAQ,CAAA;IAC5D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,IAAI,cAAS,CAAA;IAEhE,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AA3CY,QAAA,OAAO,WA2CnB","sourcesContent":["import {\n  MakeDirectoryOptions,\n  mkdir,\n  mkdirSync,\n  stat,\n  Stats,\n  statSync,\n} from 'fs'\n\nexport interface FsProvider {\n  stat?: (\n    path: string,\n    callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any\n  ) => any\n  mkdir?: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean },\n    callback: (err: NodeJS.ErrnoException | null, made?: string) => any\n  ) => any\n  statSync?: (path: string) => Stats\n  mkdirSync?: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean }\n  ) => string | undefined\n}\n\ninterface Options extends FsProvider {\n  mode?: number | string\n  fs?: FsProvider\n  mkdirAsync?: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean }\n  ) => Promise\n  statAsync?: (path: string) => Promise\n}\n\nexport type MkdirpOptions = Options | number | string\n\nexport interface MkdirpOptionsResolved {\n  mode: number\n  fs: FsProvider\n  mkdirAsync: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean }\n  ) => Promise\n  statAsync: (path: string) => Promise\n  stat: (\n    path: string,\n    callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any\n  ) => any\n  mkdir: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean },\n    callback: (err: NodeJS.ErrnoException | null, made?: string) => any\n  ) => any\n  statSync: (path: string) => Stats\n  mkdirSync: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean }\n  ) => string | undefined\n  recursive?: boolean\n}\n\nexport const optsArg = (opts?: MkdirpOptions): MkdirpOptionsResolved => {\n  if (!opts) {\n    opts = { mode: 0o777 }\n  } else if (typeof opts === 'object') {\n    opts = { mode: 0o777, ...opts }\n  } else if (typeof opts === 'number') {\n    opts = { mode: opts }\n  } else if (typeof opts === 'string') {\n    opts = { mode: parseInt(opts, 8) }\n  } else {\n    throw new TypeError('invalid options argument')\n  }\n\n  const resolved = opts as MkdirpOptionsResolved\n  const optsFs = opts.fs || {}\n\n  opts.mkdir = opts.mkdir || optsFs.mkdir || mkdir\n\n  opts.mkdirAsync = opts.mkdirAsync\n    ? opts.mkdirAsync\n    : async (\n        path: string,\n        options: MakeDirectoryOptions & { recursive?: boolean }\n      ): Promise => {\n        return new Promise((res, rej) =>\n          resolved.mkdir(path, options, (er, made) =>\n            er ? rej(er) : res(made)\n          )\n        )\n      }\n\n  opts.stat = opts.stat || optsFs.stat || stat\n  opts.statAsync = opts.statAsync\n    ? opts.statAsync\n    : async (path: string) =>\n        new Promise((res, rej) =>\n          resolved.stat(path, (err, stats) => (err ? rej(err) : res(stats)))\n        )\n\n  opts.statSync = opts.statSync || optsFs.statSync || statSync\n  opts.mkdirSync = opts.mkdirSync || optsFs.mkdirSync || mkdirSync\n\n  return resolved\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/path-arg.d.ts b/node_modules/mkdirp/dist/cjs/src/path-arg.d.ts
new file mode 100644
index 00000000..ad0ccfc4
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/path-arg.d.ts
@@ -0,0 +1,2 @@
+export declare const pathArg: (path: string) => string;
+//# sourceMappingURL=path-arg.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/path-arg.d.ts.map b/node_modules/mkdirp/dist/cjs/src/path-arg.d.ts.map
new file mode 100644
index 00000000..3b52b077
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/path-arg.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"path-arg.d.ts","sourceRoot":"","sources":["../../../src/path-arg.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,SAAU,MAAM,WAyBnC,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/path-arg.js b/node_modules/mkdirp/dist/cjs/src/path-arg.js
new file mode 100644
index 00000000..a6b457f6
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/path-arg.js
@@ -0,0 +1,28 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.pathArg = void 0;
+const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
+const path_1 = require("path");
+const pathArg = (path) => {
+    if (/\0/.test(path)) {
+        // simulate same failure that node raises
+        throw Object.assign(new TypeError('path must be a string without null bytes'), {
+            path,
+            code: 'ERR_INVALID_ARG_VALUE',
+        });
+    }
+    path = (0, path_1.resolve)(path);
+    if (platform === 'win32') {
+        const badWinChars = /[*|"<>?:]/;
+        const { root } = (0, path_1.parse)(path);
+        if (badWinChars.test(path.substring(root.length))) {
+            throw Object.assign(new Error('Illegal characters in path.'), {
+                path,
+                code: 'EINVAL',
+            });
+        }
+    }
+    return path;
+};
+exports.pathArg = pathArg;
+//# sourceMappingURL=path-arg.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/path-arg.js.map b/node_modules/mkdirp/dist/cjs/src/path-arg.js.map
new file mode 100644
index 00000000..ad3b5d38
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/path-arg.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"path-arg.js","sourceRoot":"","sources":["../../../src/path-arg.ts"],"names":[],"mappings":";;;AAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,OAAO,CAAC,QAAQ,CAAA;AAC5E,+BAAqC;AAC9B,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE;IACtC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACnB,yCAAyC;QACzC,MAAM,MAAM,CAAC,MAAM,CACjB,IAAI,SAAS,CAAC,0CAA0C,CAAC,EACzD;YACE,IAAI;YACJ,IAAI,EAAE,uBAAuB;SAC9B,CACF,CAAA;KACF;IAED,IAAI,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAA;IACpB,IAAI,QAAQ,KAAK,OAAO,EAAE;QACxB,MAAM,WAAW,GAAG,WAAW,CAAA;QAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,YAAK,EAAC,IAAI,CAAC,CAAA;QAC5B,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;YACjD,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,6BAA6B,CAAC,EAAE;gBAC5D,IAAI;gBACJ,IAAI,EAAE,QAAQ;aACf,CAAC,CAAA;SACH;KACF;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAzBY,QAAA,OAAO,WAyBnB","sourcesContent":["const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform\nimport { parse, resolve } from 'path'\nexport const pathArg = (path: string) => {\n  if (/\\0/.test(path)) {\n    // simulate same failure that node raises\n    throw Object.assign(\n      new TypeError('path must be a string without null bytes'),\n      {\n        path,\n        code: 'ERR_INVALID_ARG_VALUE',\n      }\n    )\n  }\n\n  path = resolve(path)\n  if (platform === 'win32') {\n    const badWinChars = /[*|\"<>?:]/\n    const { root } = parse(path)\n    if (badWinChars.test(path.substring(root.length))) {\n      throw Object.assign(new Error('Illegal characters in path.'), {\n        path,\n        code: 'EINVAL',\n      })\n    }\n  }\n\n  return path\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/use-native.d.ts b/node_modules/mkdirp/dist/cjs/src/use-native.d.ts
new file mode 100644
index 00000000..1c6cb619
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/use-native.d.ts
@@ -0,0 +1,6 @@
+import { MkdirpOptions } from './opts-arg.js';
+export declare const useNativeSync: (opts?: MkdirpOptions) => boolean;
+export declare const useNative: ((opts?: MkdirpOptions) => boolean) & {
+    sync: (opts?: MkdirpOptions) => boolean;
+};
+//# sourceMappingURL=use-native.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/use-native.d.ts.map b/node_modules/mkdirp/dist/cjs/src/use-native.d.ts.map
new file mode 100644
index 00000000..7dc275e3
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/use-native.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"use-native.d.ts","sourceRoot":"","sources":["../../../src/use-native.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAA;AAMtD,eAAO,MAAM,aAAa,UAEd,aAAa,YAA0C,CAAA;AAEnE,eAAO,MAAM,SAAS,WAGR,aAAa;kBALf,aAAa;CASxB,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/use-native.js b/node_modules/mkdirp/dist/cjs/src/use-native.js
new file mode 100644
index 00000000..550b3452
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/use-native.js
@@ -0,0 +1,17 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.useNative = exports.useNativeSync = void 0;
+const fs_1 = require("fs");
+const opts_arg_js_1 = require("./opts-arg.js");
+const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version;
+const versArr = version.replace(/^v/, '').split('.');
+const hasNative = +versArr[0] > 10 || (+versArr[0] === 10 && +versArr[1] >= 12);
+exports.useNativeSync = !hasNative
+    ? () => false
+    : (opts) => (0, opts_arg_js_1.optsArg)(opts).mkdirSync === fs_1.mkdirSync;
+exports.useNative = Object.assign(!hasNative
+    ? () => false
+    : (opts) => (0, opts_arg_js_1.optsArg)(opts).mkdir === fs_1.mkdir, {
+    sync: exports.useNativeSync,
+});
+//# sourceMappingURL=use-native.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/cjs/src/use-native.js.map b/node_modules/mkdirp/dist/cjs/src/use-native.js.map
new file mode 100644
index 00000000..9a15efeb
--- /dev/null
+++ b/node_modules/mkdirp/dist/cjs/src/use-native.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"use-native.js","sourceRoot":"","sources":["../../../src/use-native.ts"],"names":[],"mappings":";;;AAAA,2BAAqC;AACrC,+CAAsD;AAEtD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,OAAO,CAAC,OAAO,CAAA;AAC9E,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACpD,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAElE,QAAA,aAAa,GAAG,CAAC,SAAS;IACrC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK;IACb,CAAC,CAAC,CAAC,IAAoB,EAAE,EAAE,CAAC,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC,SAAS,KAAK,cAAS,CAAA;AAEtD,QAAA,SAAS,GAAG,MAAM,CAAC,MAAM,CACpC,CAAC,SAAS;IACR,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK;IACb,CAAC,CAAC,CAAC,IAAoB,EAAE,EAAE,CAAC,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC,KAAK,KAAK,UAAK,EAC3D;IACE,IAAI,EAAE,qBAAa;CACpB,CACF,CAAA","sourcesContent":["import { mkdir, mkdirSync } from 'fs'\nimport { MkdirpOptions, optsArg } from './opts-arg.js'\n\nconst version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version\nconst versArr = version.replace(/^v/, '').split('.')\nconst hasNative = +versArr[0] > 10 || (+versArr[0] === 10 && +versArr[1] >= 12)\n\nexport const useNativeSync = !hasNative\n  ? () => false\n  : (opts?: MkdirpOptions) => optsArg(opts).mkdirSync === mkdirSync\n\nexport const useNative = Object.assign(\n  !hasNative\n    ? () => false\n    : (opts?: MkdirpOptions) => optsArg(opts).mkdir === mkdir,\n  {\n    sync: useNativeSync,\n  }\n)\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/find-made.d.ts b/node_modules/mkdirp/dist/mjs/find-made.d.ts
new file mode 100644
index 00000000..e47794b3
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/find-made.d.ts
@@ -0,0 +1,4 @@
+import { MkdirpOptionsResolved } from './opts-arg.js';
+export declare const findMade: (opts: MkdirpOptionsResolved, parent: string, path?: string) => Promise;
+export declare const findMadeSync: (opts: MkdirpOptionsResolved, parent: string, path?: string) => undefined | string;
+//# sourceMappingURL=find-made.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/find-made.d.ts.map b/node_modules/mkdirp/dist/mjs/find-made.d.ts.map
new file mode 100644
index 00000000..411aad14
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/find-made.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"find-made.d.ts","sourceRoot":"","sources":["../../src/find-made.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAErD,eAAO,MAAM,QAAQ,SACb,qBAAqB,UACnB,MAAM,SACP,MAAM,KACZ,QAAQ,SAAS,GAAG,MAAM,CAe5B,CAAA;AAED,eAAO,MAAM,YAAY,SACjB,qBAAqB,UACnB,MAAM,SACP,MAAM,KACZ,SAAS,GAAG,MAad,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/find-made.js b/node_modules/mkdirp/dist/mjs/find-made.js
new file mode 100644
index 00000000..3e72fd59
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/find-made.js
@@ -0,0 +1,30 @@
+import { dirname } from 'path';
+export const findMade = async (opts, parent, path) => {
+    // we never want the 'made' return value to be a root directory
+    if (path === parent) {
+        return;
+    }
+    return opts.statAsync(parent).then(st => (st.isDirectory() ? path : undefined), // will fail later
+    // will fail later
+    er => {
+        const fer = er;
+        return fer && fer.code === 'ENOENT'
+            ? findMade(opts, dirname(parent), parent)
+            : undefined;
+    });
+};
+export const findMadeSync = (opts, parent, path) => {
+    if (path === parent) {
+        return undefined;
+    }
+    try {
+        return opts.statSync(parent).isDirectory() ? path : undefined;
+    }
+    catch (er) {
+        const fer = er;
+        return fer && fer.code === 'ENOENT'
+            ? findMadeSync(opts, dirname(parent), parent)
+            : undefined;
+    }
+};
+//# sourceMappingURL=find-made.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/find-made.js.map b/node_modules/mkdirp/dist/mjs/find-made.js.map
new file mode 100644
index 00000000..7b58089c
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/find-made.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"find-made.js","sourceRoot":"","sources":["../../src/find-made.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAG9B,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAC3B,IAA2B,EAC3B,MAAc,EACd,IAAa,EACgB,EAAE;IAC/B,+DAA+D;IAC/D,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAM;KACP;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAChC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,kBAAkB;IAC/D,AAD6C,kBAAkB;IAC/D,EAAE,CAAC,EAAE;QACH,MAAM,GAAG,GAAG,EAA2B,CAAA;QACvC,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;YACjC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YACzC,CAAC,CAAC,SAAS,CAAA;IACf,CAAC,CACF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,IAA2B,EAC3B,MAAc,EACd,IAAa,EACO,EAAE;IACtB,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAO,SAAS,CAAA;KACjB;IAED,IAAI;QACF,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;KAC9D;IAAC,OAAO,EAAE,EAAE;QACX,MAAM,GAAG,GAAG,EAA2B,CAAA;QACvC,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;YACjC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YAC7C,CAAC,CAAC,SAAS,CAAA;KACd;AACH,CAAC,CAAA","sourcesContent":["import { dirname } from 'path'\nimport { MkdirpOptionsResolved } from './opts-arg.js'\n\nexport const findMade = async (\n  opts: MkdirpOptionsResolved,\n  parent: string,\n  path?: string\n): Promise => {\n  // we never want the 'made' return value to be a root directory\n  if (path === parent) {\n    return\n  }\n\n  return opts.statAsync(parent).then(\n    st => (st.isDirectory() ? path : undefined), // will fail later\n    er => {\n      const fer = er as NodeJS.ErrnoException\n      return fer && fer.code === 'ENOENT'\n        ? findMade(opts, dirname(parent), parent)\n        : undefined\n    }\n  )\n}\n\nexport const findMadeSync = (\n  opts: MkdirpOptionsResolved,\n  parent: string,\n  path?: string\n): undefined | string => {\n  if (path === parent) {\n    return undefined\n  }\n\n  try {\n    return opts.statSync(parent).isDirectory() ? path : undefined\n  } catch (er) {\n    const fer = er as NodeJS.ErrnoException\n    return fer && fer.code === 'ENOENT'\n      ? findMadeSync(opts, dirname(parent), parent)\n      : undefined\n  }\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/index.d.ts b/node_modules/mkdirp/dist/mjs/index.d.ts
new file mode 100644
index 00000000..fc9e43b3
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/index.d.ts
@@ -0,0 +1,39 @@
+import { MkdirpOptions } from './opts-arg.js';
+export { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js';
+export { mkdirpNative, mkdirpNativeSync } from './mkdirp-native.js';
+export { useNative, useNativeSync } from './use-native.js';
+export declare const mkdirpSync: (path: string, opts?: MkdirpOptions) => string | void;
+export declare const sync: (path: string, opts?: MkdirpOptions) => string | void;
+export declare const manual: ((path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => Promise) & {
+    sync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+};
+export declare const manualSync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+export declare const native: ((path: string, options?: MkdirpOptions | undefined) => Promise) & {
+    sync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+};
+export declare const nativeSync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+export declare const mkdirp: ((path: string, opts?: MkdirpOptions) => Promise) & {
+    mkdirpSync: (path: string, opts?: MkdirpOptions) => string | void;
+    mkdirpNative: ((path: string, options?: MkdirpOptions | undefined) => Promise) & {
+        sync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+    };
+    mkdirpNativeSync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+    mkdirpManual: ((path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => Promise) & {
+        sync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+    };
+    mkdirpManualSync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+    sync: (path: string, opts?: MkdirpOptions) => string | void;
+    native: ((path: string, options?: MkdirpOptions | undefined) => Promise) & {
+        sync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+    };
+    nativeSync: (path: string, options?: MkdirpOptions | undefined) => string | void | undefined;
+    manual: ((path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => Promise) & {
+        sync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+    };
+    manualSync: (path: string, options?: MkdirpOptions | undefined, made?: string | void | undefined) => string | void | undefined;
+    useNative: ((opts?: MkdirpOptions | undefined) => boolean) & {
+        sync: (opts?: MkdirpOptions | undefined) => boolean;
+    };
+    useNativeSync: (opts?: MkdirpOptions | undefined) => boolean;
+};
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/index.d.ts.map b/node_modules/mkdirp/dist/mjs/index.d.ts.map
new file mode 100644
index 00000000..cfcc7808
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAA;AAItD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG1D,eAAO,MAAM,UAAU,SAAU,MAAM,SAAS,aAAa,kBAM5D,CAAA;AAED,eAAO,MAAM,IAAI,SARgB,MAAM,SAAS,aAAa,kBAQ/B,CAAA;AAC9B,eAAO,MAAM,MAAM;;CAAe,CAAA;AAClC,eAAO,MAAM,UAAU,oHAAmB,CAAA;AAC1C,eAAO,MAAM,MAAM;;CAAe,CAAA;AAClC,eAAO,MAAM,UAAU,kFAAmB,CAAA;AAC1C,eAAO,MAAM,MAAM,UACJ,MAAM,SAAS,aAAa;uBAdV,MAAM,SAAS,aAAa;;;;;;;;;iBAA5B,MAAM,SAAS,aAAa;;;;;;;;;;;;;CAoC5D,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/index.js b/node_modules/mkdirp/dist/mjs/index.js
new file mode 100644
index 00000000..0217ecc8
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/index.js
@@ -0,0 +1,43 @@
+import { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js';
+import { mkdirpNative, mkdirpNativeSync } from './mkdirp-native.js';
+import { optsArg } from './opts-arg.js';
+import { pathArg } from './path-arg.js';
+import { useNative, useNativeSync } from './use-native.js';
+/* c8 ignore start */
+export { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js';
+export { mkdirpNative, mkdirpNativeSync } from './mkdirp-native.js';
+export { useNative, useNativeSync } from './use-native.js';
+/* c8 ignore stop */
+export const mkdirpSync = (path, opts) => {
+    path = pathArg(path);
+    const resolved = optsArg(opts);
+    return useNativeSync(resolved)
+        ? mkdirpNativeSync(path, resolved)
+        : mkdirpManualSync(path, resolved);
+};
+export const sync = mkdirpSync;
+export const manual = mkdirpManual;
+export const manualSync = mkdirpManualSync;
+export const native = mkdirpNative;
+export const nativeSync = mkdirpNativeSync;
+export const mkdirp = Object.assign(async (path, opts) => {
+    path = pathArg(path);
+    const resolved = optsArg(opts);
+    return useNative(resolved)
+        ? mkdirpNative(path, resolved)
+        : mkdirpManual(path, resolved);
+}, {
+    mkdirpSync,
+    mkdirpNative,
+    mkdirpNativeSync,
+    mkdirpManual,
+    mkdirpManualSync,
+    sync: mkdirpSync,
+    native: mkdirpNative,
+    nativeSync: mkdirpNativeSync,
+    manual: mkdirpManual,
+    manualSync: mkdirpManualSync,
+    useNative,
+    useNativeSync,
+});
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/index.js.map b/node_modules/mkdirp/dist/mjs/index.js.map
new file mode 100644
index 00000000..47a8133a
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAiB,OAAO,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC1D,qBAAqB;AACrB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC1D,oBAAoB;AAEpB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,IAAoB,EAAE,EAAE;IAC/D,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9B,OAAO,aAAa,CAAC,QAAQ,CAAC;QAC5B,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC;QAClC,CAAC,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AACtC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAA;AAC9B,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAA;AAClC,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAA;AAC1C,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAA;AAClC,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAA;AAC1C,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CACjC,KAAK,EAAE,IAAY,EAAE,IAAoB,EAAE,EAAE;IAC3C,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9B,OAAO,SAAS,CAAC,QAAQ,CAAC;QACxB,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC;QAC9B,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAClC,CAAC,EACD;IACE,UAAU;IACV,YAAY;IACZ,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAEhB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,YAAY;IACpB,UAAU,EAAE,gBAAgB;IAC5B,SAAS;IACT,aAAa;CACd,CACF,CAAA","sourcesContent":["import { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js'\nimport { mkdirpNative, mkdirpNativeSync } from './mkdirp-native.js'\nimport { MkdirpOptions, optsArg } from './opts-arg.js'\nimport { pathArg } from './path-arg.js'\nimport { useNative, useNativeSync } from './use-native.js'\n/* c8 ignore start */\nexport { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js'\nexport { mkdirpNative, mkdirpNativeSync } from './mkdirp-native.js'\nexport { useNative, useNativeSync } from './use-native.js'\n/* c8 ignore stop */\n\nexport const mkdirpSync = (path: string, opts?: MkdirpOptions) => {\n  path = pathArg(path)\n  const resolved = optsArg(opts)\n  return useNativeSync(resolved)\n    ? mkdirpNativeSync(path, resolved)\n    : mkdirpManualSync(path, resolved)\n}\n\nexport const sync = mkdirpSync\nexport const manual = mkdirpManual\nexport const manualSync = mkdirpManualSync\nexport const native = mkdirpNative\nexport const nativeSync = mkdirpNativeSync\nexport const mkdirp = Object.assign(\n  async (path: string, opts?: MkdirpOptions) => {\n    path = pathArg(path)\n    const resolved = optsArg(opts)\n    return useNative(resolved)\n      ? mkdirpNative(path, resolved)\n      : mkdirpManual(path, resolved)\n  },\n  {\n    mkdirpSync,\n    mkdirpNative,\n    mkdirpNativeSync,\n    mkdirpManual,\n    mkdirpManualSync,\n\n    sync: mkdirpSync,\n    native: mkdirpNative,\n    nativeSync: mkdirpNativeSync,\n    manual: mkdirpManual,\n    manualSync: mkdirpManualSync,\n    useNative,\n    useNativeSync,\n  }\n)\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/mkdirp-manual.d.ts b/node_modules/mkdirp/dist/mjs/mkdirp-manual.d.ts
new file mode 100644
index 00000000..e49cdf9f
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/mkdirp-manual.d.ts
@@ -0,0 +1,6 @@
+import { MkdirpOptions } from './opts-arg.js';
+export declare const mkdirpManualSync: (path: string, options?: MkdirpOptions, made?: string | undefined | void) => string | undefined | void;
+export declare const mkdirpManual: ((path: string, options?: MkdirpOptions, made?: string | undefined | void) => Promise) & {
+    sync: (path: string, options?: MkdirpOptions, made?: string | undefined | void) => string | undefined | void;
+};
+//# sourceMappingURL=mkdirp-manual.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/mkdirp-manual.d.ts.map b/node_modules/mkdirp/dist/mjs/mkdirp-manual.d.ts.map
new file mode 100644
index 00000000..ae7f243d
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/mkdirp-manual.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mkdirp-manual.d.ts","sourceRoot":"","sources":["../../src/mkdirp-manual.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,gBAAgB,SACrB,MAAM,YACF,aAAa,SAChB,MAAM,GAAG,SAAS,GAAG,IAAI,KAC/B,MAAM,GAAG,SAAS,GAAG,IAmCvB,CAAA;AAED,eAAO,MAAM,YAAY,UAEf,MAAM,YACF,aAAa,SAChB,MAAM,GAAG,SAAS,GAAG,IAAI,KAC/B,QAAQ,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;iBA7C/B,MAAM,YACF,aAAa,SAChB,MAAM,GAAG,SAAS,GAAG,IAAI,KAC/B,MAAM,GAAG,SAAS,GAAG,IAAI;CAqF3B,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/mkdirp-manual.js b/node_modules/mkdirp/dist/mjs/mkdirp-manual.js
new file mode 100644
index 00000000..a4d044e0
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/mkdirp-manual.js
@@ -0,0 +1,75 @@
+import { dirname } from 'path';
+import { optsArg } from './opts-arg.js';
+export const mkdirpManualSync = (path, options, made) => {
+    const parent = dirname(path);
+    const opts = { ...optsArg(options), recursive: false };
+    if (parent === path) {
+        try {
+            return opts.mkdirSync(path, opts);
+        }
+        catch (er) {
+            // swallowed by recursive implementation on posix systems
+            // any other error is a failure
+            const fer = er;
+            if (fer && fer.code !== 'EISDIR') {
+                throw er;
+            }
+            return;
+        }
+    }
+    try {
+        opts.mkdirSync(path, opts);
+        return made || path;
+    }
+    catch (er) {
+        const fer = er;
+        if (fer && fer.code === 'ENOENT') {
+            return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made));
+        }
+        if (fer && fer.code !== 'EEXIST' && fer && fer.code !== 'EROFS') {
+            throw er;
+        }
+        try {
+            if (!opts.statSync(path).isDirectory())
+                throw er;
+        }
+        catch (_) {
+            throw er;
+        }
+    }
+};
+export const mkdirpManual = Object.assign(async (path, options, made) => {
+    const opts = optsArg(options);
+    opts.recursive = false;
+    const parent = dirname(path);
+    if (parent === path) {
+        return opts.mkdirAsync(path, opts).catch(er => {
+            // swallowed by recursive implementation on posix systems
+            // any other error is a failure
+            const fer = er;
+            if (fer && fer.code !== 'EISDIR') {
+                throw er;
+            }
+        });
+    }
+    return opts.mkdirAsync(path, opts).then(() => made || path, async (er) => {
+        const fer = er;
+        if (fer && fer.code === 'ENOENT') {
+            return mkdirpManual(parent, opts).then((made) => mkdirpManual(path, opts, made));
+        }
+        if (fer && fer.code !== 'EEXIST' && fer.code !== 'EROFS') {
+            throw er;
+        }
+        return opts.statAsync(path).then(st => {
+            if (st.isDirectory()) {
+                return made;
+            }
+            else {
+                throw er;
+            }
+        }, () => {
+            throw er;
+        });
+    });
+}, { sync: mkdirpManualSync });
+//# sourceMappingURL=mkdirp-manual.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/mkdirp-manual.js.map b/node_modules/mkdirp/dist/mjs/mkdirp-manual.js.map
new file mode 100644
index 00000000..29eab250
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/mkdirp-manual.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"mkdirp-manual.js","sourceRoot":"","sources":["../../src/mkdirp-manual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAiB,OAAO,EAAE,MAAM,eAAe,CAAA;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,IAAY,EACZ,OAAuB,EACvB,IAAgC,EACL,EAAE;IAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,IAAI,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,EAA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IAAI,EAAE,gBAAgB,EAAE,CAC3B,CAAA","sourcesContent":["import { dirname } from 'path'\nimport { MkdirpOptions, optsArg } from './opts-arg.js'\n\nexport const mkdirpManualSync = (\n  path: string,\n  options?: MkdirpOptions,\n  made?: string | undefined | void\n): string | undefined | void => {\n  const parent = dirname(path)\n  const opts = { ...optsArg(options), recursive: false }\n\n  if (parent === path) {\n    try {\n      return opts.mkdirSync(path, opts)\n    } catch (er) {\n      // swallowed by recursive implementation on posix systems\n      // any other error is a failure\n      const fer = er as NodeJS.ErrnoException\n      if (fer && fer.code !== 'EISDIR') {\n        throw er\n      }\n      return\n    }\n  }\n\n  try {\n    opts.mkdirSync(path, opts)\n    return made || path\n  } catch (er) {\n    const fer = er as NodeJS.ErrnoException\n    if (fer && fer.code === 'ENOENT') {\n      return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made))\n    }\n    if (fer && fer.code !== 'EEXIST' && fer && fer.code !== 'EROFS') {\n      throw er\n    }\n    try {\n      if (!opts.statSync(path).isDirectory()) throw er\n    } catch (_) {\n      throw er\n    }\n  }\n}\n\nexport const mkdirpManual = Object.assign(\n  async (\n    path: string,\n    options?: MkdirpOptions,\n    made?: string | undefined | void\n  ): Promise => {\n    const opts = optsArg(options)\n    opts.recursive = false\n    const parent = dirname(path)\n    if (parent === path) {\n      return opts.mkdirAsync(path, opts).catch(er => {\n        // swallowed by recursive implementation on posix systems\n        // any other error is a failure\n        const fer = er as NodeJS.ErrnoException\n        if (fer && fer.code !== 'EISDIR') {\n          throw er\n        }\n      })\n    }\n\n    return opts.mkdirAsync(path, opts).then(\n      () => made || path,\n      async er => {\n        const fer = er as NodeJS.ErrnoException\n        if (fer && fer.code === 'ENOENT') {\n          return mkdirpManual(parent, opts).then(\n            (made?: string | undefined | void) => mkdirpManual(path, opts, made)\n          )\n        }\n        if (fer && fer.code !== 'EEXIST' && fer.code !== 'EROFS') {\n          throw er\n        }\n        return opts.statAsync(path).then(\n          st => {\n            if (st.isDirectory()) {\n              return made\n            } else {\n              throw er\n            }\n          },\n          () => {\n            throw er\n          }\n        )\n      }\n    )\n  },\n  { sync: mkdirpManualSync }\n)\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/mkdirp-native.d.ts b/node_modules/mkdirp/dist/mjs/mkdirp-native.d.ts
new file mode 100644
index 00000000..28b64814
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/mkdirp-native.d.ts
@@ -0,0 +1,6 @@
+import { MkdirpOptions } from './opts-arg.js';
+export declare const mkdirpNativeSync: (path: string, options?: MkdirpOptions) => string | void | undefined;
+export declare const mkdirpNative: ((path: string, options?: MkdirpOptions) => Promise) & {
+    sync: (path: string, options?: MkdirpOptions) => string | void | undefined;
+};
+//# sourceMappingURL=mkdirp-native.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/mkdirp-native.d.ts.map b/node_modules/mkdirp/dist/mjs/mkdirp-native.d.ts.map
new file mode 100644
index 00000000..517dfabe
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/mkdirp-native.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"mkdirp-native.d.ts","sourceRoot":"","sources":["../../src/mkdirp-native.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAA;AAEtD,eAAO,MAAM,gBAAgB,SACrB,MAAM,YACF,aAAa,KACtB,MAAM,GAAG,IAAI,GAAG,SAoBlB,CAAA;AAED,eAAO,MAAM,YAAY,UAEf,MAAM,YACF,aAAa,KACtB,QAAQ,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;iBA5B/B,MAAM,YACF,aAAa,KACtB,MAAM,GAAG,IAAI,GAAG,SAAS;CAgD3B,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/mkdirp-native.js b/node_modules/mkdirp/dist/mjs/mkdirp-native.js
new file mode 100644
index 00000000..99d10a54
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/mkdirp-native.js
@@ -0,0 +1,46 @@
+import { dirname } from 'path';
+import { findMade, findMadeSync } from './find-made.js';
+import { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js';
+import { optsArg } from './opts-arg.js';
+export const mkdirpNativeSync = (path, options) => {
+    const opts = optsArg(options);
+    opts.recursive = true;
+    const parent = dirname(path);
+    if (parent === path) {
+        return opts.mkdirSync(path, opts);
+    }
+    const made = findMadeSync(opts, path);
+    try {
+        opts.mkdirSync(path, opts);
+        return made;
+    }
+    catch (er) {
+        const fer = er;
+        if (fer && fer.code === 'ENOENT') {
+            return mkdirpManualSync(path, opts);
+        }
+        else {
+            throw er;
+        }
+    }
+};
+export const mkdirpNative = Object.assign(async (path, options) => {
+    const opts = { ...optsArg(options), recursive: true };
+    const parent = dirname(path);
+    if (parent === path) {
+        return await opts.mkdirAsync(path, opts);
+    }
+    return findMade(opts, path).then((made) => opts
+        .mkdirAsync(path, opts)
+        .then(m => made || m)
+        .catch(er => {
+        const fer = er;
+        if (fer && fer.code === 'ENOENT') {
+            return mkdirpManual(path, opts);
+        }
+        else {
+            throw er;
+        }
+    }));
+}, { sync: mkdirpNativeSync });
+//# sourceMappingURL=mkdirp-native.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/mkdirp-native.js.map b/node_modules/mkdirp/dist/mjs/mkdirp-native.js.map
new file mode 100644
index 00000000..27de32d9
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/mkdirp-native.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"mkdirp-native.js","sourceRoot":"","sources":["../../src/mkdirp-native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAiB,OAAO,EAAE,MAAM,eAAe,CAAA;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,IAAI,EAAE,IAAI,CAAC;SACtB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC;SACpB,KAAK,CAAC,EAAE,CAAC,EAAE;QACV,MAAM,GAAG,GAAG,EAA2B,CAAA;QACvC,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE;YAChC,OAAO,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;SAChC;aAAM;YACL,MAAM,EAAE,CAAA;SACT;IACH,CAAC,CAAC,CACL,CAAA;AACH,CAAC,EACD,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAC3B,CAAA","sourcesContent":["import { dirname } from 'path'\nimport { findMade, findMadeSync } from './find-made.js'\nimport { mkdirpManual, mkdirpManualSync } from './mkdirp-manual.js'\nimport { MkdirpOptions, optsArg } from './opts-arg.js'\n\nexport const mkdirpNativeSync = (\n  path: string,\n  options?: MkdirpOptions\n): string | void | undefined => {\n  const opts = optsArg(options)\n  opts.recursive = true\n  const parent = dirname(path)\n  if (parent === path) {\n    return opts.mkdirSync(path, opts)\n  }\n\n  const made = findMadeSync(opts, path)\n  try {\n    opts.mkdirSync(path, opts)\n    return made\n  } catch (er) {\n    const fer = er as NodeJS.ErrnoException\n    if (fer && fer.code === 'ENOENT') {\n      return mkdirpManualSync(path, opts)\n    } else {\n      throw er\n    }\n  }\n}\n\nexport const mkdirpNative = Object.assign(\n  async (\n    path: string,\n    options?: MkdirpOptions\n  ): Promise => {\n    const opts = { ...optsArg(options), recursive: true }\n    const parent = dirname(path)\n    if (parent === path) {\n      return await opts.mkdirAsync(path, opts)\n    }\n\n    return findMade(opts, path).then((made?: string | undefined) =>\n      opts\n        .mkdirAsync(path, opts)\n        .then(m => made || m)\n        .catch(er => {\n          const fer = er as NodeJS.ErrnoException\n          if (fer && fer.code === 'ENOENT') {\n            return mkdirpManual(path, opts)\n          } else {\n            throw er\n          }\n        })\n    )\n  },\n  { sync: mkdirpNativeSync }\n)\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/opts-arg.d.ts b/node_modules/mkdirp/dist/mjs/opts-arg.d.ts
new file mode 100644
index 00000000..73d076b3
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/opts-arg.d.ts
@@ -0,0 +1,42 @@
+/// 
+/// 
+import { MakeDirectoryOptions, Stats } from 'fs';
+export interface FsProvider {
+    stat?: (path: string, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any) => any;
+    mkdir?: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }, callback: (err: NodeJS.ErrnoException | null, made?: string) => any) => any;
+    statSync?: (path: string) => Stats;
+    mkdirSync?: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }) => string | undefined;
+}
+interface Options extends FsProvider {
+    mode?: number | string;
+    fs?: FsProvider;
+    mkdirAsync?: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }) => Promise;
+    statAsync?: (path: string) => Promise;
+}
+export type MkdirpOptions = Options | number | string;
+export interface MkdirpOptionsResolved {
+    mode: number;
+    fs: FsProvider;
+    mkdirAsync: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }) => Promise;
+    statAsync: (path: string) => Promise;
+    stat: (path: string, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any) => any;
+    mkdir: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }, callback: (err: NodeJS.ErrnoException | null, made?: string) => any) => any;
+    statSync: (path: string) => Stats;
+    mkdirSync: (path: string, opts: MakeDirectoryOptions & {
+        recursive?: boolean;
+    }) => string | undefined;
+    recursive?: boolean;
+}
+export declare const optsArg: (opts?: MkdirpOptions) => MkdirpOptionsResolved;
+export {};
+//# sourceMappingURL=opts-arg.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/opts-arg.d.ts.map b/node_modules/mkdirp/dist/mjs/opts-arg.d.ts.map
new file mode 100644
index 00000000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e2927
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/opts-arg.js
@@ -0,0 +1,34 @@
+import { mkdir, mkdirSync, stat, statSync, } from 'fs';
+export const optsArg = (opts) => {
+    if (!opts) {
+        opts = { mode: 0o777 };
+    }
+    else if (typeof opts === 'object') {
+        opts = { mode: 0o777, ...opts };
+    }
+    else if (typeof opts === 'number') {
+        opts = { mode: opts };
+    }
+    else if (typeof opts === 'string') {
+        opts = { mode: parseInt(opts, 8) };
+    }
+    else {
+        throw new TypeError('invalid options argument');
+    }
+    const resolved = opts;
+    const optsFs = opts.fs || {};
+    opts.mkdir = opts.mkdir || optsFs.mkdir || mkdir;
+    opts.mkdirAsync = opts.mkdirAsync
+        ? opts.mkdirAsync
+        : async (path, options) => {
+            return new Promise((res, rej) => resolved.mkdir(path, options, (er, made) => er ? rej(er) : res(made)));
+        };
+    opts.stat = opts.stat || optsFs.stat || stat;
+    opts.statAsync = opts.statAsync
+        ? opts.statAsync
+        : async (path) => new Promise((res, rej) => resolved.stat(path, (err, stats) => (err ? rej(err) : res(stats))));
+    opts.statSync = opts.statSync || optsFs.statSync || statSync;
+    opts.mkdirSync = opts.mkdirSync || optsFs.mkdirSync || mkdirSync;
+    return resolved;
+};
+//# sourceMappingURL=opts-arg.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/opts-arg.js.map b/node_modules/mkdirp/dist/mjs/opts-arg.js.map
new file mode 100644
index 00000000..663286dc
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/opts-arg.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"opts-arg.js","sourceRoot":"","sources":["../../src/opts-arg.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EACL,SAAS,EACT,IAAI,EAEJ,QAAQ,GACT,MAAM,IAAI,CAAA;AAwDX,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAoB,EAAyB,EAAE;IACrE,IAAI,CAAC,IAAI,EAAE;QACT,IAAI,GAAG,EA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7B,CAAC,CAAC,IAAI,CAAC,SAAS;QAChB,CAAC,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CACrB,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CACvB,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CACnE,CAAA;IAEP,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAA;IAC5D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,IAAI,SAAS,CAAA;IAEhE,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA","sourcesContent":["import {\n  MakeDirectoryOptions,\n  mkdir,\n  mkdirSync,\n  stat,\n  Stats,\n  statSync,\n} from 'fs'\n\nexport interface FsProvider {\n  stat?: (\n    path: string,\n    callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any\n  ) => any\n  mkdir?: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean },\n    callback: (err: NodeJS.ErrnoException | null, made?: string) => any\n  ) => any\n  statSync?: (path: string) => Stats\n  mkdirSync?: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean }\n  ) => string | undefined\n}\n\ninterface Options extends FsProvider {\n  mode?: number | string\n  fs?: FsProvider\n  mkdirAsync?: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean }\n  ) => Promise\n  statAsync?: (path: string) => Promise\n}\n\nexport type MkdirpOptions = Options | number | string\n\nexport interface MkdirpOptionsResolved {\n  mode: number\n  fs: FsProvider\n  mkdirAsync: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean }\n  ) => Promise\n  statAsync: (path: string) => Promise\n  stat: (\n    path: string,\n    callback: (err: NodeJS.ErrnoException | null, stats: Stats) => any\n  ) => any\n  mkdir: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean },\n    callback: (err: NodeJS.ErrnoException | null, made?: string) => any\n  ) => any\n  statSync: (path: string) => Stats\n  mkdirSync: (\n    path: string,\n    opts: MakeDirectoryOptions & { recursive?: boolean }\n  ) => string | undefined\n  recursive?: boolean\n}\n\nexport const optsArg = (opts?: MkdirpOptions): MkdirpOptionsResolved => {\n  if (!opts) {\n    opts = { mode: 0o777 }\n  } else if (typeof opts === 'object') {\n    opts = { mode: 0o777, ...opts }\n  } else if (typeof opts === 'number') {\n    opts = { mode: opts }\n  } else if (typeof opts === 'string') {\n    opts = { mode: parseInt(opts, 8) }\n  } else {\n    throw new TypeError('invalid options argument')\n  }\n\n  const resolved = opts as MkdirpOptionsResolved\n  const optsFs = opts.fs || {}\n\n  opts.mkdir = opts.mkdir || optsFs.mkdir || mkdir\n\n  opts.mkdirAsync = opts.mkdirAsync\n    ? opts.mkdirAsync\n    : async (\n        path: string,\n        options: MakeDirectoryOptions & { recursive?: boolean }\n      ): Promise => {\n        return new Promise((res, rej) =>\n          resolved.mkdir(path, options, (er, made) =>\n            er ? rej(er) : res(made)\n          )\n        )\n      }\n\n  opts.stat = opts.stat || optsFs.stat || stat\n  opts.statAsync = opts.statAsync\n    ? opts.statAsync\n    : async (path: string) =>\n        new Promise((res, rej) =>\n          resolved.stat(path, (err, stats) => (err ? rej(err) : res(stats)))\n        )\n\n  opts.statSync = opts.statSync || optsFs.statSync || statSync\n  opts.mkdirSync = opts.mkdirSync || optsFs.mkdirSync || mkdirSync\n\n  return resolved\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/package.json b/node_modules/mkdirp/dist/mjs/package.json
new file mode 100644
index 00000000..3dbc1ca5
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/node_modules/mkdirp/dist/mjs/path-arg.d.ts b/node_modules/mkdirp/dist/mjs/path-arg.d.ts
new file mode 100644
index 00000000..ad0ccfc4
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/path-arg.d.ts
@@ -0,0 +1,2 @@
+export declare const pathArg: (path: string) => string;
+//# sourceMappingURL=path-arg.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/path-arg.d.ts.map b/node_modules/mkdirp/dist/mjs/path-arg.d.ts.map
new file mode 100644
index 00000000..801799e7
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/path-arg.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"path-arg.d.ts","sourceRoot":"","sources":["../../src/path-arg.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,SAAU,MAAM,WAyBnC,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/path-arg.js b/node_modules/mkdirp/dist/mjs/path-arg.js
new file mode 100644
index 00000000..03539cc5
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/path-arg.js
@@ -0,0 +1,24 @@
+const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
+import { parse, resolve } from 'path';
+export const pathArg = (path) => {
+    if (/\0/.test(path)) {
+        // simulate same failure that node raises
+        throw Object.assign(new TypeError('path must be a string without null bytes'), {
+            path,
+            code: 'ERR_INVALID_ARG_VALUE',
+        });
+    }
+    path = resolve(path);
+    if (platform === 'win32') {
+        const badWinChars = /[*|"<>?:]/;
+        const { root } = parse(path);
+        if (badWinChars.test(path.substring(root.length))) {
+            throw Object.assign(new Error('Illegal characters in path.'), {
+                path,
+                code: 'EINVAL',
+            });
+        }
+    }
+    return path;
+};
+//# sourceMappingURL=path-arg.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/path-arg.js.map b/node_modules/mkdirp/dist/mjs/path-arg.js.map
new file mode 100644
index 00000000..43efe1e3
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/path-arg.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"path-arg.js","sourceRoot":"","sources":["../../src/path-arg.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,OAAO,CAAC,QAAQ,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACrC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE;IACtC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACnB,yCAAyC;QACzC,MAAM,MAAM,CAAC,MAAM,CACjB,IAAI,SAAS,CAAC,0CAA0C,CAAC,EACzD;YACE,IAAI;YACJ,IAAI,EAAE,uBAAuB;SAC9B,CACF,CAAA;KACF;IAED,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpB,IAAI,QAAQ,KAAK,OAAO,EAAE;QACxB,MAAM,WAAW,GAAG,WAAW,CAAA;QAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;QAC5B,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;YACjD,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,6BAA6B,CAAC,EAAE;gBAC5D,IAAI;gBACJ,IAAI,EAAE,QAAQ;aACf,CAAC,CAAA;SACH;KACF;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA","sourcesContent":["const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform\nimport { parse, resolve } from 'path'\nexport const pathArg = (path: string) => {\n  if (/\\0/.test(path)) {\n    // simulate same failure that node raises\n    throw Object.assign(\n      new TypeError('path must be a string without null bytes'),\n      {\n        path,\n        code: 'ERR_INVALID_ARG_VALUE',\n      }\n    )\n  }\n\n  path = resolve(path)\n  if (platform === 'win32') {\n    const badWinChars = /[*|\"<>?:]/\n    const { root } = parse(path)\n    if (badWinChars.test(path.substring(root.length))) {\n      throw Object.assign(new Error('Illegal characters in path.'), {\n        path,\n        code: 'EINVAL',\n      })\n    }\n  }\n\n  return path\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/use-native.d.ts b/node_modules/mkdirp/dist/mjs/use-native.d.ts
new file mode 100644
index 00000000..1c6cb619
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/use-native.d.ts
@@ -0,0 +1,6 @@
+import { MkdirpOptions } from './opts-arg.js';
+export declare const useNativeSync: (opts?: MkdirpOptions) => boolean;
+export declare const useNative: ((opts?: MkdirpOptions) => boolean) & {
+    sync: (opts?: MkdirpOptions) => boolean;
+};
+//# sourceMappingURL=use-native.d.ts.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/use-native.d.ts.map b/node_modules/mkdirp/dist/mjs/use-native.d.ts.map
new file mode 100644
index 00000000..e2484228
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/use-native.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"use-native.d.ts","sourceRoot":"","sources":["../../src/use-native.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAW,MAAM,eAAe,CAAA;AAMtD,eAAO,MAAM,aAAa,UAEd,aAAa,YAA0C,CAAA;AAEnE,eAAO,MAAM,SAAS,WAGR,aAAa;kBALf,aAAa;CASxB,CAAA"}
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/use-native.js b/node_modules/mkdirp/dist/mjs/use-native.js
new file mode 100644
index 00000000..ad209386
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/use-native.js
@@ -0,0 +1,14 @@
+import { mkdir, mkdirSync } from 'fs';
+import { optsArg } from './opts-arg.js';
+const version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version;
+const versArr = version.replace(/^v/, '').split('.');
+const hasNative = +versArr[0] > 10 || (+versArr[0] === 10 && +versArr[1] >= 12);
+export const useNativeSync = !hasNative
+    ? () => false
+    : (opts) => optsArg(opts).mkdirSync === mkdirSync;
+export const useNative = Object.assign(!hasNative
+    ? () => false
+    : (opts) => optsArg(opts).mkdir === mkdir, {
+    sync: useNativeSync,
+});
+//# sourceMappingURL=use-native.js.map
\ No newline at end of file
diff --git a/node_modules/mkdirp/dist/mjs/use-native.js.map b/node_modules/mkdirp/dist/mjs/use-native.js.map
new file mode 100644
index 00000000..08c616d3
--- /dev/null
+++ b/node_modules/mkdirp/dist/mjs/use-native.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"use-native.js","sourceRoot":"","sources":["../../src/use-native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AACrC,OAAO,EAAiB,OAAO,EAAE,MAAM,eAAe,CAAA;AAEtD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,+BAA+B,IAAI,OAAO,CAAC,OAAO,CAAA;AAC9E,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACpD,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AAE/E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS;IACrC,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK;IACb,CAAC,CAAC,CAAC,IAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,SAAS,CAAA;AAEnE,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CACpC,CAAC,SAAS;IACR,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK;IACb,CAAC,CAAC,CAAC,IAAoB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,EAC3D;IACE,IAAI,EAAE,aAAa;CACpB,CACF,CAAA","sourcesContent":["import { mkdir, mkdirSync } from 'fs'\nimport { MkdirpOptions, optsArg } from './opts-arg.js'\n\nconst version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version\nconst versArr = version.replace(/^v/, '').split('.')\nconst hasNative = +versArr[0] > 10 || (+versArr[0] === 10 && +versArr[1] >= 12)\n\nexport const useNativeSync = !hasNative\n  ? () => false\n  : (opts?: MkdirpOptions) => optsArg(opts).mkdirSync === mkdirSync\n\nexport const useNative = Object.assign(\n  !hasNative\n    ? () => false\n    : (opts?: MkdirpOptions) => optsArg(opts).mkdir === mkdir,\n  {\n    sync: useNativeSync,\n  }\n)\n"]}
\ No newline at end of file
diff --git a/node_modules/mkdirp/package.json b/node_modules/mkdirp/package.json
new file mode 100644
index 00000000..f31ac331
--- /dev/null
+++ b/node_modules/mkdirp/package.json
@@ -0,0 +1,91 @@
+{
+  "name": "mkdirp",
+  "description": "Recursively mkdir, like `mkdir -p`",
+  "version": "3.0.1",
+  "keywords": [
+    "mkdir",
+    "directory",
+    "make dir",
+    "make",
+    "dir",
+    "recursive",
+    "native"
+  ],
+  "bin": "./dist/cjs/src/bin.js",
+  "main": "./dist/cjs/src/index.js",
+  "module": "./dist/mjs/index.js",
+  "types": "./dist/mjs/index.d.ts",
+  "exports": {
+    ".": {
+      "import": {
+        "types": "./dist/mjs/index.d.ts",
+        "default": "./dist/mjs/index.js"
+      },
+      "require": {
+        "types": "./dist/cjs/src/index.d.ts",
+        "default": "./dist/cjs/src/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "preprepare": "rm -rf dist",
+    "prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json",
+    "postprepare": "bash fixup.sh",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "c8 tap",
+    "snap": "c8 tap",
+    "format": "prettier --write . --loglevel warn",
+    "benchmark": "node benchmark/index.js",
+    "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts"
+  },
+  "prettier": {
+    "semi": false,
+    "printWidth": 80,
+    "tabWidth": 2,
+    "useTabs": false,
+    "singleQuote": true,
+    "jsxSingleQuote": false,
+    "bracketSameLine": true,
+    "arrowParens": "avoid",
+    "endOfLine": "lf"
+  },
+  "devDependencies": {
+    "@types/brace-expansion": "^1.1.0",
+    "@types/node": "^18.11.9",
+    "@types/tap": "^15.0.7",
+    "c8": "^7.12.0",
+    "eslint-config-prettier": "^8.6.0",
+    "prettier": "^2.8.2",
+    "tap": "^16.3.3",
+    "ts-node": "^10.9.1",
+    "typedoc": "^0.23.21",
+    "typescript": "^4.9.3"
+  },
+  "tap": {
+    "coverage": false,
+    "node-arg": [
+      "--no-warnings",
+      "--loader",
+      "ts-node/esm"
+    ],
+    "ts": false
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/isaacs"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/isaacs/node-mkdirp.git"
+  },
+  "license": "MIT",
+  "engines": {
+    "node": ">=10"
+  }
+}
diff --git a/node_modules/mkdirp/readme.markdown b/node_modules/mkdirp/readme.markdown
new file mode 100644
index 00000000..df654b80
--- /dev/null
+++ b/node_modules/mkdirp/readme.markdown
@@ -0,0 +1,281 @@
+# mkdirp
+
+Like `mkdir -p`, but in Node.js!
+
+Now with a modern API and no\* bugs!
+
+\* may contain some bugs
+
+# example
+
+## pow.js
+
+```js
+// hybrid module, import or require() both work
+import { mkdirp } from 'mkdirp'
+// or:
+const { mkdirp } = require('mkdirp')
+
+// return value is a Promise resolving to the first directory created
+mkdirp('/tmp/foo/bar/baz').then(made =>
+  console.log(`made directories, starting with ${made}`)
+)
+```
+
+Output (where `/tmp/foo` already exists)
+
+```
+made directories, starting with /tmp/foo/bar
+```
+
+Or, if you don't have time to wait around for promises:
+
+```js
+import { mkdirp } from 'mkdirp'
+
+// return value is the first directory created
+const made = mkdirp.sync('/tmp/foo/bar/baz')
+console.log(`made directories, starting with ${made}`)
+```
+
+And now /tmp/foo/bar/baz exists, huzzah!
+
+# methods
+
+```js
+import { mkdirp } from 'mkdirp'
+```
+
+## `mkdirp(dir: string, opts?: MkdirpOptions) => Promise`
+
+Create a new directory and any necessary subdirectories at `dir`
+with octal permission string `opts.mode`. If `opts` is a string
+or number, it will be treated as the `opts.mode`.
+
+If `opts.mode` isn't specified, it defaults to `0o777`.
+
+Promise resolves to first directory `made` that had to be
+created, or `undefined` if everything already exists. Promise
+rejects if any errors are encountered. Note that, in the case of
+promise rejection, some directories _may_ have been created, as
+recursive directory creation is not an atomic operation.
+
+You can optionally pass in an alternate `fs` implementation by
+passing in `opts.fs`. Your implementation should have
+`opts.fs.mkdir(path, opts, cb)` and `opts.fs.stat(path, cb)`.
+
+You can also override just one or the other of `mkdir` and `stat`
+by passing in `opts.stat` or `opts.mkdir`, or providing an `fs`
+option that only overrides one of these.
+
+## `mkdirp.sync(dir: string, opts: MkdirpOptions) => string|undefined`
+
+Synchronously create a new directory and any necessary
+subdirectories at `dir` with octal permission string `opts.mode`.
+If `opts` is a string or number, it will be treated as the
+`opts.mode`.
+
+If `opts.mode` isn't specified, it defaults to `0o777`.
+
+Returns the first directory that had to be created, or undefined
+if everything already exists.
+
+You can optionally pass in an alternate `fs` implementation by
+passing in `opts.fs`. Your implementation should have
+`opts.fs.mkdirSync(path, mode)` and `opts.fs.statSync(path)`.
+
+You can also override just one or the other of `mkdirSync` and
+`statSync` by passing in `opts.statSync` or `opts.mkdirSync`, or
+providing an `fs` option that only overrides one of these.
+
+## `mkdirp.manual`, `mkdirp.manualSync`
+
+Use the manual implementation (not the native one). This is the
+default when the native implementation is not available or the
+stat/mkdir implementation is overridden.
+
+## `mkdirp.native`, `mkdirp.nativeSync`
+
+Use the native implementation (not the manual one). This is the
+default when the native implementation is available and
+stat/mkdir are not overridden.
+
+# implementation
+
+On Node.js v10.12.0 and above, use the native `fs.mkdir(p,
+{recursive:true})` option, unless `fs.mkdir`/`fs.mkdirSync` has
+been overridden by an option.
+
+## native implementation
+
+- If the path is a root directory, then pass it to the underlying
+  implementation and return the result/error. (In this case,
+  it'll either succeed or fail, but we aren't actually creating
+  any dirs.)
+- Walk up the path statting each directory, to find the first
+  path that will be created, `made`.
+- Call `fs.mkdir(path, { recursive: true })` (or `fs.mkdirSync`)
+- If error, raise it to the caller.
+- Return `made`.
+
+## manual implementation
+
+- Call underlying `fs.mkdir` implementation, with `recursive:
+false`
+- If error:
+  - If path is a root directory, raise to the caller and do not
+    handle it
+  - If ENOENT, mkdirp parent dir, store result as `made`
+  - stat(path)
+    - If error, raise original `mkdir` error
+    - If directory, return `made`
+    - Else, raise original `mkdir` error
+- else
+  - return `undefined` if a root dir, or `made` if set, or `path`
+
+## windows vs unix caveat
+
+On Windows file systems, attempts to create a root directory (ie,
+a drive letter or root UNC path) will fail. If the root
+directory exists, then it will fail with `EPERM`. If the root
+directory does not exist, then it will fail with `ENOENT`.
+
+On posix file systems, attempts to create a root directory (in
+recursive mode) will succeed silently, as it is treated like just
+another directory that already exists. (In non-recursive mode,
+of course, it fails with `EEXIST`.)
+
+In order to preserve this system-specific behavior (and because
+it's not as if we can create the parent of a root directory
+anyway), attempts to create a root directory are passed directly
+to the `fs` implementation, and any errors encountered are not
+handled.
+
+## native error caveat
+
+The native implementation (as of at least Node.js v13.4.0) does
+not provide appropriate errors in some cases (see
+[nodejs/node#31481](https://github.com/nodejs/node/issues/31481)
+and
+[nodejs/node#28015](https://github.com/nodejs/node/issues/28015)).
+
+In order to work around this issue, the native implementation
+will fall back to the manual implementation if an `ENOENT` error
+is encountered.
+
+# choosing a recursive mkdir implementation
+
+There are a few to choose from! Use the one that suits your
+needs best :D
+
+## use `fs.mkdir(path, {recursive: true}, cb)` if:
+
+- You wish to optimize performance even at the expense of other
+  factors.
+- You don't need to know the first dir created.
+- You are ok with getting `ENOENT` as the error when some other
+  problem is the actual cause.
+- You can limit your platforms to Node.js v10.12 and above.
+- You're ok with using callbacks instead of promises.
+- You don't need/want a CLI.
+- You don't need to override the `fs` methods in use.
+
+## use this module (mkdirp 1.x or 2.x) if:
+
+- You need to know the first directory that was created.
+- You wish to use the native implementation if available, but
+  fall back when it's not.
+- You prefer promise-returning APIs to callback-taking APIs.
+- You want more useful error messages than the native recursive
+  mkdir provides (at least as of Node.js v13.4), and are ok with
+  re-trying on `ENOENT` to achieve this.
+- You need (or at least, are ok with) a CLI.
+- You need to override the `fs` methods in use.
+
+## use [`make-dir`](http://npm.im/make-dir) if:
+
+- You do not need to know the first dir created (and wish to save
+  a few `stat` calls when using the native implementation for
+  this reason).
+- You wish to use the native implementation if available, but
+  fall back when it's not.
+- You prefer promise-returning APIs to callback-taking APIs.
+- You are ok with occasionally getting `ENOENT` errors for
+  failures that are actually related to something other than a
+  missing file system entry.
+- You don't need/want a CLI.
+- You need to override the `fs` methods in use.
+
+## use mkdirp 0.x if:
+
+- You need to know the first directory that was created.
+- You need (or at least, are ok with) a CLI.
+- You need to override the `fs` methods in use.
+- You're ok with using callbacks instead of promises.
+- You are not running on Windows, where the root-level ENOENT
+  errors can lead to infinite regress.
+- You think vinyl just sounds warmer and richer for some weird
+  reason.
+- You are supporting truly ancient Node.js versions, before even
+  the advent of a `Promise` language primitive. (Please don't.
+  You deserve better.)
+
+# cli
+
+This package also ships with a `mkdirp` command.
+
+```
+$ mkdirp -h
+
+usage: mkdirp [DIR1,DIR2..] {OPTIONS}
+
+  Create each supplied directory including any necessary parent directories
+  that don't yet exist.
+
+  If the directory already exists, do nothing.
+
+OPTIONS are:
+
+  -m       If a directory needs to be created, set the mode as an octal
+  --mode=  permission string.
+
+  -v --version   Print the mkdirp version number
+
+  -h --help      Print this helpful banner
+
+  -p --print     Print the first directories created for each path provided
+
+  --manual       Use manual implementation, even if native is available
+```
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install mkdirp
+```
+
+to get the library locally, or
+
+```
+npm install -g mkdirp
+```
+
+to get the command everywhere, or
+
+```
+npx mkdirp ...
+```
+
+to run the command without installing it globally.
+
+# platform support
+
+This module works on node v8, but only v10 and above are officially
+supported, as Node v8 reached its LTS end of life 2020-01-01, which is in
+the past, as of this writing.
+
+# license
+
+MIT
diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js
new file mode 100644
index 00000000..ea734fb7
--- /dev/null
+++ b/node_modules/ms/index.js
@@ -0,0 +1,162 @@
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var w = d * 7;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ *  - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function (val, options) {
+  options = options || {};
+  var type = typeof val;
+  if (type === 'string' && val.length > 0) {
+    return parse(val);
+  } else if (type === 'number' && isFinite(val)) {
+    return options.long ? fmtLong(val) : fmtShort(val);
+  }
+  throw new Error(
+    'val is not a non-empty string or a valid number. val=' +
+      JSON.stringify(val)
+  );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+  str = String(str);
+  if (str.length > 100) {
+    return;
+  }
+  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+    str
+  );
+  if (!match) {
+    return;
+  }
+  var n = parseFloat(match[1]);
+  var type = (match[2] || 'ms').toLowerCase();
+  switch (type) {
+    case 'years':
+    case 'year':
+    case 'yrs':
+    case 'yr':
+    case 'y':
+      return n * y;
+    case 'weeks':
+    case 'week':
+    case 'w':
+      return n * w;
+    case 'days':
+    case 'day':
+    case 'd':
+      return n * d;
+    case 'hours':
+    case 'hour':
+    case 'hrs':
+    case 'hr':
+    case 'h':
+      return n * h;
+    case 'minutes':
+    case 'minute':
+    case 'mins':
+    case 'min':
+    case 'm':
+      return n * m;
+    case 'seconds':
+    case 'second':
+    case 'secs':
+    case 'sec':
+    case 's':
+      return n * s;
+    case 'milliseconds':
+    case 'millisecond':
+    case 'msecs':
+    case 'msec':
+    case 'ms':
+      return n;
+    default:
+      return undefined;
+  }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+  var msAbs = Math.abs(ms);
+  if (msAbs >= d) {
+    return Math.round(ms / d) + 'd';
+  }
+  if (msAbs >= h) {
+    return Math.round(ms / h) + 'h';
+  }
+  if (msAbs >= m) {
+    return Math.round(ms / m) + 'm';
+  }
+  if (msAbs >= s) {
+    return Math.round(ms / s) + 's';
+  }
+  return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+  var msAbs = Math.abs(ms);
+  if (msAbs >= d) {
+    return plural(ms, msAbs, d, 'day');
+  }
+  if (msAbs >= h) {
+    return plural(ms, msAbs, h, 'hour');
+  }
+  if (msAbs >= m) {
+    return plural(ms, msAbs, m, 'minute');
+  }
+  if (msAbs >= s) {
+    return plural(ms, msAbs, s, 'second');
+  }
+  return ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, msAbs, n, name) {
+  var isPlural = msAbs >= n * 1.5;
+  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+}
diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md
new file mode 100644
index 00000000..fa5d39b6
--- /dev/null
+++ b/node_modules/ms/license.md
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2020 Vercel, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json
new file mode 100644
index 00000000..49971890
--- /dev/null
+++ b/node_modules/ms/package.json
@@ -0,0 +1,38 @@
+{
+  "name": "ms",
+  "version": "2.1.3",
+  "description": "Tiny millisecond conversion utility",
+  "repository": "vercel/ms",
+  "main": "./index",
+  "files": [
+    "index.js"
+  ],
+  "scripts": {
+    "precommit": "lint-staged",
+    "lint": "eslint lib/* bin/*",
+    "test": "mocha tests.js"
+  },
+  "eslintConfig": {
+    "extends": "eslint:recommended",
+    "env": {
+      "node": true,
+      "es6": true
+    }
+  },
+  "lint-staged": {
+    "*.js": [
+      "npm run lint",
+      "prettier --single-quote --write",
+      "git add"
+    ]
+  },
+  "license": "MIT",
+  "devDependencies": {
+    "eslint": "4.18.2",
+    "expect.js": "0.3.1",
+    "husky": "0.14.3",
+    "lint-staged": "5.0.0",
+    "mocha": "4.0.1",
+    "prettier": "2.0.5"
+  }
+}
diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md
new file mode 100644
index 00000000..0fc1abb3
--- /dev/null
+++ b/node_modules/ms/readme.md
@@ -0,0 +1,59 @@
+# ms
+
+![CI](https://github.com/vercel/ms/workflows/CI/badge.svg)
+
+Use this package to easily convert various time formats to milliseconds.
+
+## Examples
+
+```js
+ms('2 days')  // 172800000
+ms('1d')      // 86400000
+ms('10h')     // 36000000
+ms('2.5 hrs') // 9000000
+ms('2h')      // 7200000
+ms('1m')      // 60000
+ms('5s')      // 5000
+ms('1y')      // 31557600000
+ms('100')     // 100
+ms('-3 days') // -259200000
+ms('-1h')     // -3600000
+ms('-200')    // -200
+```
+
+### Convert from Milliseconds
+
+```js
+ms(60000)             // "1m"
+ms(2 * 60000)         // "2m"
+ms(-3 * 60000)        // "-3m"
+ms(ms('10 hours'))    // "10h"
+```
+
+### Time Format Written-Out
+
+```js
+ms(60000, { long: true })             // "1 minute"
+ms(2 * 60000, { long: true })         // "2 minutes"
+ms(-3 * 60000, { long: true })        // "-3 minutes"
+ms(ms('10 hours'), { long: true })    // "10 hours"
+```
+
+## Features
+
+- Works both in [Node.js](https://nodejs.org) and in the browser
+- If a number is supplied to `ms`, a string with a unit is returned
+- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
+- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
+
+## Related Packages
+
+- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
+
+## Caught a Bug?
+
+1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
+2. Link the package to the global module directory: `npm link`
+3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
+
+As always, you can run the tests using: `npm test`
diff --git a/node_modules/mz/HISTORY.md b/node_modules/mz/HISTORY.md
new file mode 100644
index 00000000..6ebee21d
--- /dev/null
+++ b/node_modules/mz/HISTORY.md
@@ -0,0 +1,66 @@
+
+2.7.0 / 2017-09-13
+==================
+
+  * feat: support fs.copyFile (#58)
+
+2.6.0 / 2016-11-22
+==================
+
+  * Added fdatasync to fs api (#46)
+
+2.5.0 / 2016-11-04
+==================
+
+  * feat: support fs.mkdtemp
+
+2.4.0 / 2016-03-23
+==================
+
+  * add `fs.truncate()` [#34](https://github.com/normalize/mz/pull/34)
+
+2.3.1 / 2016-02-01
+==================
+
+  * update `any-promise@v1`
+
+2.3.0 / 2016-01-30
+==================
+
+  * feat(package): switch to `any-promise` to support more promise engines
+
+2.2.0 / 2016-01-24
+==================
+
+  * feat(package): add index.js to files
+
+2.1.0 / 2015-10-15
+==================
+
+ * support for readline library
+
+2.0.0 / 2015-05-24
+==================
+
+ * support callbacks as well
+
+1.2.0 / 2014-12-16
+==================
+
+ * refactor promisification to `thenify` and `thenify-all`
+
+1.1.0 / 2014-11-14
+==================
+
+ * use `graceful-fs` if available
+
+1.0.1 / 2014-08-18
+==================
+
+ * don't use `bluebird.promisify()` - unnecessarily wraps runtime errors, causing issues
+
+1.0.0 / 2014-06-18
+==================
+
+ * use `bluebird` by default if found
+ * support node 0.8
diff --git a/node_modules/mz/LICENSE b/node_modules/mz/LICENSE
new file mode 100644
index 00000000..1835f3d9
--- /dev/null
+++ b/node_modules/mz/LICENSE
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/mz/README.md b/node_modules/mz/README.md
new file mode 100644
index 00000000..50d6557c
--- /dev/null
+++ b/node_modules/mz/README.md
@@ -0,0 +1,106 @@
+
+# MZ - Modernize node.js
+
+[![NPM version][npm-image]][npm-url]
+[![Build status][travis-image]][travis-url]
+[![Test coverage][coveralls-image]][coveralls-url]
+[![Dependency Status][david-image]][david-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+Modernize node.js to current ECMAScript specifications!
+node.js will not update their API to ES6+ [for a while](https://github.com/joyent/node/issues/7549).
+This library is a wrapper for various aspects of node.js' API.
+
+## Installation and Usage
+
+Set `mz` as a dependency and install it.
+
+```bash
+npm i mz
+```
+
+Then prefix the relevant `require()`s with `mz/`:
+
+```js
+var fs = require('mz/fs')
+
+fs.exists(__filename).then(function (exists) {
+  if (exists) // do something
+})
+```
+
+With ES2017, this will allow you to use async functions cleanly with node's core API:
+
+```js
+const fs = require('mz/fs')
+
+
+async function doSomething () {
+  if (await fs.exists(__filename)) // do something
+}
+```
+
+## Promisification
+
+Many node methods are converted into promises.
+Any properties that are deprecated or aren't asynchronous will simply be proxied.
+The modules wrapped are:
+
+- `child_process`
+- `crypto`
+- `dns`
+- `fs` (uses `graceful-fs` if available)
+- `readline`
+- `zlib`
+
+```js
+var exec = require('mz/child_process').exec
+
+exec('node --version').then(function (stdout) {
+  console.log(stdout)
+})
+```
+
+## Promise Engine
+
+`mz` uses [`any-promise`](https://github.com/kevinbeaty/any-promise).
+
+## FAQ
+
+### Can I use this in production?
+
+Yes, Node 4.x ships with stable promises support. For older engines,
+you should probably install your own promise implementation and register it with
+`require('any-promise/register')('bluebird')`.
+
+### Will this make my app faster?
+
+Nope, probably slower actually.
+
+### Can I add more features?
+
+Sure.
+Open an issue.
+
+Currently, the plans are to eventually support:
+
+- New APIs in node.js that are not available in older versions of node
+- ECMAScript7 Streams
+
+[bluebird]: https://github.com/petkaantonov/bluebird
+
+[npm-image]: https://img.shields.io/npm/v/mz.svg?style=flat-square
+[npm-url]: https://npmjs.org/package/mz
+[github-tag]: http://img.shields.io/github/tag/normalize/mz.svg?style=flat-square
+[github-url]: https://github.com/normalize/mz/tags
+[travis-image]: https://img.shields.io/travis/normalize/mz.svg?style=flat-square
+[travis-url]: https://travis-ci.org/normalize/mz
+[coveralls-image]: https://img.shields.io/coveralls/normalize/mz.svg?style=flat-square
+[coveralls-url]: https://coveralls.io/r/normalize/mz?branch=master
+[david-image]: http://img.shields.io/david/normalize/mz.svg?style=flat-square
+[david-url]: https://david-dm.org/normalize/mz
+[license-image]: http://img.shields.io/npm/l/mz.svg?style=flat-square
+[license-url]: LICENSE
+[downloads-image]: http://img.shields.io/npm/dm/mz.svg?style=flat-square
+[downloads-url]: https://npmjs.org/package/mz
diff --git a/node_modules/mz/child_process.js b/node_modules/mz/child_process.js
new file mode 100644
index 00000000..06d5d9e3
--- /dev/null
+++ b/node_modules/mz/child_process.js
@@ -0,0 +1,8 @@
+
+require('thenify-all').withCallback(
+  require('child_process'),
+  exports, [
+    'exec',
+    'execFile',
+  ]
+)
diff --git a/node_modules/mz/crypto.js b/node_modules/mz/crypto.js
new file mode 100644
index 00000000..d8cff57f
--- /dev/null
+++ b/node_modules/mz/crypto.js
@@ -0,0 +1,9 @@
+
+require('thenify-all').withCallback(
+  require('crypto'),
+  exports, [
+    'pbkdf2',
+    'pseudoRandomBytes',
+    'randomBytes'
+  ]
+)
diff --git a/node_modules/mz/dns.js b/node_modules/mz/dns.js
new file mode 100644
index 00000000..c1035822
--- /dev/null
+++ b/node_modules/mz/dns.js
@@ -0,0 +1,16 @@
+
+require('thenify-all').withCallback(
+  require('dns'),
+  exports, [
+    'lookup',
+    'resolve',
+    'resolve4',
+    'resolve6',
+    'resolveCname',
+    'resolveMx',
+    'resolveNs',
+    'resolveSrv',
+    'resolveTxt',
+    'reverse'
+  ]
+)
diff --git a/node_modules/mz/fs.js b/node_modules/mz/fs.js
new file mode 100644
index 00000000..1cfd2d77
--- /dev/null
+++ b/node_modules/mz/fs.js
@@ -0,0 +1,62 @@
+
+var Promise = require('any-promise')
+var fs
+try {
+  fs = require('graceful-fs')
+} catch(err) {
+  fs = require('fs')
+}
+
+var api = [
+  'appendFile',
+  'chmod',
+  'chown',
+  'close',
+  'fchmod',
+  'fchown',
+  'fdatasync',
+  'fstat',
+  'fsync',
+  'ftruncate',
+  'futimes',
+  'lchown',
+  'link',
+  'lstat',
+  'mkdir',
+  'open',
+  'read',
+  'readFile',
+  'readdir',
+  'readlink',
+  'realpath',
+  'rename',
+  'rmdir',
+  'stat',
+  'symlink',
+  'truncate',
+  'unlink',
+  'utimes',
+  'write',
+  'writeFile'
+]
+
+typeof fs.access === 'function' && api.push('access')
+typeof fs.copyFile === 'function' && api.push('copyFile')
+typeof fs.mkdtemp === 'function' && api.push('mkdtemp')
+
+require('thenify-all').withCallback(fs, exports, api)
+
+exports.exists = function (filename, callback) {
+  // callback
+  if (typeof callback === 'function') {
+    return fs.stat(filename, function (err) {
+      callback(null, !err);
+    })
+  }
+  // or promise
+  return new Promise(function (resolve) {
+    fs.stat(filename, function (err) {
+      resolve(!err)
+    })
+  })
+}
diff --git a/node_modules/mz/index.js b/node_modules/mz/index.js
new file mode 100644
index 00000000..cef508dc
--- /dev/null
+++ b/node_modules/mz/index.js
@@ -0,0 +1,8 @@
+module.exports = {
+  fs: require('./fs'),
+  dns: require('./dns'),
+  zlib: require('./zlib'),
+  crypto: require('./crypto'),
+  readline: require('./readline'),
+  child_process: require('./child_process')
+}
diff --git a/node_modules/mz/package.json b/node_modules/mz/package.json
new file mode 100644
index 00000000..de8d542c
--- /dev/null
+++ b/node_modules/mz/package.json
@@ -0,0 +1,44 @@
+{
+  "name": "mz",
+  "description": "modernize node.js to current ECMAScript standards",
+  "version": "2.7.0",
+  "author": {
+    "name": "Jonathan Ong",
+    "email": "me@jongleberry.com",
+    "url": "http://jongleberry.com",
+    "twitter": "https://twitter.com/jongleberry"
+  },
+  "license": "MIT",
+  "repository": "normalize/mz",
+  "dependencies": {
+    "any-promise": "^1.0.0",
+    "object-assign": "^4.0.1",
+    "thenify-all": "^1.0.0"
+  },
+  "devDependencies": {
+    "istanbul": "^0.4.0",
+    "bluebird": "^3.0.0",
+    "mocha": "^3.0.0"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
+  },
+  "keywords": [
+    "promisify",
+    "promise",
+    "thenify",
+    "then",
+    "es6"
+  ],
+  "files": [
+    "index.js",
+    "child_process.js",
+    "crypto.js",
+    "dns.js",
+    "fs.js",
+    "readline.js",
+    "zlib.js"
+  ]
+}
diff --git a/node_modules/mz/readline.js b/node_modules/mz/readline.js
new file mode 100644
index 00000000..eb70c46f
--- /dev/null
+++ b/node_modules/mz/readline.js
@@ -0,0 +1,64 @@
+var readline = require('readline')
+var Promise = require('any-promise')
+var objectAssign = require('object-assign')
+var Interface = readline.Interface
+
+function wrapCompleter (completer) {
+  if (completer.length === 2) return completer
+
+  return function (line, cb) {
+    var result = completer(line)
+
+    if (typeof result.then !== 'function') {
+      return cb(null, result)
+    }
+
+    result.catch(cb).then(function (result) {
+      process.nextTick(function () { cb(null, result) })
+    })
+  }
+}
+
+function InterfaceAsPromised (input, output, completer, terminal) {
+  if (arguments.length === 1) {
+    var options = input
+
+    if (typeof options.completer === 'function') {
+      options = objectAssign({}, options, {
+        completer: wrapCompleter(options.completer)
+      })
+    }
+
+    Interface.call(this, options)
+  } else {
+    if (typeof completer === 'function') {
+      completer = wrapCompleter(completer)
+    }
+
+    Interface.call(this, input, output, completer, terminal)
+  }
+}
+
+InterfaceAsPromised.prototype = Object.create(Interface.prototype)
+
+InterfaceAsPromised.prototype.question = function (question, callback) {
+  if (typeof callback === 'function') {
+    return Interface.prototype.question.call(this, question, callback)
+  }
+
+  var self = this
+  return new Promise(function (resolve) {
+    Interface.prototype.question.call(self, question, resolve)
+  })
+}
+
+objectAssign(exports, readline, {
+  Interface: InterfaceAsPromised,
+  createInterface: function (input, output, completer, terminal) {
+    if (arguments.length === 1) {
+      return new InterfaceAsPromised(input)
+    }
+
+    return new InterfaceAsPromised(input, output, completer, terminal)
+  }
+})
diff --git a/node_modules/mz/zlib.js b/node_modules/mz/zlib.js
new file mode 100644
index 00000000..a05c26a6
--- /dev/null
+++ b/node_modules/mz/zlib.js
@@ -0,0 +1,13 @@
+
+require('thenify-all').withCallback(
+  require('zlib'),
+  exports, [
+    'deflate',
+    'deflateRaw',
+    'gzip',
+    'gunzip',
+    'inflate',
+    'inflateRaw',
+    'unzip',
+  ]
+)
diff --git a/node_modules/no-case/LICENSE b/node_modules/no-case/LICENSE
new file mode 100644
index 00000000..983fbe8a
--- /dev/null
+++ b/node_modules/no-case/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/no-case/README.md b/node_modules/no-case/README.md
new file mode 100644
index 00000000..6ce3b81f
--- /dev/null
+++ b/node_modules/no-case/README.md
@@ -0,0 +1,37 @@
+# No Case
+
+[![NPM version][npm-image]][npm-url]
+[![NPM downloads][downloads-image]][downloads-url]
+[![Bundle size][bundlephobia-image]][bundlephobia-url]
+
+> Transform into a lower cased string with spaces between words.
+
+## Installation
+
+```
+npm install no-case --save
+```
+
+## Usage
+
+```js
+import { noCase } from "no-case";
+
+noCase("string"); //=> "string"
+noCase("dot.case"); //=> "dot case"
+noCase("PascalCase"); //=> "pascal case"
+noCase("version 1.2.10"); //=> "version 1 2 10"
+```
+
+The function also accepts [`options`](https://github.com/blakeembrey/change-case#options).
+
+## License
+
+MIT
+
+[npm-image]: https://img.shields.io/npm/v/no-case.svg?style=flat
+[npm-url]: https://npmjs.org/package/no-case
+[downloads-image]: https://img.shields.io/npm/dm/no-case.svg?style=flat
+[downloads-url]: https://npmjs.org/package/no-case
+[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/no-case.svg
+[bundlephobia-url]: https://bundlephobia.com/result?p=no-case
diff --git a/node_modules/no-case/dist.es2015/index.d.ts b/node_modules/no-case/dist.es2015/index.d.ts
new file mode 100644
index 00000000..4b24f804
--- /dev/null
+++ b/node_modules/no-case/dist.es2015/index.d.ts
@@ -0,0 +1,10 @@
+export interface Options {
+    splitRegexp?: RegExp | RegExp[];
+    stripRegexp?: RegExp | RegExp[];
+    delimiter?: string;
+    transform?: (part: string, index: number, parts: string[]) => string;
+}
+/**
+ * Normalize the string into something other libraries can manipulate easier.
+ */
+export declare function noCase(input: string, options?: Options): string;
diff --git a/node_modules/no-case/dist.es2015/index.js b/node_modules/no-case/dist.es2015/index.js
new file mode 100644
index 00000000..8aa0ce10
--- /dev/null
+++ b/node_modules/no-case/dist.es2015/index.js
@@ -0,0 +1,31 @@
+import { lowerCase } from "lower-case";
+// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
+var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
+// Remove all non-word characters.
+var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
+/**
+ * Normalize the string into something other libraries can manipulate easier.
+ */
+export function noCase(input, options) {
+    if (options === void 0) { options = {}; }
+    var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
+    var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
+    var start = 0;
+    var end = result.length;
+    // Trim the delimiter from around the output string.
+    while (result.charAt(start) === "\0")
+        start++;
+    while (result.charAt(end - 1) === "\0")
+        end--;
+    // Transform each token independently.
+    return result.slice(start, end).split("\0").map(transform).join(delimiter);
+}
+/**
+ * Replace `re` in the input string with the replacement value.
+ */
+function replace(input, re, value) {
+    if (re instanceof RegExp)
+        return input.replace(re, value);
+    return re.reduce(function (input, re) { return input.replace(re, value); }, input);
+}
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/no-case/dist.es2015/index.js.map b/node_modules/no-case/dist.es2015/index.js.map
new file mode 100644
index 00000000..fe9541f5
--- /dev/null
+++ b/node_modules/no-case/dist.es2015/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.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AM;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,EAAE,CAAC,MAAM,CAAC,UAAC,KAAK,EAAE,EAAE,IAAK,OAAA,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,EAAxB,CAAwB,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import { lowerCase } from \"lower-case\";\n\nexport interface Options {\n  splitRegexp?: RegExp | RegExp[];\n  stripRegexp?: RegExp | RegExp[];\n  delimiter?: string;\n  transform?: (part: string, index: number, parts: string[]) => string;\n}\n\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nconst DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n\n// Remove all non-word characters.\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input: string, options: Options = {}) {\n  const {\n    splitRegexp = DEFAULT_SPLIT_REGEXP,\n    stripRegexp = DEFAULT_STRIP_REGEXP,\n    transform = lowerCase,\n    delimiter = \" \",\n  } = options;\n\n  let result = replace(\n    replace(input, splitRegexp, \"$1\\0$2\"),\n    stripRegexp,\n    \"\\0\"\n  );\n  let start = 0;\n  let end = result.length;\n\n  // Trim the delimiter from around the output string.\n  while (result.charAt(start) === \"\\0\") start++;\n  while (result.charAt(end - 1) === \"\\0\") end--;\n\n  // Transform each token independently.\n  return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input: string, re: RegExp | RegExp[], value: string) {\n  if (re instanceof RegExp) return input.replace(re, value);\n  return re.reduce((input, re) => input.replace(re, value), input);\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/no-case/dist.es2015/index.spec.d.ts b/node_modules/no-case/dist.es2015/index.spec.d.ts
new file mode 100644
index 00000000..cb0ff5c3
--- /dev/null
+++ b/node_modules/no-case/dist.es2015/index.spec.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/no-case/dist.es2015/index.spec.js b/node_modules/no-case/dist.es2015/index.spec.js
new file mode 100644
index 00000000..5fd9b15c
--- /dev/null
+++ b/node_modules/no-case/dist.es2015/index.spec.js
@@ -0,0 +1,57 @@
+import { noCase } from ".";
+var TEST_CASES = [
+    // Single words.
+    ["test", "test"],
+    ["TEST", "test"],
+    // Camel case.
+    ["testString", "test string"],
+    ["testString123", "test string123"],
+    ["testString_1_2_3", "test string 1 2 3"],
+    ["x_256", "x 256"],
+    ["anHTMLTag", "an html tag"],
+    ["ID123String", "id123 string"],
+    ["Id123String", "id123 string"],
+    ["foo bar123", "foo bar123"],
+    ["a1bStar", "a1b star"],
+    // Constant case.
+    ["CONSTANT_CASE ", "constant case"],
+    ["CONST123_FOO", "const123 foo"],
+    // Random cases.
+    ["FOO_bar", "foo bar"],
+    ["XMLHttpRequest", "xml http request"],
+    ["IQueryAArgs", "i query a args"],
+    // Non-alphanumeric separators.
+    ["dot.case", "dot case"],
+    ["path/case", "path case"],
+    ["snake_case", "snake case"],
+    ["snake_case123", "snake case123"],
+    ["snake_case_123", "snake case 123"],
+    // Punctuation.
+    ['"quotes"', "quotes"],
+    // Space between number parts.
+    ["version 0.45.0", "version 0 45 0"],
+    ["version 0..78..9", "version 0 78 9"],
+    ["version 4_99/4", "version 4 99 4"],
+    // Whitespace.
+    ["  test  ", "test"],
+    // Number string input.
+    ["something_2014_other", "something 2014 other"],
+    // https://github.com/blakeembrey/change-case/issues/21
+    ["amazon s3 data", "amazon s3 data"],
+    ["foo_13_bar", "foo 13 bar"],
+    // Customization.
+    ["camel2019", "camel 2019", { splitRegexp: /([a-z])([A-Z0-9])/g }],
+    ["minifyURLs", "minify urls", { splitRegexp: /([a-z])([A-Z0-9])/g }],
+];
+describe("no case", function () {
+    var _loop_1 = function (input, result, options) {
+        it(input + " -> " + result, function () {
+            expect(noCase(input, options)).toEqual(result);
+        });
+    };
+    for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) {
+        var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1], options = _a[2];
+        _loop_1(input, result, options);
+    }
+});
+//# sourceMappingURL=index.spec.js.map
\ No newline at end of file
diff --git a/node_modules/no-case/dist.es2015/index.spec.js.map b/node_modules/no-case/dist.es2015/index.spec.js.map
new file mode 100644
index 00000000..d0325524
--- /dev/null
+++ b/node_modules/no-case/dist.es2015/index.spec.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,GAAG,CAAC;AAEpC,IAAM,UAAU,GAAiC;IAC/C,gBAAgB;IAChB,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,MAAM,EAAE,MAAM,CAAC;IAEhB,cAAc;IACd,CAAC,YAAY,EAAE,aAAa,CAAC;IAC7B,CAAC,eAAe,EAAE,gBAAgB,CAAC;IACnC,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IACzC,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,WAAW,EAAE,aAAa,CAAC;IAC5B,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,YAAY,EAAE,YAAY,CAAC;IAC5B,CAAC,SAAS,EAAE,UAAU,CAAC;IAEvB,iBAAiB;IACjB,CAAC,gBAAgB,EAAE,eAAe,CAAC;IACnC,CAAC,cAAc,EAAE,cAAc,CAAC;IAEhC,gBAAgB;IAChB,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;IACtC,CAAC,aAAa,EAAE,gBAAgB,CAAC;IAEjC,+BAA+B;IAC/B,CAAC,UAAU,EAAE,UAAU,CA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", \"test\"],\n  [\"TEST\", \"test\"],\n\n  // Camel case.\n  [\"testString\", \"test string\"],\n  [\"testString123\", \"test string123\"],\n  [\"testString_1_2_3\", \"test string 1 2 3\"],\n  [\"x_256\", \"x 256\"],\n  [\"anHTMLTag\", \"an html tag\"],\n  [\"ID123String\", \"id123 string\"],\n  [\"Id123String\", \"id123 string\"],\n  [\"foo bar123\", \"foo bar123\"],\n  [\"a1bStar\", \"a1b star\"],\n\n  // Constant case.\n  [\"CONSTANT_CASE \", \"constant case\"],\n  [\"CONST123_FOO\", \"const123 foo\"],\n\n  // Random cases.\n  [\"FOO_bar\", \"foo bar\"],\n  [\"XMLHttpRequest\", \"xml http request\"],\n  [\"IQueryAArgs\", \"i query a args\"],\n\n  // Non-alphanumeric separators.\n  [\"dot.case\", \"dot case\"],\n  [\"path/case\", \"path case\"],\n  [\"snake_case\", \"snake case\"],\n  [\"snake_case123\", \"snake case123\"],\n  [\"snake_case_123\", \"snake case 123\"],\n\n  // Punctuation.\n  ['\"quotes\"', \"quotes\"],\n\n  // Space between number parts.\n  [\"version 0.45.0\", \"version 0 45 0\"],\n  [\"version 0..78..9\", \"version 0 78 9\"],\n  [\"version 4_99/4\", \"version 4 99 4\"],\n\n  // Whitespace.\n  [\"  test  \", \"test\"],\n\n  // Number string input.\n  [\"something_2014_other\", \"something 2014 other\"],\n\n  // https://github.com/blakeembrey/change-case/issues/21\n  [\"amazon s3 data\", \"amazon s3 data\"],\n  [\"foo_13_bar\", \"foo 13 bar\"],\n\n  // Customization.\n  [\"camel2019\", \"camel 2019\", { splitRegexp: /([a-z])([A-Z0-9])/g }],\n  [\"minifyURLs\", \"minify urls\", { splitRegexp: /([a-z])([A-Z0-9])/g }],\n];\n\ndescribe(\"no case\", () => {\n  for (const [input, result, options] of TEST_CASES) {\n    it(`${input} -> ${result}`, () => {\n      expect(noCase(input, options)).toEqual(result);\n    });\n  }\n});\n"]}
\ No newline at end of file
diff --git a/node_modules/no-case/dist/index.d.ts b/node_modules/no-case/dist/index.d.ts
new file mode 100644
index 00000000..4b24f804
--- /dev/null
+++ b/node_modules/no-case/dist/index.d.ts
@@ -0,0 +1,10 @@
+export interface Options {
+    splitRegexp?: RegExp | RegExp[];
+    stripRegexp?: RegExp | RegExp[];
+    delimiter?: string;
+    transform?: (part: string, index: number, parts: string[]) => string;
+}
+/**
+ * Normalize the string into something other libraries can manipulate easier.
+ */
+export declare function noCase(input: string, options?: Options): string;
diff --git a/node_modules/no-case/dist/index.js b/node_modules/no-case/dist/index.js
new file mode 100644
index 00000000..0adeaf43
--- /dev/null
+++ b/node_modules/no-case/dist/index.js
@@ -0,0 +1,35 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.noCase = void 0;
+var lower_case_1 = require("lower-case");
+// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
+var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
+// Remove all non-word characters.
+var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
+/**
+ * Normalize the string into something other libraries can manipulate easier.
+ */
+function noCase(input, options) {
+    if (options === void 0) { options = {}; }
+    var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lower_case_1.lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
+    var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
+    var start = 0;
+    var end = result.length;
+    // Trim the delimiter from around the output string.
+    while (result.charAt(start) === "\0")
+        start++;
+    while (result.charAt(end - 1) === "\0")
+        end--;
+    // Transform each token independently.
+    return result.slice(start, end).split("\0").map(transform).join(delimiter);
+}
+exports.noCase = noCase;
+/**
+ * Replace `re` in the input string with the replacement value.
+ */
+function replace(input, re, value) {
+    if (re instanceof RegExp)
+        return input.replace(re, value);
+    return re.reduce(function (input, re) { return input.replace(re, value); }, input);
+}
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/no-case/dist/index.js.map b/node_modules/no-case/dist/index.js.map
new file mode 100644
index 00000000..493a884e
--- /dev/null
+++ b/node_modules/no-case/dist/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AASvC,oFAAoF;AACpF,IAAM,oBAAoB,GAAG,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;AAE5E,kCAAkC;AAClC,IAAM,oBAAoB,GAAG,cAAc,CAAC;AAE5C;;GAEG;AACH,SAAgB,MAAM,CAAC,KAAa,EAAE,OAAqB;IAArB,wBAAA,EAAA,YAAqB;IAEvD,IAAA,KAIE,OAAO,YAJyB,EAAlC,WAAW,mBAAG,oBAAoB,KAAA,EAClC,KAGE,OAAO,YAHyB,EAAlC,WAAW,mBAAG,oBAAoB,KAAA,EAClC,KAEE,OAAO,UAFY,EAArB,SAAS,mBAAG,sBAAS,KAAA,EACrB,KACE,OAAO,UADM,EAAf,SAAS,mBAAG,GAAG,KAAA,CACL;IAEZ,IAAI,MAAM,GAAG,OAAO,CAClB,OAAO,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EACrC,WAAW,EACX,IAAI,CACL,CAAC;IACF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;IAExB,oDAAoD;IACpD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI;QAAE,KAAK,EAAE,CAAC;IAC9C,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI;QAAE,GAAG,EAAE,CAAC;IAE9C,sCAAsC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC7E,CAAC;AAtBD,wBAsBC;AAED;;GAEG;AACH,SAAS,OAAO,CAAC,KAAa,EAAE,EAAqB,EAAE,KAAa;IAClE,IAAI,EAAE,YAAY,MAAM;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1D,OAAO,EAAE,CAAC,MAAM,CAAC,UAAC,KAAK,EAAE,EAAE,IAAK,OAAA,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,EAAxB,CAAwB,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import { lowerCase } from \"lower-case\";\n\nexport interface Options {\n  splitRegexp?: RegExp | RegExp[];\n  stripRegexp?: RegExp | RegExp[];\n  delimiter?: string;\n  transform?: (part: string, index: number, parts: string[]) => string;\n}\n\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nconst DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n\n// Remove all non-word characters.\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input: string, options: Options = {}) {\n  const {\n    splitRegexp = DEFAULT_SPLIT_REGEXP,\n    stripRegexp = DEFAULT_STRIP_REGEXP,\n    transform = lowerCase,\n    delimiter = \" \",\n  } = options;\n\n  let result = replace(\n    replace(input, splitRegexp, \"$1\\0$2\"),\n    stripRegexp,\n    \"\\0\"\n  );\n  let start = 0;\n  let end = result.length;\n\n  // Trim the delimiter from around the output string.\n  while (result.charAt(start) === \"\\0\") start++;\n  while (result.charAt(end - 1) === \"\\0\") end--;\n\n  // Transform each token independently.\n  return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input: string, re: RegExp | RegExp[], value: string) {\n  if (re instanceof RegExp) return input.replace(re, value);\n  return re.reduce((input, re) => input.replace(re, value), input);\n}\n"]}
\ No newline at end of file
diff --git a/node_modules/no-case/dist/index.spec.d.ts b/node_modules/no-case/dist/index.spec.d.ts
new file mode 100644
index 00000000..cb0ff5c3
--- /dev/null
+++ b/node_modules/no-case/dist/index.spec.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/no-case/dist/index.spec.js b/node_modules/no-case/dist/index.spec.js
new file mode 100644
index 00000000..199432c2
--- /dev/null
+++ b/node_modules/no-case/dist/index.spec.js
@@ -0,0 +1,59 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var _1 = require(".");
+var TEST_CASES = [
+    // Single words.
+    ["test", "test"],
+    ["TEST", "test"],
+    // Camel case.
+    ["testString", "test string"],
+    ["testString123", "test string123"],
+    ["testString_1_2_3", "test string 1 2 3"],
+    ["x_256", "x 256"],
+    ["anHTMLTag", "an html tag"],
+    ["ID123String", "id123 string"],
+    ["Id123String", "id123 string"],
+    ["foo bar123", "foo bar123"],
+    ["a1bStar", "a1b star"],
+    // Constant case.
+    ["CONSTANT_CASE ", "constant case"],
+    ["CONST123_FOO", "const123 foo"],
+    // Random cases.
+    ["FOO_bar", "foo bar"],
+    ["XMLHttpRequest", "xml http request"],
+    ["IQueryAArgs", "i query a args"],
+    // Non-alphanumeric separators.
+    ["dot.case", "dot case"],
+    ["path/case", "path case"],
+    ["snake_case", "snake case"],
+    ["snake_case123", "snake case123"],
+    ["snake_case_123", "snake case 123"],
+    // Punctuation.
+    ['"quotes"', "quotes"],
+    // Space between number parts.
+    ["version 0.45.0", "version 0 45 0"],
+    ["version 0..78..9", "version 0 78 9"],
+    ["version 4_99/4", "version 4 99 4"],
+    // Whitespace.
+    ["  test  ", "test"],
+    // Number string input.
+    ["something_2014_other", "something 2014 other"],
+    // https://github.com/blakeembrey/change-case/issues/21
+    ["amazon s3 data", "amazon s3 data"],
+    ["foo_13_bar", "foo 13 bar"],
+    // Customization.
+    ["camel2019", "camel 2019", { splitRegexp: /([a-z])([A-Z0-9])/g }],
+    ["minifyURLs", "minify urls", { splitRegexp: /([a-z])([A-Z0-9])/g }],
+];
+describe("no case", function () {
+    var _loop_1 = function (input, result, options) {
+        it(input + " -> " + result, function () {
+            expect(_1.noCase(input, options)).toEqual(result);
+        });
+    };
+    for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) {
+        var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1], options = _a[2];
+        _loop_1(input, result, options);
+    }
+});
+//# sourceMappingURL=index.spec.js.map
\ No newline at end of file
diff --git a/node_modules/no-case/dist/index.spec.js.map b/node_modules/no-case/dist/index.spec.js.map
new file mode 100644
index 00000000..1a0d9574
--- /dev/null
+++ b/node_modules/no-case/dist/index.spec.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;AAAA,sBAAoC;AAEpC,IAAM,UAAU,GAAiC;IAC/C,gBAAgB;IAChB,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,MAAM,EAAE,MAAM,CAAC;IAEhB,cAAc;IACd,CAAC,YAAY,EAAE,aAAa,CAAC;IAC7B,CAAC,eAAe,EAAE,gBAAgB,CAAC;IACnC,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IACzC,CAAC,OAAO,EAAE,OAAO,CAAC;IAClB,CAAC,WAAW,EAAE,aAAa,CAAC;IAC5B,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,aAAa,EAAE,cAAc,CAAC;IAC/B,CAAC,YAAY,EAAE,YAAY,CAAC;IAC5B,CAAC,SAAS,EAAE,UAAU,CAAC;IAEvB,iBAAiB;IACjB,CAAC,gBAAgB,EAAE,eAAe,CAAC;IACnC,CAAC,cAAc,EAAE,cAAc,CAAC;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AAE,MAAM,QAAA,EAAE,OAAO,QAAA;gBAAtB,KAAK,EAAE,MAAM,EAAE,OAAO;KAIjC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { noCase, Options } from \".\";\n\nconst TEST_CASES: [string, string, Options?][] = [\n  // Single words.\n  [\"test\", \"test\"],\n  [\"TEST\", \"test\"],\n\n  // Camel case.\n  [\"testString\", \"test string\"],\n  [\"testString123\", \"test string123\"],\n  [\"testString_1_2_3\", \"test string 1 2 3\"],\n  [\"x_256\", \"x 256\"],\n  [\"anHTMLTag\", \"an html tag\"],\n  [\"ID123String\", \"id123 string\"],\n  [\"Id123String\", \"id123 string\"],\n  [\"foo bar123\", \"foo bar123\"],\n  [\"a1bStar\", \"a1b star\"],\n\n  // Constant case.\n  [\"CONSTANT_CASE \", \"constant case\"],\n  [\"CONST123_FOO\", \"const123 foo\"],\n\n  // Random cases.\n  [\"FOO_bar\", \"foo bar\"],\n  [\"XMLHttpRequest\", \"xml http request\"],\n  [\"IQueryAArgs\", \"i query a args\"],\n\n  // Non-alphanumeric separators.\n  [\"dot.case\", \"dot case\"],\n  [\"path/case\", \"path case\"],\n  [\"snake_case\", \"snake case\"],\n  [\"snake_case123\", \"snake case123\"],\n  [\"snake_case_123\", \"snake case 123\"],\n\n  // Punctuation.\n  ['\"quotes\"', \"quotes\"],\n\n  // Space between number parts.\n  [\"version 0.45.0\", \"version 0 45 0\"],\n  [\"version 0..78..9\", \"version 0 78 9\"],\n  [\"version 4_99/4\", \"version 4 99 4\"],\n\n  // Whitespace.\n  [\"  test  \", \"test\"],\n\n  // Number string input.\n  [\"something_2014_other\", \"something 2014 other\"],\n\n  // https://github.com/blakeembrey/change-case/issues/21\n  [\"amazon s3 data\", \"amazon s3 data\"],\n  [\"foo_13_bar\", \"foo 13 bar\"],\n\n  // Customization.\n  [\"camel2019\", \"camel 2019\", { splitRegexp: /([a-z])([A-Z0-9])/g }],\n  [\"minifyURLs\", \"minify urls\", { splitRegexp: /([a-z])([A-Z0-9])/g }],\n];\n\ndescribe(\"no case\", () => {\n  for (const [input, result, options] of TEST_CASES) {\n    it(`${input} -> ${result}`, () => {\n      expect(noCase(input, options)).toEqual(result);\n    });\n  }\n});\n"]}
\ No newline at end of file
diff --git a/node_modules/no-case/package.json b/node_modules/no-case/package.json
new file mode 100644
index 00000000..b2a4d67c
--- /dev/null
+++ b/node_modules/no-case/package.json
@@ -0,0 +1,85 @@
+{
+  "name": "no-case",
+  "version": "3.0.4",
+  "description": "Transform into a lower cased string with spaces between words",
+  "main": "dist/index.js",
+  "typings": "dist/index.d.ts",
+  "module": "dist.es2015/index.js",
+  "sideEffects": false,
+  "jsnext:main": "dist.es2015/index.js",
+  "files": [
+    "dist/",
+    "dist.es2015/",
+    "LICENSE"
+  ],
+  "scripts": {
+    "lint": "tslint \"src/**/*\" --project tsconfig.json",
+    "build": "rimraf dist/ dist.es2015/ && tsc && tsc -P tsconfig.es2015.json",
+    "specs": "jest --coverage",
+    "test": "npm run build && npm run lint && npm run specs",
+    "size": "size-limit",
+    "prepare": "npm run build"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/blakeembrey/change-case.git"
+  },
+  "keywords": [
+    "no",
+    "case",
+    "space",
+    "lower",
+    "convert",
+    "transform"
+  ],
+  "author": {
+    "name": "Blake Embrey",
+    "email": "hello@blakeembrey.com",
+    "url": "http://blakeembrey.me"
+  },
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/blakeembrey/change-case/issues"
+  },
+  "homepage": "https://github.com/blakeembrey/change-case/tree/master/packages/no-case#readme",
+  "size-limit": [
+    {
+      "path": "dist/index.js",
+      "limit": "550 B"
+    }
+  ],
+  "jest": {
+    "roots": [
+      "/src/"
+    ],
+    "transform": {
+      "\\.tsx?$": "ts-jest"
+    },
+    "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
+    "moduleFileExtensions": [
+      "ts",
+      "tsx",
+      "js",
+      "jsx",
+      "json",
+      "node"
+    ]
+  },
+  "dependencies": {
+    "lower-case": "^2.0.2",
+    "tslib": "^2.0.3"
+  },
+  "devDependencies": {
+    "@size-limit/preset-small-lib": "^2.2.1",
+    "@types/jest": "^24.0.23",
+    "@types/node": "^12.12.14",
+    "jest": "^24.9.0",
+    "rimraf": "^3.0.0",
+    "ts-jest": "^24.2.0",
+    "tslint": "^5.20.1",
+    "tslint-config-prettier": "^1.18.0",
+    "tslint-config-standard": "^9.0.0",
+    "typescript": "^4.1.2"
+  },
+  "gitHead": "76a21a7f6f2a226521ef6abd345ff309cbd01fb0"
+}
diff --git a/node_modules/normalize-package-data/LICENSE b/node_modules/normalize-package-data/LICENSE
new file mode 100644
index 00000000..19d1364a
--- /dev/null
+++ b/node_modules/normalize-package-data/LICENSE
@@ -0,0 +1,15 @@
+This package contains code originally written by Isaac Z. Schlueter.
+Used with permission.
+
+Copyright (c) Meryn Stol ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/normalize-package-data/README.md b/node_modules/normalize-package-data/README.md
new file mode 100644
index 00000000..58cbbcae
--- /dev/null
+++ b/node_modules/normalize-package-data/README.md
@@ -0,0 +1,108 @@
+# normalize-package-data
+
+[![Build Status](https://img.shields.io/github/actions/workflow/status/npm/normalize-package-data/ci.yml?branch=main)](https://github.com/npm/normalize-package-data)
+
+normalize-package-data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.
+
+normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.
+
+## Installation
+
+```
+npm install normalize-package-data
+```
+
+## Usage
+
+Basic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.
+
+```javascript
+normalizeData = require('normalize-package-data')
+packageData = require("./package.json")
+normalizeData(packageData)
+// packageData is now normalized
+```
+
+#### Strict mode
+
+You may activate strict validation by passing true as the second argument.
+
+```javascript
+normalizeData = require('normalize-package-data')
+packageData = require("./package.json")
+normalizeData(packageData, true)
+// packageData is now normalized
+```
+
+If strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace.
+
+#### Warnings
+
+Optionally, you may pass a "warning" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data.
+
+```javascript
+normalizeData = require('normalize-package-data')
+packageData = require("./package.json")
+warnFn = function(msg) { console.error(msg) }
+normalizeData(packageData, warnFn)
+// packageData is now normalized. Any number of warnings may have been logged.
+```
+
+You may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third.
+
+When `private` field is set to `true`, warnings will be suppressed.
+
+### Potential exceptions
+
+If the supplied data has an invalid name or version field, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.
+
+## What normalization (currently) entails
+
+* The value of `name` field gets trimmed (unless in strict mode).
+* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).
+* If `name` and/or `version` fields are missing, they are set to empty strings.
+* If `files` field is not an array, it will be removed.
+* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.
+* If `man` field is a string, it will become an array with the original string as its sole member.
+* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\s+`.
+* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.
+* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.
+* If the value of any of the dependencies fields  (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.
+* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.
+* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved.
+* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shortcut was previously expanded to a URL.
+* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.
+* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`.
+* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to git+https://github.com/[owner-name]/[repo-name].git
+* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.
+* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.
+* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.
+* If `homepage` field is not a string, it will be removed.
+* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.
+* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]#readme . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.
+
+### Rules for name field
+
+If `name` field is given, the value of the name field must be a string. The string may not:
+
+* start with a period.
+* contain the following characters: `/@\s+%`
+* contain any characters that would need to be encoded for use in urls.
+* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).
+
+### Rules for version field
+
+If `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).
+
+### Rules for license field
+
+The `license`/`licence` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/package/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license).
+
+## Credits
+
+This package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permission.
+
+## License
+
+normalize-package-data is released under the [BSD 2-Clause License](https://opensource.org/licenses/BSD-2-Clause).
+Copyright (c) 2013 Meryn Stol
diff --git a/node_modules/normalize-package-data/lib/extract_description.js b/node_modules/normalize-package-data/lib/extract_description.js
new file mode 100644
index 00000000..631966b5
--- /dev/null
+++ b/node_modules/normalize-package-data/lib/extract_description.js
@@ -0,0 +1,24 @@
+module.exports = extractDescription
+
+// Extracts description from contents of a readme file in markdown format
+function extractDescription (d) {
+  if (!d) {
+    return
+  }
+  if (d === 'ERROR: No README data found!') {
+    return
+  }
+  // the first block of text before the first heading
+  // that isn't the first line heading
+  d = d.trim().split('\n')
+  let s = 0
+  while (d[s] && d[s].trim().match(/^(#|$)/)) {
+    s++
+  }
+  const l = d.length
+  let e = s + 1
+  while (e < l && d[e].trim()) {
+    e++
+  }
+  return d.slice(s, e).join(' ').trim()
+}
diff --git a/node_modules/normalize-package-data/lib/fixer.js b/node_modules/normalize-package-data/lib/fixer.js
new file mode 100644
index 00000000..49b97f5e
--- /dev/null
+++ b/node_modules/normalize-package-data/lib/fixer.js
@@ -0,0 +1,472 @@
+var { URL } = require('node:url')
+var isValidSemver = require('semver/functions/valid')
+var cleanSemver = require('semver/functions/clean')
+var validateLicense = require('validate-npm-package-license')
+var hostedGitInfo = require('hosted-git-info')
+var { isBuiltin } = require('node:module')
+var depTypes = ['dependencies', 'devDependencies', 'optionalDependencies']
+var extractDescription = require('./extract_description')
+var typos = require('./typos.json')
+
+var isEmail = str => str.includes('@') && (str.indexOf('@') < str.lastIndexOf('.'))
+
+module.exports = {
+  // default warning function
+  warn: function () {},
+
+  fixRepositoryField: function (data) {
+    if (data.repositories) {
+      this.warn('repositories')
+      data.repository = data.repositories[0]
+    }
+    if (!data.repository) {
+      return this.warn('missingRepository')
+    }
+    if (typeof data.repository === 'string') {
+      data.repository = {
+        type: 'git',
+        url: data.repository,
+      }
+    }
+    var r = data.repository.url || ''
+    if (r) {
+      var hosted = hostedGitInfo.fromUrl(r)
+      if (hosted) {
+        r = data.repository.url
+          = hosted.getDefaultRepresentation() === 'shortcut' ? hosted.https() : hosted.toString()
+      }
+    }
+
+    if (r.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)) {
+      this.warn('brokenGitUrl', r)
+    }
+  },
+
+  fixTypos: function (data) {
+    Object.keys(typos.topLevel).forEach(function (d) {
+      if (Object.prototype.hasOwnProperty.call(data, d)) {
+        this.warn('typo', d, typos.topLevel[d])
+      }
+    }, this)
+  },
+
+  fixScriptsField: function (data) {
+    if (!data.scripts) {
+      return
+    }
+    if (typeof data.scripts !== 'object') {
+      this.warn('nonObjectScripts')
+      delete data.scripts
+      return
+    }
+    Object.keys(data.scripts).forEach(function (k) {
+      if (typeof data.scripts[k] !== 'string') {
+        this.warn('nonStringScript')
+        delete data.scripts[k]
+      } else if (typos.script[k] && !data.scripts[typos.script[k]]) {
+        this.warn('typo', k, typos.script[k], 'scripts')
+      }
+    }, this)
+  },
+
+  fixFilesField: function (data) {
+    var files = data.files
+    if (files && !Array.isArray(files)) {
+      this.warn('nonArrayFiles')
+      delete data.files
+    } else if (data.files) {
+      data.files = data.files.filter(function (file) {
+        if (!file || typeof file !== 'string') {
+          this.warn('invalidFilename', file)
+          return false
+        } else {
+          return true
+        }
+      }, this)
+    }
+  },
+
+  fixBinField: function (data) {
+    if (!data.bin) {
+      return
+    }
+    if (typeof data.bin === 'string') {
+      var b = {}
+      var match
+      if (match = data.name.match(/^@[^/]+[/](.*)$/)) {
+        b[match[1]] = data.bin
+      } else {
+        b[data.name] = data.bin
+      }
+      data.bin = b
+    }
+  },
+
+  fixManField: function (data) {
+    if (!data.man) {
+      return
+    }
+    if (typeof data.man === 'string') {
+      data.man = [data.man]
+    }
+  },
+  fixBundleDependenciesField: function (data) {
+    var bdd = 'bundledDependencies'
+    var bd = 'bundleDependencies'
+    if (data[bdd] && !data[bd]) {
+      data[bd] = data[bdd]
+      delete data[bdd]
+    }
+    if (data[bd] && !Array.isArray(data[bd])) {
+      this.warn('nonArrayBundleDependencies')
+      delete data[bd]
+    } else if (data[bd]) {
+      data[bd] = data[bd].filter(function (filtered) {
+        if (!filtered || typeof filtered !== 'string') {
+          this.warn('nonStringBundleDependency', filtered)
+          return false
+        } else {
+          if (!data.dependencies) {
+            data.dependencies = {}
+          }
+          if (!Object.prototype.hasOwnProperty.call(data.dependencies, filtered)) {
+            this.warn('nonDependencyBundleDependency', filtered)
+            data.dependencies[filtered] = '*'
+          }
+          return true
+        }
+      }, this)
+    }
+  },
+
+  fixDependencies: function (data) {
+    objectifyDeps(data, this.warn)
+    addOptionalDepsToDeps(data, this.warn)
+    this.fixBundleDependenciesField(data)
+
+    ;['dependencies', 'devDependencies'].forEach(function (deps) {
+      if (!(deps in data)) {
+        return
+      }
+      if (!data[deps] || typeof data[deps] !== 'object') {
+        this.warn('nonObjectDependencies', deps)
+        delete data[deps]
+        return
+      }
+      Object.keys(data[deps]).forEach(function (d) {
+        var r = data[deps][d]
+        if (typeof r !== 'string') {
+          this.warn('nonStringDependency', d, JSON.stringify(r))
+          delete data[deps][d]
+        }
+        var hosted = hostedGitInfo.fromUrl(data[deps][d])
+        if (hosted) {
+          data[deps][d] = hosted.toString()
+        }
+      }, this)
+    }, this)
+  },
+
+  fixModulesField: function (data) {
+    if (data.modules) {
+      this.warn('deprecatedModules')
+      delete data.modules
+    }
+  },
+
+  fixKeywordsField: function (data) {
+    if (typeof data.keywords === 'string') {
+      data.keywords = data.keywords.split(/,\s+/)
+    }
+    if (data.keywords && !Array.isArray(data.keywords)) {
+      delete data.keywords
+      this.warn('nonArrayKeywords')
+    } else if (data.keywords) {
+      data.keywords = data.keywords.filter(function (kw) {
+        if (typeof kw !== 'string' || !kw) {
+          this.warn('nonStringKeyword')
+          return false
+        } else {
+          return true
+        }
+      }, this)
+    }
+  },
+
+  fixVersionField: function (data, strict) {
+    // allow "loose" semver 1.0 versions in non-strict mode
+    // enforce strict semver 2.0 compliance in strict mode
+    var loose = !strict
+    if (!data.version) {
+      data.version = ''
+      return true
+    }
+    if (!isValidSemver(data.version, loose)) {
+      throw new Error('Invalid version: "' + data.version + '"')
+    }
+    data.version = cleanSemver(data.version, loose)
+    return true
+  },
+
+  fixPeople: function (data) {
+    modifyPeople(data, unParsePerson)
+    modifyPeople(data, parsePerson)
+  },
+
+  fixNameField: function (data, options) {
+    if (typeof options === 'boolean') {
+      options = { strict: options }
+    } else if (typeof options === 'undefined') {
+      options = {}
+    }
+    var strict = options.strict
+    if (!data.name && !strict) {
+      data.name = ''
+      return
+    }
+    if (typeof data.name !== 'string') {
+      throw new Error('name field must be a string.')
+    }
+    if (!strict) {
+      data.name = data.name.trim()
+    }
+    ensureValidName(data.name, strict, options.allowLegacyCase)
+    if (isBuiltin(data.name)) {
+      this.warn('conflictingName', data.name)
+    }
+  },
+
+  fixDescriptionField: function (data) {
+    if (data.description && typeof data.description !== 'string') {
+      this.warn('nonStringDescription')
+      delete data.description
+    }
+    if (data.readme && !data.description) {
+      data.description = extractDescription(data.readme)
+    }
+    if (data.description === undefined) {
+      delete data.description
+    }
+    if (!data.description) {
+      this.warn('missingDescription')
+    }
+  },
+
+  fixReadmeField: function (data) {
+    if (!data.readme) {
+      this.warn('missingReadme')
+      data.readme = 'ERROR: No README data found!'
+    }
+  },
+
+  fixBugsField: function (data) {
+    if (!data.bugs && data.repository && data.repository.url) {
+      var hosted = hostedGitInfo.fromUrl(data.repository.url)
+      if (hosted && hosted.bugs()) {
+        data.bugs = { url: hosted.bugs() }
+      }
+    } else if (data.bugs) {
+      if (typeof data.bugs === 'string') {
+        if (isEmail(data.bugs)) {
+          data.bugs = { email: data.bugs }
+        } else if (URL.canParse(data.bugs)) {
+          data.bugs = { url: data.bugs }
+        } else {
+          this.warn('nonEmailUrlBugsString')
+        }
+      } else {
+        bugsTypos(data.bugs, this.warn)
+        var oldBugs = data.bugs
+        data.bugs = {}
+        if (oldBugs.url) {
+          if (URL.canParse(oldBugs.url)) {
+            data.bugs.url = oldBugs.url
+          } else {
+            this.warn('nonUrlBugsUrlField')
+          }
+        }
+        if (oldBugs.email) {
+          if (typeof (oldBugs.email) === 'string' && isEmail(oldBugs.email)) {
+            data.bugs.email = oldBugs.email
+          } else {
+            this.warn('nonEmailBugsEmailField')
+          }
+        }
+      }
+      if (!data.bugs.email && !data.bugs.url) {
+        delete data.bugs
+        this.warn('emptyNormalizedBugs')
+      }
+    }
+  },
+
+  fixHomepageField: function (data) {
+    if (!data.homepage && data.repository && data.repository.url) {
+      var hosted = hostedGitInfo.fromUrl(data.repository.url)
+      if (hosted && hosted.docs()) {
+        data.homepage = hosted.docs()
+      }
+    }
+    if (!data.homepage) {
+      return
+    }
+
+    if (typeof data.homepage !== 'string') {
+      this.warn('nonUrlHomepage')
+      return delete data.homepage
+    }
+    if (!URL.canParse(data.homepage)) {
+      data.homepage = 'http://' + data.homepage
+    }
+  },
+
+  fixLicenseField: function (data) {
+    const license = data.license || data.licence
+    if (!license) {
+      return this.warn('missingLicense')
+    }
+    if (
+      typeof (license) !== 'string' ||
+      license.length < 1 ||
+      license.trim() === ''
+    ) {
+      return this.warn('invalidLicense')
+    }
+    if (!validateLicense(license).validForNewPackages) {
+      return this.warn('invalidLicense')
+    }
+  },
+}
+
+function isValidScopedPackageName (spec) {
+  if (spec.charAt(0) !== '@') {
+    return false
+  }
+
+  var rest = spec.slice(1).split('/')
+  if (rest.length !== 2) {
+    return false
+  }
+
+  return rest[0] && rest[1] &&
+    rest[0] === encodeURIComponent(rest[0]) &&
+    rest[1] === encodeURIComponent(rest[1])
+}
+
+function isCorrectlyEncodedName (spec) {
+  return !spec.match(/[/@\s+%:]/) &&
+    spec === encodeURIComponent(spec)
+}
+
+function ensureValidName (name, strict, allowLegacyCase) {
+  if (name.charAt(0) === '.' ||
+      !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) ||
+      (strict && (!allowLegacyCase) && name !== name.toLowerCase()) ||
+      name.toLowerCase() === 'node_modules' ||
+      name.toLowerCase() === 'favicon.ico') {
+    throw new Error('Invalid name: ' + JSON.stringify(name))
+  }
+}
+
+function modifyPeople (data, fn) {
+  if (data.author) {
+    data.author = fn(data.author)
+  }['maintainers', 'contributors'].forEach(function (set) {
+    if (!Array.isArray(data[set])) {
+      return
+    }
+    data[set] = data[set].map(fn)
+  })
+  return data
+}
+
+function unParsePerson (person) {
+  if (typeof person === 'string') {
+    return person
+  }
+  var name = person.name || ''
+  var u = person.url || person.web
+  var wrappedUrl = u ? (' (' + u + ')') : ''
+  var e = person.email || person.mail
+  var wrappedEmail = e ? (' <' + e + '>') : ''
+  return name + wrappedEmail + wrappedUrl
+}
+
+function parsePerson (person) {
+  if (typeof person !== 'string') {
+    return person
+  }
+  var matchedName = person.match(/^([^(<]+)/)
+  var matchedUrl = person.match(/\(([^()]+)\)/)
+  var matchedEmail = person.match(/<([^<>]+)>/)
+  var obj = {}
+  if (matchedName && matchedName[0].trim()) {
+    obj.name = matchedName[0].trim()
+  }
+  if (matchedEmail) {
+    obj.email = matchedEmail[1]
+  }
+  if (matchedUrl) {
+    obj.url = matchedUrl[1]
+  }
+  return obj
+}
+
+function addOptionalDepsToDeps (data) {
+  var o = data.optionalDependencies
+  if (!o) {
+    return
+  }
+  var d = data.dependencies || {}
+  Object.keys(o).forEach(function (k) {
+    d[k] = o[k]
+  })
+  data.dependencies = d
+}
+
+function depObjectify (deps, type, warn) {
+  if (!deps) {
+    return {}
+  }
+  if (typeof deps === 'string') {
+    deps = deps.trim().split(/[\n\r\s\t ,]+/)
+  }
+  if (!Array.isArray(deps)) {
+    return deps
+  }
+  warn('deprecatedArrayDependencies', type)
+  var o = {}
+  deps.filter(function (d) {
+    return typeof d === 'string'
+  }).forEach(function (d) {
+    d = d.trim().split(/(:?[@\s><=])/)
+    var dn = d.shift()
+    var dv = d.join('')
+    dv = dv.trim()
+    dv = dv.replace(/^@/, '')
+    o[dn] = dv
+  })
+  return o
+}
+
+function objectifyDeps (data, warn) {
+  depTypes.forEach(function (type) {
+    if (!data[type]) {
+      return
+    }
+    data[type] = depObjectify(data[type], type, warn)
+  })
+}
+
+function bugsTypos (bugs, warn) {
+  if (!bugs) {
+    return
+  }
+  Object.keys(bugs).forEach(function (k) {
+    if (typos.bugs[k]) {
+      warn('typo', k, typos.bugs[k], 'bugs')
+      bugs[typos.bugs[k]] = bugs[k]
+      delete bugs[k]
+    }
+  })
+}
diff --git a/node_modules/normalize-package-data/lib/make_warning.js b/node_modules/normalize-package-data/lib/make_warning.js
new file mode 100644
index 00000000..3be9c865
--- /dev/null
+++ b/node_modules/normalize-package-data/lib/make_warning.js
@@ -0,0 +1,22 @@
+var util = require('util')
+var messages = require('./warning_messages.json')
+
+module.exports = function () {
+  var args = Array.prototype.slice.call(arguments, 0)
+  var warningName = args.shift()
+  if (warningName === 'typo') {
+    return makeTypoWarning.apply(null, args)
+  } else {
+    var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'"
+    args.unshift(msgTemplate)
+    return util.format.apply(null, args)
+  }
+}
+
+function makeTypoWarning (providedName, probableName, field) {
+  if (field) {
+    providedName = field + "['" + providedName + "']"
+    probableName = field + "['" + probableName + "']"
+  }
+  return util.format(messages.typo, providedName, probableName)
+}
diff --git a/node_modules/normalize-package-data/lib/normalize.js b/node_modules/normalize-package-data/lib/normalize.js
new file mode 100644
index 00000000..e806f110
--- /dev/null
+++ b/node_modules/normalize-package-data/lib/normalize.js
@@ -0,0 +1,48 @@
+module.exports = normalize
+
+var fixer = require('./fixer')
+normalize.fixer = fixer
+
+var makeWarning = require('./make_warning')
+
+var fieldsToFix = ['name', 'version', 'description', 'repository', 'modules', 'scripts',
+  'files', 'bin', 'man', 'bugs', 'keywords', 'readme', 'homepage', 'license']
+var otherThingsToFix = ['dependencies', 'people', 'typos']
+
+var thingsToFix = fieldsToFix.map(function (fieldName) {
+  return ucFirst(fieldName) + 'Field'
+})
+// two ways to do this in CoffeeScript on only one line, sub-70 chars:
+// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field"
+// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix)
+thingsToFix = thingsToFix.concat(otherThingsToFix)
+
+function normalize (data, warn, strict) {
+  if (warn === true) {
+    warn = null
+    strict = true
+  }
+  if (!strict) {
+    strict = false
+  }
+  if (!warn || data.private) {
+    warn = function () { /* noop */ }
+  }
+
+  if (data.scripts &&
+      data.scripts.install === 'node-gyp rebuild' &&
+      !data.scripts.preinstall) {
+    data.gypfile = true
+  }
+  fixer.warn = function () {
+    warn(makeWarning.apply(null, arguments))
+  }
+  thingsToFix.forEach(function (thingName) {
+    fixer['fix' + ucFirst(thingName)](data, strict)
+  })
+  data._id = data.name + '@' + data.version
+}
+
+function ucFirst (string) {
+  return string.charAt(0).toUpperCase() + string.slice(1)
+}
diff --git a/node_modules/normalize-package-data/lib/safe_format.js b/node_modules/normalize-package-data/lib/safe_format.js
new file mode 100644
index 00000000..5fc888e5
--- /dev/null
+++ b/node_modules/normalize-package-data/lib/safe_format.js
@@ -0,0 +1,11 @@
+var util = require('util')
+
+module.exports = function () {
+  var args = Array.prototype.slice.call(arguments, 0)
+  args.forEach(function (arg) {
+    if (!arg) {
+      throw new TypeError('Bad arguments.')
+    }
+  })
+  return util.format.apply(null, arguments)
+}
diff --git a/node_modules/normalize-package-data/lib/typos.json b/node_modules/normalize-package-data/lib/typos.json
new file mode 100644
index 00000000..7f9dd283
--- /dev/null
+++ b/node_modules/normalize-package-data/lib/typos.json
@@ -0,0 +1,25 @@
+{
+  "topLevel": {
+    "dependancies": "dependencies"
+   ,"dependecies": "dependencies"
+   ,"depdenencies": "dependencies"
+   ,"devEependencies": "devDependencies"
+   ,"depends": "dependencies"
+   ,"dev-dependencies": "devDependencies"
+   ,"devDependences": "devDependencies"
+   ,"devDepenencies": "devDependencies"
+   ,"devdependencies": "devDependencies"
+   ,"repostitory": "repository"
+   ,"repo": "repository"
+   ,"prefereGlobal": "preferGlobal"
+   ,"hompage": "homepage"
+   ,"hampage": "homepage"
+   ,"autohr": "author"
+   ,"autor": "author"
+   ,"contributers": "contributors"
+   ,"publicationConfig": "publishConfig"
+   ,"script": "scripts"
+  },
+  "bugs": { "web": "url", "name": "url" },
+  "script": { "server": "start", "tests": "test" }
+}
diff --git a/node_modules/normalize-package-data/lib/warning_messages.json b/node_modules/normalize-package-data/lib/warning_messages.json
new file mode 100644
index 00000000..4890f506
--- /dev/null
+++ b/node_modules/normalize-package-data/lib/warning_messages.json
@@ -0,0 +1,30 @@
+{
+  "repositories": "'repositories' (plural) Not supported. Please pick one as the 'repository' field"
+  ,"missingRepository": "No repository field."
+  ,"brokenGitUrl": "Probably broken git url: %s"
+  ,"nonObjectScripts": "scripts must be an object"
+  ,"nonStringScript": "script values must be string commands"
+  ,"nonArrayFiles": "Invalid 'files' member"
+  ,"invalidFilename": "Invalid filename in 'files' list: %s"
+  ,"nonArrayBundleDependencies": "Invalid 'bundleDependencies' list. Must be array of package names"
+  ,"nonStringBundleDependency": "Invalid bundleDependencies member: %s"
+  ,"nonDependencyBundleDependency": "Non-dependency in bundleDependencies: %s"
+  ,"nonObjectDependencies": "%s field must be an object"
+  ,"nonStringDependency": "Invalid dependency: %s %s"
+  ,"deprecatedArrayDependencies": "specifying %s as array is deprecated"
+  ,"deprecatedModules": "modules field is deprecated"
+  ,"nonArrayKeywords": "keywords should be an array of strings"
+  ,"nonStringKeyword": "keywords should be an array of strings"
+  ,"conflictingName": "%s is also the name of a node core module."
+  ,"nonStringDescription": "'description' field should be a string"
+  ,"missingDescription": "No description"
+  ,"missingReadme": "No README data"
+  ,"missingLicense": "No license field."
+  ,"nonEmailUrlBugsString": "Bug string field must be url, email, or {email,url}"
+  ,"nonUrlBugsUrlField": "bugs.url field must be a string url. Deleted."
+  ,"nonEmailBugsEmailField": "bugs.email field must be a string email. Deleted."
+  ,"emptyNormalizedBugs": "Normalized value of bugs field is an empty object. Deleted."
+  ,"nonUrlHomepage": "homepage field must be a string url. Deleted."
+  ,"invalidLicense": "license should be a valid SPDX license expression"
+  ,"typo": "%s should probably be %s."
+}
diff --git a/node_modules/normalize-package-data/package.json b/node_modules/normalize-package-data/package.json
new file mode 100644
index 00000000..e4fbdddc
--- /dev/null
+++ b/node_modules/normalize-package-data/package.json
@@ -0,0 +1,56 @@
+{
+  "name": "normalize-package-data",
+  "version": "8.0.0",
+  "author": "GitHub Inc.",
+  "description": "Normalizes data that can be found in package.json files.",
+  "license": "BSD-2-Clause",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/normalize-package-data.git"
+  },
+  "main": "lib/normalize.js",
+  "scripts": {
+    "test": "tap",
+    "npmclilint": "npmcli-lint",
+    "lint": "npm run eslint",
+    "lintfix": "npm run eslint -- --fix",
+    "posttest": "npm run lint",
+    "postsnap": "npm run lintfix --",
+    "postlint": "template-oss-check",
+    "snap": "tap",
+    "template-oss-apply": "template-oss-apply --force",
+    "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
+  },
+  "dependencies": {
+    "hosted-git-info": "^9.0.0",
+    "semver": "^7.3.5",
+    "validate-npm-package-license": "^3.0.4"
+  },
+  "devDependencies": {
+    "@npmcli/eslint-config": "^5.0.0",
+    "@npmcli/template-oss": "4.25.0",
+    "tap": "^16.0.1"
+  },
+  "files": [
+    "bin/",
+    "lib/"
+  ],
+  "engines": {
+    "node": "^20.17.0 || >=22.9.0"
+  },
+  "templateOSS": {
+    "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
+    "version": "4.25.0",
+    "publish": "true"
+  },
+  "tap": {
+    "branches": 86,
+    "functions": 92,
+    "lines": 86,
+    "statements": 86,
+    "nyc-arg": [
+      "--exclude",
+      "tap-snapshots/**"
+    ]
+  }
+}
diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js
new file mode 100644
index 00000000..0930cf88
--- /dev/null
+++ b/node_modules/object-assign/index.js
@@ -0,0 +1,90 @@
+/*
+object-assign
+(c) Sindre Sorhus
+@license MIT
+*/
+
+'use strict';
+/* eslint-disable no-unused-vars */
+var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+var propIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+function toObject(val) {
+	if (val === null || val === undefined) {
+		throw new TypeError('Object.assign cannot be called with null or undefined');
+	}
+
+	return Object(val);
+}
+
+function shouldUseNative() {
+	try {
+		if (!Object.assign) {
+			return false;
+		}
+
+		// Detect buggy property enumeration order in older V8 versions.
+
+		// https://bugs.chromium.org/p/v8/issues/detail?id=4118
+		var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
+		test1[5] = 'de';
+		if (Object.getOwnPropertyNames(test1)[0] === '5') {
+			return false;
+		}
+
+		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
+		var test2 = {};
+		for (var i = 0; i < 10; i++) {
+			test2['_' + String.fromCharCode(i)] = i;
+		}
+		var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
+			return test2[n];
+		});
+		if (order2.join('') !== '0123456789') {
+			return false;
+		}
+
+		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
+		var test3 = {};
+		'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
+			test3[letter] = letter;
+		});
+		if (Object.keys(Object.assign({}, test3)).join('') !==
+				'abcdefghijklmnopqrst') {
+			return false;
+		}
+
+		return true;
+	} catch (err) {
+		// We don't expect any of the above to throw, but better to be safe.
+		return false;
+	}
+}
+
+module.exports = shouldUseNative() ? Object.assign : function (target, source) {
+	var from;
+	var to = toObject(target);
+	var symbols;
+
+	for (var s = 1; s < arguments.length; s++) {
+		from = Object(arguments[s]);
+
+		for (var key in from) {
+			if (hasOwnProperty.call(from, key)) {
+				to[key] = from[key];
+			}
+		}
+
+		if (getOwnPropertySymbols) {
+			symbols = getOwnPropertySymbols(from);
+			for (var i = 0; i < symbols.length; i++) {
+				if (propIsEnumerable.call(from, symbols[i])) {
+					to[symbols[i]] = from[symbols[i]];
+				}
+			}
+		}
+	}
+
+	return to;
+};
diff --git a/node_modules/object-assign/license b/node_modules/object-assign/license
new file mode 100644
index 00000000..654d0bfe
--- /dev/null
+++ b/node_modules/object-assign/license
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus  (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/object-assign/package.json b/node_modules/object-assign/package.json
new file mode 100644
index 00000000..503eb1e6
--- /dev/null
+++ b/node_modules/object-assign/package.json
@@ -0,0 +1,42 @@
+{
+  "name": "object-assign",
+  "version": "4.1.1",
+  "description": "ES2015 `Object.assign()` ponyfill",
+  "license": "MIT",
+  "repository": "sindresorhus/object-assign",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "scripts": {
+    "test": "xo && ava",
+    "bench": "matcha bench.js"
+  },
+  "files": [
+    "index.js"
+  ],
+  "keywords": [
+    "object",
+    "assign",
+    "extend",
+    "properties",
+    "es2015",
+    "ecmascript",
+    "harmony",
+    "ponyfill",
+    "prollyfill",
+    "polyfill",
+    "shim",
+    "browser"
+  ],
+  "devDependencies": {
+    "ava": "^0.16.0",
+    "lodash": "^4.16.4",
+    "matcha": "^0.7.0",
+    "xo": "^0.16.0"
+  }
+}
diff --git a/node_modules/object-assign/readme.md b/node_modules/object-assign/readme.md
new file mode 100644
index 00000000..1be09d35
--- /dev/null
+++ b/node_modules/object-assign/readme.md
@@ -0,0 +1,61 @@
+# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign)
+
+> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com)
+
+
+## Use the built-in
+
+Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari),
+support `Object.assign()` :tada:. If you target only those environments, then by all
+means, use `Object.assign()` instead of this package.
+
+
+## Install
+
+```
+$ npm install --save object-assign
+```
+
+
+## Usage
+
+```js
+const objectAssign = require('object-assign');
+
+objectAssign({foo: 0}, {bar: 1});
+//=> {foo: 0, bar: 1}
+
+// multiple sources
+objectAssign({foo: 0}, {bar: 1}, {baz: 2});
+//=> {foo: 0, bar: 1, baz: 2}
+
+// overwrites equal keys
+objectAssign({foo: 0}, {foo: 1}, {foo: 2});
+//=> {foo: 2}
+
+// ignores null and undefined sources
+objectAssign({foo: 0}, null, {bar: 1}, undefined);
+//=> {foo: 0, bar: 1}
+```
+
+
+## API
+
+### objectAssign(target, [source, ...])
+
+Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
+
+
+## Resources
+
+- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign)
+
+
+## Related
+
+- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()`
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/pad-right/LICENSE b/node_modules/pad-right/LICENSE
new file mode 100644
index 00000000..b576e8d4
--- /dev/null
+++ b/node_modules/pad-right/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Jon Schlinkert
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/pad-right/README.md b/node_modules/pad-right/README.md
new file mode 100644
index 00000000..97106f46
--- /dev/null
+++ b/node_modules/pad-right/README.md
@@ -0,0 +1,71 @@
+# pad-right [![NPM version](https://badge.fury.io/js/pad-right.svg)](http://badge.fury.io/js/pad-right)
+
+> Right pad a string with zeros or a specified string. Fastest implementation.
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i pad-right --save
+```
+
+## Run tests
+
+```bash
+npm test
+```
+
+## Usage
+
+```js
+var pad = require('pad-right');
+pad('abc', 5)
+// 'abc00'
+pad('abc', 10)
+// 'abc0000000'
+pad('abc', 10, '~')
+// 'abc~~~~~~~'
+pad('abc', 10, ' ')
+// 'abc       '
+```
+
+## Related
+
+* [align-text](https://github.com/jonschlinkert/align-text): Align the text in a string.
+* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
+* [justified](https://github.com/jonschlinkert/justified): Wrap words to a specified length and justified the text.
+* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation.
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.
+* [right-align-keys](https://github.com/jonschlinkert/right-align-keys): Right align the keys of an object.
+* [right-align-values](https://github.com/jonschlinkert/right-align-values): Right align the values of a given property for each object in an array. Useful… [more](https://github.com/jonschlinkert/right-align-values)
+* [right-pad-keys](https://github.com/jonschlinkert/right-pad-keys): Right pad the keys of an object.
+* [right-pad-values](https://github.com/jonschlinkert/right-pad-values): Right pad the values of a given property for each object in an array. Useful… [more](https://github.com/jonschlinkert/right-pad-values)
+* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pad-right/issues/new)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2014-2015 Jon Schlinkert
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 15, 2015._
\ No newline at end of file
diff --git a/node_modules/pad-right/index.js b/node_modules/pad-right/index.js
new file mode 100644
index 00000000..70127666
--- /dev/null
+++ b/node_modules/pad-right/index.js
@@ -0,0 +1,20 @@
+'use strict';
+
+var repeat = require('repeat-string');
+
+module.exports = function padLeft(val, num, str) {
+  var padding = '';
+  var diff = num - val.length;
+
+  // Breakpoints based on benchmarks to use the fastest approach
+  // for the given number of zeros
+  if (diff <= 5 && !str) {
+    padding = '00000';
+  } else if (diff <= 25 && !str) {
+    padding = '000000000000000000000000000';
+  } else {
+    return val + repeat(str || '0', diff);
+  }
+
+  return val + padding.slice(0, diff);
+};
diff --git a/node_modules/pad-right/package.json b/node_modules/pad-right/package.json
new file mode 100644
index 00000000..cc18490d
--- /dev/null
+++ b/node_modules/pad-right/package.json
@@ -0,0 +1,64 @@
+{
+  "name": "pad-right",
+  "description": "Right pad a string with zeros or a specified string. Fastest implementation.",
+  "version": "0.2.2",
+  "homepage": "https://github.com/jonschlinkert/pad-right",
+  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+  "repository": "jonschlinkert/pad-right",
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/pad-right/issues"
+  },
+  "license": "MIT",
+  "main": "index.js",
+  "files": [
+    "index.js"
+  ],
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "dependencies": {
+    "repeat-string": "^1.5.2"
+  },
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "keywords": [
+    "align",
+    "alignment",
+    "fill",
+    "left",
+    "pad",
+    "pad-left",
+    "pad-right",
+    "padded",
+    "padding",
+    "right",
+    "right-pad",
+    "spaces",
+    "string",
+    "zero",
+    "zero-fill",
+    "zeros"
+  ],
+  "verb": {
+    "related": {
+      "list": [
+        "align-text",
+        "center-align",
+        "justified",
+        "pad-left",
+        "repeat-string",
+        "right-align",
+        "right-align-keys",
+        "right-align-values",
+        "right-pad-keys",
+        "right-pad-values",
+        "word-wrap"
+      ]
+    }
+  }
+}
diff --git a/node_modules/parse-json/index.d.ts b/node_modules/parse-json/index.d.ts
new file mode 100644
index 00000000..683d141b
--- /dev/null
+++ b/node_modules/parse-json/index.d.ts
@@ -0,0 +1,144 @@
+import type {JsonObject} from 'type-fest';
+
+/**
+Exposed for `instanceof` checking.
+*/
+export class JSONError extends Error { // eslint-disable-line @typescript-eslint/naming-convention
+	/**
+	The filename displayed in the error message, if any.
+	*/
+	fileName: string;
+
+	/**
+	The printable section of the JSON which produces the error.
+	*/
+	readonly codeFrame: string;
+
+	/**
+	The raw version of `codeFrame` without colors.
+	*/
+	readonly rawCodeFrame: string;
+}
+
+// Get `reviver`` parameter from `JSON.parse()`.
+export type Reviver = Parameters['1'];
+
+/**
+Parse JSON with more helpful errors.
+
+@param string - A valid JSON string.
+@param reviver - Prescribes how the value originally produced by parsing is transformed, before being returned. See [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter
+) for more.
+@param filename - The filename displayed in the error message.
+@returns A parsed JSON object.
+@throws A {@link JSONError} when there is a parsing error.
+
+@example
+```
+import parseJson, {JSONError} from 'parse-json';
+
+const json = '{\n\t"foo": true,\n}';
+
+parseJson(json);
+// JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+
+//   1 | {
+//   2 |   "foo": true,
+// > 3 | }
+//     | ^
+
+parseJson(json, 'foo.json');
+// JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1) in foo.json
+
+//   1 | {
+//   2 |   "foo": true,
+// > 3 | }
+//     | ^
+//   fileName: 'foo.json',
+//   [cause]: SyntaxError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+//       at JSON.parse ()
+//       at ...
+
+// You can also add the filename at a later point
+try {
+	parseJson(json);
+} catch (error) {
+	if (error instanceof JSONError) {
+		error.fileName = 'foo.json';
+	}
+
+	throw error;
+}
+// JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1) in foo.json
+
+//   1 | {
+//   2 |   "foo": true,
+// > 3 | }
+//     | ^
+
+//   fileName: 'foo.json',
+//   [cause]: SyntaxError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+//       at JSON.parse ()
+//       at ...
+```
+*/
+export default function parseJson(string: string, reviver?: Reviver, filename?: string): JsonObject;
+
+/**
+Parse JSON with more helpful errors.
+
+@param string - A valid JSON string.
+@param filename - The filename displayed in the error message.
+@returns A parsed JSON object.
+@throws A {@link JSONError} when there is a parsing error.
+
+@example
+```
+import parseJson, {JSONError} from 'parse-json';
+
+const json = '{\n\t"foo": true,\n}';
+
+parseJson(json);
+// JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+
+//   1 | {
+//   2 |   "foo": true,
+// > 3 | }
+//     | ^
+
+parseJson(json, 'foo.json');
+// JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1) in foo.json
+
+//   1 | {
+//   2 |   "foo": true,
+// > 3 | }
+//     | ^
+//   fileName: 'foo.json',
+//   [cause]: SyntaxError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+//       at JSON.parse ()
+//       at ...
+
+// You can also add the filename at a later point
+try {
+	parseJson(json);
+} catch (error) {
+	if (error instanceof JSONError) {
+		error.fileName = 'foo.json';
+	}
+
+	throw error;
+}
+// JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1) in foo.json
+
+//   1 | {
+//   2 |   "foo": true,
+// > 3 | }
+//     | ^
+
+//   fileName: 'foo.json',
+//   [cause]: SyntaxError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+//       at JSON.parse ()
+//       at ...
+```
+*/
+export default function parseJson(string: string, filename?: string): JsonObject;
diff --git a/node_modules/parse-json/index.js b/node_modules/parse-json/index.js
new file mode 100644
index 00000000..5d1e3a2c
--- /dev/null
+++ b/node_modules/parse-json/index.js
@@ -0,0 +1,110 @@
+import {codeFrameColumns} from '@babel/code-frame';
+import indexToPosition from 'index-to-position';
+
+const getCodePoint = character => `\\u{${character.codePointAt(0).toString(16)}}`;
+
+export class JSONError extends Error {
+	name = 'JSONError';
+	fileName;
+	#input;
+	#jsonParseError;
+	#message;
+	#codeFrame;
+	#rawCodeFrame;
+
+	constructor(messageOrOptions) {
+		// JSONError constructor used accept string
+		// TODO[>=9]: Remove this `if` on next major version
+		if (typeof messageOrOptions === 'string') {
+			super();
+			this.#message = messageOrOptions;
+		} else {
+			const {jsonParseError, fileName, input} = messageOrOptions;
+			// We cannot pass message to `super()`, otherwise the message accessor will be overridden.
+			// https://262.ecma-international.org/14.0/#sec-error-message
+			super(undefined, {cause: jsonParseError});
+
+			this.#input = input;
+			this.#jsonParseError = jsonParseError;
+			this.fileName = fileName;
+		}
+
+		Error.captureStackTrace?.(this, JSONError);
+	}
+
+	get message() {
+		this.#message ??= `${addCodePointToUnexpectedToken(this.#jsonParseError.message)}${this.#input === '' ? ' while parsing empty string' : ''}`;
+
+		const {codeFrame} = this;
+		return `${this.#message}${this.fileName ? ` in ${this.fileName}` : ''}${codeFrame ? `\n\n${codeFrame}\n` : ''}`;
+	}
+
+	set message(message) {
+		this.#message = message;
+	}
+
+	#getCodeFrame(highlightCode) {
+		// TODO[>=9]: Remove this `if` on next major version
+		if (!this.#jsonParseError) {
+			return;
+		}
+
+		const input = this.#input;
+
+		const location = getErrorLocation(input, this.#jsonParseError.message);
+		if (!location) {
+			return;
+		}
+
+		return codeFrameColumns(input, {start: location}, {highlightCode});
+	}
+
+	get codeFrame() {
+		this.#codeFrame ??= this.#getCodeFrame(/* highlightCode */ true);
+		return this.#codeFrame;
+	}
+
+	get rawCodeFrame() {
+		this.#rawCodeFrame ??= this.#getCodeFrame(/* highlightCode */ false);
+		return this.#rawCodeFrame;
+	}
+}
+
+const getErrorLocation = (string, message) => {
+	const match = message.match(/in JSON at position (?\d+)(?: \(line (?\d+) column (?\d+)\))?$/);
+
+	if (!match) {
+		return;
+	}
+
+	const {index, line, column} = match.groups;
+
+	if (line && column) {
+		return {line: Number(line), column: Number(column)};
+	}
+
+	return indexToPosition(string, Number(index), {oneBased: true});
+};
+
+const addCodePointToUnexpectedToken = message => message.replace(
+	// TODO[engine:node@>=20]: The token always quoted after Node.js 20
+	/(?<=^Unexpected token )(?')?(.)\k/,
+	(_, _quote, token) => `"${token}"(${getCodePoint(token)})`,
+);
+
+export default function parseJson(string, reviver, fileName) {
+	if (typeof reviver === 'string') {
+		fileName = reviver;
+		reviver = undefined;
+	}
+
+	try {
+		return JSON.parse(string, reviver);
+	} catch (error) {
+		throw new JSONError({
+			jsonParseError: error,
+			fileName,
+			input: string,
+		});
+	}
+}
diff --git a/node_modules/parse-json/license b/node_modules/parse-json/license
new file mode 100644
index 00000000..fa7ceba3
--- /dev/null
+++ b/node_modules/parse-json/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus  (https://sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/parse-json/package.json b/node_modules/parse-json/package.json
new file mode 100644
index 00000000..72a196ff
--- /dev/null
+++ b/node_modules/parse-json/package.json
@@ -0,0 +1,53 @@
+{
+	"name": "parse-json",
+	"version": "8.3.0",
+	"description": "Parse JSON with more helpful errors",
+	"license": "MIT",
+	"repository": "sindresorhus/parse-json",
+	"funding": "https://github.com/sponsors/sindresorhus",
+	"author": {
+		"name": "Sindre Sorhus",
+		"email": "sindresorhus@gmail.com",
+		"url": "https://sindresorhus.com"
+	},
+	"type": "module",
+	"exports": {
+		"types": "./index.d.ts",
+		"default": "./index.js"
+	},
+	"sideEffects": false,
+	"engines": {
+		"node": ">=18"
+	},
+	"scripts": {
+		"test": "xo && c8 ava && tsd"
+	},
+	"files": [
+		"index.js",
+		"index.d.ts"
+	],
+	"keywords": [
+		"parse",
+		"json",
+		"graceful",
+		"error",
+		"message",
+		"humanize",
+		"friendly",
+		"helpful",
+		"string"
+	],
+	"dependencies": {
+		"@babel/code-frame": "^7.26.2",
+		"index-to-position": "^1.1.0",
+		"type-fest": "^4.39.1"
+	},
+	"devDependencies": {
+		"ava": "^6.2.0",
+		"c8": "^10.1.3",
+		"outdent": "^0.8.0",
+		"strip-ansi": "^7.1.0",
+		"tsd": "^0.31.2",
+		"xo": "^0.60.0"
+	}
+}
diff --git a/node_modules/parse-json/readme.md b/node_modules/parse-json/readme.md
new file mode 100644
index 00000000..be57c752
--- /dev/null
+++ b/node_modules/parse-json/readme.md
@@ -0,0 +1,119 @@
+# parse-json
+
+> Parse JSON with more helpful errors
+
+## Install
+
+```sh
+npm install parse-json
+```
+
+## Usage
+
+```js
+import parseJson, {JSONError} from 'parse-json';
+
+const json = '{\n\t"foo": true,\n}';
+
+
+JSON.parse(json);
+/*
+SyntaxError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+*/
+
+
+parseJson(json);
+/*
+JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+
+  1 | {
+  2 |   "foo": true,
+> 3 | }
+    | ^
+*/
+
+
+parseJson(json, 'foo.json');
+/*
+JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1) in foo.json
+
+  1 | {
+  2 |   "foo": true,
+> 3 | }
+    | ^
+  fileName: 'foo.json',
+  [cause]: SyntaxError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+      at JSON.parse ()
+      at ...
+*/
+
+
+// You can also add the filename at a later point
+try {
+	parseJson(json);
+} catch (error) {
+	if (error instanceof JSONError) {
+		error.fileName = 'foo.json';
+	}
+
+	throw error;
+}
+/*
+JSONError: Expected double-quoted property name in JSON at position 16 (line 3 column 1) in foo.json
+
+  1 | {
+  2 |   "foo": true,
+> 3 | }
+    | ^
+
+  fileName: 'foo.json',
+  [cause]: SyntaxError: Expected double-quoted property name in JSON at position 16 (line 3 column 1)
+      at JSON.parse ()
+      at ...
+*/
+```
+
+## API
+
+### parseJson(string, reviver?, filename?)
+
+Throws a `JSONError` when there is a parsing error.
+
+#### string
+
+Type: `string`
+
+#### reviver
+
+Type: `Function`
+
+Prescribes how the value originally produced by parsing is transformed, before being returned. See [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter
+) for more.
+
+#### filename
+
+Type: `string`
+
+The filename displayed in the error message.
+
+### JSONError
+
+Exposed for `instanceof` checking.
+
+#### fileName
+
+Type: `string`
+
+The filename displayed in the error message.
+
+#### codeFrame
+
+Type: `string`
+
+The printable section of the JSON which produces the error.
+
+#### rawCodeFrame
+
+Type: `string`
+
+The raw version of `codeFrame` without colors.
diff --git a/node_modules/path-scurry/LICENSE.md b/node_modules/path-scurry/LICENSE.md
new file mode 100644
index 00000000..c5402b95
--- /dev/null
+++ b/node_modules/path-scurry/LICENSE.md
@@ -0,0 +1,55 @@
+# Blue Oak Model License
+
+Version 1.0.0
+
+## Purpose
+
+This license gives everyone as much permission to work with
+this software as possible, while protecting contributors
+from liability.
+
+## Acceptance
+
+In order to receive this license, you must agree to its
+rules.  The rules of this license are both obligations
+under that agreement and conditions to your license.
+You must not do anything with this software that triggers
+a rule that you cannot or will not follow.
+
+## Copyright
+
+Each contributor licenses you to do everything with this
+software that would otherwise infringe that contributor's
+copyright in it.
+
+## Notices
+
+You must ensure that everyone who gets a copy of
+any part of this software from you, with or without
+changes, also gets the text of this license or a link to
+.
+
+## Excuse
+
+If anyone notifies you in writing that you have not
+complied with [Notices](#notices), you can keep your
+license by taking all practical steps to comply within 30
+days after the notice.  If you do not do so, your license
+ends immediately.
+
+## Patent
+
+Each contributor licenses you to do everything with this
+software that would otherwise infringe any patent claims
+they can license or become able to license.
+
+## Reliability
+
+No contributor can revoke this license.
+
+## No Liability
+
+***As far as the law allows, this software comes as is,
+without any warranty or condition, and no contributor
+will be liable to anyone for any damages related to this
+software or this license, under any kind of legal claim.***
diff --git a/node_modules/path-scurry/README.md b/node_modules/path-scurry/README.md
new file mode 100644
index 00000000..b5cb495c
--- /dev/null
+++ b/node_modules/path-scurry/README.md
@@ -0,0 +1,636 @@
+# path-scurry
+
+Extremely high performant utility for building tools that read
+the file system, minimizing filesystem and path string munging
+operations to the greatest degree possible.
+
+## Ugh, yet another file traversal thing on npm?
+
+Yes. None of the existing ones gave me exactly what I wanted.
+
+## Well what is it you wanted?
+
+While working on [glob](http://npm.im/glob), I found that I
+needed a module to very efficiently manage the traversal over a
+folder tree, such that:
+
+1. No `readdir()` or `stat()` would ever be called on the same
+   file or directory more than one time.
+2. No `readdir()` calls would be made if we can be reasonably
+   sure that the path is not a directory. (Ie, a previous
+   `readdir()` or `stat()` covered the path, and
+   `ent.isDirectory()` is false.)
+3. `path.resolve()`, `dirname()`, `basename()`, and other
+   string-parsing/munging operations are be minimized. This means
+   it has to track "provisional" child nodes that may not exist
+   (and if we find that they _don't_ exist, store that
+   information as well, so we don't have to ever check again).
+4. The API is not limited to use as a stream/iterator/etc. There
+   are many cases where an API like node's `fs` is preferrable.
+5. It's more important to prevent excess syscalls than to be up
+   to date, but it should be smart enough to know what it
+   _doesn't_ know, and go get it seamlessly when requested.
+6. Do not blow up the JS heap allocation if operating on a
+   directory with a huge number of entries.
+7. Handle all the weird aspects of Windows paths, like UNC paths
+   and drive letters and wrongway slashes, so that the consumer
+   can return canonical platform-specific paths without having to
+   parse or join or do any error-prone string munging.
+
+## PERFORMANCE
+
+JavaScript people throw around the word "blazing" a lot. I hope
+that this module doesn't blaze anyone. But it does go very fast,
+in the cases it's optimized for, if used properly.
+
+PathScurry provides ample opportunities to get extremely good
+performance, as well as several options to trade performance for
+convenience.
+
+Benchmarks can be run by executing `npm run bench`.
+
+As is always the case, doing more means going slower, doing less
+means going faster, and there are trade offs between speed and
+memory usage.
+
+PathScurry makes heavy use of [LRUCache](http://npm.im/lru-cache)
+to efficiently cache whatever it can, and `Path` objects remain
+in the graph for the lifetime of the walker, so repeated calls
+with a single PathScurry object will be extremely fast. However,
+adding items to a cold cache means "doing more", so in those
+cases, we pay a price. Nothing is free, but every effort has been
+made to reduce costs wherever possible.
+
+Also, note that a "cache as long as possible" approach means that
+changes to the filesystem may not be reflected in the results of
+repeated PathScurry operations.
+
+For resolving string paths, `PathScurry` ranges from 5-50 times
+faster than `path.resolve` on repeated resolutions, but around
+100 to 1000 times _slower_ on the first resolution. If your
+program is spending a lot of time resolving the _same_ paths
+repeatedly (like, thousands or millions of times), then this can
+be beneficial. But both implementations are pretty fast, and
+speeding up an infrequent operation from 4µs to 400ns is not
+going to move the needle on your app's performance.
+
+For walking file system directory trees, a lot depends on how
+often a given PathScurry object will be used, and also on the
+walk method used.
+
+With default settings on a folder tree of 100,000 items,
+consisting of around a 10-to-1 ratio of normal files to
+directories, PathScurry performs comparably to
+[@nodelib/fs.walk](http://npm.im/@nodelib/fs.walk), which is the
+fastest and most reliable file system walker I could find. As far
+as I can tell, it's almost impossible to go much faster in a
+Node.js program, just based on how fast you can push syscalls out
+to the fs thread pool.
+
+On my machine, that is about 1000-1200 completed walks per second
+for async or stream walks, and around 500-600 walks per second
+synchronously.
+
+In the warm cache state, PathScurry's performance increases
+around 4x for async `for await` iteration, 10-15x faster for
+streams and synchronous `for of` iteration, and anywhere from 30x
+to 80x faster for the rest.
+
+```
+# walk 100,000 fs entries, 10/1 file/dir ratio
+# operations / ms
+ New PathScurry object  |  Reuse PathScurry object
+     stream:  1112.589  |  13974.917
+sync stream:   492.718  |  15028.343
+ async walk:  1095.648  |  32706.395
+  sync walk:   527.632  |  46129.772
+ async iter:  1288.821  |   5045.510
+  sync iter:   498.496  |  17920.746
+```
+
+A hand-rolled walk calling `entry.readdir()` and recursing
+through the entries can benefit even more from caching, with
+greater flexibility and without the overhead of streams or
+generators.
+
+The cold cache state is still limited by the costs of file system
+operations, but with a warm cache, the only bottleneck is CPU
+speed and VM optimizations. Of course, in that case, some care
+must be taken to ensure that you don't lose performance as a
+result of silly mistakes, like calling `readdir()` on entries
+that you know are not directories.
+
+```
+# manual recursive iteration functions
+      cold cache  |  warm cache
+async:  1164.901  |  17923.320
+   cb:  1101.127  |  40999.344
+zalgo:  1082.240  |  66689.936
+ sync:   526.935  |  87097.591
+```
+
+In this case, the speed improves by around 10-20x in the async
+case, 40x in the case of using `entry.readdirCB` with protections
+against synchronous callbacks, and 50-100x with callback
+deferrals disabled, and _several hundred times faster_ for
+synchronous iteration.
+
+If you can think of a case that is not covered in these
+benchmarks, or an implementation that performs significantly
+better than PathScurry, please [let me
+know](https://github.com/isaacs/path-scurry/issues).
+
+## USAGE
+
+```ts
+// hybrid module, load with either method
+import { PathScurry, Path } from 'path-scurry'
+// or:
+const { PathScurry, Path } = require('path-scurry')
+
+// very simple example, say we want to find and
+// delete all the .DS_Store files in a given path
+// note that the API is very similar to just a
+// naive walk with fs.readdir()
+import { unlink } from 'fs/promises'
+
+// easy way, iterate over the directory and do the thing
+const pw = new PathScurry(process.cwd())
+for await (const entry of pw) {
+  if (entry.isFile() && entry.name === '.DS_Store') {
+    unlink(entry.fullpath())
+  }
+}
+
+// here it is as a manual recursive method
+const walk = async (entry: Path) => {
+  const promises: Promise = []
+  // readdir doesn't throw on non-directories, it just doesn't
+  // return any entries, to save stack trace costs.
+  // Items are returned in arbitrary unsorted order
+  for (const child of await pw.readdir(entry)) {
+    // each child is a Path object
+    if (child.name === '.DS_Store' && child.isFile()) {
+      // could also do pw.resolve(entry, child.name),
+      // just like fs.readdir walking, but .fullpath is
+      // a *slightly* more efficient shorthand.
+      promises.push(unlink(child.fullpath()))
+    } else if (child.isDirectory()) {
+      promises.push(walk(child))
+    }
+  }
+  return Promise.all(promises)
+}
+
+walk(pw.cwd).then(() => {
+  console.log('all .DS_Store files removed')
+})
+
+const pw2 = new PathScurry('/a/b/c') // pw2.cwd is the Path for /a/b/c
+const relativeDir = pw2.cwd.resolve('../x') // Path entry for '/a/b/x'
+const relative2 = pw2.cwd.resolve('/a/b/d/../x') // same path, same entry
+assert.equal(relativeDir, relative2)
+```
+
+## API
+
+[Full TypeDoc API](https://isaacs.github.io/path-scurry)
+
+There are platform-specific classes exported, but for the most
+part, the default `PathScurry` and `Path` exports are what you
+most likely need, unless you are testing behavior for other
+platforms.
+
+Intended public API is documented here, but the full
+documentation does include internal types, which should not be
+accessed directly.
+
+### Interface `PathScurryOpts`
+
+The type of the `options` argument passed to the `PathScurry`
+constructor.
+
+- `nocase`: Boolean indicating that file names should be compared
+  case-insensitively. Defaults to `true` on darwin and win32
+  implementations, `false` elsewhere.
+
+  **Warning** Performing case-insensitive matching on a
+  case-sensitive filesystem will result in occasionally very
+  bizarre behavior. Performing case-sensitive matching on a
+  case-insensitive filesystem may negatively impact performance.
+
+- `childrenCacheSize`: Number of child entries to cache, in order
+  to speed up `resolve()` and `readdir()` calls. Defaults to
+  `16 * 1024` (ie, `16384`).
+
+  Setting it to a higher value will run the risk of JS heap
+  allocation errors on large directory trees. Setting it to `256`
+  or smaller will significantly reduce the construction time and
+  data consumption overhead, but with the downside of operations
+  being slower on large directory trees. Setting it to `0` will
+  mean that effectively no operations are cached, and this module
+  will be roughly the same speed as `fs` for file system
+  operations, and _much_ slower than `path.resolve()` for
+  repeated path resolution.
+
+- `fs` An object that will be used to override the default `fs`
+  methods. Any methods that are not overridden will use Node's
+  built-in implementations.
+
+  - lstatSync
+  - readdir (callback `withFileTypes` Dirent variant, used for
+    readdirCB and most walks)
+  - readdirSync
+  - readlinkSync
+  - realpathSync
+  - promises: Object containing the following async methods:
+    - lstat
+    - readdir (Dirent variant only)
+    - readlink
+    - realpath
+
+### Interface `WalkOptions`
+
+The options object that may be passed to all walk methods.
+
+- `withFileTypes`: Boolean, default true. Indicates that `Path`
+  objects should be returned. Set to `false` to get string paths
+  instead.
+- `follow`: Boolean, default false. Attempt to read directory
+  entries from symbolic links. Otherwise, only actual directories
+  are traversed. Regardless of this setting, a given target path
+  will only ever be walked once, meaning that a symbolic link to
+  a previously traversed directory will never be followed.
+
+  Setting this imposes a slight performance penalty, because
+  `readlink` must be called on all symbolic links encountered, in
+  order to avoid infinite cycles.
+
+- `filter`: Function `(entry: Path) => boolean`. If provided,
+  will prevent the inclusion of any entry for which it returns a
+  falsey value. This will not prevent directories from being
+  traversed if they do not pass the filter, though it will
+  prevent the directories themselves from being included in the
+  results. By default, if no filter is provided, then all entries
+  are included in the results.
+- `walkFilter`: Function `(entry: Path) => boolean`. If provided,
+  will prevent the traversal of any directory (or in the case of
+  `follow:true` symbolic links to directories) for which the
+  function returns false. This will not prevent the directories
+  themselves from being included in the result set. Use `filter`
+  for that.
+
+Note that TypeScript return types will only be inferred properly
+from static analysis if the `withFileTypes` option is omitted, or
+a constant `true` or `false` value.
+
+### Class `PathScurry`
+
+The main interface. Defaults to an appropriate class based on the
+current platform.
+
+Use `PathScurryWin32`, `PathScurryDarwin`, or `PathScurryPosix`
+if implementation-specific behavior is desired.
+
+All walk methods may be called with a `WalkOptions` argument to
+walk over the object's current working directory with the
+supplied options.
+
+#### `async pw.walk(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Walk the directory tree according to the options provided,
+resolving to an array of all entries found.
+
+#### `pw.walkSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Walk the directory tree according to the options provided,
+returning an array of all entries found.
+
+#### `pw.iterate(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Iterate over the directory asynchronously, for use with `for
+await of`. This is also the default async iterator method.
+
+#### `pw.iterateSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Iterate over the directory synchronously, for use with `for of`.
+This is also the default sync iterator method.
+
+#### `pw.stream(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Return a [Minipass](http://npm.im/minipass) stream that emits
+each entry or path string in the walk. Results are made available
+asynchronously.
+
+#### `pw.streamSync(entry?: string | Path | WalkOptions, opts?: WalkOptions)`
+
+Return a [Minipass](http://npm.im/minipass) stream that emits
+each entry or path string in the walk. Results are made available
+synchronously, meaning that the walk will complete in a single
+tick if the stream is fully consumed.
+
+#### `pw.cwd`
+
+Path object representing the current working directory for the
+PathScurry.
+
+#### `pw.chdir(path: string)`
+
+Set the new effective current working directory for the scurry
+object, so that `path.relative()` and `path.relativePosix()`
+return values relative to the new cwd path.
+
+#### `pw.depth(path?: Path | string): number`
+
+Return the depth of the specified path (or the PathScurry cwd)
+within the directory tree.
+
+Root entries have a depth of `0`.
+
+#### `pw.resolve(...paths: string[])`
+
+Caching `path.resolve()`.
+
+Significantly faster than `path.resolve()` if called repeatedly
+with the same paths. Significantly slower otherwise, as it builds
+out the cached Path entries.
+
+To get a `Path` object resolved from the `PathScurry`, use
+`pw.cwd.resolve(path)`. Note that `Path.resolve` only takes a
+single string argument, not multiple.
+
+#### `pw.resolvePosix(...paths: string[])`
+
+Caching `path.resolve()`, but always using posix style paths.
+
+This is identical to `pw.resolve(...paths)` on posix systems (ie,
+everywhere except Windows).
+
+On Windows, it returns the full absolute UNC path using `/`
+separators. Ie, instead of `'C:\\foo\\bar`, it would return
+`//?/C:/foo/bar`.
+
+#### `pw.relative(path: string | Path): string`
+
+Return the relative path from the PathWalker cwd to the supplied
+path string or entry.
+
+If the nearest common ancestor is the root, then an absolute path
+is returned.
+
+#### `pw.relativePosix(path: string | Path): string`
+
+Return the relative path from the PathWalker cwd to the supplied
+path string or entry, using `/` path separators.
+
+If the nearest common ancestor is the root, then an absolute path
+is returned.
+
+On posix platforms (ie, all platforms except Windows), this is
+identical to `pw.relative(path)`.
+
+On Windows systems, it returns the resulting string as a
+`/`-delimited path. If an absolute path is returned (because the
+target does not share a common ancestor with `pw.cwd`), then a
+full absolute UNC path will be returned. Ie, instead of
+`'C:\\foo\\bar`, it would return `//?/C:/foo/bar`.
+
+#### `pw.basename(path: string | Path): string`
+
+Return the basename of the provided string or Path.
+
+#### `pw.dirname(path: string | Path): string`
+
+Return the parent directory of the supplied string or Path.
+
+#### `async pw.readdir(dir = pw.cwd, opts = { withFileTypes: true })`
+
+Read the directory and resolve to an array of strings if
+`withFileTypes` is explicitly set to `false` or Path objects
+otherwise.
+
+Can be called as `pw.readdir({ withFileTypes: boolean })` as
+well.
+
+Returns `[]` if no entries are found, or if any error occurs.
+
+Note that TypeScript return types will only be inferred properly
+from static analysis if the `withFileTypes` option is omitted, or
+a constant `true` or `false` value.
+
+#### `pw.readdirSync(dir = pw.cwd, opts = { withFileTypes: true })`
+
+Synchronous `pw.readdir()`
+
+#### `async pw.readlink(link = pw.cwd, opts = { withFileTypes: false })`
+
+Call `fs.readlink` on the supplied string or Path object, and
+return the result.
+
+Can be called as `pw.readlink({ withFileTypes: boolean })` as
+well.
+
+Returns `undefined` if any error occurs (for example, if the
+argument is not a symbolic link), or a `Path` object if
+`withFileTypes` is explicitly set to `true`, or a string
+otherwise.
+
+Note that TypeScript return types will only be inferred properly
+from static analysis if the `withFileTypes` option is omitted, or
+a constant `true` or `false` value.
+
+#### `pw.readlinkSync(link = pw.cwd, opts = { withFileTypes: false })`
+
+Synchronous `pw.readlink()`
+
+#### `async pw.lstat(entry = pw.cwd)`
+
+Call `fs.lstat` on the supplied string or Path object, and fill
+in as much information as possible, returning the updated `Path`
+object.
+
+Returns `undefined` if the entry does not exist, or if any error
+is encountered.
+
+Note that some `Stats` data (such as `ino`, `dev`, and `mode`)
+will not be supplied. For those things, you'll need to call
+`fs.lstat` yourself.
+
+#### `pw.lstatSync(entry = pw.cwd)`
+
+Synchronous `pw.lstat()`
+
+#### `pw.realpath(entry = pw.cwd, opts = { withFileTypes: false })`
+
+Call `fs.realpath` on the supplied string or Path object, and
+return the realpath if available.
+
+Returns `undefined` if any error occurs.
+
+May be called as `pw.realpath({ withFileTypes: boolean })` to run
+on `pw.cwd`.
+
+#### `pw.realpathSync(entry = pw.cwd, opts = { withFileTypes: false })`
+
+Synchronous `pw.realpath()`
+
+### Class `Path` implements [fs.Dirent](https://nodejs.org/docs/latest/api/fs.html#class-fsdirent)
+
+Object representing a given path on the filesystem, which may or
+may not exist.
+
+Note that the actual class in use will be either `PathWin32` or
+`PathPosix`, depending on the implementation of `PathScurry` in
+use. They differ in the separators used to split and join path
+strings, and the handling of root paths.
+
+In `PathPosix` implementations, paths are split and joined using
+the `'/'` character, and `'/'` is the only root path ever in use.
+
+In `PathWin32` implementations, paths are split using either
+`'/'` or `'\\'` and joined using `'\\'`, and multiple roots may
+be in use based on the drives and UNC paths encountered. UNC
+paths such as `//?/C:/` that identify a drive letter, will be
+treated as an alias for the same root entry as their associated
+drive letter (in this case `'C:\\'`).
+
+#### `path.name`
+
+Name of this file system entry.
+
+**Important**: _always_ test the path name against any test
+string using the `isNamed` method, and not by directly comparing
+this string. Otherwise, unicode path strings that the system sees
+as identical will not be properly treated as the same path,
+leading to incorrect behavior and possible security issues.
+
+#### `path.isNamed(name: string): boolean`
+
+Return true if the path is a match for the given path name. This
+handles case sensitivity and unicode normalization.
+
+Note: even on case-sensitive systems, it is **not** safe to test
+the equality of the `.name` property to determine whether a given
+pathname matches, due to unicode normalization mismatches.
+
+Always use this method instead of testing the `path.name`
+property directly.
+
+#### `path.isCWD`
+
+Set to true if this `Path` object is the current working
+directory of the `PathScurry` collection that contains it.
+
+#### `path.getType()`
+
+Returns the type of the Path object, `'File'`, `'Directory'`,
+etc.
+
+#### `path.isType(t: type)`
+
+Returns true if `is{t}()` returns true.
+
+For example, `path.isType('Directory')` is equivalent to
+`path.isDirectory()`.
+
+#### `path.depth()`
+
+Return the depth of the Path entry within the directory tree.
+Root paths have a depth of `0`.
+
+#### `path.fullpath()`
+
+The fully resolved path to the entry.
+
+#### `path.fullpathPosix()`
+
+The fully resolved path to the entry, using `/` separators.
+
+On posix systems, this is identical to `path.fullpath()`. On
+windows, this will return a fully resolved absolute UNC path
+using `/` separators. Eg, instead of `'C:\\foo\\bar'`, it will
+return `'//?/C:/foo/bar'`.
+
+#### `path.isFile()`, `path.isDirectory()`, etc.
+
+Same as the identical `fs.Dirent.isX()` methods.
+
+#### `path.isUnknown()`
+
+Returns true if the path's type is unknown. Always returns true
+when the path is known to not exist.
+
+#### `path.resolve(p: string)`
+
+Return a `Path` object associated with the provided path string
+as resolved from the current Path object.
+
+#### `path.relative(): string`
+
+Return the relative path from the PathWalker cwd to the supplied
+path string or entry.
+
+If the nearest common ancestor is the root, then an absolute path
+is returned.
+
+#### `path.relativePosix(): string`
+
+Return the relative path from the PathWalker cwd to the supplied
+path string or entry, using `/` path separators.
+
+If the nearest common ancestor is the root, then an absolute path
+is returned.
+
+On posix platforms (ie, all platforms except Windows), this is
+identical to `pw.relative(path)`.
+
+On Windows systems, it returns the resulting string as a
+`/`-delimited path. If an absolute path is returned (because the
+target does not share a common ancestor with `pw.cwd`), then a
+full absolute UNC path will be returned. Ie, instead of
+`'C:\\foo\\bar`, it would return `//?/C:/foo/bar`.
+
+#### `async path.readdir()`
+
+Return an array of `Path` objects found by reading the associated
+path entry.
+
+If path is not a directory, or if any error occurs, returns `[]`,
+and marks all children as provisional and non-existent.
+
+#### `path.readdirSync()`
+
+Synchronous `path.readdir()`
+
+#### `async path.readlink()`
+
+Return the `Path` object referenced by the `path` as a symbolic
+link.
+
+If the `path` is not a symbolic link, or any error occurs,
+returns `undefined`.
+
+#### `path.readlinkSync()`
+
+Synchronous `path.readlink()`
+
+#### `async path.lstat()`
+
+Call `lstat` on the path object, and fill it in with details
+determined.
+
+If path does not exist, or any other error occurs, returns
+`undefined`, and marks the path as "unknown" type.
+
+#### `path.lstatSync()`
+
+Synchronous `path.lstat()`
+
+#### `async path.realpath()`
+
+Call `realpath` on the path, and return a Path object
+corresponding to the result, or `undefined` if any error occurs.
+
+#### `path.realpathSync()`
+
+Synchornous `path.realpath()`
diff --git a/node_modules/path-scurry/dist/commonjs/index.d.ts b/node_modules/path-scurry/dist/commonjs/index.d.ts
new file mode 100644
index 00000000..ef31b1b7
--- /dev/null
+++ b/node_modules/path-scurry/dist/commonjs/index.d.ts
@@ -0,0 +1,1115 @@
+import { LRUCache } from 'lru-cache';
+import { posix, win32 } from 'node:path';
+import { Minipass } from 'minipass';
+import type { Dirent, Stats } from 'node:fs';
+/**
+ * An object that will be used to override the default `fs`
+ * methods.  Any methods that are not overridden will use Node's
+ * built-in implementations.
+ *
+ * - lstatSync
+ * - readdir (callback `withFileTypes` Dirent variant, used for
+ *   readdirCB and most walks)
+ * - readdirSync
+ * - readlinkSync
+ * - realpathSync
+ * - promises: Object containing the following async methods:
+ *   - lstat
+ *   - readdir (Dirent variant only)
+ *   - readlink
+ *   - realpath
+ */
+export interface FSOption {
+    lstatSync?: (path: string) => Stats;
+    readdir?: (path: string, options: {
+        withFileTypes: true;
+    }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
+    readdirSync?: (path: string, options: {
+        withFileTypes: true;
+    }) => Dirent[];
+    readlinkSync?: (path: string) => string;
+    realpathSync?: (path: string) => string;
+    promises?: {
+        lstat?: (path: string) => Promise;
+        readdir?: (path: string, options: {
+            withFileTypes: true;
+        }) => Promise;
+        readlink?: (path: string) => Promise;
+        realpath?: (path: string) => Promise;
+        [k: string]: any;
+    };
+    [k: string]: any;
+}
+interface FSValue {
+    lstatSync: (path: string) => Stats;
+    readdir: (path: string, options: {
+        withFileTypes: true;
+    }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
+    readdirSync: (path: string, options: {
+        withFileTypes: true;
+    }) => Dirent[];
+    readlinkSync: (path: string) => string;
+    realpathSync: (path: string) => string;
+    promises: {
+        lstat: (path: string) => Promise;
+        readdir: (path: string, options: {
+            withFileTypes: true;
+        }) => Promise;
+        readlink: (path: string) => Promise;
+        realpath: (path: string) => Promise;
+        [k: string]: any;
+    };
+    [k: string]: any;
+}
+export type Type = 'Unknown' | 'FIFO' | 'CharacterDevice' | 'Directory' | 'BlockDevice' | 'File' | 'SymbolicLink' | 'Socket';
+/**
+ * Options that may be provided to the Path constructor
+ */
+export interface PathOpts {
+    fullpath?: string;
+    relative?: string;
+    relativePosix?: string;
+    parent?: PathBase;
+    /**
+     * See {@link FSOption}
+     */
+    fs?: FSOption;
+}
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+export declare class ResolveCache extends LRUCache {
+    constructor();
+}
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+export declare class ChildrenCache extends LRUCache {
+    constructor(maxSize?: number);
+}
+/**
+ * Array of Path objects, plus a marker indicating the first provisional entry
+ *
+ * @internal
+ */
+export type Children = PathBase[] & {
+    provisional: number;
+};
+declare const setAsCwd: unique symbol;
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+export declare abstract class PathBase implements Dirent {
+    #private;
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name: string;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root: PathBase;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots: {
+        [k: string]: PathBase;
+    };
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent?: PathBase;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase: boolean;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD: boolean;
+    /**
+     * the string or regexp used to split paths. On posix, it is `'/'`, and on
+     * windows it is a RegExp matching either `'/'` or `'\\'`
+     */
+    abstract splitSep: string | RegExp;
+    /**
+     * The path separator string to use when joining paths
+     */
+    abstract sep: string;
+    get dev(): number | undefined;
+    get mode(): number | undefined;
+    get nlink(): number | undefined;
+    get uid(): number | undefined;
+    get gid(): number | undefined;
+    get rdev(): number | undefined;
+    get blksize(): number | undefined;
+    get ino(): number | undefined;
+    get size(): number | undefined;
+    get blocks(): number | undefined;
+    get atimeMs(): number | undefined;
+    get mtimeMs(): number | undefined;
+    get ctimeMs(): number | undefined;
+    get birthtimeMs(): number | undefined;
+    get atime(): Date | undefined;
+    get mtime(): Date | undefined;
+    get ctime(): Date | undefined;
+    get birthtime(): Date | undefined;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath(): string;
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path(): string;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth(): number;
+    /**
+     * @internal
+     */
+    abstract getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    abstract getRoot(rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase;
+    /**
+     * @internal
+     */
+    childrenCache(): ChildrenCache;
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path?: string): PathBase;
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children(): Children;
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart: string, opts?: PathOpts): PathBase;
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative(): string;
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix(): string;
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath(): string;
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix(): string;
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown(): boolean;
+    isType(type: Type): boolean;
+    getType(): Type;
+    /**
+     * Is the Path a regular file?
+     */
+    isFile(): boolean;
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory(): boolean;
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice(): boolean;
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice(): boolean;
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO(): boolean;
+    /**
+     * Is the path a socket?
+     */
+    isSocket(): boolean;
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink(): boolean;
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached(): PathBase | undefined;
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached(): PathBase | undefined;
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached(): PathBase | undefined;
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached(): PathBase[];
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink(): boolean;
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir(): boolean;
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT(): boolean;
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n: string): boolean;
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    readlink(): Promise;
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync(): PathBase | undefined;
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    lstat(): Promise;
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync(): PathBase | undefined;
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    readdir(): Promise;
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync(): PathBase[];
+    canReaddir(): boolean;
+    shouldWalk(dirs: Set, walkFilter?: (e: PathBase) => boolean): boolean;
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    realpath(): Promise;
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync(): PathBase | undefined;
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd: PathBase): void;
+}
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+export declare class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep: '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep: RegExp;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * @internal
+     */
+    newChild(name: string, type?: number, opts?: PathOpts): PathWin32;
+    /**
+     * @internal
+     */
+    getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    getRoot(rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    sameRoot(rootPath: string, compare?: string): boolean;
+}
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+export declare class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep: '/';
+    /**
+     * separator for generating path strings
+     */
+    sep: '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * @internal
+     */
+    getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    getRoot(_rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    newChild(name: string, type?: number, opts?: PathOpts): PathPosix;
+}
+/**
+ * Options that may be provided to the PathScurry constructor
+ */
+export interface PathScurryOpts {
+    /**
+     * perform case-insensitive path matching. Default based on platform
+     * subclass.
+     */
+    nocase?: boolean;
+    /**
+     * Number of Path entries to keep in the cache of Path child references.
+     *
+     * Setting this higher than 65536 will dramatically increase the data
+     * consumption and construction time overhead of each PathScurry.
+     *
+     * Setting this value to 256 or lower will significantly reduce the data
+     * consumption and construction time overhead, but may also reduce resolve()
+     * and readdir() performance on large filesystems.
+     *
+     * Default `16384`.
+     */
+    childrenCacheSize?: number;
+    /**
+     * An object that overrides the built-in functions from the fs and
+     * fs/promises modules.
+     *
+     * See {@link FSOption}
+     */
+    fs?: FSOption;
+}
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+export declare abstract class PathScurryBase {
+    #private;
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root: PathBase;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath: string;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots: {
+        [k: string]: PathBase;
+    };
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd: PathBase;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase: boolean;
+    /**
+     * The path separator used for parsing paths
+     *
+     * `'/'` on Posix systems, either `'/'` or `'\\'` on Windows
+     */
+    abstract sep: string | RegExp;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd: (URL | string) | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts);
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path?: Path | string): number;
+    /**
+     * Parse the root portion of a path string
+     *
+     * @internal
+     */
+    abstract parseRootPath(dir: string): string;
+    /**
+     * create a new Path to use as root during construction.
+     *
+     * @internal
+     */
+    abstract newRoot(fs: FSValue): PathBase;
+    /**
+     * Determine whether a given path string is absolute
+     */
+    abstract isAbsolute(p: string): boolean;
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache(): ChildrenCache;
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths: string[]): string;
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths: string[]): string;
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry?: PathBase | string): string;
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry?: PathBase | string): string;
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry?: PathBase | string): string;
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry?: PathBase | string): string;
+    /**
+     * Return an array of known child entries.
+     *
+     * First argument may be either a string, or a Path object.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set
+     * `{ withFileTypes: false }` to return strings.
+     */
+    readdir(): Promise;
+    readdir(opts: {
+        withFileTypes: true;
+    }): Promise;
+    readdir(opts: {
+        withFileTypes: false;
+    }): Promise;
+    readdir(opts: {
+        withFileTypes: boolean;
+    }): Promise;
+    readdir(entry: PathBase | string): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: true;
+    }): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: false;
+    }): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: boolean;
+    }): Promise;
+    /**
+     * synchronous {@link PathScurryBase.readdir}
+     */
+    readdirSync(): PathBase[];
+    readdirSync(opts: {
+        withFileTypes: true;
+    }): PathBase[];
+    readdirSync(opts: {
+        withFileTypes: false;
+    }): string[];
+    readdirSync(opts: {
+        withFileTypes: boolean;
+    }): PathBase[] | string[];
+    readdirSync(entry: PathBase | string): PathBase[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: true;
+    }): PathBase[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: false;
+    }): string[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: boolean;
+    }): PathBase[] | string[];
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    lstat(entry?: string | PathBase): Promise;
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry?: string | PathBase): PathBase | undefined;
+    /**
+     * Return the Path object or string path corresponding to the target of a
+     * symbolic link.
+     *
+     * If the path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     *
+     * `{withFileTypes}` option defaults to `false`.
+     *
+     * On success, returns a Path object if `withFileTypes` option is true,
+     * otherwise a string.
+     */
+    readlink(): Promise;
+    readlink(opt: {
+        withFileTypes: false;
+    }): Promise;
+    readlink(opt: {
+        withFileTypes: true;
+    }): Promise;
+    readlink(opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    readlink(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): Promise;
+    readlink(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): Promise;
+    readlink(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    /**
+     * synchronous {@link PathScurryBase.readlink}
+     */
+    readlinkSync(): string | undefined;
+    readlinkSync(opt: {
+        withFileTypes: false;
+    }): string | undefined;
+    readlinkSync(opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    readlinkSync(opt: {
+        withFileTypes: boolean;
+    }): PathBase | string | undefined;
+    readlinkSync(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): string | undefined;
+    readlinkSync(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    readlinkSync(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): string | PathBase | undefined;
+    /**
+     * Return the Path object or string path corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     *
+     * `{withFileTypes}` option defaults to `false`.
+     *
+     * On success, returns a Path object if `withFileTypes` option is true,
+     * otherwise a string.
+     */
+    realpath(): Promise;
+    realpath(opt: {
+        withFileTypes: false;
+    }): Promise;
+    realpath(opt: {
+        withFileTypes: true;
+    }): Promise;
+    realpath(opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    realpath(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): Promise;
+    realpath(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): Promise;
+    realpath(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    realpathSync(): string | undefined;
+    realpathSync(opt: {
+        withFileTypes: false;
+    }): string | undefined;
+    realpathSync(opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    realpathSync(opt: {
+        withFileTypes: boolean;
+    }): PathBase | string | undefined;
+    realpathSync(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): string | undefined;
+    realpathSync(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    realpathSync(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): string | PathBase | undefined;
+    /**
+     * Asynchronously walk the directory tree, returning an array of
+     * all path strings or Path objects found.
+     *
+     * Note that this will be extremely memory-hungry on large filesystems.
+     * In such cases, it may be better to use the stream or async iterator
+     * walk implementation.
+     */
+    walk(): Promise;
+    walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise;
+    walk(opts: WalkOptionsWithFileTypesFalse): Promise;
+    walk(opts: WalkOptions): Promise;
+    walk(entry: string | PathBase): Promise;
+    walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise;
+    walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise;
+    walk(entry: string | PathBase, opts: WalkOptions): Promise;
+    /**
+     * Synchronously walk the directory tree, returning an array of
+     * all path strings or Path objects found.
+     *
+     * Note that this will be extremely memory-hungry on large filesystems.
+     * In such cases, it may be better to use the stream or async iterator
+     * walk implementation.
+     */
+    walkSync(): PathBase[];
+    walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[];
+    walkSync(opts: WalkOptionsWithFileTypesFalse): string[];
+    walkSync(opts: WalkOptions): string[] | PathBase[];
+    walkSync(entry: string | PathBase): PathBase[];
+    walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[];
+    walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[];
+    walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[];
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator](): AsyncGenerator;
+    /**
+     * Async generator form of {@link PathScurryBase.walk}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking, especially if most/all of the directory tree has been previously
+     * walked.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    iterate(): AsyncGenerator;
+    iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator;
+    iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator;
+    iterate(opts: WalkOptions): AsyncGenerator;
+    iterate(entry: string | PathBase): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator;
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator](): Generator;
+    iterateSync(): Generator;
+    iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator;
+    iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator;
+    iterateSync(opts: WalkOptions): Generator;
+    iterateSync(entry: string | PathBase): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptions): Generator;
+    /**
+     * Stream form of {@link PathScurryBase.walk}
+     *
+     * Returns a Minipass stream that emits {@link PathBase} objects by default,
+     * or strings if `{ withFileTypes: false }` is set in the options.
+     */
+    stream(): Minipass;
+    stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass;
+    stream(opts: WalkOptionsWithFileTypesFalse): Minipass;
+    stream(opts: WalkOptions): Minipass;
+    stream(entry: string | PathBase): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass;
+    /**
+     * Synchronous form of {@link PathScurryBase.stream}
+     *
+     * Returns a Minipass stream that emits {@link PathBase} objects by default,
+     * or strings if `{ withFileTypes: false }` is set in the options.
+     *
+     * Will complete the walk in a single tick if the stream is consumed fully.
+     * Otherwise, will pause as needed for stream backpressure.
+     */
+    streamSync(): Minipass;
+    streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass;
+    streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass;
+    streamSync(opts: WalkOptions): Minipass;
+    streamSync(entry: string | PathBase): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass;
+    chdir(path?: string | Path): void;
+}
+/**
+ * Options provided to all walk methods.
+ */
+export interface WalkOptions {
+    /**
+     * Return results as {@link PathBase} objects rather than strings.
+     * When set to false, results are fully resolved paths, as returned by
+     * {@link PathBase.fullpath}.
+     * @default true
+     */
+    withFileTypes?: boolean;
+    /**
+     *  Attempt to read directory entries from symbolic links. Otherwise, only
+     *  actual directories are traversed. Regardless of this setting, a given
+     *  target path will only ever be walked once, meaning that a symbolic link
+     *  to a previously traversed directory will never be followed.
+     *
+     *  Setting this imposes a slight performance penalty, because `readlink`
+     *  must be called on all symbolic links encountered, in order to avoid
+     *  infinite cycles.
+     * @default false
+     */
+    follow?: boolean;
+    /**
+     * Only return entries where the provided function returns true.
+     *
+     * This will not prevent directories from being traversed, even if they do
+     * not pass the filter, though it will prevent directories themselves from
+     * being included in the result set.  See {@link walkFilter}
+     *
+     * Asynchronous functions are not supported here.
+     *
+     * By default, if no filter is provided, all entries and traversed
+     * directories are included.
+     */
+    filter?: (entry: PathBase) => boolean;
+    /**
+     * Only traverse directories (and in the case of {@link follow} being set to
+     * true, symbolic links to directories) if the provided function returns
+     * true.
+     *
+     * This will not prevent directories from being included in the result set,
+     * even if they do not pass the supplied filter function.  See {@link filter}
+     * to do that.
+     *
+     * Asynchronous functions are not supported here.
+     */
+    walkFilter?: (entry: PathBase) => boolean;
+}
+export type WalkOptionsWithFileTypesUnset = WalkOptions & {
+    withFileTypes?: undefined;
+};
+export type WalkOptionsWithFileTypesTrue = WalkOptions & {
+    withFileTypes: true;
+};
+export type WalkOptionsWithFileTypesFalse = WalkOptions & {
+    withFileTypes: false;
+};
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+export declare class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep: '\\';
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+    /**
+     * @internal
+     */
+    parseRootPath(dir: string): string;
+    /**
+     * @internal
+     */
+    newRoot(fs: FSValue): PathWin32;
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p: string): boolean;
+}
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export declare class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep: '/';
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+    /**
+     * @internal
+     */
+    parseRootPath(_dir: string): string;
+    /**
+     * @internal
+     */
+    newRoot(fs: FSValue): PathPosix;
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p: string): boolean;
+}
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export declare class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+}
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+export declare const Path: typeof PathWin32 | typeof PathPosix;
+export type Path = PathBase | InstanceType;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+export declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix;
+export type PathScurry = PathScurryBase | InstanceType;
+export {};
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/path-scurry/dist/commonjs/index.d.ts.map b/node_modules/path-scurry/dist/commonjs/index.d.ts.map
new file mode 100644
index 00000000..bf58a3a3
--- /dev/null
+++ b/node_modules/path-scurry/dist/commonjs/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAmBxC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAA;IACnC,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,EAChC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,KAC9D,IAAI,CAAA;IACT,WAAW,CAAC,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,I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_modules/path-scurry/dist/commonjs/index.js
new file mode 100644
index 00000000..112f732d
--- /dev/null
+++ b/node_modules/path-scurry/dist/commonjs/index.js
@@ -0,0 +1,2018 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || function (mod) {
+    if (mod && mod.__esModule) return mod;
+    var result = {};
+    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
+    __setModuleDefault(result, mod);
+    return result;
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = void 0;
+const lru_cache_1 = require("lru-cache");
+const node_path_1 = require("node:path");
+const node_url_1 = require("node:url");
+const fs_1 = require("fs");
+const actualFS = __importStar(require("node:fs"));
+const realpathSync = fs_1.realpathSync.native;
+// TODO: test perf of fs/promises realpath vs realpathCB,
+// since the promises one uses realpath.native
+const promises_1 = require("node:fs/promises");
+const minipass_1 = require("minipass");
+const defaultFS = {
+    lstatSync: fs_1.lstatSync,
+    readdir: fs_1.readdir,
+    readdirSync: fs_1.readdirSync,
+    readlinkSync: fs_1.readlinkSync,
+    realpathSync,
+    promises: {
+        lstat: promises_1.lstat,
+        readdir: promises_1.readdir,
+        readlink: promises_1.readlink,
+        realpath: promises_1.realpath,
+    },
+};
+// if they just gave us require('fs') then use our default
+const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ?
+    defaultFS
+    : {
+        ...defaultFS,
+        ...fsOption,
+        promises: {
+            ...defaultFS.promises,
+            ...(fsOption.promises || {}),
+        },
+    };
+// turn something like //?/c:/ into c:\
+const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
+const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
+// windows paths are separated by either / or \
+const eitherSep = /[\\\/]/;
+const UNKNOWN = 0; // may not even exist, for all we know
+const IFIFO = 0b0001;
+const IFCHR = 0b0010;
+const IFDIR = 0b0100;
+const IFBLK = 0b0110;
+const IFREG = 0b1000;
+const IFLNK = 0b1010;
+const IFSOCK = 0b1100;
+const IFMT = 0b1111;
+// mask to unset low 4 bits
+const IFMT_UNKNOWN = ~IFMT;
+// set after successfully calling readdir() and getting entries.
+const READDIR_CALLED = 0b0000_0001_0000;
+// set after a successful lstat()
+const LSTAT_CALLED = 0b0000_0010_0000;
+// set if an entry (or one of its parents) is definitely not a dir
+const ENOTDIR = 0b0000_0100_0000;
+// set if an entry (or one of its parents) does not exist
+// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
+const ENOENT = 0b0000_1000_0000;
+// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
+// set if we fail to readlink
+const ENOREADLINK = 0b0001_0000_0000;
+// set if we know realpath() will fail
+const ENOREALPATH = 0b0010_0000_0000;
+const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
+const TYPEMASK = 0b0011_1111_1111;
+const entToType = (s) => s.isFile() ? IFREG
+    : s.isDirectory() ? IFDIR
+        : s.isSymbolicLink() ? IFLNK
+            : s.isCharacterDevice() ? IFCHR
+                : s.isBlockDevice() ? IFBLK
+                    : s.isSocket() ? IFSOCK
+                        : s.isFIFO() ? IFIFO
+                            : UNKNOWN;
+// normalize unicode path names
+const normalizeCache = new lru_cache_1.LRUCache({ max: 2 ** 12 });
+const normalize = (s) => {
+    const c = normalizeCache.get(s);
+    if (c)
+        return c;
+    const n = s.normalize('NFKD');
+    normalizeCache.set(s, n);
+    return n;
+};
+const normalizeNocaseCache = new lru_cache_1.LRUCache({ max: 2 ** 12 });
+const normalizeNocase = (s) => {
+    const c = normalizeNocaseCache.get(s);
+    if (c)
+        return c;
+    const n = normalize(s.toLowerCase());
+    normalizeNocaseCache.set(s, n);
+    return n;
+};
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+class ResolveCache extends lru_cache_1.LRUCache {
+    constructor() {
+        super({ max: 256 });
+    }
+}
+exports.ResolveCache = ResolveCache;
+// In order to prevent blowing out the js heap by allocating hundreds of
+// thousands of Path entries when walking extremely large trees, the "children"
+// in this tree are represented by storing an array of Path entries in an
+// LRUCache, indexed by the parent.  At any time, Path.children() may return an
+// empty array, indicating that it doesn't know about any of its children, and
+// thus has to rebuild that cache.  This is fine, it just means that we don't
+// benefit as much from having the cached entries, but huge directory walks
+// don't blow out the stack, and smaller ones are still as fast as possible.
+//
+//It does impose some complexity when building up the readdir data, because we
+//need to pass a reference to the children array that we started with.
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+class ChildrenCache extends lru_cache_1.LRUCache {
+    constructor(maxSize = 16 * 1024) {
+        super({
+            maxSize,
+            // parent + children
+            sizeCalculation: a => a.length + 1,
+        });
+    }
+}
+exports.ChildrenCache = ChildrenCache;
+const setAsCwd = Symbol('PathScurry setAsCwd');
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+class PathBase {
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots;
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD = false;
+    // potential default fs override
+    #fs;
+    // Stats fields
+    #dev;
+    get dev() {
+        return this.#dev;
+    }
+    #mode;
+    get mode() {
+        return this.#mode;
+    }
+    #nlink;
+    get nlink() {
+        return this.#nlink;
+    }
+    #uid;
+    get uid() {
+        return this.#uid;
+    }
+    #gid;
+    get gid() {
+        return this.#gid;
+    }
+    #rdev;
+    get rdev() {
+        return this.#rdev;
+    }
+    #blksize;
+    get blksize() {
+        return this.#blksize;
+    }
+    #ino;
+    get ino() {
+        return this.#ino;
+    }
+    #size;
+    get size() {
+        return this.#size;
+    }
+    #blocks;
+    get blocks() {
+        return this.#blocks;
+    }
+    #atimeMs;
+    get atimeMs() {
+        return this.#atimeMs;
+    }
+    #mtimeMs;
+    get mtimeMs() {
+        return this.#mtimeMs;
+    }
+    #ctimeMs;
+    get ctimeMs() {
+        return this.#ctimeMs;
+    }
+    #birthtimeMs;
+    get birthtimeMs() {
+        return this.#birthtimeMs;
+    }
+    #atime;
+    get atime() {
+        return this.#atime;
+    }
+    #mtime;
+    get mtime() {
+        return this.#mtime;
+    }
+    #ctime;
+    get ctime() {
+        return this.#ctime;
+    }
+    #birthtime;
+    get birthtime() {
+        return this.#birthtime;
+    }
+    #matchName;
+    #depth;
+    #fullpath;
+    #fullpathPosix;
+    #relative;
+    #relativePosix;
+    #type;
+    #children;
+    #linkTarget;
+    #realpath;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath() {
+        return (this.parent || this).fullpath();
+    }
+    /* c8 ignore start */
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path() {
+        return this.parentPath;
+    }
+    /* c8 ignore stop */
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        this.name = name;
+        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
+        this.#type = type & TYPEMASK;
+        this.nocase = nocase;
+        this.roots = roots;
+        this.root = root || this;
+        this.#children = children;
+        this.#fullpath = opts.fullpath;
+        this.#relative = opts.relative;
+        this.#relativePosix = opts.relativePosix;
+        this.parent = opts.parent;
+        if (this.parent) {
+            this.#fs = this.parent.#fs;
+        }
+        else {
+            this.#fs = fsFromOption(opts.fs);
+        }
+    }
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth() {
+        if (this.#depth !== undefined)
+            return this.#depth;
+        if (!this.parent)
+            return (this.#depth = 0);
+        return (this.#depth = this.parent.depth() + 1);
+    }
+    /**
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path) {
+        if (!path) {
+            return this;
+        }
+        const rootPath = this.getRootString(path);
+        const dir = path.substring(rootPath.length);
+        const dirParts = dir.split(this.splitSep);
+        const result = rootPath ?
+            this.getRoot(rootPath).#resolveParts(dirParts)
+            : this.#resolveParts(dirParts);
+        return result;
+    }
+    #resolveParts(dirParts) {
+        let p = this;
+        for (const part of dirParts) {
+            p = p.child(part);
+        }
+        return p;
+    }
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children() {
+        const cached = this.#children.get(this);
+        if (cached) {
+            return cached;
+        }
+        const children = Object.assign([], { provisional: 0 });
+        this.#children.set(this, children);
+        this.#type &= ~READDIR_CALLED;
+        return children;
+    }
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart, opts) {
+        if (pathPart === '' || pathPart === '.') {
+            return this;
+        }
+        if (pathPart === '..') {
+            return this.parent || this;
+        }
+        // find the child
+        const children = this.children();
+        const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);
+        for (const p of children) {
+            if (p.#matchName === name) {
+                return p;
+            }
+        }
+        // didn't find it, create provisional child, since it might not
+        // actually exist.  If we know the parent isn't a dir, then
+        // in fact it CAN'T exist.
+        const s = this.parent ? this.sep : '';
+        const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;
+        const pchild = this.newChild(pathPart, UNKNOWN, {
+            ...opts,
+            parent: this,
+            fullpath,
+        });
+        if (!this.canReaddir()) {
+            pchild.#type |= ENOENT;
+        }
+        // don't have to update provisional, because if we have real children,
+        // then provisional is set to children.length, otherwise a lower number
+        children.push(pchild);
+        return pchild;
+    }
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative() {
+        if (this.isCWD)
+            return '';
+        if (this.#relative !== undefined) {
+            return this.#relative;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relative = this.name);
+        }
+        const pv = p.relative();
+        return pv + (!pv || !p.parent ? '' : this.sep) + name;
+    }
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix() {
+        if (this.sep === '/')
+            return this.relative();
+        if (this.isCWD)
+            return '';
+        if (this.#relativePosix !== undefined)
+            return this.#relativePosix;
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relativePosix = this.fullpathPosix());
+        }
+        const pv = p.relativePosix();
+        return pv + (!pv || !p.parent ? '' : '/') + name;
+    }
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath() {
+        if (this.#fullpath !== undefined) {
+            return this.#fullpath;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#fullpath = this.name);
+        }
+        const pv = p.fullpath();
+        const fp = pv + (!p.parent ? '' : this.sep) + name;
+        return (this.#fullpath = fp);
+    }
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix() {
+        if (this.#fullpathPosix !== undefined)
+            return this.#fullpathPosix;
+        if (this.sep === '/')
+            return (this.#fullpathPosix = this.fullpath());
+        if (!this.parent) {
+            const p = this.fullpath().replace(/\\/g, '/');
+            if (/^[a-z]:\//i.test(p)) {
+                return (this.#fullpathPosix = `//?/${p}`);
+            }
+            else {
+                return (this.#fullpathPosix = p);
+            }
+        }
+        const p = this.parent;
+        const pfpp = p.fullpathPosix();
+        const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;
+        return (this.#fullpathPosix = fpp);
+    }
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown() {
+        return (this.#type & IFMT) === UNKNOWN;
+    }
+    isType(type) {
+        return this[`is${type}`]();
+    }
+    getType() {
+        return (this.isUnknown() ? 'Unknown'
+            : this.isDirectory() ? 'Directory'
+                : this.isFile() ? 'File'
+                    : this.isSymbolicLink() ? 'SymbolicLink'
+                        : this.isFIFO() ? 'FIFO'
+                            : this.isCharacterDevice() ? 'CharacterDevice'
+                                : this.isBlockDevice() ? 'BlockDevice'
+                                    : /* c8 ignore start */ this.isSocket() ? 'Socket'
+                                        : 'Unknown');
+        /* c8 ignore stop */
+    }
+    /**
+     * Is the Path a regular file?
+     */
+    isFile() {
+        return (this.#type & IFMT) === IFREG;
+    }
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory() {
+        return (this.#type & IFMT) === IFDIR;
+    }
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice() {
+        return (this.#type & IFMT) === IFCHR;
+    }
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice() {
+        return (this.#type & IFMT) === IFBLK;
+    }
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO() {
+        return (this.#type & IFMT) === IFIFO;
+    }
+    /**
+     * Is the path a socket?
+     */
+    isSocket() {
+        return (this.#type & IFMT) === IFSOCK;
+    }
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink() {
+        return (this.#type & IFLNK) === IFLNK;
+    }
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached() {
+        return this.#type & LSTAT_CALLED ? this : undefined;
+    }
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached() {
+        return this.#linkTarget;
+    }
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached() {
+        return this.#realpath;
+    }
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached() {
+        const children = this.children();
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink() {
+        if (this.#linkTarget)
+            return true;
+        if (!this.parent)
+            return false;
+        // cases where it cannot possibly succeed
+        const ifmt = this.#type & IFMT;
+        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
+            this.#type & ENOREADLINK ||
+            this.#type & ENOENT);
+    }
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir() {
+        return !!(this.#type & READDIR_CALLED);
+    }
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT() {
+        return !!(this.#type & ENOENT);
+    }
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n) {
+        return !this.nocase ?
+            this.#matchName === normalize(n)
+            : this.#matchName === normalizeNocase(n);
+    }
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    async readlink() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = await this.#fs.promises.readlink(this.fullpath());
+            const linkTarget = (await this.parent.realpath())?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = this.#fs.readlinkSync(this.fullpath());
+            const linkTarget = this.parent.realpathSync()?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    #readdirSuccess(children) {
+        // succeeded, mark readdir called bit
+        this.#type |= READDIR_CALLED;
+        // mark all remaining provisional children as ENOENT
+        for (let p = children.provisional; p < children.length; p++) {
+            const c = children[p];
+            if (c)
+                c.#markENOENT();
+        }
+    }
+    #markENOENT() {
+        // mark as UNKNOWN and ENOENT
+        if (this.#type & ENOENT)
+            return;
+        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
+        this.#markChildrenENOENT();
+    }
+    #markChildrenENOENT() {
+        // all children are provisional and do not exist
+        const children = this.children();
+        children.provisional = 0;
+        for (const p of children) {
+            p.#markENOENT();
+        }
+    }
+    #markENOREALPATH() {
+        this.#type |= ENOREALPATH;
+        this.#markENOTDIR();
+    }
+    // save the information when we know the entry is not a dir
+    #markENOTDIR() {
+        // entry is not a directory, so any children can't exist.
+        // this *should* be impossible, since any children created
+        // after it's been marked ENOTDIR should be marked ENOENT,
+        // so it won't even get to this point.
+        /* c8 ignore start */
+        if (this.#type & ENOTDIR)
+            return;
+        /* c8 ignore stop */
+        let t = this.#type;
+        // this could happen if we stat a dir, then delete it,
+        // then try to read it or one of its children.
+        if ((t & IFMT) === IFDIR)
+            t &= IFMT_UNKNOWN;
+        this.#type = t | ENOTDIR;
+        this.#markChildrenENOENT();
+    }
+    #readdirFail(code = '') {
+        // markENOTDIR and markENOENT also set provisional=0
+        if (code === 'ENOTDIR' || code === 'EPERM') {
+            this.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            this.#markENOENT();
+        }
+        else {
+            this.children().provisional = 0;
+        }
+    }
+    #lstatFail(code = '') {
+        // Windows just raises ENOENT in this case, disable for win CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR') {
+            // already know it has a parent by this point
+            const p = this.parent;
+            p.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            /* c8 ignore stop */
+            this.#markENOENT();
+        }
+    }
+    #readlinkFail(code = '') {
+        let ter = this.#type;
+        ter |= ENOREADLINK;
+        if (code === 'ENOENT')
+            ter |= ENOENT;
+        // windows gets a weird error when you try to readlink a file
+        if (code === 'EINVAL' || code === 'UNKNOWN') {
+            // exists, but not a symlink, we don't know WHAT it is, so remove
+            // all IFMT bits.
+            ter &= IFMT_UNKNOWN;
+        }
+        this.#type = ter;
+        // windows just gets ENOENT in this case.  We do cover the case,
+        // just disabled because it's impossible on Windows CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR' && this.parent) {
+            this.parent.#markENOTDIR();
+        }
+        /* c8 ignore stop */
+    }
+    #readdirAddChild(e, c) {
+        return (this.#readdirMaybePromoteChild(e, c) ||
+            this.#readdirAddNewChild(e, c));
+    }
+    #readdirAddNewChild(e, c) {
+        // alloc new entry at head, so it's never provisional
+        const type = entToType(e);
+        const child = this.newChild(e.name, type, { parent: this });
+        const ifmt = child.#type & IFMT;
+        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
+            child.#type |= ENOTDIR;
+        }
+        c.unshift(child);
+        c.provisional++;
+        return child;
+    }
+    #readdirMaybePromoteChild(e, c) {
+        for (let p = c.provisional; p < c.length; p++) {
+            const pchild = c[p];
+            const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
+            if (name !== pchild.#matchName) {
+                continue;
+            }
+            return this.#readdirPromoteChild(e, pchild, p, c);
+        }
+    }
+    #readdirPromoteChild(e, p, index, c) {
+        const v = p.name;
+        // retain any other flags, but set ifmt from dirent
+        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
+        // case sensitivity fixing when we learn the true name.
+        if (v !== e.name)
+            p.name = e.name;
+        // just advance provisional index (potentially off the list),
+        // otherwise we have to splice/pop it out and re-insert at head
+        if (index !== c.provisional) {
+            if (index === c.length - 1)
+                c.pop();
+            else
+                c.splice(index, 1);
+            c.unshift(p);
+        }
+        c.provisional++;
+        return p;
+    }
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    #applyStat(st) {
+        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
+        this.#atime = atime;
+        this.#atimeMs = atimeMs;
+        this.#birthtime = birthtime;
+        this.#birthtimeMs = birthtimeMs;
+        this.#blksize = blksize;
+        this.#blocks = blocks;
+        this.#ctime = ctime;
+        this.#ctimeMs = ctimeMs;
+        this.#dev = dev;
+        this.#gid = gid;
+        this.#ino = ino;
+        this.#mode = mode;
+        this.#mtime = mtime;
+        this.#mtimeMs = mtimeMs;
+        this.#nlink = nlink;
+        this.#rdev = rdev;
+        this.#size = size;
+        this.#uid = uid;
+        const ifmt = entToType(st);
+        // retain any other flags, but set the ifmt
+        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
+        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
+            this.#type |= ENOTDIR;
+        }
+    }
+    #onReaddirCB = [];
+    #readdirCBInFlight = false;
+    #callOnReaddirCB(children) {
+        this.#readdirCBInFlight = false;
+        const cbs = this.#onReaddirCB.slice();
+        this.#onReaddirCB.length = 0;
+        cbs.forEach(cb => cb(null, children));
+    }
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb, allowZalgo = false) {
+        if (!this.canReaddir()) {
+            if (allowZalgo)
+                cb(null, []);
+            else
+                queueMicrotask(() => cb(null, []));
+            return;
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            const c = children.slice(0, children.provisional);
+            if (allowZalgo)
+                cb(null, c);
+            else
+                queueMicrotask(() => cb(null, c));
+            return;
+        }
+        // don't have to worry about zalgo at this point.
+        this.#onReaddirCB.push(cb);
+        if (this.#readdirCBInFlight) {
+            return;
+        }
+        this.#readdirCBInFlight = true;
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
+            if (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            else {
+                // if we didn't get an error, we always get entries.
+                //@ts-ignore
+                for (const e of entries) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            this.#callOnReaddirCB(children.slice(0, children.provisional));
+            return;
+        });
+    }
+    #asyncReaddirInFlight;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async readdir() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        if (this.#asyncReaddirInFlight) {
+            await this.#asyncReaddirInFlight;
+        }
+        else {
+            /* c8 ignore start */
+            let resolve = () => { };
+            /* c8 ignore stop */
+            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
+            try {
+                for (const e of await this.#fs.promises.readdir(fullpath, {
+                    withFileTypes: true,
+                })) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            catch (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            this.#asyncReaddirInFlight = undefined;
+            resolve();
+        }
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        try {
+            for (const e of this.#fs.readdirSync(fullpath, {
+                withFileTypes: true,
+            })) {
+                this.#readdirAddChild(e, children);
+            }
+            this.#readdirSuccess(children);
+        }
+        catch (er) {
+            this.#readdirFail(er.code);
+            children.provisional = 0;
+        }
+        return children.slice(0, children.provisional);
+    }
+    canReaddir() {
+        if (this.#type & ENOCHILD)
+            return false;
+        const ifmt = IFMT & this.#type;
+        // we always set ENOTDIR when setting IFMT, so should be impossible
+        /* c8 ignore start */
+        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
+            return false;
+        }
+        /* c8 ignore stop */
+        return true;
+    }
+    shouldWalk(dirs, walkFilter) {
+        return ((this.#type & IFDIR) === IFDIR &&
+            !(this.#type & ENOCHILD) &&
+            !dirs.has(this) &&
+            (!walkFilter || walkFilter(this)));
+    }
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    async realpath() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = await this.#fs.promises.realpath(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = this.#fs.realpathSync(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd) {
+        if (oldCwd === this)
+            return;
+        oldCwd.isCWD = false;
+        this.isCWD = true;
+        const changed = new Set([]);
+        let rp = [];
+        let p = this;
+        while (p && p.parent) {
+            changed.add(p);
+            p.#relative = rp.join(this.sep);
+            p.#relativePosix = rp.join('/');
+            p = p.parent;
+            rp.push('..');
+        }
+        // now un-memoize parents of old cwd
+        p = oldCwd;
+        while (p && p.parent && !changed.has(p)) {
+            p.#relative = undefined;
+            p.#relativePosix = undefined;
+            p = p.parent;
+        }
+    }
+}
+exports.PathBase = PathBase;
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep = '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep = eitherSep;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return node_path_1.win32.parse(path).root;
+    }
+    /**
+     * @internal
+     */
+    getRoot(rootPath) {
+        rootPath = uncToDrive(rootPath.toUpperCase());
+        if (rootPath === this.root.name) {
+            return this.root;
+        }
+        // ok, not that one, check if it matches another we know about
+        for (const [compare, root] of Object.entries(this.roots)) {
+            if (this.sameRoot(rootPath, compare)) {
+                return (this.roots[rootPath] = root);
+            }
+        }
+        // otherwise, have to create a new one.
+        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
+    }
+    /**
+     * @internal
+     */
+    sameRoot(rootPath, compare = this.root.name) {
+        // windows can (rarely) have case-sensitive filesystem, but
+        // UNC and drive letters are always case-insensitive, and canonically
+        // represented uppercase.
+        rootPath = rootPath
+            .toUpperCase()
+            .replace(/\//g, '\\')
+            .replace(uncDriveRegexp, '$1\\');
+        return rootPath === compare;
+    }
+}
+exports.PathWin32 = PathWin32;
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep = '/';
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return path.startsWith('/') ? '/' : '';
+    }
+    /**
+     * @internal
+     */
+    getRoot(_rootPath) {
+        return this.root;
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+}
+exports.PathPosix = PathPosix;
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+class PathScurryBase {
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots;
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd;
+    #resolveCache;
+    #resolvePosixCache;
+    #children;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase;
+    #fs;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
+        this.#fs = fsFromOption(fs);
+        if (cwd instanceof URL || cwd.startsWith('file://')) {
+            cwd = (0, node_url_1.fileURLToPath)(cwd);
+        }
+        // resolve and split root, and then add to the store.
+        // this is the only time we call path.resolve()
+        const cwdPath = pathImpl.resolve(cwd);
+        this.roots = Object.create(null);
+        this.rootPath = this.parseRootPath(cwdPath);
+        this.#resolveCache = new ResolveCache();
+        this.#resolvePosixCache = new ResolveCache();
+        this.#children = new ChildrenCache(childrenCacheSize);
+        const split = cwdPath.substring(this.rootPath.length).split(sep);
+        // resolve('/') leaves '', splits to [''], we don't want that.
+        if (split.length === 1 && !split[0]) {
+            split.pop();
+        }
+        /* c8 ignore start */
+        if (nocase === undefined) {
+            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
+        }
+        /* c8 ignore stop */
+        this.nocase = nocase;
+        this.root = this.newRoot(this.#fs);
+        this.roots[this.rootPath] = this.root;
+        let prev = this.root;
+        let len = split.length - 1;
+        const joinSep = pathImpl.sep;
+        let abs = this.rootPath;
+        let sawFirst = false;
+        for (const part of split) {
+            const l = len--;
+            prev = prev.child(part, {
+                relative: new Array(l).fill('..').join(joinSep),
+                relativePosix: new Array(l).fill('..').join('/'),
+                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
+            });
+            sawFirst = true;
+        }
+        this.cwd = prev;
+    }
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path = this.cwd) {
+        if (typeof path === 'string') {
+            path = this.cwd.resolve(path);
+        }
+        return path.depth();
+    }
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolveCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpath();
+        this.#resolveCache.set(r, result);
+        return result;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolvePosixCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpathPosix();
+        this.#resolvePosixCache.set(r, result);
+        return result;
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relative();
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relativePosix();
+    }
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.name;
+    }
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return (entry.parent || entry).fullpath();
+    }
+    async readdir(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else {
+            const p = await entry.readdir();
+            return withFileTypes ? p : p.map(e => e.name);
+        }
+    }
+    readdirSync(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else if (withFileTypes) {
+            return entry.readdirSync();
+        }
+        else {
+            return entry.readdirSync().map(e => e.name);
+        }
+    }
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstat();
+    }
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstatSync();
+    }
+    async readlink(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.readlink();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    readlinkSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.readlinkSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async realpath(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.realpath();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    realpathSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.realpathSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async walk(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const walk = (dir, cb) => {
+            dirs.add(dir);
+            dir.readdirCB((er, entries) => {
+                /* c8 ignore start */
+                if (er) {
+                    return cb(er);
+                }
+                /* c8 ignore stop */
+                let len = entries.length;
+                if (!len)
+                    return cb();
+                const next = () => {
+                    if (--len === 0) {
+                        cb();
+                    }
+                };
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        results.push(withFileTypes ? e : e.fullpath());
+                    }
+                    if (follow && e.isSymbolicLink()) {
+                        e.realpath()
+                            .then(r => (r?.isUnknown() ? r.lstat() : r))
+                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
+                    }
+                    else {
+                        if (e.shouldWalk(dirs, walkFilter)) {
+                            walk(e, next);
+                        }
+                        else {
+                            next();
+                        }
+                    }
+                }
+            }, true); // zalgooooooo
+        };
+        const start = entry;
+        return new Promise((res, rej) => {
+            walk(start, er => {
+                /* c8 ignore start */
+                if (er)
+                    return rej(er);
+                /* c8 ignore stop */
+                res(results);
+            });
+        });
+    }
+    walkSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    results.push(withFileTypes ? e : e.fullpath());
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+        return results;
+    }
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator]() {
+        return this.iterate();
+    }
+    iterate(entry = this.cwd, options = {}) {
+        // iterating async over the stream is significantly more performant,
+        // especially in the warm-cache scenario, because it buffers up directory
+        // entries in the background instead of waiting for a yield for each one.
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            options = entry;
+            entry = this.cwd;
+        }
+        return this.stream(entry, options)[Symbol.asyncIterator]();
+    }
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator]() {
+        return this.iterateSync();
+    }
+    *iterateSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        if (!filter || filter(entry)) {
+            yield withFileTypes ? entry : entry.fullpath();
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    yield withFileTypes ? e : e.fullpath();
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+    }
+    stream(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new minipass_1.Minipass({ objectMode: true });
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const onReaddir = (er, entries, didRealpaths = false) => {
+                    /* c8 ignore start */
+                    if (er)
+                        return results.emit('error', er);
+                    /* c8 ignore stop */
+                    if (follow && !didRealpaths) {
+                        const promises = [];
+                        for (const e of entries) {
+                            if (e.isSymbolicLink()) {
+                                promises.push(e
+                                    .realpath()
+                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
+                            }
+                        }
+                        if (promises.length) {
+                            Promise.all(promises).then(() => onReaddir(null, entries, true));
+                            return;
+                        }
+                    }
+                    for (const e of entries) {
+                        if (e && (!filter || filter(e))) {
+                            if (!results.write(withFileTypes ? e : e.fullpath())) {
+                                paused = true;
+                            }
+                        }
+                    }
+                    processing--;
+                    for (const e of entries) {
+                        const r = e.realpathCached() || e;
+                        if (r.shouldWalk(dirs, walkFilter)) {
+                            queue.push(r);
+                        }
+                    }
+                    if (paused && !results.flowing) {
+                        results.once('drain', process);
+                    }
+                    else if (!sync) {
+                        process();
+                    }
+                };
+                // zalgo containment
+                let sync = true;
+                dir.readdirCB(onReaddir, true);
+                sync = false;
+            }
+        };
+        process();
+        return results;
+    }
+    streamSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new minipass_1.Minipass({ objectMode: true });
+        const dirs = new Set();
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const entries = dir.readdirSync();
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        if (!results.write(withFileTypes ? e : e.fullpath())) {
+                            paused = true;
+                        }
+                    }
+                }
+                processing--;
+                for (const e of entries) {
+                    let r = e;
+                    if (e.isSymbolicLink()) {
+                        if (!(follow && (r = e.realpathSync())))
+                            continue;
+                        if (r.isUnknown())
+                            r.lstatSync();
+                    }
+                    if (r.shouldWalk(dirs, walkFilter)) {
+                        queue.push(r);
+                    }
+                }
+            }
+            if (paused && !results.flowing)
+                results.once('drain', process);
+        };
+        process();
+        return results;
+    }
+    chdir(path = this.cwd) {
+        const oldCwd = this.cwd;
+        this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;
+        this.cwd[setAsCwd](oldCwd);
+    }
+}
+exports.PathScurryBase = PathScurryBase;
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '\\';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, node_path_1.win32, '\\', { ...opts, nocase });
+        this.nocase = nocase;
+        for (let p = this.cwd; p; p = p.parent) {
+            p.nocase = this.nocase;
+        }
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(dir) {
+        // if the path starts with a single separator, it's not a UNC, and we'll
+        // just get separator as the root, and driveFromUNC will return \
+        // In that case, mount \ on the root from the cwd.
+        return node_path_1.win32.parse(dir).root.toUpperCase();
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
+    }
+}
+exports.PathScurryWin32 = PathScurryWin32;
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = false } = opts;
+        super(cwd, node_path_1.posix, '/', { ...opts, nocase });
+        this.nocase = nocase;
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(_dir) {
+        return '/';
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return p.startsWith('/');
+    }
+}
+exports.PathScurryPosix = PathScurryPosix;
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, { ...opts, nocase });
+    }
+}
+exports.PathScurryDarwin = PathScurryDarwin;
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+exports.Path = process.platform === 'win32' ? PathWin32 : PathPosix;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+exports.PathScurry = process.platform === 'win32' ? PathScurryWin32
+    : process.platform === 'darwin' ? PathScurryDarwin
+        : PathScurryPosix;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/path-scurry/dist/commonjs/index.js.map b/node_modules/path-scurry/dist/commonjs/index.js.map
new file mode 100644
index 00000000..a20f78ad
--- /dev/null
+++ b/node_modules/path-scurry/dist/commonjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,yCAAwC;AAExC,uCAAwC;AAExC,2BAMW;AACX,kDAAmC;AAEnC,MAAM,YAAY,GAAG,iBAAG,CAAC,MAAM,CAAA;AAC/B,yDAAyD;AACzD,8CAA8C;AAE9C,+CAAqE;AAErE,uCAAmC;AAqEnC,MAAM,SAAS,GAAY;IACzB,SAAS,EAAT,cAAS;IACT,OAAO,EAAE,YAAS;IAClB,WAAW,EAAX,gBAAW;IACX,YAAY,EAAZ,iBAAY;IACZ,YAAY;IACZ,QAAQ,EAAE;QACR,KAAK,EAAL,gBAAK;QACL,OAAO,EAAP,kBAAO;QACP,QAAQ,EAAR,mBAAQ;QACR,QAAQ,EAAR,mBAAQ;KACT;CACF,CAAA;AAED,0DAA0D;AAC1D,MAAM,YAAY,GAAG,CAAC,QAAmB,EAAW,EAAE,CACpD,CAAC,QAAQ,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,QAAQ,CAAC,CAAC;IAC5D,SAAS;IACX,CAAC,CAAC;QACE,GAAG,SAAS;QACZ,GAAG,QAAQ;QACX,QAAQ,EAAE;YACR,GAAG,SAAS,CAAC,QAAQ;YACrB,GAAG,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC;SAC7B;KACF,CAAA;AAEL,uCAAuC;AACvC,MAAM,cAAc,GAAG,wBAAwB,CAAA;AAC/C,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC9C,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,I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aAAa,EAAE,EACpB,EAAE,EAAE,EAAE,CACP,CAAA;IACH,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,CAAS;QAClB,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;IAC1B,CAAC;CACF;AA1CD,0CA0CC;AAED;;;;;;;GAOG;AACH,MAAa,gBAAiB,SAAQ,eAAe;IACnD,YACE,MAAoB,OAAO,CAAC,GAAG,EAAE,EACjC,OAAuB,EAAE;QAEzB,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;QAC9B,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IACjC,CAAC;CACF;AARD,4CAQC;AAED;;;;GAIG;AACU,QAAA,IAAI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAGxE;;;;;GAKG;AACU,QAAA,UAAU,GAIrB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe;IAC9C,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB;QAClD,CAAC,CAAC,eAAe,CAAA","sourcesContent":["import { LRUCache } from 'lru-cache'\nimport { posix, win32 } from 'node:path'\n\nimport { fileURLToPath } from 'node:url'\n\nimport {\n  lstatSync,\n  readdir as readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync as rps,\n} from 'fs'\nimport * as actualFS from 'node:fs'\n\nconst realpathSync = rps.native\n// TODO: test perf of fs/promises realpath vs realpathCB,\n// since the promises one uses realpath.native\n\nimport { lstat, readdir, readlink, realpath } from 'node:fs/promises'\n\nimport { Minipass } from 'minipass'\nimport type { Dirent, Stats } from 'node:fs'\n\n/**\n * An object that will be used to override the default `fs`\n * methods.  Any methods that are not overridden will use Node's\n * built-in implementations.\n *\n * - lstatSync\n * - readdir (callback `withFileTypes` Dirent variant, used for\n *   readdirCB and most walks)\n * - readdirSync\n * - readlinkSync\n * - realpathSync\n * - promises: Object containing the following async methods:\n *   - lstat\n *   - readdir (Dirent variant only)\n *   - readlink\n *   - realpath\n */\nexport interface FSOption {\n  lstatSync?: (path: string) => Stats\n  readdir?: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync?: (\n    path: string,\n    options: { withFileTypes: true },\n  ) => Dirent[]\n  readlinkSync?: (path: string) => string\n  realpathSync?: (path: string) => string\n  promises?: {\n    lstat?: (path: string) => Promise\n    readdir?: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink?: (path: string) => Promise\n    realpath?: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\ninterface FSValue {\n  lstatSync: (path: string) => Stats\n  readdir: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync: (path: string, options: { withFileTypes: true }) => Dirent[]\n  readlinkSync: (path: string) => string\n  realpathSync: (path: string) => string\n  promises: {\n    lstat: (path: string) => Promise\n    readdir: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink: (path: string) => Promise\n    realpath: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\nconst defaultFS: FSValue = {\n  lstatSync,\n  readdir: readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync,\n  promises: {\n    lstat,\n    readdir,\n    readlink,\n    realpath,\n  },\n}\n\n// if they just gave us require('fs') then use our default\nconst fsFromOption = (fsOption?: FSOption): FSValue =>\n  !fsOption || fsOption === defaultFS || fsOption === actualFS ?\n    defaultFS\n  : {\n      ...defaultFS,\n      ...fsOption,\n      promises: {\n        ...defaultFS.promises,\n        ...(fsOption.promises || {}),\n      },\n    }\n\n// turn something like //?/c:/ into c:\\\nconst uncDriveRegexp = /^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i\nconst uncToDrive = (rootPath: string): string =>\n  rootPath.replace(/\\//g, '\\\\').replace(uncDriveRegexp, '$1\\\\')\n\n// windows paths are separated by either / or \\\nconst eitherSep = /[\\\\\\/]/\n\nconst UNKNOWN = 0 // may not even exist, for all we know\nconst IFIFO = 0b0001\nconst IFCHR = 0b0010\nconst IFDIR = 0b0100\nconst IFBLK = 0b0110\nconst IFREG = 0b1000\nconst IFLNK = 0b1010\nconst IFSOCK = 0b1100\nconst IFMT = 0b1111\n\nexport type Type =\n  | 'Unknown'\n  | 'FIFO'\n  | 'CharacterDevice'\n  | 'Directory'\n  | 'BlockDevice'\n  | 'File'\n  | 'SymbolicLink'\n  | 'Socket'\n\n// mask to unset low 4 bits\nconst IFMT_UNKNOWN = ~IFMT\n\n// set after successfully calling readdir() and getting entries.\nconst READDIR_CALLED = 0b0000_0001_0000\n// set after a successful lstat()\nconst LSTAT_CALLED = 0b0000_0010_0000\n// set if an entry (or one of its parents) is definitely not a dir\nconst ENOTDIR = 0b0000_0100_0000\n// set if an entry (or one of its parents) does not exist\n// (can also be set on lstat errors like EACCES or ENAMETOOLONG)\nconst ENOENT = 0b0000_1000_0000\n// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK\n// set if we fail to readlink\nconst ENOREADLINK = 0b0001_0000_0000\n// set if we know realpath() will fail\nconst ENOREALPATH = 0b0010_0000_0000\n\nconst ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH\nconst TYPEMASK = 0b0011_1111_1111\n\nconst entToType = (s: Dirent | Stats) =>\n  s.isFile() ? IFREG\n  : s.isDirectory() ? IFDIR\n  : s.isSymbolicLink() ? IFLNK\n  : s.isCharacterDevice() ? IFCHR\n  : s.isBlockDevice() ? IFBLK\n  : s.isSocket() ? IFSOCK\n  : s.isFIFO() ? IFIFO\n  : UNKNOWN\n\n// normalize unicode path names\nconst normalizeCache = new LRUCache({ max: 2 ** 12 })\nconst normalize = (s: string) => {\n  const c = normalizeCache.get(s)\n  if (c) return c\n  const n = s.normalize('NFKD')\n  normalizeCache.set(s, n)\n  return n\n}\n\nconst normalizeNocaseCache = new LRUCache({ max: 2 ** 12 })\nconst normalizeNocase = (s: string) => {\n  const c = normalizeNocaseCache.get(s)\n  if (c) return c\n  const n = normalize(s.toLowerCase())\n  normalizeNocaseCache.set(s, n)\n  return n\n}\n\n/**\n * Options that may be provided to the Path constructor\n */\nexport interface PathOpts {\n  fullpath?: string\n  relative?: string\n  relativePosix?: string\n  parent?: PathBase\n  /**\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * An LRUCache for storing resolved path strings or Path objects.\n * @internal\n */\nexport class ResolveCache extends LRUCache {\n  constructor() {\n    super({ max: 256 })\n  }\n}\n\n// In order to prevent blowing out the js heap by allocating hundreds of\n// thousands of Path entries when walking extremely large trees, the \"children\"\n// in this tree are represented by storing an array of Path entries in an\n// LRUCache, indexed by the parent.  At any time, Path.children() may return an\n// empty array, indicating that it doesn't know about any of its children, and\n// thus has to rebuild that cache.  This is fine, it just means that we don't\n// benefit as much from having the cached entries, but huge directory walks\n// don't blow out the stack, and smaller ones are still as fast as possible.\n//\n//It does impose some complexity when building up the readdir data, because we\n//need to pass a reference to the children array that we started with.\n\n/**\n * an LRUCache for storing child entries.\n * @internal\n */\nexport class ChildrenCache extends LRUCache {\n  constructor(maxSize: number = 16 * 1024) {\n    super({\n      maxSize,\n      // parent + children\n      sizeCalculation: a => a.length + 1,\n    })\n  }\n}\n\n/**\n * Array of Path objects, plus a marker indicating the first provisional entry\n *\n * @internal\n */\nexport type Children = PathBase[] & { provisional: number }\n\nconst setAsCwd = Symbol('PathScurry setAsCwd')\n\n/**\n * Path objects are sort of like a super-powered\n * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}\n *\n * Each one represents a single filesystem entry on disk, which may or may not\n * exist. It includes methods for reading various types of information via\n * lstat, readlink, and readdir, and caches all information to the greatest\n * degree possible.\n *\n * Note that fs operations that would normally throw will instead return an\n * \"empty\" value. This is in order to prevent excessive overhead from error\n * stack traces.\n */\nexport abstract class PathBase implements Dirent {\n  /**\n   * the basename of this path\n   *\n   * **Important**: *always* test the path name against any test string\n   * usingthe {@link isNamed} method, and not by directly comparing this\n   * string. Otherwise, unicode path strings that the system sees as identical\n   * will not be properly treated as the same path, leading to incorrect\n   * behavior and possible security issues.\n   */\n  name: string\n  /**\n   * the Path entry corresponding to the path root.\n   *\n   * @internal\n   */\n  root: PathBase\n  /**\n   * All roots found within the current PathScurry family\n   *\n   * @internal\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * a reference to the parent path, or undefined in the case of root entries\n   *\n   * @internal\n   */\n  parent?: PathBase\n  /**\n   * boolean indicating whether paths are compared case-insensitively\n   * @internal\n   */\n  nocase: boolean\n\n  /**\n   * boolean indicating that this path is the current working directory\n   * of the PathScurry collection that contains it.\n   */\n  isCWD: boolean = false\n\n  /**\n   * the string or regexp used to split paths. On posix, it is `'/'`, and on\n   * windows it is a RegExp matching either `'/'` or `'\\\\'`\n   */\n  abstract splitSep: string | RegExp\n  /**\n   * The path separator string to use when joining paths\n   */\n  abstract sep: string\n\n  // potential default fs override\n  #fs: FSValue\n\n  // Stats fields\n  #dev?: number\n  get dev() {\n    return this.#dev\n  }\n  #mode?: number\n  get mode() {\n    return this.#mode\n  }\n  #nlink?: number\n  get nlink() {\n    return this.#nlink\n  }\n  #uid?: number\n  get uid() {\n    return this.#uid\n  }\n  #gid?: number\n  get gid() {\n    return this.#gid\n  }\n  #rdev?: number\n  get rdev() {\n    return this.#rdev\n  }\n  #blksize?: number\n  get blksize() {\n    return this.#blksize\n  }\n  #ino?: number\n  get ino() {\n    return this.#ino\n  }\n  #size?: number\n  get size() {\n    return this.#size\n  }\n  #blocks?: number\n  get blocks() {\n    return this.#blocks\n  }\n  #atimeMs?: number\n  get atimeMs() {\n    return this.#atimeMs\n  }\n  #mtimeMs?: number\n  get mtimeMs() {\n    return this.#mtimeMs\n  }\n  #ctimeMs?: number\n  get ctimeMs() {\n    return this.#ctimeMs\n  }\n  #birthtimeMs?: number\n  get birthtimeMs() {\n    return this.#birthtimeMs\n  }\n  #atime?: Date\n  get atime() {\n    return this.#atime\n  }\n  #mtime?: Date\n  get mtime() {\n    return this.#mtime\n  }\n  #ctime?: Date\n  get ctime() {\n    return this.#ctime\n  }\n  #birthtime?: Date\n  get birthtime() {\n    return this.#birthtime\n  }\n\n  #matchName: string\n  #depth?: number\n  #fullpath?: string\n  #fullpathPosix?: string\n  #relative?: string\n  #relativePosix?: string\n  #type: number\n  #children: ChildrenCache\n  #linkTarget?: PathBase\n  #realpath?: PathBase\n\n  /**\n   * This property is for compatibility with the Dirent class as of\n   * Node v20, where Dirent['parentPath'] refers to the path of the\n   * directory that was passed to readdir. For root entries, it's the path\n   * to the entry itself.\n   */\n  get parentPath(): string {\n    return (this.parent || this).fullpath()\n  }\n\n  /* c8 ignore start */\n  /**\n   * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,\n   * this property refers to the *parent* path, not the path object itself.\n   *\n   * @deprecated\n   */\n  get path(): string {\n    return this.parentPath\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    this.name = name\n    this.#matchName = nocase ? normalizeNocase(name) : normalize(name)\n    this.#type = type & TYPEMASK\n    this.nocase = nocase\n    this.roots = roots\n    this.root = root || this\n    this.#children = children\n    this.#fullpath = opts.fullpath\n    this.#relative = opts.relative\n    this.#relativePosix = opts.relativePosix\n    this.parent = opts.parent\n    if (this.parent) {\n      this.#fs = this.parent.#fs\n    } else {\n      this.#fs = fsFromOption(opts.fs)\n    }\n  }\n\n  /**\n   * Returns the depth of the Path object from its root.\n   *\n   * For example, a path at `/foo/bar` would have a depth of 2.\n   */\n  depth(): number {\n    if (this.#depth !== undefined) return this.#depth\n    if (!this.parent) return (this.#depth = 0)\n    return (this.#depth = this.parent.depth() + 1)\n  }\n\n  /**\n   * @internal\n   */\n  abstract getRootString(path: string): string\n  /**\n   * @internal\n   */\n  abstract getRoot(rootPath: string): PathBase\n  /**\n   * @internal\n   */\n  abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase\n\n  /**\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Get the Path object referenced by the string path, resolved from this Path\n   */\n  resolve(path?: string): PathBase {\n    if (!path) {\n      return this\n    }\n    const rootPath = this.getRootString(path)\n    const dir = path.substring(rootPath.length)\n    const dirParts = dir.split(this.splitSep)\n    const result: PathBase =\n      rootPath ?\n        this.getRoot(rootPath).#resolveParts(dirParts)\n      : this.#resolveParts(dirParts)\n    return result\n  }\n\n  #resolveParts(dirParts: string[]) {\n    let p: PathBase = this\n    for (const part of dirParts) {\n      p = p.child(part)\n    }\n    return p\n  }\n\n  /**\n   * Returns the cached children Path objects, if still available.  If they\n   * have fallen out of the cache, then returns an empty array, and resets the\n   * READDIR_CALLED bit, so that future calls to readdir() will require an fs\n   * lookup.\n   *\n   * @internal\n   */\n  children(): Children {\n    const cached = this.#children.get(this)\n    if (cached) {\n      return cached\n    }\n    const children: Children = Object.assign([], { provisional: 0 })\n    this.#children.set(this, children)\n    this.#type &= ~READDIR_CALLED\n    return children\n  }\n\n  /**\n   * Resolves a path portion and returns or creates the child Path.\n   *\n   * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is\n   * `'..'`.\n   *\n   * This should not be called directly.  If `pathPart` contains any path\n   * separators, it will lead to unsafe undefined behavior.\n   *\n   * Use `Path.resolve()` instead.\n   *\n   * @internal\n   */\n  child(pathPart: string, opts?: PathOpts): PathBase {\n    if (pathPart === '' || pathPart === '.') {\n      return this\n    }\n    if (pathPart === '..') {\n      return this.parent || this\n    }\n\n    // find the child\n    const children = this.children()\n    const name =\n      this.nocase ? normalizeNocase(pathPart) : normalize(pathPart)\n    for (const p of children) {\n      if (p.#matchName === name) {\n        return p\n      }\n    }\n\n    // didn't find it, create provisional child, since it might not\n    // actually exist.  If we know the parent isn't a dir, then\n    // in fact it CAN'T exist.\n    const s = this.parent ? this.sep : ''\n    const fullpath =\n      this.#fullpath ? this.#fullpath + s + pathPart : undefined\n    const pchild = this.newChild(pathPart, UNKNOWN, {\n      ...opts,\n      parent: this,\n      fullpath,\n    })\n\n    if (!this.canReaddir()) {\n      pchild.#type |= ENOENT\n    }\n\n    // don't have to update provisional, because if we have real children,\n    // then provisional is set to children.length, otherwise a lower number\n    children.push(pchild)\n    return pchild\n  }\n\n  /**\n   * The relative path from the cwd. If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpath()\n   */\n  relative(): string {\n    if (this.isCWD) return ''\n    if (this.#relative !== undefined) {\n      return this.#relative\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relative = this.name)\n    }\n    const pv = p.relative()\n    return pv + (!pv || !p.parent ? '' : this.sep) + name\n  }\n\n  /**\n   * The relative path from the cwd, using / as the path separator.\n   * If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpathPosix()\n   * On posix systems, this is identical to relative().\n   */\n  relativePosix(): string {\n    if (this.sep === '/') return this.relative()\n    if (this.isCWD) return ''\n    if (this.#relativePosix !== undefined) return this.#relativePosix\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relativePosix = this.fullpathPosix())\n    }\n    const pv = p.relativePosix()\n    return pv + (!pv || !p.parent ? '' : '/') + name\n  }\n\n  /**\n   * The fully resolved path string for this Path entry\n   */\n  fullpath(): string {\n    if (this.#fullpath !== undefined) {\n      return this.#fullpath\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#fullpath = this.name)\n    }\n    const pv = p.fullpath()\n    const fp = pv + (!p.parent ? '' : this.sep) + name\n    return (this.#fullpath = fp)\n  }\n\n  /**\n   * On platforms other than windows, this is identical to fullpath.\n   *\n   * On windows, this is overridden to return the forward-slash form of the\n   * full UNC path.\n   */\n  fullpathPosix(): string {\n    if (this.#fullpathPosix !== undefined) return this.#fullpathPosix\n    if (this.sep === '/') return (this.#fullpathPosix = this.fullpath())\n    if (!this.parent) {\n      const p = this.fullpath().replace(/\\\\/g, '/')\n      if (/^[a-z]:\\//i.test(p)) {\n        return (this.#fullpathPosix = `//?/${p}`)\n      } else {\n        return (this.#fullpathPosix = p)\n      }\n    }\n    const p = this.parent\n    const pfpp = p.fullpathPosix()\n    const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name\n    return (this.#fullpathPosix = fpp)\n  }\n\n  /**\n   * Is the Path of an unknown type?\n   *\n   * Note that we might know *something* about it if there has been a previous\n   * filesystem operation, for example that it does not exist, or is not a\n   * link, or whether it has child entries.\n   */\n  isUnknown(): boolean {\n    return (this.#type & IFMT) === UNKNOWN\n  }\n\n  isType(type: Type): boolean {\n    return this[`is${type}`]()\n  }\n\n  getType(): Type {\n    return (\n      this.isUnknown() ? 'Unknown'\n      : this.isDirectory() ? 'Directory'\n      : this.isFile() ? 'File'\n      : this.isSymbolicLink() ? 'SymbolicLink'\n      : this.isFIFO() ? 'FIFO'\n      : this.isCharacterDevice() ? 'CharacterDevice'\n      : this.isBlockDevice() ? 'BlockDevice'\n      : /* c8 ignore start */ this.isSocket() ? 'Socket'\n      : 'Unknown'\n    )\n    /* c8 ignore stop */\n  }\n\n  /**\n   * Is the Path a regular file?\n   */\n  isFile(): boolean {\n    return (this.#type & IFMT) === IFREG\n  }\n\n  /**\n   * Is the Path a directory?\n   */\n  isDirectory(): boolean {\n    return (this.#type & IFMT) === IFDIR\n  }\n\n  /**\n   * Is the path a character device?\n   */\n  isCharacterDevice(): boolean {\n    return (this.#type & IFMT) === IFCHR\n  }\n\n  /**\n   * Is the path a block device?\n   */\n  isBlockDevice(): boolean {\n    return (this.#type & IFMT) === IFBLK\n  }\n\n  /**\n   * Is the path a FIFO pipe?\n   */\n  isFIFO(): boolean {\n    return (this.#type & IFMT) === IFIFO\n  }\n\n  /**\n   * Is the path a socket?\n   */\n  isSocket(): boolean {\n    return (this.#type & IFMT) === IFSOCK\n  }\n\n  /**\n   * Is the path a symbolic link?\n   */\n  isSymbolicLink(): boolean {\n    return (this.#type & IFLNK) === IFLNK\n  }\n\n  /**\n   * Return the entry if it has been subject of a successful lstat, or\n   * undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* simply\n   * mean that we haven't called lstat on it.\n   */\n  lstatCached(): PathBase | undefined {\n    return this.#type & LSTAT_CALLED ? this : undefined\n  }\n\n  /**\n   * Return the cached link target if the entry has been the subject of a\n   * successful readlink, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readlink() has been called at some point.\n   */\n  readlinkCached(): PathBase | undefined {\n    return this.#linkTarget\n  }\n\n  /**\n   * Returns the cached realpath target if the entry has been the subject\n   * of a successful realpath, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * realpath() has been called at some point.\n   */\n  realpathCached(): PathBase | undefined {\n    return this.#realpath\n  }\n\n  /**\n   * Returns the cached child Path entries array if the entry has been the\n   * subject of a successful readdir(), or [] otherwise.\n   *\n   * Does not read the filesystem, so an empty array *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readdir() has been called recently enough to still be valid.\n   */\n  readdirCached(): PathBase[] {\n    const children = this.children()\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * Return true if it's worth trying to readlink.  Ie, we don't (yet) have\n   * any indication that readlink will definitely fail.\n   *\n   * Returns false if the path is known to not be a symlink, if a previous\n   * readlink failed, or if the entry does not exist.\n   */\n  canReadlink(): boolean {\n    if (this.#linkTarget) return true\n    if (!this.parent) return false\n    // cases where it cannot possibly succeed\n    const ifmt = this.#type & IFMT\n    return !(\n      (ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n      this.#type & ENOREADLINK ||\n      this.#type & ENOENT\n    )\n  }\n\n  /**\n   * Return true if readdir has previously been successfully called on this\n   * path, indicating that cachedReaddir() is likely valid.\n   */\n  calledReaddir(): boolean {\n    return !!(this.#type & READDIR_CALLED)\n  }\n\n  /**\n   * Returns true if the path is known to not exist. That is, a previous lstat\n   * or readdir failed to verify its existence when that would have been\n   * expected, or a parent entry was marked either enoent or enotdir.\n   */\n  isENOENT(): boolean {\n    return !!(this.#type & ENOENT)\n  }\n\n  /**\n   * Return true if the path is a match for the given path name.  This handles\n   * case sensitivity and unicode normalization.\n   *\n   * Note: even on case-sensitive systems, it is **not** safe to test the\n   * equality of the `.name` property to determine whether a given pathname\n   * matches, due to unicode normalization mismatches.\n   *\n   * Always use this method instead of testing the `path.name` property\n   * directly.\n   */\n  isNamed(n: string): boolean {\n    return !this.nocase ?\n        this.#matchName === normalize(n)\n      : this.#matchName === normalizeNocase(n)\n  }\n\n  /**\n   * Return the Path object corresponding to the target of a symbolic link.\n   *\n   * If the Path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   */\n  async readlink(): Promise {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = await this.#fs.promises.readlink(this.fullpath())\n      const linkTarget = (await this.parent.realpath())?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  /**\n   * Synchronous {@link PathBase.readlink}\n   */\n  readlinkSync(): PathBase | undefined {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = this.#fs.readlinkSync(this.fullpath())\n      const linkTarget = this.parent.realpathSync()?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  #readdirSuccess(children: Children) {\n    // succeeded, mark readdir called bit\n    this.#type |= READDIR_CALLED\n    // mark all remaining provisional children as ENOENT\n    for (let p = children.provisional; p < children.length; p++) {\n      const c = children[p]\n      if (c) c.#markENOENT()\n    }\n  }\n\n  #markENOENT() {\n    // mark as UNKNOWN and ENOENT\n    if (this.#type & ENOENT) return\n    this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN\n    this.#markChildrenENOENT()\n  }\n\n  #markChildrenENOENT() {\n    // all children are provisional and do not exist\n    const children = this.children()\n    children.provisional = 0\n    for (const p of children) {\n      p.#markENOENT()\n    }\n  }\n\n  #markENOREALPATH() {\n    this.#type |= ENOREALPATH\n    this.#markENOTDIR()\n  }\n\n  // save the information when we know the entry is not a dir\n  #markENOTDIR() {\n    // entry is not a directory, so any children can't exist.\n    // this *should* be impossible, since any children created\n    // after it's been marked ENOTDIR should be marked ENOENT,\n    // so it won't even get to this point.\n    /* c8 ignore start */\n    if (this.#type & ENOTDIR) return\n    /* c8 ignore stop */\n    let t = this.#type\n    // this could happen if we stat a dir, then delete it,\n    // then try to read it or one of its children.\n    if ((t & IFMT) === IFDIR) t &= IFMT_UNKNOWN\n    this.#type = t | ENOTDIR\n    this.#markChildrenENOENT()\n  }\n\n  #readdirFail(code: string = '') {\n    // markENOTDIR and markENOENT also set provisional=0\n    if (code === 'ENOTDIR' || code === 'EPERM') {\n      this.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      this.#markENOENT()\n    } else {\n      this.children().provisional = 0\n    }\n  }\n\n  #lstatFail(code: string = '') {\n    // Windows just raises ENOENT in this case, disable for win CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR') {\n      // already know it has a parent by this point\n      const p = this.parent as PathBase\n      p.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      /* c8 ignore stop */\n      this.#markENOENT()\n    }\n  }\n\n  #readlinkFail(code: string = '') {\n    let ter = this.#type\n    ter |= ENOREADLINK\n    if (code === 'ENOENT') ter |= ENOENT\n    // windows gets a weird error when you try to readlink a file\n    if (code === 'EINVAL' || code === 'UNKNOWN') {\n      // exists, but not a symlink, we don't know WHAT it is, so remove\n      // all IFMT bits.\n      ter &= IFMT_UNKNOWN\n    }\n    this.#type = ter\n    // windows just gets ENOENT in this case.  We do cover the case,\n    // just disabled because it's impossible on Windows CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR' && this.parent) {\n      this.parent.#markENOTDIR()\n    }\n    /* c8 ignore stop */\n  }\n\n  #readdirAddChild(e: Dirent, c: Children) {\n    return (\n      this.#readdirMaybePromoteChild(e, c) ||\n      this.#readdirAddNewChild(e, c)\n    )\n  }\n\n  #readdirAddNewChild(e: Dirent, c: Children): PathBase {\n    // alloc new entry at head, so it's never provisional\n    const type = entToType(e)\n    const child = this.newChild(e.name, type, { parent: this })\n    const ifmt = child.#type & IFMT\n    if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {\n      child.#type |= ENOTDIR\n    }\n    c.unshift(child)\n    c.provisional++\n    return child\n  }\n\n  #readdirMaybePromoteChild(e: Dirent, c: Children): PathBase | undefined {\n    for (let p = c.provisional; p < c.length; p++) {\n      const pchild = c[p]\n      const name =\n        this.nocase ? normalizeNocase(e.name) : normalize(e.name)\n      if (name !== pchild!.#matchName) {\n        continue\n      }\n\n      return this.#readdirPromoteChild(e, pchild!, p, c)\n    }\n  }\n\n  #readdirPromoteChild(\n    e: Dirent,\n    p: PathBase,\n    index: number,\n    c: Children,\n  ): PathBase {\n    const v = p.name\n    // retain any other flags, but set ifmt from dirent\n    p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e)\n    // case sensitivity fixing when we learn the true name.\n    if (v !== e.name) p.name = e.name\n\n    // just advance provisional index (potentially off the list),\n    // otherwise we have to splice/pop it out and re-insert at head\n    if (index !== c.provisional) {\n      if (index === c.length - 1) c.pop()\n      else c.splice(index, 1)\n      c.unshift(p)\n    }\n    c.provisional++\n    return p\n  }\n\n  /**\n   * Call lstat() on this Path, and update all known information that can be\n   * determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(): Promise {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(await this.#fs.promises.lstat(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  /**\n   * synchronous {@link PathBase.lstat}\n   */\n  lstatSync(): PathBase | undefined {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(this.#fs.lstatSync(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  #applyStat(st: Stats) {\n    const {\n      atime,\n      atimeMs,\n      birthtime,\n      birthtimeMs,\n      blksize,\n      blocks,\n      ctime,\n      ctimeMs,\n      dev,\n      gid,\n      ino,\n      mode,\n      mtime,\n      mtimeMs,\n      nlink,\n      rdev,\n      size,\n      uid,\n    } = st\n    this.#atime = atime\n    this.#atimeMs = atimeMs\n    this.#birthtime = birthtime\n    this.#birthtimeMs = birthtimeMs\n    this.#blksize = blksize\n    this.#blocks = blocks\n    this.#ctime = ctime\n    this.#ctimeMs = ctimeMs\n    this.#dev = dev\n    this.#gid = gid\n    this.#ino = ino\n    this.#mode = mode\n    this.#mtime = mtime\n    this.#mtimeMs = mtimeMs\n    this.#nlink = nlink\n    this.#rdev = rdev\n    this.#size = size\n    this.#uid = uid\n    const ifmt = entToType(st)\n    // retain any other flags, but set the ifmt\n    this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED\n    if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {\n      this.#type |= ENOTDIR\n    }\n  }\n\n  #onReaddirCB: ((\n    er: NodeJS.ErrnoException | null,\n    entries: Path[],\n  ) => any)[] = []\n  #readdirCBInFlight: boolean = false\n  #callOnReaddirCB(children: Path[]) {\n    this.#readdirCBInFlight = false\n    const cbs = this.#onReaddirCB.slice()\n    this.#onReaddirCB.length = 0\n    cbs.forEach(cb => cb(null, children))\n  }\n\n  /**\n   * Standard node-style callback interface to get list of directory entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * @param cb The callback called with (er, entries).  Note that the `er`\n   * param is somewhat extraneous, as all readdir() errors are handled and\n   * simply result in an empty set of entries being returned.\n   * @param allowZalgo Boolean indicating that immediately known results should\n   * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release\n   * zalgo at your peril, the dark pony lord is devious and unforgiving.\n   */\n  readdirCB(\n    cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any,\n    allowZalgo: boolean = false,\n  ): void {\n    if (!this.canReaddir()) {\n      if (allowZalgo) cb(null, [])\n      else queueMicrotask(() => cb(null, []))\n      return\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      const c = children.slice(0, children.provisional)\n      if (allowZalgo) cb(null, c)\n      else queueMicrotask(() => cb(null, c))\n      return\n    }\n\n    // don't have to worry about zalgo at this point.\n    this.#onReaddirCB.push(cb)\n    if (this.#readdirCBInFlight) {\n      return\n    }\n    this.#readdirCBInFlight = true\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {\n      if (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      } else {\n        // if we didn't get an error, we always get entries.\n        //@ts-ignore\n        for (const e of entries) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      }\n      this.#callOnReaddirCB(children.slice(0, children.provisional))\n      return\n    })\n  }\n\n  #asyncReaddirInFlight?: Promise\n\n  /**\n   * Return an array of known child entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async readdir(): Promise {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    if (this.#asyncReaddirInFlight) {\n      await this.#asyncReaddirInFlight\n    } else {\n      /* c8 ignore start */\n      let resolve: () => void = () => {}\n      /* c8 ignore stop */\n      this.#asyncReaddirInFlight = new Promise(\n        res => (resolve = res),\n      )\n      try {\n        for (const e of await this.#fs.promises.readdir(fullpath, {\n          withFileTypes: true,\n        })) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      } catch (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      }\n      this.#asyncReaddirInFlight = undefined\n      resolve()\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * synchronous {@link PathBase.readdir}\n   */\n  readdirSync(): PathBase[] {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    try {\n      for (const e of this.#fs.readdirSync(fullpath, {\n        withFileTypes: true,\n      })) {\n        this.#readdirAddChild(e, children)\n      }\n      this.#readdirSuccess(children)\n    } catch (er) {\n      this.#readdirFail((er as NodeJS.ErrnoException).code)\n      children.provisional = 0\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  canReaddir() {\n    if (this.#type & ENOCHILD) return false\n    const ifmt = IFMT & this.#type\n    // we always set ENOTDIR when setting IFMT, so should be impossible\n    /* c8 ignore start */\n    if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {\n      return false\n    }\n    /* c8 ignore stop */\n    return true\n  }\n\n  shouldWalk(\n    dirs: Set,\n    walkFilter?: (e: PathBase) => boolean,\n  ): boolean {\n    return (\n      (this.#type & IFDIR) === IFDIR &&\n      !(this.#type & ENOCHILD) &&\n      !dirs.has(this) &&\n      (!walkFilter || walkFilter(this))\n    )\n  }\n\n  /**\n   * Return the Path object corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   * On success, returns a Path object.\n   */\n  async realpath(): Promise {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = await this.#fs.promises.realpath(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Synchronous {@link realpath}\n   */\n  realpathSync(): PathBase | undefined {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = this.#fs.realpathSync(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Internal method to mark this Path object as the scurry cwd,\n   * called by {@link PathScurry#chdir}\n   *\n   * @internal\n   */\n  [setAsCwd](oldCwd: PathBase): void {\n    if (oldCwd === this) return\n    oldCwd.isCWD = false\n    this.isCWD = true\n\n    const changed = new Set([])\n    let rp = []\n    let p: PathBase = this\n    while (p && p.parent) {\n      changed.add(p)\n      p.#relative = rp.join(this.sep)\n      p.#relativePosix = rp.join('/')\n      p = p.parent\n      rp.push('..')\n    }\n    // now un-memoize parents of old cwd\n    p = oldCwd\n    while (p && p.parent && !changed.has(p)) {\n      p.#relative = undefined\n      p.#relativePosix = undefined\n      p = p.parent\n    }\n  }\n}\n\n/**\n * Path class used on win32 systems\n *\n * Uses `'\\\\'` as the path separator for returned paths, either `'\\\\'` or `'/'`\n * as the path separator for parsing paths.\n */\nexport class PathWin32 extends PathBase {\n  /**\n   * Separator for generating path strings.\n   */\n  sep: '\\\\' = '\\\\'\n  /**\n   * Separator for parsing path strings.\n   */\n  splitSep: RegExp = eitherSep\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathWin32(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return win32.parse(path).root\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(rootPath: string): PathBase {\n    rootPath = uncToDrive(rootPath.toUpperCase())\n    if (rootPath === this.root.name) {\n      return this.root\n    }\n    // ok, not that one, check if it matches another we know about\n    for (const [compare, root] of Object.entries(this.roots)) {\n      if (this.sameRoot(rootPath, compare)) {\n        return (this.roots[rootPath] = root)\n      }\n    }\n    // otherwise, have to create a new one.\n    return (this.roots[rootPath] = new PathScurryWin32(\n      rootPath,\n      this,\n    ).root)\n  }\n\n  /**\n   * @internal\n   */\n  sameRoot(rootPath: string, compare: string = this.root.name): boolean {\n    // windows can (rarely) have case-sensitive filesystem, but\n    // UNC and drive letters are always case-insensitive, and canonically\n    // represented uppercase.\n    rootPath = rootPath\n      .toUpperCase()\n      .replace(/\\//g, '\\\\')\n      .replace(uncDriveRegexp, '$1\\\\')\n    return rootPath === compare\n  }\n}\n\n/**\n * Path class used on all posix systems.\n *\n * Uses `'/'` as the path separator.\n */\nexport class PathPosix extends PathBase {\n  /**\n   * separator for parsing path strings\n   */\n  splitSep: '/' = '/'\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return path.startsWith('/') ? '/' : ''\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(_rootPath: string): PathBase {\n    return this.root\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathPosix(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n}\n\n/**\n * Options that may be provided to the PathScurry constructor\n */\nexport interface PathScurryOpts {\n  /**\n   * perform case-insensitive path matching. Default based on platform\n   * subclass.\n   */\n  nocase?: boolean\n  /**\n   * Number of Path entries to keep in the cache of Path child references.\n   *\n   * Setting this higher than 65536 will dramatically increase the data\n   * consumption and construction time overhead of each PathScurry.\n   *\n   * Setting this value to 256 or lower will significantly reduce the data\n   * consumption and construction time overhead, but may also reduce resolve()\n   * and readdir() performance on large filesystems.\n   *\n   * Default `16384`.\n   */\n  childrenCacheSize?: number\n  /**\n   * An object that overrides the built-in functions from the fs and\n   * fs/promises modules.\n   *\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * The base class for all PathScurry classes, providing the interface for path\n * resolution and filesystem operations.\n *\n * Typically, you should *not* instantiate this class directly, but rather one\n * of the platform-specific classes, or the exported {@link PathScurry} which\n * defaults to the current platform.\n */\nexport abstract class PathScurryBase {\n  /**\n   * The root Path entry for the current working directory of this Scurry\n   */\n  root: PathBase\n  /**\n   * The string path for the root of this Scurry's current working directory\n   */\n  rootPath: string\n  /**\n   * A collection of all roots encountered, referenced by rootPath\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * The Path entry corresponding to this PathScurry's current working directory.\n   */\n  cwd: PathBase\n  #resolveCache: ResolveCache\n  #resolvePosixCache: ResolveCache\n  #children: ChildrenCache\n  /**\n   * Perform path comparisons case-insensitively.\n   *\n   * Defaults true on Darwin and Windows systems, false elsewhere.\n   */\n  nocase: boolean\n\n  /**\n   * The path separator used for parsing paths\n   *\n   * `'/'` on Posix systems, either `'/'` or `'\\\\'` on Windows\n   */\n  abstract sep: string | RegExp\n\n  #fs: FSValue\n\n  /**\n   * This class should not be instantiated directly.\n   *\n   * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry\n   *\n   * @internal\n   */\n  constructor(\n    cwd: URL | string = process.cwd(),\n    pathImpl: typeof win32 | typeof posix,\n    sep: string | RegExp,\n    {\n      nocase,\n      childrenCacheSize = 16 * 1024,\n      fs = defaultFS,\n    }: PathScurryOpts = {},\n  ) {\n    this.#fs = fsFromOption(fs)\n    if (cwd instanceof URL || cwd.startsWith('file://')) {\n      cwd = fileURLToPath(cwd)\n    }\n    // resolve and split root, and then add to the store.\n    // this is the only time we call path.resolve()\n    const cwdPath = pathImpl.resolve(cwd)\n    this.roots = Object.create(null)\n    this.rootPath = this.parseRootPath(cwdPath)\n    this.#resolveCache = new ResolveCache()\n    this.#resolvePosixCache = new ResolveCache()\n    this.#children = new ChildrenCache(childrenCacheSize)\n\n    const split = cwdPath.substring(this.rootPath.length).split(sep)\n    // resolve('/') leaves '', splits to [''], we don't want that.\n    if (split.length === 1 && !split[0]) {\n      split.pop()\n    }\n    /* c8 ignore start */\n    if (nocase === undefined) {\n      throw new TypeError(\n        'must provide nocase setting to PathScurryBase ctor',\n      )\n    }\n    /* c8 ignore stop */\n    this.nocase = nocase\n    this.root = this.newRoot(this.#fs)\n    this.roots[this.rootPath] = this.root\n    let prev: PathBase = this.root\n    let len = split.length - 1\n    const joinSep = pathImpl.sep\n    let abs = this.rootPath\n    let sawFirst = false\n    for (const part of split) {\n      const l = len--\n      prev = prev.child(part, {\n        relative: new Array(l).fill('..').join(joinSep),\n        relativePosix: new Array(l).fill('..').join('/'),\n        fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n      })\n      sawFirst = true\n    }\n    this.cwd = prev\n  }\n\n  /**\n   * Get the depth of a provided path, string, or the cwd\n   */\n  depth(path: Path | string = this.cwd): number {\n    if (typeof path === 'string') {\n      path = this.cwd.resolve(path)\n    }\n    return path.depth()\n  }\n\n  /**\n   * Parse the root portion of a path string\n   *\n   * @internal\n   */\n  abstract parseRootPath(dir: string): string\n  /**\n   * create a new Path to use as root during construction.\n   *\n   * @internal\n   */\n  abstract newRoot(fs: FSValue): PathBase\n  /**\n   * Determine whether a given path string is absolute\n   */\n  abstract isAbsolute(p: string): boolean\n\n  /**\n   * Return the cache of child entries.  Exposed so subclasses can create\n   * child Path objects in a platform-specific way.\n   *\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolve(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolveCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpath()\n    this.#resolveCache.set(r, result)\n    return result\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string, returning\n   * the posix path.  Identical to .resolve() on posix systems, but on\n   * windows will return a forward-slash separated UNC path.\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolvePosix(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolvePosixCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpathPosix()\n    this.#resolvePosixCache.set(r, result)\n    return result\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or entry\n   */\n  relative(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relative()\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or\n   * entry, using / as the path delimiter, even on Windows.\n   */\n  relativePosix(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relativePosix()\n  }\n\n  /**\n   * Return the basename for the provided string or Path object\n   */\n  basename(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.name\n  }\n\n  /**\n   * Return the dirname for the provided string or Path object\n   */\n  dirname(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return (entry.parent || entry).fullpath()\n  }\n\n  /**\n   * Return an array of known child entries.\n   *\n   * First argument may be either a string, or a Path object.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set\n   * `{ withFileTypes: false }` to return strings.\n   */\n\n  readdir(): Promise\n  readdir(opts: { withFileTypes: true }): Promise\n  readdir(opts: { withFileTypes: false }): Promise\n  readdir(opts: { withFileTypes: boolean }): Promise\n  readdir(entry: PathBase | string): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): Promise\n  async readdir(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else {\n      const p = await entry.readdir()\n      return withFileTypes ? p : p.map(e => e.name)\n    }\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readdir}\n   */\n  readdirSync(): PathBase[]\n  readdirSync(opts: { withFileTypes: true }): PathBase[]\n  readdirSync(opts: { withFileTypes: false }): string[]\n  readdirSync(opts: { withFileTypes: boolean }): PathBase[] | string[]\n  readdirSync(entry: PathBase | string): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): string[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): PathBase[] | string[]\n  readdirSync(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes = true } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else if (withFileTypes) {\n      return entry.readdirSync()\n    } else {\n      return entry.readdirSync().map(e => e.name)\n    }\n  }\n\n  /**\n   * Call lstat() on the string or Path object, and update all known\n   * information that can be determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(\n    entry: string | PathBase = this.cwd,\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstat()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.lstat}\n   */\n  lstatSync(entry: string | PathBase = this.cwd): PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstatSync()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to the target of a\n   * symbolic link.\n   *\n   * If the path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  readlink(): Promise\n  readlink(opt: { withFileTypes: false }): Promise\n  readlink(opt: { withFileTypes: true }): Promise\n  readlink(opt: {\n    withFileTypes: boolean\n  }): Promise\n  readlink(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async readlink(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.readlink()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readlink}\n   */\n  readlinkSync(): string | undefined\n  readlinkSync(opt: { withFileTypes: false }): string | undefined\n  readlinkSync(opt: { withFileTypes: true }): PathBase | undefined\n  readlinkSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.readlinkSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  realpath(): Promise\n  realpath(opt: { withFileTypes: false }): Promise\n  realpath(opt: { withFileTypes: true }): Promise\n  realpath(opt: {\n    withFileTypes: boolean\n  }): Promise\n  realpath(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async realpath(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.realpath()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  realpathSync(): string | undefined\n  realpathSync(opt: { withFileTypes: false }): string | undefined\n  realpathSync(opt: { withFileTypes: true }): PathBase | undefined\n  realpathSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  realpathSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.realpathSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Asynchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walk(): Promise\n  walk(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(opts: WalkOptionsWithFileTypesFalse): Promise\n  walk(opts: WalkOptions): Promise\n  walk(entry: string | PathBase): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Promise\n  async walk(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const walk = (\n      dir: PathBase,\n      cb: (er?: NodeJS.ErrnoException) => void,\n    ) => {\n      dirs.add(dir)\n      dir.readdirCB((er, entries) => {\n        /* c8 ignore start */\n        if (er) {\n          return cb(er)\n        }\n        /* c8 ignore stop */\n        let len = entries.length\n        if (!len) return cb()\n        const next = () => {\n          if (--len === 0) {\n            cb()\n          }\n        }\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            results.push(withFileTypes ? e : e.fullpath())\n          }\n          if (follow && e.isSymbolicLink()) {\n            e.realpath()\n              .then(r => (r?.isUnknown() ? r.lstat() : r))\n              .then(r =>\n                r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next(),\n              )\n          } else {\n            if (e.shouldWalk(dirs, walkFilter)) {\n              walk(e, next)\n            } else {\n              next()\n            }\n          }\n        }\n      }, true) // zalgooooooo\n    }\n\n    const start = entry\n    return new Promise((res, rej) => {\n      walk(start, er => {\n        /* c8 ignore start */\n        if (er) return rej(er)\n        /* c8 ignore stop */\n        res(results as PathBase[] | string[])\n      })\n    })\n  }\n\n  /**\n   * Synchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walkSync(): PathBase[]\n  walkSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): PathBase[]\n  walkSync(opts: WalkOptionsWithFileTypesFalse): string[]\n  walkSync(opts: WalkOptions): string[] | PathBase[]\n  walkSync(entry: string | PathBase): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): string[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): PathBase[] | string[]\n  walkSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          results.push(withFileTypes ? e : e.fullpath())\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n    return results as string[] | PathBase[]\n  }\n\n  /**\n   * Support for `for await`\n   *\n   * Alias for {@link PathScurryBase.iterate}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  [Symbol.asyncIterator]() {\n    return this.iterate()\n  }\n\n  /**\n   * Async generator form of {@link PathScurryBase.walk}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking, especially if most/all of the directory tree has been previously\n   * walked.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  iterate(): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(opts: WalkOptions): AsyncGenerator\n  iterate(entry: string | PathBase): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    options: WalkOptions = {},\n  ): AsyncGenerator {\n    // iterating async over the stream is significantly more performant,\n    // especially in the warm-cache scenario, because it buffers up directory\n    // entries in the background instead of waiting for a yield for each one.\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      options = entry\n      entry = this.cwd\n    }\n    return this.stream(entry, options)[Symbol.asyncIterator]()\n  }\n\n  /**\n   * Iterating over a PathScurry performs a synchronous walk.\n   *\n   * Alias for {@link PathScurryBase.iterateSync}\n   */\n  [Symbol.iterator]() {\n    return this.iterateSync()\n  }\n\n  iterateSync(): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(opts: WalkOptions): Generator\n  iterateSync(entry: string | PathBase): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Generator\n  *iterateSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Generator {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    if (!filter || filter(entry)) {\n      yield withFileTypes ? entry : entry.fullpath()\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          yield withFileTypes ? e : e.fullpath()\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n  }\n\n  /**\n   * Stream form of {@link PathScurryBase.walk}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   */\n  stream(): Minipass\n  stream(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  stream(opts: WalkOptionsWithFileTypesFalse): Minipass\n  stream(opts: WalkOptions): Minipass\n  stream(entry: string | PathBase): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  stream(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n\n        processing++\n        dirs.add(dir)\n\n        const onReaddir = (\n          er: null | NodeJS.ErrnoException,\n          entries: PathBase[],\n          didRealpaths: boolean = false,\n        ) => {\n          /* c8 ignore start */\n          if (er) return results.emit('error', er)\n          /* c8 ignore stop */\n          if (follow && !didRealpaths) {\n            const promises: Promise[] = []\n            for (const e of entries) {\n              if (e.isSymbolicLink()) {\n                promises.push(\n                  e\n                    .realpath()\n                    .then((r: PathBase | undefined) =>\n                      r?.isUnknown() ? r.lstat() : r,\n                    ),\n                )\n              }\n            }\n            if (promises.length) {\n              Promise.all(promises).then(() =>\n                onReaddir(null, entries, true),\n              )\n              return\n            }\n          }\n\n          for (const e of entries) {\n            if (e && (!filter || filter(e))) {\n              if (!results.write(withFileTypes ? e : e.fullpath())) {\n                paused = true\n              }\n            }\n          }\n\n          processing--\n          for (const e of entries) {\n            const r = e.realpathCached() || e\n            if (r.shouldWalk(dirs, walkFilter)) {\n              queue.push(r)\n            }\n          }\n          if (paused && !results.flowing) {\n            results.once('drain', process)\n          } else if (!sync) {\n            process()\n          }\n        }\n\n        // zalgo containment\n        let sync = true\n        dir.readdirCB(onReaddir, true)\n        sync = false\n      }\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  /**\n   * Synchronous form of {@link PathScurryBase.stream}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   *\n   * Will complete the walk in a single tick if the stream is consumed fully.\n   * Otherwise, will pause as needed for stream backpressure.\n   */\n  streamSync(): Minipass\n  streamSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass\n  streamSync(opts: WalkOptions): Minipass\n  streamSync(entry: string | PathBase): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  streamSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    const dirs = new Set()\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n        processing++\n        dirs.add(dir)\n\n        const entries = dir.readdirSync()\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            if (!results.write(withFileTypes ? e : e.fullpath())) {\n              paused = true\n            }\n          }\n        }\n        processing--\n        for (const e of entries) {\n          let r: PathBase | undefined = e\n          if (e.isSymbolicLink()) {\n            if (!(follow && (r = e.realpathSync()))) continue\n            if (r.isUnknown()) r.lstatSync()\n          }\n          if (r.shouldWalk(dirs, walkFilter)) {\n            queue.push(r)\n          }\n        }\n      }\n      if (paused && !results.flowing) results.once('drain', process)\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  chdir(path: string | Path = this.cwd) {\n    const oldCwd = this.cwd\n    this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path\n    this.cwd[setAsCwd](oldCwd)\n  }\n}\n\n/**\n * Options provided to all walk methods.\n */\nexport interface WalkOptions {\n  /**\n   * Return results as {@link PathBase} objects rather than strings.\n   * When set to false, results are fully resolved paths, as returned by\n   * {@link PathBase.fullpath}.\n   * @default true\n   */\n  withFileTypes?: boolean\n\n  /**\n   *  Attempt to read directory entries from symbolic links. Otherwise, only\n   *  actual directories are traversed. Regardless of this setting, a given\n   *  target path will only ever be walked once, meaning that a symbolic link\n   *  to a previously traversed directory will never be followed.\n   *\n   *  Setting this imposes a slight performance penalty, because `readlink`\n   *  must be called on all symbolic links encountered, in order to avoid\n   *  infinite cycles.\n   * @default false\n   */\n  follow?: boolean\n\n  /**\n   * Only return entries where the provided function returns true.\n   *\n   * This will not prevent directories from being traversed, even if they do\n   * not pass the filter, though it will prevent directories themselves from\n   * being included in the result set.  See {@link walkFilter}\n   *\n   * Asynchronous functions are not supported here.\n   *\n   * By default, if no filter is provided, all entries and traversed\n   * directories are included.\n   */\n  filter?: (entry: PathBase) => boolean\n\n  /**\n   * Only traverse directories (and in the case of {@link follow} being set to\n   * true, symbolic links to directories) if the provided function returns\n   * true.\n   *\n   * This will not prevent directories from being included in the result set,\n   * even if they do not pass the supplied filter function.  See {@link filter}\n   * to do that.\n   *\n   * Asynchronous functions are not supported here.\n   */\n  walkFilter?: (entry: PathBase) => boolean\n}\n\nexport type WalkOptionsWithFileTypesUnset = WalkOptions & {\n  withFileTypes?: undefined\n}\nexport type WalkOptionsWithFileTypesTrue = WalkOptions & {\n  withFileTypes: true\n}\nexport type WalkOptionsWithFileTypesFalse = WalkOptions & {\n  withFileTypes: false\n}\n\n/**\n * Windows implementation of {@link PathScurryBase}\n *\n * Defaults to case insensitve, uses `'\\\\'` to generate path strings.  Uses\n * {@link PathWin32} for Path objects.\n */\nexport class PathScurryWin32 extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '\\\\' = '\\\\'\n\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, win32, '\\\\', { ...opts, nocase })\n    this.nocase = nocase\n    for (let p: PathBase | undefined = this.cwd; p; p = p.parent) {\n      p.nocase = this.nocase\n    }\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(dir: string): string {\n    // if the path starts with a single separator, it's not a UNC, and we'll\n    // just get separator as the root, and driveFromUNC will return \\\n    // In that case, mount \\ on the root from the cwd.\n    return win32.parse(dir).root.toUpperCase()\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathWin32(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return (\n      p.startsWith('/') || p.startsWith('\\\\') || /^[a-z]:(\\/|\\\\)/i.test(p)\n    )\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for all posix systems other than Darwin.\n *\n * Defaults to case-sensitive matching, uses `'/'` to generate path strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryPosix extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = false } = opts\n    super(cwd, posix, '/', { ...opts, nocase })\n    this.nocase = nocase\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(_dir: string): string {\n    return '/'\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathPosix(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return p.startsWith('/')\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for Darwin (macOS) systems.\n *\n * Defaults to case-insensitive matching, uses `'/'` for generating path\n * strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryDarwin extends PathScurryPosix {\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, { ...opts, nocase })\n  }\n}\n\n/**\n * Default {@link PathBase} implementation for the current platform.\n *\n * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.\n */\nexport const Path = process.platform === 'win32' ? PathWin32 : PathPosix\nexport type Path = PathBase | InstanceType\n\n/**\n * Default {@link PathScurryBase} implementation for the current platform.\n *\n * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on\n * Darwin (macOS) systems, {@link PathScurryPosix} on all others.\n */\nexport const PathScurry:\n  | typeof PathScurryWin32\n  | typeof PathScurryDarwin\n  | typeof PathScurryPosix =\n  process.platform === 'win32' ? PathScurryWin32\n  : process.platform === 'darwin' ? PathScurryDarwin\n  : PathScurryPosix\nexport type PathScurry = PathScurryBase | InstanceType\n"]}
\ No newline at end of file
diff --git a/node_modules/path-scurry/dist/commonjs/package.json b/node_modules/path-scurry/dist/commonjs/package.json
new file mode 100644
index 00000000..5bbefffb
--- /dev/null
+++ b/node_modules/path-scurry/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
diff --git a/node_modules/path-scurry/dist/esm/index.d.ts b/node_modules/path-scurry/dist/esm/index.d.ts
new file mode 100644
index 00000000..ef31b1b7
--- /dev/null
+++ b/node_modules/path-scurry/dist/esm/index.d.ts
@@ -0,0 +1,1115 @@
+import { LRUCache } from 'lru-cache';
+import { posix, win32 } from 'node:path';
+import { Minipass } from 'minipass';
+import type { Dirent, Stats } from 'node:fs';
+/**
+ * An object that will be used to override the default `fs`
+ * methods.  Any methods that are not overridden will use Node's
+ * built-in implementations.
+ *
+ * - lstatSync
+ * - readdir (callback `withFileTypes` Dirent variant, used for
+ *   readdirCB and most walks)
+ * - readdirSync
+ * - readlinkSync
+ * - realpathSync
+ * - promises: Object containing the following async methods:
+ *   - lstat
+ *   - readdir (Dirent variant only)
+ *   - readlink
+ *   - realpath
+ */
+export interface FSOption {
+    lstatSync?: (path: string) => Stats;
+    readdir?: (path: string, options: {
+        withFileTypes: true;
+    }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
+    readdirSync?: (path: string, options: {
+        withFileTypes: true;
+    }) => Dirent[];
+    readlinkSync?: (path: string) => string;
+    realpathSync?: (path: string) => string;
+    promises?: {
+        lstat?: (path: string) => Promise;
+        readdir?: (path: string, options: {
+            withFileTypes: true;
+        }) => Promise;
+        readlink?: (path: string) => Promise;
+        realpath?: (path: string) => Promise;
+        [k: string]: any;
+    };
+    [k: string]: any;
+}
+interface FSValue {
+    lstatSync: (path: string) => Stats;
+    readdir: (path: string, options: {
+        withFileTypes: true;
+    }, cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any) => void;
+    readdirSync: (path: string, options: {
+        withFileTypes: true;
+    }) => Dirent[];
+    readlinkSync: (path: string) => string;
+    realpathSync: (path: string) => string;
+    promises: {
+        lstat: (path: string) => Promise;
+        readdir: (path: string, options: {
+            withFileTypes: true;
+        }) => Promise;
+        readlink: (path: string) => Promise;
+        realpath: (path: string) => Promise;
+        [k: string]: any;
+    };
+    [k: string]: any;
+}
+export type Type = 'Unknown' | 'FIFO' | 'CharacterDevice' | 'Directory' | 'BlockDevice' | 'File' | 'SymbolicLink' | 'Socket';
+/**
+ * Options that may be provided to the Path constructor
+ */
+export interface PathOpts {
+    fullpath?: string;
+    relative?: string;
+    relativePosix?: string;
+    parent?: PathBase;
+    /**
+     * See {@link FSOption}
+     */
+    fs?: FSOption;
+}
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+export declare class ResolveCache extends LRUCache {
+    constructor();
+}
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+export declare class ChildrenCache extends LRUCache {
+    constructor(maxSize?: number);
+}
+/**
+ * Array of Path objects, plus a marker indicating the first provisional entry
+ *
+ * @internal
+ */
+export type Children = PathBase[] & {
+    provisional: number;
+};
+declare const setAsCwd: unique symbol;
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+export declare abstract class PathBase implements Dirent {
+    #private;
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name: string;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root: PathBase;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots: {
+        [k: string]: PathBase;
+    };
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent?: PathBase;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase: boolean;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD: boolean;
+    /**
+     * the string or regexp used to split paths. On posix, it is `'/'`, and on
+     * windows it is a RegExp matching either `'/'` or `'\\'`
+     */
+    abstract splitSep: string | RegExp;
+    /**
+     * The path separator string to use when joining paths
+     */
+    abstract sep: string;
+    get dev(): number | undefined;
+    get mode(): number | undefined;
+    get nlink(): number | undefined;
+    get uid(): number | undefined;
+    get gid(): number | undefined;
+    get rdev(): number | undefined;
+    get blksize(): number | undefined;
+    get ino(): number | undefined;
+    get size(): number | undefined;
+    get blocks(): number | undefined;
+    get atimeMs(): number | undefined;
+    get mtimeMs(): number | undefined;
+    get ctimeMs(): number | undefined;
+    get birthtimeMs(): number | undefined;
+    get atime(): Date | undefined;
+    get mtime(): Date | undefined;
+    get ctime(): Date | undefined;
+    get birthtime(): Date | undefined;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath(): string;
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path(): string;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth(): number;
+    /**
+     * @internal
+     */
+    abstract getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    abstract getRoot(rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase;
+    /**
+     * @internal
+     */
+    childrenCache(): ChildrenCache;
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path?: string): PathBase;
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children(): Children;
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart: string, opts?: PathOpts): PathBase;
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative(): string;
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix(): string;
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath(): string;
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix(): string;
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown(): boolean;
+    isType(type: Type): boolean;
+    getType(): Type;
+    /**
+     * Is the Path a regular file?
+     */
+    isFile(): boolean;
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory(): boolean;
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice(): boolean;
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice(): boolean;
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO(): boolean;
+    /**
+     * Is the path a socket?
+     */
+    isSocket(): boolean;
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink(): boolean;
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached(): PathBase | undefined;
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached(): PathBase | undefined;
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached(): PathBase | undefined;
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached(): PathBase[];
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink(): boolean;
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir(): boolean;
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT(): boolean;
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n: string): boolean;
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    readlink(): Promise;
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync(): PathBase | undefined;
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    lstat(): Promise;
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync(): PathBase | undefined;
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any, allowZalgo?: boolean): void;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    readdir(): Promise;
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync(): PathBase[];
+    canReaddir(): boolean;
+    shouldWalk(dirs: Set, walkFilter?: (e: PathBase) => boolean): boolean;
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    realpath(): Promise;
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync(): PathBase | undefined;
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd: PathBase): void;
+}
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+export declare class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep: '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep: RegExp;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * @internal
+     */
+    newChild(name: string, type?: number, opts?: PathOpts): PathWin32;
+    /**
+     * @internal
+     */
+    getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    getRoot(rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    sameRoot(rootPath: string, compare?: string): boolean;
+}
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+export declare class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep: '/';
+    /**
+     * separator for generating path strings
+     */
+    sep: '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name: string, type: number | undefined, root: PathBase | undefined, roots: {
+        [k: string]: PathBase;
+    }, nocase: boolean, children: ChildrenCache, opts: PathOpts);
+    /**
+     * @internal
+     */
+    getRootString(path: string): string;
+    /**
+     * @internal
+     */
+    getRoot(_rootPath: string): PathBase;
+    /**
+     * @internal
+     */
+    newChild(name: string, type?: number, opts?: PathOpts): PathPosix;
+}
+/**
+ * Options that may be provided to the PathScurry constructor
+ */
+export interface PathScurryOpts {
+    /**
+     * perform case-insensitive path matching. Default based on platform
+     * subclass.
+     */
+    nocase?: boolean;
+    /**
+     * Number of Path entries to keep in the cache of Path child references.
+     *
+     * Setting this higher than 65536 will dramatically increase the data
+     * consumption and construction time overhead of each PathScurry.
+     *
+     * Setting this value to 256 or lower will significantly reduce the data
+     * consumption and construction time overhead, but may also reduce resolve()
+     * and readdir() performance on large filesystems.
+     *
+     * Default `16384`.
+     */
+    childrenCacheSize?: number;
+    /**
+     * An object that overrides the built-in functions from the fs and
+     * fs/promises modules.
+     *
+     * See {@link FSOption}
+     */
+    fs?: FSOption;
+}
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+export declare abstract class PathScurryBase {
+    #private;
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root: PathBase;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath: string;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots: {
+        [k: string]: PathBase;
+    };
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd: PathBase;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase: boolean;
+    /**
+     * The path separator used for parsing paths
+     *
+     * `'/'` on Posix systems, either `'/'` or `'\\'` on Windows
+     */
+    abstract sep: string | RegExp;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd: (URL | string) | undefined, pathImpl: typeof win32 | typeof posix, sep: string | RegExp, { nocase, childrenCacheSize, fs, }?: PathScurryOpts);
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path?: Path | string): number;
+    /**
+     * Parse the root portion of a path string
+     *
+     * @internal
+     */
+    abstract parseRootPath(dir: string): string;
+    /**
+     * create a new Path to use as root during construction.
+     *
+     * @internal
+     */
+    abstract newRoot(fs: FSValue): PathBase;
+    /**
+     * Determine whether a given path string is absolute
+     */
+    abstract isAbsolute(p: string): boolean;
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache(): ChildrenCache;
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths: string[]): string;
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths: string[]): string;
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry?: PathBase | string): string;
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry?: PathBase | string): string;
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry?: PathBase | string): string;
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry?: PathBase | string): string;
+    /**
+     * Return an array of known child entries.
+     *
+     * First argument may be either a string, or a Path object.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set
+     * `{ withFileTypes: false }` to return strings.
+     */
+    readdir(): Promise;
+    readdir(opts: {
+        withFileTypes: true;
+    }): Promise;
+    readdir(opts: {
+        withFileTypes: false;
+    }): Promise;
+    readdir(opts: {
+        withFileTypes: boolean;
+    }): Promise;
+    readdir(entry: PathBase | string): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: true;
+    }): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: false;
+    }): Promise;
+    readdir(entry: PathBase | string, opts: {
+        withFileTypes: boolean;
+    }): Promise;
+    /**
+     * synchronous {@link PathScurryBase.readdir}
+     */
+    readdirSync(): PathBase[];
+    readdirSync(opts: {
+        withFileTypes: true;
+    }): PathBase[];
+    readdirSync(opts: {
+        withFileTypes: false;
+    }): string[];
+    readdirSync(opts: {
+        withFileTypes: boolean;
+    }): PathBase[] | string[];
+    readdirSync(entry: PathBase | string): PathBase[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: true;
+    }): PathBase[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: false;
+    }): string[];
+    readdirSync(entry: PathBase | string, opts: {
+        withFileTypes: boolean;
+    }): PathBase[] | string[];
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    lstat(entry?: string | PathBase): Promise;
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry?: string | PathBase): PathBase | undefined;
+    /**
+     * Return the Path object or string path corresponding to the target of a
+     * symbolic link.
+     *
+     * If the path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     *
+     * `{withFileTypes}` option defaults to `false`.
+     *
+     * On success, returns a Path object if `withFileTypes` option is true,
+     * otherwise a string.
+     */
+    readlink(): Promise;
+    readlink(opt: {
+        withFileTypes: false;
+    }): Promise;
+    readlink(opt: {
+        withFileTypes: true;
+    }): Promise;
+    readlink(opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    readlink(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): Promise;
+    readlink(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): Promise;
+    readlink(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    /**
+     * synchronous {@link PathScurryBase.readlink}
+     */
+    readlinkSync(): string | undefined;
+    readlinkSync(opt: {
+        withFileTypes: false;
+    }): string | undefined;
+    readlinkSync(opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    readlinkSync(opt: {
+        withFileTypes: boolean;
+    }): PathBase | string | undefined;
+    readlinkSync(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): string | undefined;
+    readlinkSync(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    readlinkSync(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): string | PathBase | undefined;
+    /**
+     * Return the Path object or string path corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     *
+     * `{withFileTypes}` option defaults to `false`.
+     *
+     * On success, returns a Path object if `withFileTypes` option is true,
+     * otherwise a string.
+     */
+    realpath(): Promise;
+    realpath(opt: {
+        withFileTypes: false;
+    }): Promise;
+    realpath(opt: {
+        withFileTypes: true;
+    }): Promise;
+    realpath(opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    realpath(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): Promise;
+    realpath(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): Promise;
+    realpath(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): Promise;
+    realpathSync(): string | undefined;
+    realpathSync(opt: {
+        withFileTypes: false;
+    }): string | undefined;
+    realpathSync(opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    realpathSync(opt: {
+        withFileTypes: boolean;
+    }): PathBase | string | undefined;
+    realpathSync(entry: string | PathBase, opt?: {
+        withFileTypes: false;
+    }): string | undefined;
+    realpathSync(entry: string | PathBase, opt: {
+        withFileTypes: true;
+    }): PathBase | undefined;
+    realpathSync(entry: string | PathBase, opt: {
+        withFileTypes: boolean;
+    }): string | PathBase | undefined;
+    /**
+     * Asynchronously walk the directory tree, returning an array of
+     * all path strings or Path objects found.
+     *
+     * Note that this will be extremely memory-hungry on large filesystems.
+     * In such cases, it may be better to use the stream or async iterator
+     * walk implementation.
+     */
+    walk(): Promise;
+    walk(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise;
+    walk(opts: WalkOptionsWithFileTypesFalse): Promise;
+    walk(opts: WalkOptions): Promise;
+    walk(entry: string | PathBase): Promise;
+    walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Promise;
+    walk(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Promise;
+    walk(entry: string | PathBase, opts: WalkOptions): Promise;
+    /**
+     * Synchronously walk the directory tree, returning an array of
+     * all path strings or Path objects found.
+     *
+     * Note that this will be extremely memory-hungry on large filesystems.
+     * In such cases, it may be better to use the stream or async iterator
+     * walk implementation.
+     */
+    walkSync(): PathBase[];
+    walkSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): PathBase[];
+    walkSync(opts: WalkOptionsWithFileTypesFalse): string[];
+    walkSync(opts: WalkOptions): string[] | PathBase[];
+    walkSync(entry: string | PathBase): PathBase[];
+    walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): PathBase[];
+    walkSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): string[];
+    walkSync(entry: string | PathBase, opts: WalkOptions): PathBase[] | string[];
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator](): AsyncGenerator;
+    /**
+     * Async generator form of {@link PathScurryBase.walk}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking, especially if most/all of the directory tree has been previously
+     * walked.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    iterate(): AsyncGenerator;
+    iterate(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator;
+    iterate(opts: WalkOptionsWithFileTypesFalse): AsyncGenerator;
+    iterate(opts: WalkOptions): AsyncGenerator;
+    iterate(entry: string | PathBase): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): AsyncGenerator;
+    iterate(entry: string | PathBase, opts: WalkOptions): AsyncGenerator;
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator](): Generator;
+    iterateSync(): Generator;
+    iterateSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator;
+    iterateSync(opts: WalkOptionsWithFileTypesFalse): Generator;
+    iterateSync(opts: WalkOptions): Generator;
+    iterateSync(entry: string | PathBase): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Generator;
+    iterateSync(entry: string | PathBase, opts: WalkOptions): Generator;
+    /**
+     * Stream form of {@link PathScurryBase.walk}
+     *
+     * Returns a Minipass stream that emits {@link PathBase} objects by default,
+     * or strings if `{ withFileTypes: false }` is set in the options.
+     */
+    stream(): Minipass;
+    stream(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass;
+    stream(opts: WalkOptionsWithFileTypesFalse): Minipass;
+    stream(opts: WalkOptions): Minipass;
+    stream(entry: string | PathBase): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass;
+    stream(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass;
+    /**
+     * Synchronous form of {@link PathScurryBase.stream}
+     *
+     * Returns a Minipass stream that emits {@link PathBase} objects by default,
+     * or strings if `{ withFileTypes: false }` is set in the options.
+     *
+     * Will complete the walk in a single tick if the stream is consumed fully.
+     * Otherwise, will pause as needed for stream backpressure.
+     */
+    streamSync(): Minipass;
+    streamSync(opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset): Minipass;
+    streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass;
+    streamSync(opts: WalkOptions): Minipass;
+    streamSync(entry: string | PathBase): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptionsWithFileTypesFalse): Minipass;
+    streamSync(entry: string | PathBase, opts: WalkOptions): Minipass | Minipass;
+    chdir(path?: string | Path): void;
+}
+/**
+ * Options provided to all walk methods.
+ */
+export interface WalkOptions {
+    /**
+     * Return results as {@link PathBase} objects rather than strings.
+     * When set to false, results are fully resolved paths, as returned by
+     * {@link PathBase.fullpath}.
+     * @default true
+     */
+    withFileTypes?: boolean;
+    /**
+     *  Attempt to read directory entries from symbolic links. Otherwise, only
+     *  actual directories are traversed. Regardless of this setting, a given
+     *  target path will only ever be walked once, meaning that a symbolic link
+     *  to a previously traversed directory will never be followed.
+     *
+     *  Setting this imposes a slight performance penalty, because `readlink`
+     *  must be called on all symbolic links encountered, in order to avoid
+     *  infinite cycles.
+     * @default false
+     */
+    follow?: boolean;
+    /**
+     * Only return entries where the provided function returns true.
+     *
+     * This will not prevent directories from being traversed, even if they do
+     * not pass the filter, though it will prevent directories themselves from
+     * being included in the result set.  See {@link walkFilter}
+     *
+     * Asynchronous functions are not supported here.
+     *
+     * By default, if no filter is provided, all entries and traversed
+     * directories are included.
+     */
+    filter?: (entry: PathBase) => boolean;
+    /**
+     * Only traverse directories (and in the case of {@link follow} being set to
+     * true, symbolic links to directories) if the provided function returns
+     * true.
+     *
+     * This will not prevent directories from being included in the result set,
+     * even if they do not pass the supplied filter function.  See {@link filter}
+     * to do that.
+     *
+     * Asynchronous functions are not supported here.
+     */
+    walkFilter?: (entry: PathBase) => boolean;
+}
+export type WalkOptionsWithFileTypesUnset = WalkOptions & {
+    withFileTypes?: undefined;
+};
+export type WalkOptionsWithFileTypesTrue = WalkOptions & {
+    withFileTypes: true;
+};
+export type WalkOptionsWithFileTypesFalse = WalkOptions & {
+    withFileTypes: false;
+};
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+export declare class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep: '\\';
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+    /**
+     * @internal
+     */
+    parseRootPath(dir: string): string;
+    /**
+     * @internal
+     */
+    newRoot(fs: FSValue): PathWin32;
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p: string): boolean;
+}
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export declare class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep: '/';
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+    /**
+     * @internal
+     */
+    parseRootPath(_dir: string): string;
+    /**
+     * @internal
+     */
+    newRoot(fs: FSValue): PathPosix;
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p: string): boolean;
+}
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export declare class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd?: URL | string, opts?: PathScurryOpts);
+}
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+export declare const Path: typeof PathWin32 | typeof PathPosix;
+export type Path = PathBase | InstanceType;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+export declare const PathScurry: typeof PathScurryWin32 | typeof PathScurryDarwin | typeof PathScurryPosix;
+export type PathScurry = PathScurryBase | InstanceType;
+export {};
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/node_modules/path-scurry/dist/esm/index.d.ts.map b/node_modules/path-scurry/dist/esm/index.d.ts.map
new file mode 100644
index 00000000..bf58a3a3
--- /dev/null
+++ b/node_modules/path-scurry/dist/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAmBxC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAA;IACnC,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,EAChC,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,CAAC,cAAc,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,GAAG,KAC9D,IAAI,CAAA;IACT,WAAW,CAAC,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,KAC7B,MAAM,EAAE,CAAA;IACb,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAAA;QACxC,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;YAAE,aAAa,EAAE,IAAI,CAAA;SAAE,KAC7B,OAAO,CAAC,MAAM,EAAE,CAA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;GAMG;AACH,qBAAa,eAAgB,SAAQ,cAAc;IACjD;;OAEG;IACH,GAAG,EAAE,GAAG,CAAM;gBAEZ,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;IAO3B;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,OAAO;IAYnB;;OAEG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO;CAG/B;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;gBAEjD,GAAG,GAAE,GAAG,GAAG,MAAsB,EACjC,IAAI,GAAE,cAAmB;CAK5B;AAED;;;;GAIG;AACH,eAAO,MAAM,IAAI,qCAAuD,CAAA;AACxE,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EACnB,OAAO,eAAe,GACtB,OAAO,gBAAgB,GACvB,OAAO,eAGQ,CAAA;AACnB,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAA"}
\ No newline at end of file
diff --git a/node_modules/path-scurry/dist/esm/index.js b/node_modules/path-scurry/dist/esm/index.js
new file mode 100644
index 00000000..dc7cae49
--- /dev/null
+++ b/node_modules/path-scurry/dist/esm/index.js
@@ -0,0 +1,1983 @@
+import { LRUCache } from 'lru-cache';
+import { posix, win32 } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps, } from 'fs';
+import * as actualFS from 'node:fs';
+const realpathSync = rps.native;
+// TODO: test perf of fs/promises realpath vs realpathCB,
+// since the promises one uses realpath.native
+import { lstat, readdir, readlink, realpath } from 'node:fs/promises';
+import { Minipass } from 'minipass';
+const defaultFS = {
+    lstatSync,
+    readdir: readdirCB,
+    readdirSync,
+    readlinkSync,
+    realpathSync,
+    promises: {
+        lstat,
+        readdir,
+        readlink,
+        realpath,
+    },
+};
+// if they just gave us require('fs') then use our default
+const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === actualFS ?
+    defaultFS
+    : {
+        ...defaultFS,
+        ...fsOption,
+        promises: {
+            ...defaultFS.promises,
+            ...(fsOption.promises || {}),
+        },
+    };
+// turn something like //?/c:/ into c:\
+const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
+const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
+// windows paths are separated by either / or \
+const eitherSep = /[\\\/]/;
+const UNKNOWN = 0; // may not even exist, for all we know
+const IFIFO = 0b0001;
+const IFCHR = 0b0010;
+const IFDIR = 0b0100;
+const IFBLK = 0b0110;
+const IFREG = 0b1000;
+const IFLNK = 0b1010;
+const IFSOCK = 0b1100;
+const IFMT = 0b1111;
+// mask to unset low 4 bits
+const IFMT_UNKNOWN = ~IFMT;
+// set after successfully calling readdir() and getting entries.
+const READDIR_CALLED = 0b0000_0001_0000;
+// set after a successful lstat()
+const LSTAT_CALLED = 0b0000_0010_0000;
+// set if an entry (or one of its parents) is definitely not a dir
+const ENOTDIR = 0b0000_0100_0000;
+// set if an entry (or one of its parents) does not exist
+// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
+const ENOENT = 0b0000_1000_0000;
+// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
+// set if we fail to readlink
+const ENOREADLINK = 0b0001_0000_0000;
+// set if we know realpath() will fail
+const ENOREALPATH = 0b0010_0000_0000;
+const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
+const TYPEMASK = 0b0011_1111_1111;
+const entToType = (s) => s.isFile() ? IFREG
+    : s.isDirectory() ? IFDIR
+        : s.isSymbolicLink() ? IFLNK
+            : s.isCharacterDevice() ? IFCHR
+                : s.isBlockDevice() ? IFBLK
+                    : s.isSocket() ? IFSOCK
+                        : s.isFIFO() ? IFIFO
+                            : UNKNOWN;
+// normalize unicode path names
+const normalizeCache = new LRUCache({ max: 2 ** 12 });
+const normalize = (s) => {
+    const c = normalizeCache.get(s);
+    if (c)
+        return c;
+    const n = s.normalize('NFKD');
+    normalizeCache.set(s, n);
+    return n;
+};
+const normalizeNocaseCache = new LRUCache({ max: 2 ** 12 });
+const normalizeNocase = (s) => {
+    const c = normalizeNocaseCache.get(s);
+    if (c)
+        return c;
+    const n = normalize(s.toLowerCase());
+    normalizeNocaseCache.set(s, n);
+    return n;
+};
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+export class ResolveCache extends LRUCache {
+    constructor() {
+        super({ max: 256 });
+    }
+}
+// In order to prevent blowing out the js heap by allocating hundreds of
+// thousands of Path entries when walking extremely large trees, the "children"
+// in this tree are represented by storing an array of Path entries in an
+// LRUCache, indexed by the parent.  At any time, Path.children() may return an
+// empty array, indicating that it doesn't know about any of its children, and
+// thus has to rebuild that cache.  This is fine, it just means that we don't
+// benefit as much from having the cached entries, but huge directory walks
+// don't blow out the stack, and smaller ones are still as fast as possible.
+//
+//It does impose some complexity when building up the readdir data, because we
+//need to pass a reference to the children array that we started with.
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+export class ChildrenCache extends LRUCache {
+    constructor(maxSize = 16 * 1024) {
+        super({
+            maxSize,
+            // parent + children
+            sizeCalculation: a => a.length + 1,
+        });
+    }
+}
+const setAsCwd = Symbol('PathScurry setAsCwd');
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+export class PathBase {
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots;
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD = false;
+    // potential default fs override
+    #fs;
+    // Stats fields
+    #dev;
+    get dev() {
+        return this.#dev;
+    }
+    #mode;
+    get mode() {
+        return this.#mode;
+    }
+    #nlink;
+    get nlink() {
+        return this.#nlink;
+    }
+    #uid;
+    get uid() {
+        return this.#uid;
+    }
+    #gid;
+    get gid() {
+        return this.#gid;
+    }
+    #rdev;
+    get rdev() {
+        return this.#rdev;
+    }
+    #blksize;
+    get blksize() {
+        return this.#blksize;
+    }
+    #ino;
+    get ino() {
+        return this.#ino;
+    }
+    #size;
+    get size() {
+        return this.#size;
+    }
+    #blocks;
+    get blocks() {
+        return this.#blocks;
+    }
+    #atimeMs;
+    get atimeMs() {
+        return this.#atimeMs;
+    }
+    #mtimeMs;
+    get mtimeMs() {
+        return this.#mtimeMs;
+    }
+    #ctimeMs;
+    get ctimeMs() {
+        return this.#ctimeMs;
+    }
+    #birthtimeMs;
+    get birthtimeMs() {
+        return this.#birthtimeMs;
+    }
+    #atime;
+    get atime() {
+        return this.#atime;
+    }
+    #mtime;
+    get mtime() {
+        return this.#mtime;
+    }
+    #ctime;
+    get ctime() {
+        return this.#ctime;
+    }
+    #birthtime;
+    get birthtime() {
+        return this.#birthtime;
+    }
+    #matchName;
+    #depth;
+    #fullpath;
+    #fullpathPosix;
+    #relative;
+    #relativePosix;
+    #type;
+    #children;
+    #linkTarget;
+    #realpath;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath() {
+        return (this.parent || this).fullpath();
+    }
+    /* c8 ignore start */
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path() {
+        return this.parentPath;
+    }
+    /* c8 ignore stop */
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        this.name = name;
+        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
+        this.#type = type & TYPEMASK;
+        this.nocase = nocase;
+        this.roots = roots;
+        this.root = root || this;
+        this.#children = children;
+        this.#fullpath = opts.fullpath;
+        this.#relative = opts.relative;
+        this.#relativePosix = opts.relativePosix;
+        this.parent = opts.parent;
+        if (this.parent) {
+            this.#fs = this.parent.#fs;
+        }
+        else {
+            this.#fs = fsFromOption(opts.fs);
+        }
+    }
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth() {
+        if (this.#depth !== undefined)
+            return this.#depth;
+        if (!this.parent)
+            return (this.#depth = 0);
+        return (this.#depth = this.parent.depth() + 1);
+    }
+    /**
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path) {
+        if (!path) {
+            return this;
+        }
+        const rootPath = this.getRootString(path);
+        const dir = path.substring(rootPath.length);
+        const dirParts = dir.split(this.splitSep);
+        const result = rootPath ?
+            this.getRoot(rootPath).#resolveParts(dirParts)
+            : this.#resolveParts(dirParts);
+        return result;
+    }
+    #resolveParts(dirParts) {
+        let p = this;
+        for (const part of dirParts) {
+            p = p.child(part);
+        }
+        return p;
+    }
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children() {
+        const cached = this.#children.get(this);
+        if (cached) {
+            return cached;
+        }
+        const children = Object.assign([], { provisional: 0 });
+        this.#children.set(this, children);
+        this.#type &= ~READDIR_CALLED;
+        return children;
+    }
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart, opts) {
+        if (pathPart === '' || pathPart === '.') {
+            return this;
+        }
+        if (pathPart === '..') {
+            return this.parent || this;
+        }
+        // find the child
+        const children = this.children();
+        const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);
+        for (const p of children) {
+            if (p.#matchName === name) {
+                return p;
+            }
+        }
+        // didn't find it, create provisional child, since it might not
+        // actually exist.  If we know the parent isn't a dir, then
+        // in fact it CAN'T exist.
+        const s = this.parent ? this.sep : '';
+        const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;
+        const pchild = this.newChild(pathPart, UNKNOWN, {
+            ...opts,
+            parent: this,
+            fullpath,
+        });
+        if (!this.canReaddir()) {
+            pchild.#type |= ENOENT;
+        }
+        // don't have to update provisional, because if we have real children,
+        // then provisional is set to children.length, otherwise a lower number
+        children.push(pchild);
+        return pchild;
+    }
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative() {
+        if (this.isCWD)
+            return '';
+        if (this.#relative !== undefined) {
+            return this.#relative;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relative = this.name);
+        }
+        const pv = p.relative();
+        return pv + (!pv || !p.parent ? '' : this.sep) + name;
+    }
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix() {
+        if (this.sep === '/')
+            return this.relative();
+        if (this.isCWD)
+            return '';
+        if (this.#relativePosix !== undefined)
+            return this.#relativePosix;
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relativePosix = this.fullpathPosix());
+        }
+        const pv = p.relativePosix();
+        return pv + (!pv || !p.parent ? '' : '/') + name;
+    }
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath() {
+        if (this.#fullpath !== undefined) {
+            return this.#fullpath;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#fullpath = this.name);
+        }
+        const pv = p.fullpath();
+        const fp = pv + (!p.parent ? '' : this.sep) + name;
+        return (this.#fullpath = fp);
+    }
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix() {
+        if (this.#fullpathPosix !== undefined)
+            return this.#fullpathPosix;
+        if (this.sep === '/')
+            return (this.#fullpathPosix = this.fullpath());
+        if (!this.parent) {
+            const p = this.fullpath().replace(/\\/g, '/');
+            if (/^[a-z]:\//i.test(p)) {
+                return (this.#fullpathPosix = `//?/${p}`);
+            }
+            else {
+                return (this.#fullpathPosix = p);
+            }
+        }
+        const p = this.parent;
+        const pfpp = p.fullpathPosix();
+        const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;
+        return (this.#fullpathPosix = fpp);
+    }
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown() {
+        return (this.#type & IFMT) === UNKNOWN;
+    }
+    isType(type) {
+        return this[`is${type}`]();
+    }
+    getType() {
+        return (this.isUnknown() ? 'Unknown'
+            : this.isDirectory() ? 'Directory'
+                : this.isFile() ? 'File'
+                    : this.isSymbolicLink() ? 'SymbolicLink'
+                        : this.isFIFO() ? 'FIFO'
+                            : this.isCharacterDevice() ? 'CharacterDevice'
+                                : this.isBlockDevice() ? 'BlockDevice'
+                                    : /* c8 ignore start */ this.isSocket() ? 'Socket'
+                                        : 'Unknown');
+        /* c8 ignore stop */
+    }
+    /**
+     * Is the Path a regular file?
+     */
+    isFile() {
+        return (this.#type & IFMT) === IFREG;
+    }
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory() {
+        return (this.#type & IFMT) === IFDIR;
+    }
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice() {
+        return (this.#type & IFMT) === IFCHR;
+    }
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice() {
+        return (this.#type & IFMT) === IFBLK;
+    }
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO() {
+        return (this.#type & IFMT) === IFIFO;
+    }
+    /**
+     * Is the path a socket?
+     */
+    isSocket() {
+        return (this.#type & IFMT) === IFSOCK;
+    }
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink() {
+        return (this.#type & IFLNK) === IFLNK;
+    }
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached() {
+        return this.#type & LSTAT_CALLED ? this : undefined;
+    }
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached() {
+        return this.#linkTarget;
+    }
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached() {
+        return this.#realpath;
+    }
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached() {
+        const children = this.children();
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink() {
+        if (this.#linkTarget)
+            return true;
+        if (!this.parent)
+            return false;
+        // cases where it cannot possibly succeed
+        const ifmt = this.#type & IFMT;
+        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
+            this.#type & ENOREADLINK ||
+            this.#type & ENOENT);
+    }
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir() {
+        return !!(this.#type & READDIR_CALLED);
+    }
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT() {
+        return !!(this.#type & ENOENT);
+    }
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n) {
+        return !this.nocase ?
+            this.#matchName === normalize(n)
+            : this.#matchName === normalizeNocase(n);
+    }
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    async readlink() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = await this.#fs.promises.readlink(this.fullpath());
+            const linkTarget = (await this.parent.realpath())?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = this.#fs.readlinkSync(this.fullpath());
+            const linkTarget = this.parent.realpathSync()?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    #readdirSuccess(children) {
+        // succeeded, mark readdir called bit
+        this.#type |= READDIR_CALLED;
+        // mark all remaining provisional children as ENOENT
+        for (let p = children.provisional; p < children.length; p++) {
+            const c = children[p];
+            if (c)
+                c.#markENOENT();
+        }
+    }
+    #markENOENT() {
+        // mark as UNKNOWN and ENOENT
+        if (this.#type & ENOENT)
+            return;
+        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
+        this.#markChildrenENOENT();
+    }
+    #markChildrenENOENT() {
+        // all children are provisional and do not exist
+        const children = this.children();
+        children.provisional = 0;
+        for (const p of children) {
+            p.#markENOENT();
+        }
+    }
+    #markENOREALPATH() {
+        this.#type |= ENOREALPATH;
+        this.#markENOTDIR();
+    }
+    // save the information when we know the entry is not a dir
+    #markENOTDIR() {
+        // entry is not a directory, so any children can't exist.
+        // this *should* be impossible, since any children created
+        // after it's been marked ENOTDIR should be marked ENOENT,
+        // so it won't even get to this point.
+        /* c8 ignore start */
+        if (this.#type & ENOTDIR)
+            return;
+        /* c8 ignore stop */
+        let t = this.#type;
+        // this could happen if we stat a dir, then delete it,
+        // then try to read it or one of its children.
+        if ((t & IFMT) === IFDIR)
+            t &= IFMT_UNKNOWN;
+        this.#type = t | ENOTDIR;
+        this.#markChildrenENOENT();
+    }
+    #readdirFail(code = '') {
+        // markENOTDIR and markENOENT also set provisional=0
+        if (code === 'ENOTDIR' || code === 'EPERM') {
+            this.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            this.#markENOENT();
+        }
+        else {
+            this.children().provisional = 0;
+        }
+    }
+    #lstatFail(code = '') {
+        // Windows just raises ENOENT in this case, disable for win CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR') {
+            // already know it has a parent by this point
+            const p = this.parent;
+            p.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            /* c8 ignore stop */
+            this.#markENOENT();
+        }
+    }
+    #readlinkFail(code = '') {
+        let ter = this.#type;
+        ter |= ENOREADLINK;
+        if (code === 'ENOENT')
+            ter |= ENOENT;
+        // windows gets a weird error when you try to readlink a file
+        if (code === 'EINVAL' || code === 'UNKNOWN') {
+            // exists, but not a symlink, we don't know WHAT it is, so remove
+            // all IFMT bits.
+            ter &= IFMT_UNKNOWN;
+        }
+        this.#type = ter;
+        // windows just gets ENOENT in this case.  We do cover the case,
+        // just disabled because it's impossible on Windows CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR' && this.parent) {
+            this.parent.#markENOTDIR();
+        }
+        /* c8 ignore stop */
+    }
+    #readdirAddChild(e, c) {
+        return (this.#readdirMaybePromoteChild(e, c) ||
+            this.#readdirAddNewChild(e, c));
+    }
+    #readdirAddNewChild(e, c) {
+        // alloc new entry at head, so it's never provisional
+        const type = entToType(e);
+        const child = this.newChild(e.name, type, { parent: this });
+        const ifmt = child.#type & IFMT;
+        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
+            child.#type |= ENOTDIR;
+        }
+        c.unshift(child);
+        c.provisional++;
+        return child;
+    }
+    #readdirMaybePromoteChild(e, c) {
+        for (let p = c.provisional; p < c.length; p++) {
+            const pchild = c[p];
+            const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
+            if (name !== pchild.#matchName) {
+                continue;
+            }
+            return this.#readdirPromoteChild(e, pchild, p, c);
+        }
+    }
+    #readdirPromoteChild(e, p, index, c) {
+        const v = p.name;
+        // retain any other flags, but set ifmt from dirent
+        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
+        // case sensitivity fixing when we learn the true name.
+        if (v !== e.name)
+            p.name = e.name;
+        // just advance provisional index (potentially off the list),
+        // otherwise we have to splice/pop it out and re-insert at head
+        if (index !== c.provisional) {
+            if (index === c.length - 1)
+                c.pop();
+            else
+                c.splice(index, 1);
+            c.unshift(p);
+        }
+        c.provisional++;
+        return p;
+    }
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    #applyStat(st) {
+        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
+        this.#atime = atime;
+        this.#atimeMs = atimeMs;
+        this.#birthtime = birthtime;
+        this.#birthtimeMs = birthtimeMs;
+        this.#blksize = blksize;
+        this.#blocks = blocks;
+        this.#ctime = ctime;
+        this.#ctimeMs = ctimeMs;
+        this.#dev = dev;
+        this.#gid = gid;
+        this.#ino = ino;
+        this.#mode = mode;
+        this.#mtime = mtime;
+        this.#mtimeMs = mtimeMs;
+        this.#nlink = nlink;
+        this.#rdev = rdev;
+        this.#size = size;
+        this.#uid = uid;
+        const ifmt = entToType(st);
+        // retain any other flags, but set the ifmt
+        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
+        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
+            this.#type |= ENOTDIR;
+        }
+    }
+    #onReaddirCB = [];
+    #readdirCBInFlight = false;
+    #callOnReaddirCB(children) {
+        this.#readdirCBInFlight = false;
+        const cbs = this.#onReaddirCB.slice();
+        this.#onReaddirCB.length = 0;
+        cbs.forEach(cb => cb(null, children));
+    }
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb, allowZalgo = false) {
+        if (!this.canReaddir()) {
+            if (allowZalgo)
+                cb(null, []);
+            else
+                queueMicrotask(() => cb(null, []));
+            return;
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            const c = children.slice(0, children.provisional);
+            if (allowZalgo)
+                cb(null, c);
+            else
+                queueMicrotask(() => cb(null, c));
+            return;
+        }
+        // don't have to worry about zalgo at this point.
+        this.#onReaddirCB.push(cb);
+        if (this.#readdirCBInFlight) {
+            return;
+        }
+        this.#readdirCBInFlight = true;
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
+            if (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            else {
+                // if we didn't get an error, we always get entries.
+                //@ts-ignore
+                for (const e of entries) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            this.#callOnReaddirCB(children.slice(0, children.provisional));
+            return;
+        });
+    }
+    #asyncReaddirInFlight;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async readdir() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        if (this.#asyncReaddirInFlight) {
+            await this.#asyncReaddirInFlight;
+        }
+        else {
+            /* c8 ignore start */
+            let resolve = () => { };
+            /* c8 ignore stop */
+            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
+            try {
+                for (const e of await this.#fs.promises.readdir(fullpath, {
+                    withFileTypes: true,
+                })) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            catch (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            this.#asyncReaddirInFlight = undefined;
+            resolve();
+        }
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        try {
+            for (const e of this.#fs.readdirSync(fullpath, {
+                withFileTypes: true,
+            })) {
+                this.#readdirAddChild(e, children);
+            }
+            this.#readdirSuccess(children);
+        }
+        catch (er) {
+            this.#readdirFail(er.code);
+            children.provisional = 0;
+        }
+        return children.slice(0, children.provisional);
+    }
+    canReaddir() {
+        if (this.#type & ENOCHILD)
+            return false;
+        const ifmt = IFMT & this.#type;
+        // we always set ENOTDIR when setting IFMT, so should be impossible
+        /* c8 ignore start */
+        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
+            return false;
+        }
+        /* c8 ignore stop */
+        return true;
+    }
+    shouldWalk(dirs, walkFilter) {
+        return ((this.#type & IFDIR) === IFDIR &&
+            !(this.#type & ENOCHILD) &&
+            !dirs.has(this) &&
+            (!walkFilter || walkFilter(this)));
+    }
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    async realpath() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = await this.#fs.promises.realpath(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = this.#fs.realpathSync(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd) {
+        if (oldCwd === this)
+            return;
+        oldCwd.isCWD = false;
+        this.isCWD = true;
+        const changed = new Set([]);
+        let rp = [];
+        let p = this;
+        while (p && p.parent) {
+            changed.add(p);
+            p.#relative = rp.join(this.sep);
+            p.#relativePosix = rp.join('/');
+            p = p.parent;
+            rp.push('..');
+        }
+        // now un-memoize parents of old cwd
+        p = oldCwd;
+        while (p && p.parent && !changed.has(p)) {
+            p.#relative = undefined;
+            p.#relativePosix = undefined;
+            p = p.parent;
+        }
+    }
+}
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+export class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep = '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep = eitherSep;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return win32.parse(path).root;
+    }
+    /**
+     * @internal
+     */
+    getRoot(rootPath) {
+        rootPath = uncToDrive(rootPath.toUpperCase());
+        if (rootPath === this.root.name) {
+            return this.root;
+        }
+        // ok, not that one, check if it matches another we know about
+        for (const [compare, root] of Object.entries(this.roots)) {
+            if (this.sameRoot(rootPath, compare)) {
+                return (this.roots[rootPath] = root);
+            }
+        }
+        // otherwise, have to create a new one.
+        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
+    }
+    /**
+     * @internal
+     */
+    sameRoot(rootPath, compare = this.root.name) {
+        // windows can (rarely) have case-sensitive filesystem, but
+        // UNC and drive letters are always case-insensitive, and canonically
+        // represented uppercase.
+        rootPath = rootPath
+            .toUpperCase()
+            .replace(/\//g, '\\')
+            .replace(uncDriveRegexp, '$1\\');
+        return rootPath === compare;
+    }
+}
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+export class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep = '/';
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return path.startsWith('/') ? '/' : '';
+    }
+    /**
+     * @internal
+     */
+    getRoot(_rootPath) {
+        return this.root;
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+}
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+export class PathScurryBase {
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots;
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd;
+    #resolveCache;
+    #resolvePosixCache;
+    #children;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase;
+    #fs;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
+        this.#fs = fsFromOption(fs);
+        if (cwd instanceof URL || cwd.startsWith('file://')) {
+            cwd = fileURLToPath(cwd);
+        }
+        // resolve and split root, and then add to the store.
+        // this is the only time we call path.resolve()
+        const cwdPath = pathImpl.resolve(cwd);
+        this.roots = Object.create(null);
+        this.rootPath = this.parseRootPath(cwdPath);
+        this.#resolveCache = new ResolveCache();
+        this.#resolvePosixCache = new ResolveCache();
+        this.#children = new ChildrenCache(childrenCacheSize);
+        const split = cwdPath.substring(this.rootPath.length).split(sep);
+        // resolve('/') leaves '', splits to [''], we don't want that.
+        if (split.length === 1 && !split[0]) {
+            split.pop();
+        }
+        /* c8 ignore start */
+        if (nocase === undefined) {
+            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
+        }
+        /* c8 ignore stop */
+        this.nocase = nocase;
+        this.root = this.newRoot(this.#fs);
+        this.roots[this.rootPath] = this.root;
+        let prev = this.root;
+        let len = split.length - 1;
+        const joinSep = pathImpl.sep;
+        let abs = this.rootPath;
+        let sawFirst = false;
+        for (const part of split) {
+            const l = len--;
+            prev = prev.child(part, {
+                relative: new Array(l).fill('..').join(joinSep),
+                relativePosix: new Array(l).fill('..').join('/'),
+                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
+            });
+            sawFirst = true;
+        }
+        this.cwd = prev;
+    }
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path = this.cwd) {
+        if (typeof path === 'string') {
+            path = this.cwd.resolve(path);
+        }
+        return path.depth();
+    }
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolveCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpath();
+        this.#resolveCache.set(r, result);
+        return result;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolvePosixCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpathPosix();
+        this.#resolvePosixCache.set(r, result);
+        return result;
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relative();
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relativePosix();
+    }
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.name;
+    }
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return (entry.parent || entry).fullpath();
+    }
+    async readdir(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else {
+            const p = await entry.readdir();
+            return withFileTypes ? p : p.map(e => e.name);
+        }
+    }
+    readdirSync(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else if (withFileTypes) {
+            return entry.readdirSync();
+        }
+        else {
+            return entry.readdirSync().map(e => e.name);
+        }
+    }
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstat();
+    }
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstatSync();
+    }
+    async readlink(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.readlink();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    readlinkSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.readlinkSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async realpath(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.realpath();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    realpathSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.realpathSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async walk(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const walk = (dir, cb) => {
+            dirs.add(dir);
+            dir.readdirCB((er, entries) => {
+                /* c8 ignore start */
+                if (er) {
+                    return cb(er);
+                }
+                /* c8 ignore stop */
+                let len = entries.length;
+                if (!len)
+                    return cb();
+                const next = () => {
+                    if (--len === 0) {
+                        cb();
+                    }
+                };
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        results.push(withFileTypes ? e : e.fullpath());
+                    }
+                    if (follow && e.isSymbolicLink()) {
+                        e.realpath()
+                            .then(r => (r?.isUnknown() ? r.lstat() : r))
+                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
+                    }
+                    else {
+                        if (e.shouldWalk(dirs, walkFilter)) {
+                            walk(e, next);
+                        }
+                        else {
+                            next();
+                        }
+                    }
+                }
+            }, true); // zalgooooooo
+        };
+        const start = entry;
+        return new Promise((res, rej) => {
+            walk(start, er => {
+                /* c8 ignore start */
+                if (er)
+                    return rej(er);
+                /* c8 ignore stop */
+                res(results);
+            });
+        });
+    }
+    walkSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    results.push(withFileTypes ? e : e.fullpath());
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+        return results;
+    }
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator]() {
+        return this.iterate();
+    }
+    iterate(entry = this.cwd, options = {}) {
+        // iterating async over the stream is significantly more performant,
+        // especially in the warm-cache scenario, because it buffers up directory
+        // entries in the background instead of waiting for a yield for each one.
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            options = entry;
+            entry = this.cwd;
+        }
+        return this.stream(entry, options)[Symbol.asyncIterator]();
+    }
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator]() {
+        return this.iterateSync();
+    }
+    *iterateSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        if (!filter || filter(entry)) {
+            yield withFileTypes ? entry : entry.fullpath();
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    yield withFileTypes ? e : e.fullpath();
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+    }
+    stream(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new Minipass({ objectMode: true });
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const onReaddir = (er, entries, didRealpaths = false) => {
+                    /* c8 ignore start */
+                    if (er)
+                        return results.emit('error', er);
+                    /* c8 ignore stop */
+                    if (follow && !didRealpaths) {
+                        const promises = [];
+                        for (const e of entries) {
+                            if (e.isSymbolicLink()) {
+                                promises.push(e
+                                    .realpath()
+                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
+                            }
+                        }
+                        if (promises.length) {
+                            Promise.all(promises).then(() => onReaddir(null, entries, true));
+                            return;
+                        }
+                    }
+                    for (const e of entries) {
+                        if (e && (!filter || filter(e))) {
+                            if (!results.write(withFileTypes ? e : e.fullpath())) {
+                                paused = true;
+                            }
+                        }
+                    }
+                    processing--;
+                    for (const e of entries) {
+                        const r = e.realpathCached() || e;
+                        if (r.shouldWalk(dirs, walkFilter)) {
+                            queue.push(r);
+                        }
+                    }
+                    if (paused && !results.flowing) {
+                        results.once('drain', process);
+                    }
+                    else if (!sync) {
+                        process();
+                    }
+                };
+                // zalgo containment
+                let sync = true;
+                dir.readdirCB(onReaddir, true);
+                sync = false;
+            }
+        };
+        process();
+        return results;
+    }
+    streamSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new Minipass({ objectMode: true });
+        const dirs = new Set();
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const entries = dir.readdirSync();
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        if (!results.write(withFileTypes ? e : e.fullpath())) {
+                            paused = true;
+                        }
+                    }
+                }
+                processing--;
+                for (const e of entries) {
+                    let r = e;
+                    if (e.isSymbolicLink()) {
+                        if (!(follow && (r = e.realpathSync())))
+                            continue;
+                        if (r.isUnknown())
+                            r.lstatSync();
+                    }
+                    if (r.shouldWalk(dirs, walkFilter)) {
+                        queue.push(r);
+                    }
+                }
+            }
+            if (paused && !results.flowing)
+                results.once('drain', process);
+        };
+        process();
+        return results;
+    }
+    chdir(path = this.cwd) {
+        const oldCwd = this.cwd;
+        this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;
+        this.cwd[setAsCwd](oldCwd);
+    }
+}
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+export class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '\\';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, win32, '\\', { ...opts, nocase });
+        this.nocase = nocase;
+        for (let p = this.cwd; p; p = p.parent) {
+            p.nocase = this.nocase;
+        }
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(dir) {
+        // if the path starts with a single separator, it's not a UNC, and we'll
+        // just get separator as the root, and driveFromUNC will return \
+        // In that case, mount \ on the root from the cwd.
+        return win32.parse(dir).root.toUpperCase();
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
+    }
+}
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = false } = opts;
+        super(cwd, posix, '/', { ...opts, nocase });
+        this.nocase = nocase;
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(_dir) {
+        return '/';
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return p.startsWith('/');
+    }
+}
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+export class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, { ...opts, nocase });
+    }
+}
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+export const Path = process.platform === 'win32' ? PathWin32 : PathPosix;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+export const PathScurry = process.platform === 'win32' ? PathScurryWin32
+    : process.platform === 'darwin' ? PathScurryDarwin
+        : PathScurryPosix;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/path-scurry/dist/esm/index.js.map b/node_modules/path-scurry/dist/esm/index.js.map
new file mode 100644
index 00000000..51e56ee1
--- /dev/null
+++ b/node_modules/path-scurry/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE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AA;IAC1B,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IACnD,YACE,MAAoB,OAAO,CAAC,GAAG,EAAE,EACjC,OAAuB,EAAE;QAEzB,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;QAC9B,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;IACjC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAGxE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAIrB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe;IAC9C,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,gBAAgB;QAClD,CAAC,CAAC,eAAe,CAAA","sourcesContent":["import { LRUCache } from 'lru-cache'\nimport { posix, win32 } from 'node:path'\n\nimport { fileURLToPath } from 'node:url'\n\nimport {\n  lstatSync,\n  readdir as readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync as rps,\n} from 'fs'\nimport * as actualFS from 'node:fs'\n\nconst realpathSync = rps.native\n// TODO: test perf of fs/promises realpath vs realpathCB,\n// since the promises one uses realpath.native\n\nimport { lstat, readdir, readlink, realpath } from 'node:fs/promises'\n\nimport { Minipass } from 'minipass'\nimport type { Dirent, Stats } from 'node:fs'\n\n/**\n * An object that will be used to override the default `fs`\n * methods.  Any methods that are not overridden will use Node's\n * built-in implementations.\n *\n * - lstatSync\n * - readdir (callback `withFileTypes` Dirent variant, used for\n *   readdirCB and most walks)\n * - readdirSync\n * - readlinkSync\n * - realpathSync\n * - promises: Object containing the following async methods:\n *   - lstat\n *   - readdir (Dirent variant only)\n *   - readlink\n *   - realpath\n */\nexport interface FSOption {\n  lstatSync?: (path: string) => Stats\n  readdir?: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync?: (\n    path: string,\n    options: { withFileTypes: true },\n  ) => Dirent[]\n  readlinkSync?: (path: string) => string\n  realpathSync?: (path: string) => string\n  promises?: {\n    lstat?: (path: string) => Promise\n    readdir?: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink?: (path: string) => Promise\n    realpath?: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\ninterface FSValue {\n  lstatSync: (path: string) => Stats\n  readdir: (\n    path: string,\n    options: { withFileTypes: true },\n    cb: (er: NodeJS.ErrnoException | null, entries?: Dirent[]) => any,\n  ) => void\n  readdirSync: (path: string, options: { withFileTypes: true }) => Dirent[]\n  readlinkSync: (path: string) => string\n  realpathSync: (path: string) => string\n  promises: {\n    lstat: (path: string) => Promise\n    readdir: (\n      path: string,\n      options: { withFileTypes: true },\n    ) => Promise\n    readlink: (path: string) => Promise\n    realpath: (path: string) => Promise\n    [k: string]: any\n  }\n  [k: string]: any\n}\n\nconst defaultFS: FSValue = {\n  lstatSync,\n  readdir: readdirCB,\n  readdirSync,\n  readlinkSync,\n  realpathSync,\n  promises: {\n    lstat,\n    readdir,\n    readlink,\n    realpath,\n  },\n}\n\n// if they just gave us require('fs') then use our default\nconst fsFromOption = (fsOption?: FSOption): FSValue =>\n  !fsOption || fsOption === defaultFS || fsOption === actualFS ?\n    defaultFS\n  : {\n      ...defaultFS,\n      ...fsOption,\n      promises: {\n        ...defaultFS.promises,\n        ...(fsOption.promises || {}),\n      },\n    }\n\n// turn something like //?/c:/ into c:\\\nconst uncDriveRegexp = /^\\\\\\\\\\?\\\\([a-z]:)\\\\?$/i\nconst uncToDrive = (rootPath: string): string =>\n  rootPath.replace(/\\//g, '\\\\').replace(uncDriveRegexp, '$1\\\\')\n\n// windows paths are separated by either / or \\\nconst eitherSep = /[\\\\\\/]/\n\nconst UNKNOWN = 0 // may not even exist, for all we know\nconst IFIFO = 0b0001\nconst IFCHR = 0b0010\nconst IFDIR = 0b0100\nconst IFBLK = 0b0110\nconst IFREG = 0b1000\nconst IFLNK = 0b1010\nconst IFSOCK = 0b1100\nconst IFMT = 0b1111\n\nexport type Type =\n  | 'Unknown'\n  | 'FIFO'\n  | 'CharacterDevice'\n  | 'Directory'\n  | 'BlockDevice'\n  | 'File'\n  | 'SymbolicLink'\n  | 'Socket'\n\n// mask to unset low 4 bits\nconst IFMT_UNKNOWN = ~IFMT\n\n// set after successfully calling readdir() and getting entries.\nconst READDIR_CALLED = 0b0000_0001_0000\n// set after a successful lstat()\nconst LSTAT_CALLED = 0b0000_0010_0000\n// set if an entry (or one of its parents) is definitely not a dir\nconst ENOTDIR = 0b0000_0100_0000\n// set if an entry (or one of its parents) does not exist\n// (can also be set on lstat errors like EACCES or ENAMETOOLONG)\nconst ENOENT = 0b0000_1000_0000\n// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK\n// set if we fail to readlink\nconst ENOREADLINK = 0b0001_0000_0000\n// set if we know realpath() will fail\nconst ENOREALPATH = 0b0010_0000_0000\n\nconst ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH\nconst TYPEMASK = 0b0011_1111_1111\n\nconst entToType = (s: Dirent | Stats) =>\n  s.isFile() ? IFREG\n  : s.isDirectory() ? IFDIR\n  : s.isSymbolicLink() ? IFLNK\n  : s.isCharacterDevice() ? IFCHR\n  : s.isBlockDevice() ? IFBLK\n  : s.isSocket() ? IFSOCK\n  : s.isFIFO() ? IFIFO\n  : UNKNOWN\n\n// normalize unicode path names\nconst normalizeCache = new LRUCache({ max: 2 ** 12 })\nconst normalize = (s: string) => {\n  const c = normalizeCache.get(s)\n  if (c) return c\n  const n = s.normalize('NFKD')\n  normalizeCache.set(s, n)\n  return n\n}\n\nconst normalizeNocaseCache = new LRUCache({ max: 2 ** 12 })\nconst normalizeNocase = (s: string) => {\n  const c = normalizeNocaseCache.get(s)\n  if (c) return c\n  const n = normalize(s.toLowerCase())\n  normalizeNocaseCache.set(s, n)\n  return n\n}\n\n/**\n * Options that may be provided to the Path constructor\n */\nexport interface PathOpts {\n  fullpath?: string\n  relative?: string\n  relativePosix?: string\n  parent?: PathBase\n  /**\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * An LRUCache for storing resolved path strings or Path objects.\n * @internal\n */\nexport class ResolveCache extends LRUCache {\n  constructor() {\n    super({ max: 256 })\n  }\n}\n\n// In order to prevent blowing out the js heap by allocating hundreds of\n// thousands of Path entries when walking extremely large trees, the \"children\"\n// in this tree are represented by storing an array of Path entries in an\n// LRUCache, indexed by the parent.  At any time, Path.children() may return an\n// empty array, indicating that it doesn't know about any of its children, and\n// thus has to rebuild that cache.  This is fine, it just means that we don't\n// benefit as much from having the cached entries, but huge directory walks\n// don't blow out the stack, and smaller ones are still as fast as possible.\n//\n//It does impose some complexity when building up the readdir data, because we\n//need to pass a reference to the children array that we started with.\n\n/**\n * an LRUCache for storing child entries.\n * @internal\n */\nexport class ChildrenCache extends LRUCache {\n  constructor(maxSize: number = 16 * 1024) {\n    super({\n      maxSize,\n      // parent + children\n      sizeCalculation: a => a.length + 1,\n    })\n  }\n}\n\n/**\n * Array of Path objects, plus a marker indicating the first provisional entry\n *\n * @internal\n */\nexport type Children = PathBase[] & { provisional: number }\n\nconst setAsCwd = Symbol('PathScurry setAsCwd')\n\n/**\n * Path objects are sort of like a super-powered\n * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}\n *\n * Each one represents a single filesystem entry on disk, which may or may not\n * exist. It includes methods for reading various types of information via\n * lstat, readlink, and readdir, and caches all information to the greatest\n * degree possible.\n *\n * Note that fs operations that would normally throw will instead return an\n * \"empty\" value. This is in order to prevent excessive overhead from error\n * stack traces.\n */\nexport abstract class PathBase implements Dirent {\n  /**\n   * the basename of this path\n   *\n   * **Important**: *always* test the path name against any test string\n   * usingthe {@link isNamed} method, and not by directly comparing this\n   * string. Otherwise, unicode path strings that the system sees as identical\n   * will not be properly treated as the same path, leading to incorrect\n   * behavior and possible security issues.\n   */\n  name: string\n  /**\n   * the Path entry corresponding to the path root.\n   *\n   * @internal\n   */\n  root: PathBase\n  /**\n   * All roots found within the current PathScurry family\n   *\n   * @internal\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * a reference to the parent path, or undefined in the case of root entries\n   *\n   * @internal\n   */\n  parent?: PathBase\n  /**\n   * boolean indicating whether paths are compared case-insensitively\n   * @internal\n   */\n  nocase: boolean\n\n  /**\n   * boolean indicating that this path is the current working directory\n   * of the PathScurry collection that contains it.\n   */\n  isCWD: boolean = false\n\n  /**\n   * the string or regexp used to split paths. On posix, it is `'/'`, and on\n   * windows it is a RegExp matching either `'/'` or `'\\\\'`\n   */\n  abstract splitSep: string | RegExp\n  /**\n   * The path separator string to use when joining paths\n   */\n  abstract sep: string\n\n  // potential default fs override\n  #fs: FSValue\n\n  // Stats fields\n  #dev?: number\n  get dev() {\n    return this.#dev\n  }\n  #mode?: number\n  get mode() {\n    return this.#mode\n  }\n  #nlink?: number\n  get nlink() {\n    return this.#nlink\n  }\n  #uid?: number\n  get uid() {\n    return this.#uid\n  }\n  #gid?: number\n  get gid() {\n    return this.#gid\n  }\n  #rdev?: number\n  get rdev() {\n    return this.#rdev\n  }\n  #blksize?: number\n  get blksize() {\n    return this.#blksize\n  }\n  #ino?: number\n  get ino() {\n    return this.#ino\n  }\n  #size?: number\n  get size() {\n    return this.#size\n  }\n  #blocks?: number\n  get blocks() {\n    return this.#blocks\n  }\n  #atimeMs?: number\n  get atimeMs() {\n    return this.#atimeMs\n  }\n  #mtimeMs?: number\n  get mtimeMs() {\n    return this.#mtimeMs\n  }\n  #ctimeMs?: number\n  get ctimeMs() {\n    return this.#ctimeMs\n  }\n  #birthtimeMs?: number\n  get birthtimeMs() {\n    return this.#birthtimeMs\n  }\n  #atime?: Date\n  get atime() {\n    return this.#atime\n  }\n  #mtime?: Date\n  get mtime() {\n    return this.#mtime\n  }\n  #ctime?: Date\n  get ctime() {\n    return this.#ctime\n  }\n  #birthtime?: Date\n  get birthtime() {\n    return this.#birthtime\n  }\n\n  #matchName: string\n  #depth?: number\n  #fullpath?: string\n  #fullpathPosix?: string\n  #relative?: string\n  #relativePosix?: string\n  #type: number\n  #children: ChildrenCache\n  #linkTarget?: PathBase\n  #realpath?: PathBase\n\n  /**\n   * This property is for compatibility with the Dirent class as of\n   * Node v20, where Dirent['parentPath'] refers to the path of the\n   * directory that was passed to readdir. For root entries, it's the path\n   * to the entry itself.\n   */\n  get parentPath(): string {\n    return (this.parent || this).fullpath()\n  }\n\n  /* c8 ignore start */\n  /**\n   * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,\n   * this property refers to the *parent* path, not the path object itself.\n   *\n   * @deprecated\n   */\n  get path(): string {\n    return this.parentPath\n  }\n  /* c8 ignore stop */\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    this.name = name\n    this.#matchName = nocase ? normalizeNocase(name) : normalize(name)\n    this.#type = type & TYPEMASK\n    this.nocase = nocase\n    this.roots = roots\n    this.root = root || this\n    this.#children = children\n    this.#fullpath = opts.fullpath\n    this.#relative = opts.relative\n    this.#relativePosix = opts.relativePosix\n    this.parent = opts.parent\n    if (this.parent) {\n      this.#fs = this.parent.#fs\n    } else {\n      this.#fs = fsFromOption(opts.fs)\n    }\n  }\n\n  /**\n   * Returns the depth of the Path object from its root.\n   *\n   * For example, a path at `/foo/bar` would have a depth of 2.\n   */\n  depth(): number {\n    if (this.#depth !== undefined) return this.#depth\n    if (!this.parent) return (this.#depth = 0)\n    return (this.#depth = this.parent.depth() + 1)\n  }\n\n  /**\n   * @internal\n   */\n  abstract getRootString(path: string): string\n  /**\n   * @internal\n   */\n  abstract getRoot(rootPath: string): PathBase\n  /**\n   * @internal\n   */\n  abstract newChild(name: string, type?: number, opts?: PathOpts): PathBase\n\n  /**\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Get the Path object referenced by the string path, resolved from this Path\n   */\n  resolve(path?: string): PathBase {\n    if (!path) {\n      return this\n    }\n    const rootPath = this.getRootString(path)\n    const dir = path.substring(rootPath.length)\n    const dirParts = dir.split(this.splitSep)\n    const result: PathBase =\n      rootPath ?\n        this.getRoot(rootPath).#resolveParts(dirParts)\n      : this.#resolveParts(dirParts)\n    return result\n  }\n\n  #resolveParts(dirParts: string[]) {\n    let p: PathBase = this\n    for (const part of dirParts) {\n      p = p.child(part)\n    }\n    return p\n  }\n\n  /**\n   * Returns the cached children Path objects, if still available.  If they\n   * have fallen out of the cache, then returns an empty array, and resets the\n   * READDIR_CALLED bit, so that future calls to readdir() will require an fs\n   * lookup.\n   *\n   * @internal\n   */\n  children(): Children {\n    const cached = this.#children.get(this)\n    if (cached) {\n      return cached\n    }\n    const children: Children = Object.assign([], { provisional: 0 })\n    this.#children.set(this, children)\n    this.#type &= ~READDIR_CALLED\n    return children\n  }\n\n  /**\n   * Resolves a path portion and returns or creates the child Path.\n   *\n   * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is\n   * `'..'`.\n   *\n   * This should not be called directly.  If `pathPart` contains any path\n   * separators, it will lead to unsafe undefined behavior.\n   *\n   * Use `Path.resolve()` instead.\n   *\n   * @internal\n   */\n  child(pathPart: string, opts?: PathOpts): PathBase {\n    if (pathPart === '' || pathPart === '.') {\n      return this\n    }\n    if (pathPart === '..') {\n      return this.parent || this\n    }\n\n    // find the child\n    const children = this.children()\n    const name =\n      this.nocase ? normalizeNocase(pathPart) : normalize(pathPart)\n    for (const p of children) {\n      if (p.#matchName === name) {\n        return p\n      }\n    }\n\n    // didn't find it, create provisional child, since it might not\n    // actually exist.  If we know the parent isn't a dir, then\n    // in fact it CAN'T exist.\n    const s = this.parent ? this.sep : ''\n    const fullpath =\n      this.#fullpath ? this.#fullpath + s + pathPart : undefined\n    const pchild = this.newChild(pathPart, UNKNOWN, {\n      ...opts,\n      parent: this,\n      fullpath,\n    })\n\n    if (!this.canReaddir()) {\n      pchild.#type |= ENOENT\n    }\n\n    // don't have to update provisional, because if we have real children,\n    // then provisional is set to children.length, otherwise a lower number\n    children.push(pchild)\n    return pchild\n  }\n\n  /**\n   * The relative path from the cwd. If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpath()\n   */\n  relative(): string {\n    if (this.isCWD) return ''\n    if (this.#relative !== undefined) {\n      return this.#relative\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relative = this.name)\n    }\n    const pv = p.relative()\n    return pv + (!pv || !p.parent ? '' : this.sep) + name\n  }\n\n  /**\n   * The relative path from the cwd, using / as the path separator.\n   * If it does not share an ancestor with\n   * the cwd, then this ends up being equivalent to the fullpathPosix()\n   * On posix systems, this is identical to relative().\n   */\n  relativePosix(): string {\n    if (this.sep === '/') return this.relative()\n    if (this.isCWD) return ''\n    if (this.#relativePosix !== undefined) return this.#relativePosix\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#relativePosix = this.fullpathPosix())\n    }\n    const pv = p.relativePosix()\n    return pv + (!pv || !p.parent ? '' : '/') + name\n  }\n\n  /**\n   * The fully resolved path string for this Path entry\n   */\n  fullpath(): string {\n    if (this.#fullpath !== undefined) {\n      return this.#fullpath\n    }\n    const name = this.name\n    const p = this.parent\n    if (!p) {\n      return (this.#fullpath = this.name)\n    }\n    const pv = p.fullpath()\n    const fp = pv + (!p.parent ? '' : this.sep) + name\n    return (this.#fullpath = fp)\n  }\n\n  /**\n   * On platforms other than windows, this is identical to fullpath.\n   *\n   * On windows, this is overridden to return the forward-slash form of the\n   * full UNC path.\n   */\n  fullpathPosix(): string {\n    if (this.#fullpathPosix !== undefined) return this.#fullpathPosix\n    if (this.sep === '/') return (this.#fullpathPosix = this.fullpath())\n    if (!this.parent) {\n      const p = this.fullpath().replace(/\\\\/g, '/')\n      if (/^[a-z]:\\//i.test(p)) {\n        return (this.#fullpathPosix = `//?/${p}`)\n      } else {\n        return (this.#fullpathPosix = p)\n      }\n    }\n    const p = this.parent\n    const pfpp = p.fullpathPosix()\n    const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name\n    return (this.#fullpathPosix = fpp)\n  }\n\n  /**\n   * Is the Path of an unknown type?\n   *\n   * Note that we might know *something* about it if there has been a previous\n   * filesystem operation, for example that it does not exist, or is not a\n   * link, or whether it has child entries.\n   */\n  isUnknown(): boolean {\n    return (this.#type & IFMT) === UNKNOWN\n  }\n\n  isType(type: Type): boolean {\n    return this[`is${type}`]()\n  }\n\n  getType(): Type {\n    return (\n      this.isUnknown() ? 'Unknown'\n      : this.isDirectory() ? 'Directory'\n      : this.isFile() ? 'File'\n      : this.isSymbolicLink() ? 'SymbolicLink'\n      : this.isFIFO() ? 'FIFO'\n      : this.isCharacterDevice() ? 'CharacterDevice'\n      : this.isBlockDevice() ? 'BlockDevice'\n      : /* c8 ignore start */ this.isSocket() ? 'Socket'\n      : 'Unknown'\n    )\n    /* c8 ignore stop */\n  }\n\n  /**\n   * Is the Path a regular file?\n   */\n  isFile(): boolean {\n    return (this.#type & IFMT) === IFREG\n  }\n\n  /**\n   * Is the Path a directory?\n   */\n  isDirectory(): boolean {\n    return (this.#type & IFMT) === IFDIR\n  }\n\n  /**\n   * Is the path a character device?\n   */\n  isCharacterDevice(): boolean {\n    return (this.#type & IFMT) === IFCHR\n  }\n\n  /**\n   * Is the path a block device?\n   */\n  isBlockDevice(): boolean {\n    return (this.#type & IFMT) === IFBLK\n  }\n\n  /**\n   * Is the path a FIFO pipe?\n   */\n  isFIFO(): boolean {\n    return (this.#type & IFMT) === IFIFO\n  }\n\n  /**\n   * Is the path a socket?\n   */\n  isSocket(): boolean {\n    return (this.#type & IFMT) === IFSOCK\n  }\n\n  /**\n   * Is the path a symbolic link?\n   */\n  isSymbolicLink(): boolean {\n    return (this.#type & IFLNK) === IFLNK\n  }\n\n  /**\n   * Return the entry if it has been subject of a successful lstat, or\n   * undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* simply\n   * mean that we haven't called lstat on it.\n   */\n  lstatCached(): PathBase | undefined {\n    return this.#type & LSTAT_CALLED ? this : undefined\n  }\n\n  /**\n   * Return the cached link target if the entry has been the subject of a\n   * successful readlink, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readlink() has been called at some point.\n   */\n  readlinkCached(): PathBase | undefined {\n    return this.#linkTarget\n  }\n\n  /**\n   * Returns the cached realpath target if the entry has been the subject\n   * of a successful realpath, or undefined otherwise.\n   *\n   * Does not read the filesystem, so an undefined result *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * realpath() has been called at some point.\n   */\n  realpathCached(): PathBase | undefined {\n    return this.#realpath\n  }\n\n  /**\n   * Returns the cached child Path entries array if the entry has been the\n   * subject of a successful readdir(), or [] otherwise.\n   *\n   * Does not read the filesystem, so an empty array *could* just mean we\n   * don't have any cached data. Only use it if you are very sure that a\n   * readdir() has been called recently enough to still be valid.\n   */\n  readdirCached(): PathBase[] {\n    const children = this.children()\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * Return true if it's worth trying to readlink.  Ie, we don't (yet) have\n   * any indication that readlink will definitely fail.\n   *\n   * Returns false if the path is known to not be a symlink, if a previous\n   * readlink failed, or if the entry does not exist.\n   */\n  canReadlink(): boolean {\n    if (this.#linkTarget) return true\n    if (!this.parent) return false\n    // cases where it cannot possibly succeed\n    const ifmt = this.#type & IFMT\n    return !(\n      (ifmt !== UNKNOWN && ifmt !== IFLNK) ||\n      this.#type & ENOREADLINK ||\n      this.#type & ENOENT\n    )\n  }\n\n  /**\n   * Return true if readdir has previously been successfully called on this\n   * path, indicating that cachedReaddir() is likely valid.\n   */\n  calledReaddir(): boolean {\n    return !!(this.#type & READDIR_CALLED)\n  }\n\n  /**\n   * Returns true if the path is known to not exist. That is, a previous lstat\n   * or readdir failed to verify its existence when that would have been\n   * expected, or a parent entry was marked either enoent or enotdir.\n   */\n  isENOENT(): boolean {\n    return !!(this.#type & ENOENT)\n  }\n\n  /**\n   * Return true if the path is a match for the given path name.  This handles\n   * case sensitivity and unicode normalization.\n   *\n   * Note: even on case-sensitive systems, it is **not** safe to test the\n   * equality of the `.name` property to determine whether a given pathname\n   * matches, due to unicode normalization mismatches.\n   *\n   * Always use this method instead of testing the `path.name` property\n   * directly.\n   */\n  isNamed(n: string): boolean {\n    return !this.nocase ?\n        this.#matchName === normalize(n)\n      : this.#matchName === normalizeNocase(n)\n  }\n\n  /**\n   * Return the Path object corresponding to the target of a symbolic link.\n   *\n   * If the Path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   */\n  async readlink(): Promise {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = await this.#fs.promises.readlink(this.fullpath())\n      const linkTarget = (await this.parent.realpath())?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  /**\n   * Synchronous {@link PathBase.readlink}\n   */\n  readlinkSync(): PathBase | undefined {\n    const target = this.#linkTarget\n    if (target) {\n      return target\n    }\n    if (!this.canReadlink()) {\n      return undefined\n    }\n    /* c8 ignore start */\n    // already covered by the canReadlink test, here for ts grumples\n    if (!this.parent) {\n      return undefined\n    }\n    /* c8 ignore stop */\n    try {\n      const read = this.#fs.readlinkSync(this.fullpath())\n      const linkTarget = this.parent.realpathSync()?.resolve(read)\n      if (linkTarget) {\n        return (this.#linkTarget = linkTarget)\n      }\n    } catch (er) {\n      this.#readlinkFail((er as NodeJS.ErrnoException).code)\n      return undefined\n    }\n  }\n\n  #readdirSuccess(children: Children) {\n    // succeeded, mark readdir called bit\n    this.#type |= READDIR_CALLED\n    // mark all remaining provisional children as ENOENT\n    for (let p = children.provisional; p < children.length; p++) {\n      const c = children[p]\n      if (c) c.#markENOENT()\n    }\n  }\n\n  #markENOENT() {\n    // mark as UNKNOWN and ENOENT\n    if (this.#type & ENOENT) return\n    this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN\n    this.#markChildrenENOENT()\n  }\n\n  #markChildrenENOENT() {\n    // all children are provisional and do not exist\n    const children = this.children()\n    children.provisional = 0\n    for (const p of children) {\n      p.#markENOENT()\n    }\n  }\n\n  #markENOREALPATH() {\n    this.#type |= ENOREALPATH\n    this.#markENOTDIR()\n  }\n\n  // save the information when we know the entry is not a dir\n  #markENOTDIR() {\n    // entry is not a directory, so any children can't exist.\n    // this *should* be impossible, since any children created\n    // after it's been marked ENOTDIR should be marked ENOENT,\n    // so it won't even get to this point.\n    /* c8 ignore start */\n    if (this.#type & ENOTDIR) return\n    /* c8 ignore stop */\n    let t = this.#type\n    // this could happen if we stat a dir, then delete it,\n    // then try to read it or one of its children.\n    if ((t & IFMT) === IFDIR) t &= IFMT_UNKNOWN\n    this.#type = t | ENOTDIR\n    this.#markChildrenENOENT()\n  }\n\n  #readdirFail(code: string = '') {\n    // markENOTDIR and markENOENT also set provisional=0\n    if (code === 'ENOTDIR' || code === 'EPERM') {\n      this.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      this.#markENOENT()\n    } else {\n      this.children().provisional = 0\n    }\n  }\n\n  #lstatFail(code: string = '') {\n    // Windows just raises ENOENT in this case, disable for win CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR') {\n      // already know it has a parent by this point\n      const p = this.parent as PathBase\n      p.#markENOTDIR()\n    } else if (code === 'ENOENT') {\n      /* c8 ignore stop */\n      this.#markENOENT()\n    }\n  }\n\n  #readlinkFail(code: string = '') {\n    let ter = this.#type\n    ter |= ENOREADLINK\n    if (code === 'ENOENT') ter |= ENOENT\n    // windows gets a weird error when you try to readlink a file\n    if (code === 'EINVAL' || code === 'UNKNOWN') {\n      // exists, but not a symlink, we don't know WHAT it is, so remove\n      // all IFMT bits.\n      ter &= IFMT_UNKNOWN\n    }\n    this.#type = ter\n    // windows just gets ENOENT in this case.  We do cover the case,\n    // just disabled because it's impossible on Windows CI\n    /* c8 ignore start */\n    if (code === 'ENOTDIR' && this.parent) {\n      this.parent.#markENOTDIR()\n    }\n    /* c8 ignore stop */\n  }\n\n  #readdirAddChild(e: Dirent, c: Children) {\n    return (\n      this.#readdirMaybePromoteChild(e, c) ||\n      this.#readdirAddNewChild(e, c)\n    )\n  }\n\n  #readdirAddNewChild(e: Dirent, c: Children): PathBase {\n    // alloc new entry at head, so it's never provisional\n    const type = entToType(e)\n    const child = this.newChild(e.name, type, { parent: this })\n    const ifmt = child.#type & IFMT\n    if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {\n      child.#type |= ENOTDIR\n    }\n    c.unshift(child)\n    c.provisional++\n    return child\n  }\n\n  #readdirMaybePromoteChild(e: Dirent, c: Children): PathBase | undefined {\n    for (let p = c.provisional; p < c.length; p++) {\n      const pchild = c[p]\n      const name =\n        this.nocase ? normalizeNocase(e.name) : normalize(e.name)\n      if (name !== pchild!.#matchName) {\n        continue\n      }\n\n      return this.#readdirPromoteChild(e, pchild!, p, c)\n    }\n  }\n\n  #readdirPromoteChild(\n    e: Dirent,\n    p: PathBase,\n    index: number,\n    c: Children,\n  ): PathBase {\n    const v = p.name\n    // retain any other flags, but set ifmt from dirent\n    p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e)\n    // case sensitivity fixing when we learn the true name.\n    if (v !== e.name) p.name = e.name\n\n    // just advance provisional index (potentially off the list),\n    // otherwise we have to splice/pop it out and re-insert at head\n    if (index !== c.provisional) {\n      if (index === c.length - 1) c.pop()\n      else c.splice(index, 1)\n      c.unshift(p)\n    }\n    c.provisional++\n    return p\n  }\n\n  /**\n   * Call lstat() on this Path, and update all known information that can be\n   * determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(): Promise {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(await this.#fs.promises.lstat(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  /**\n   * synchronous {@link PathBase.lstat}\n   */\n  lstatSync(): PathBase | undefined {\n    if ((this.#type & ENOENT) === 0) {\n      try {\n        this.#applyStat(this.#fs.lstatSync(this.fullpath()))\n        return this\n      } catch (er) {\n        this.#lstatFail((er as NodeJS.ErrnoException).code)\n      }\n    }\n  }\n\n  #applyStat(st: Stats) {\n    const {\n      atime,\n      atimeMs,\n      birthtime,\n      birthtimeMs,\n      blksize,\n      blocks,\n      ctime,\n      ctimeMs,\n      dev,\n      gid,\n      ino,\n      mode,\n      mtime,\n      mtimeMs,\n      nlink,\n      rdev,\n      size,\n      uid,\n    } = st\n    this.#atime = atime\n    this.#atimeMs = atimeMs\n    this.#birthtime = birthtime\n    this.#birthtimeMs = birthtimeMs\n    this.#blksize = blksize\n    this.#blocks = blocks\n    this.#ctime = ctime\n    this.#ctimeMs = ctimeMs\n    this.#dev = dev\n    this.#gid = gid\n    this.#ino = ino\n    this.#mode = mode\n    this.#mtime = mtime\n    this.#mtimeMs = mtimeMs\n    this.#nlink = nlink\n    this.#rdev = rdev\n    this.#size = size\n    this.#uid = uid\n    const ifmt = entToType(st)\n    // retain any other flags, but set the ifmt\n    this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED\n    if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {\n      this.#type |= ENOTDIR\n    }\n  }\n\n  #onReaddirCB: ((\n    er: NodeJS.ErrnoException | null,\n    entries: Path[],\n  ) => any)[] = []\n  #readdirCBInFlight: boolean = false\n  #callOnReaddirCB(children: Path[]) {\n    this.#readdirCBInFlight = false\n    const cbs = this.#onReaddirCB.slice()\n    this.#onReaddirCB.length = 0\n    cbs.forEach(cb => cb(null, children))\n  }\n\n  /**\n   * Standard node-style callback interface to get list of directory entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * @param cb The callback called with (er, entries).  Note that the `er`\n   * param is somewhat extraneous, as all readdir() errors are handled and\n   * simply result in an empty set of entries being returned.\n   * @param allowZalgo Boolean indicating that immediately known results should\n   * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release\n   * zalgo at your peril, the dark pony lord is devious and unforgiving.\n   */\n  readdirCB(\n    cb: (er: NodeJS.ErrnoException | null, entries: PathBase[]) => any,\n    allowZalgo: boolean = false,\n  ): void {\n    if (!this.canReaddir()) {\n      if (allowZalgo) cb(null, [])\n      else queueMicrotask(() => cb(null, []))\n      return\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      const c = children.slice(0, children.provisional)\n      if (allowZalgo) cb(null, c)\n      else queueMicrotask(() => cb(null, c))\n      return\n    }\n\n    // don't have to worry about zalgo at this point.\n    this.#onReaddirCB.push(cb)\n    if (this.#readdirCBInFlight) {\n      return\n    }\n    this.#readdirCBInFlight = true\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {\n      if (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      } else {\n        // if we didn't get an error, we always get entries.\n        //@ts-ignore\n        for (const e of entries) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      }\n      this.#callOnReaddirCB(children.slice(0, children.provisional))\n      return\n    })\n  }\n\n  #asyncReaddirInFlight?: Promise\n\n  /**\n   * Return an array of known child entries.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async readdir(): Promise {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    if (this.#asyncReaddirInFlight) {\n      await this.#asyncReaddirInFlight\n    } else {\n      /* c8 ignore start */\n      let resolve: () => void = () => {}\n      /* c8 ignore stop */\n      this.#asyncReaddirInFlight = new Promise(\n        res => (resolve = res),\n      )\n      try {\n        for (const e of await this.#fs.promises.readdir(fullpath, {\n          withFileTypes: true,\n        })) {\n          this.#readdirAddChild(e, children)\n        }\n        this.#readdirSuccess(children)\n      } catch (er) {\n        this.#readdirFail((er as NodeJS.ErrnoException).code)\n        children.provisional = 0\n      }\n      this.#asyncReaddirInFlight = undefined\n      resolve()\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  /**\n   * synchronous {@link PathBase.readdir}\n   */\n  readdirSync(): PathBase[] {\n    if (!this.canReaddir()) {\n      return []\n    }\n\n    const children = this.children()\n    if (this.calledReaddir()) {\n      return children.slice(0, children.provisional)\n    }\n\n    // else read the directory, fill up children\n    // de-provisionalize any provisional children.\n    const fullpath = this.fullpath()\n    try {\n      for (const e of this.#fs.readdirSync(fullpath, {\n        withFileTypes: true,\n      })) {\n        this.#readdirAddChild(e, children)\n      }\n      this.#readdirSuccess(children)\n    } catch (er) {\n      this.#readdirFail((er as NodeJS.ErrnoException).code)\n      children.provisional = 0\n    }\n    return children.slice(0, children.provisional)\n  }\n\n  canReaddir() {\n    if (this.#type & ENOCHILD) return false\n    const ifmt = IFMT & this.#type\n    // we always set ENOTDIR when setting IFMT, so should be impossible\n    /* c8 ignore start */\n    if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {\n      return false\n    }\n    /* c8 ignore stop */\n    return true\n  }\n\n  shouldWalk(\n    dirs: Set,\n    walkFilter?: (e: PathBase) => boolean,\n  ): boolean {\n    return (\n      (this.#type & IFDIR) === IFDIR &&\n      !(this.#type & ENOCHILD) &&\n      !dirs.has(this) &&\n      (!walkFilter || walkFilter(this))\n    )\n  }\n\n  /**\n   * Return the Path object corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   * On success, returns a Path object.\n   */\n  async realpath(): Promise {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = await this.#fs.promises.realpath(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Synchronous {@link realpath}\n   */\n  realpathSync(): PathBase | undefined {\n    if (this.#realpath) return this.#realpath\n    if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type) return undefined\n    try {\n      const rp = this.#fs.realpathSync(this.fullpath())\n      return (this.#realpath = this.resolve(rp))\n    } catch (_) {\n      this.#markENOREALPATH()\n    }\n  }\n\n  /**\n   * Internal method to mark this Path object as the scurry cwd,\n   * called by {@link PathScurry#chdir}\n   *\n   * @internal\n   */\n  [setAsCwd](oldCwd: PathBase): void {\n    if (oldCwd === this) return\n    oldCwd.isCWD = false\n    this.isCWD = true\n\n    const changed = new Set([])\n    let rp = []\n    let p: PathBase = this\n    while (p && p.parent) {\n      changed.add(p)\n      p.#relative = rp.join(this.sep)\n      p.#relativePosix = rp.join('/')\n      p = p.parent\n      rp.push('..')\n    }\n    // now un-memoize parents of old cwd\n    p = oldCwd\n    while (p && p.parent && !changed.has(p)) {\n      p.#relative = undefined\n      p.#relativePosix = undefined\n      p = p.parent\n    }\n  }\n}\n\n/**\n * Path class used on win32 systems\n *\n * Uses `'\\\\'` as the path separator for returned paths, either `'\\\\'` or `'/'`\n * as the path separator for parsing paths.\n */\nexport class PathWin32 extends PathBase {\n  /**\n   * Separator for generating path strings.\n   */\n  sep: '\\\\' = '\\\\'\n  /**\n   * Separator for parsing path strings.\n   */\n  splitSep: RegExp = eitherSep\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathWin32(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return win32.parse(path).root\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(rootPath: string): PathBase {\n    rootPath = uncToDrive(rootPath.toUpperCase())\n    if (rootPath === this.root.name) {\n      return this.root\n    }\n    // ok, not that one, check if it matches another we know about\n    for (const [compare, root] of Object.entries(this.roots)) {\n      if (this.sameRoot(rootPath, compare)) {\n        return (this.roots[rootPath] = root)\n      }\n    }\n    // otherwise, have to create a new one.\n    return (this.roots[rootPath] = new PathScurryWin32(\n      rootPath,\n      this,\n    ).root)\n  }\n\n  /**\n   * @internal\n   */\n  sameRoot(rootPath: string, compare: string = this.root.name): boolean {\n    // windows can (rarely) have case-sensitive filesystem, but\n    // UNC and drive letters are always case-insensitive, and canonically\n    // represented uppercase.\n    rootPath = rootPath\n      .toUpperCase()\n      .replace(/\\//g, '\\\\')\n      .replace(uncDriveRegexp, '$1\\\\')\n    return rootPath === compare\n  }\n}\n\n/**\n * Path class used on all posix systems.\n *\n * Uses `'/'` as the path separator.\n */\nexport class PathPosix extends PathBase {\n  /**\n   * separator for parsing path strings\n   */\n  splitSep: '/' = '/'\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n\n  /**\n   * Do not create new Path objects directly.  They should always be accessed\n   * via the PathScurry class or other methods on the Path class.\n   *\n   * @internal\n   */\n  constructor(\n    name: string,\n    type: number = UNKNOWN,\n    root: PathBase | undefined,\n    roots: { [k: string]: PathBase },\n    nocase: boolean,\n    children: ChildrenCache,\n    opts: PathOpts,\n  ) {\n    super(name, type, root, roots, nocase, children, opts)\n  }\n\n  /**\n   * @internal\n   */\n  getRootString(path: string): string {\n    return path.startsWith('/') ? '/' : ''\n  }\n\n  /**\n   * @internal\n   */\n  getRoot(_rootPath: string): PathBase {\n    return this.root\n  }\n\n  /**\n   * @internal\n   */\n  newChild(name: string, type: number = UNKNOWN, opts: PathOpts = {}) {\n    return new PathPosix(\n      name,\n      type,\n      this.root,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      opts,\n    )\n  }\n}\n\n/**\n * Options that may be provided to the PathScurry constructor\n */\nexport interface PathScurryOpts {\n  /**\n   * perform case-insensitive path matching. Default based on platform\n   * subclass.\n   */\n  nocase?: boolean\n  /**\n   * Number of Path entries to keep in the cache of Path child references.\n   *\n   * Setting this higher than 65536 will dramatically increase the data\n   * consumption and construction time overhead of each PathScurry.\n   *\n   * Setting this value to 256 or lower will significantly reduce the data\n   * consumption and construction time overhead, but may also reduce resolve()\n   * and readdir() performance on large filesystems.\n   *\n   * Default `16384`.\n   */\n  childrenCacheSize?: number\n  /**\n   * An object that overrides the built-in functions from the fs and\n   * fs/promises modules.\n   *\n   * See {@link FSOption}\n   */\n  fs?: FSOption\n}\n\n/**\n * The base class for all PathScurry classes, providing the interface for path\n * resolution and filesystem operations.\n *\n * Typically, you should *not* instantiate this class directly, but rather one\n * of the platform-specific classes, or the exported {@link PathScurry} which\n * defaults to the current platform.\n */\nexport abstract class PathScurryBase {\n  /**\n   * The root Path entry for the current working directory of this Scurry\n   */\n  root: PathBase\n  /**\n   * The string path for the root of this Scurry's current working directory\n   */\n  rootPath: string\n  /**\n   * A collection of all roots encountered, referenced by rootPath\n   */\n  roots: { [k: string]: PathBase }\n  /**\n   * The Path entry corresponding to this PathScurry's current working directory.\n   */\n  cwd: PathBase\n  #resolveCache: ResolveCache\n  #resolvePosixCache: ResolveCache\n  #children: ChildrenCache\n  /**\n   * Perform path comparisons case-insensitively.\n   *\n   * Defaults true on Darwin and Windows systems, false elsewhere.\n   */\n  nocase: boolean\n\n  /**\n   * The path separator used for parsing paths\n   *\n   * `'/'` on Posix systems, either `'/'` or `'\\\\'` on Windows\n   */\n  abstract sep: string | RegExp\n\n  #fs: FSValue\n\n  /**\n   * This class should not be instantiated directly.\n   *\n   * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry\n   *\n   * @internal\n   */\n  constructor(\n    cwd: URL | string = process.cwd(),\n    pathImpl: typeof win32 | typeof posix,\n    sep: string | RegExp,\n    {\n      nocase,\n      childrenCacheSize = 16 * 1024,\n      fs = defaultFS,\n    }: PathScurryOpts = {},\n  ) {\n    this.#fs = fsFromOption(fs)\n    if (cwd instanceof URL || cwd.startsWith('file://')) {\n      cwd = fileURLToPath(cwd)\n    }\n    // resolve and split root, and then add to the store.\n    // this is the only time we call path.resolve()\n    const cwdPath = pathImpl.resolve(cwd)\n    this.roots = Object.create(null)\n    this.rootPath = this.parseRootPath(cwdPath)\n    this.#resolveCache = new ResolveCache()\n    this.#resolvePosixCache = new ResolveCache()\n    this.#children = new ChildrenCache(childrenCacheSize)\n\n    const split = cwdPath.substring(this.rootPath.length).split(sep)\n    // resolve('/') leaves '', splits to [''], we don't want that.\n    if (split.length === 1 && !split[0]) {\n      split.pop()\n    }\n    /* c8 ignore start */\n    if (nocase === undefined) {\n      throw new TypeError(\n        'must provide nocase setting to PathScurryBase ctor',\n      )\n    }\n    /* c8 ignore stop */\n    this.nocase = nocase\n    this.root = this.newRoot(this.#fs)\n    this.roots[this.rootPath] = this.root\n    let prev: PathBase = this.root\n    let len = split.length - 1\n    const joinSep = pathImpl.sep\n    let abs = this.rootPath\n    let sawFirst = false\n    for (const part of split) {\n      const l = len--\n      prev = prev.child(part, {\n        relative: new Array(l).fill('..').join(joinSep),\n        relativePosix: new Array(l).fill('..').join('/'),\n        fullpath: (abs += (sawFirst ? '' : joinSep) + part),\n      })\n      sawFirst = true\n    }\n    this.cwd = prev\n  }\n\n  /**\n   * Get the depth of a provided path, string, or the cwd\n   */\n  depth(path: Path | string = this.cwd): number {\n    if (typeof path === 'string') {\n      path = this.cwd.resolve(path)\n    }\n    return path.depth()\n  }\n\n  /**\n   * Parse the root portion of a path string\n   *\n   * @internal\n   */\n  abstract parseRootPath(dir: string): string\n  /**\n   * create a new Path to use as root during construction.\n   *\n   * @internal\n   */\n  abstract newRoot(fs: FSValue): PathBase\n  /**\n   * Determine whether a given path string is absolute\n   */\n  abstract isAbsolute(p: string): boolean\n\n  /**\n   * Return the cache of child entries.  Exposed so subclasses can create\n   * child Path objects in a platform-specific way.\n   *\n   * @internal\n   */\n  childrenCache() {\n    return this.#children\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolve(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolveCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpath()\n    this.#resolveCache.set(r, result)\n    return result\n  }\n\n  /**\n   * Resolve one or more path strings to a resolved string, returning\n   * the posix path.  Identical to .resolve() on posix systems, but on\n   * windows will return a forward-slash separated UNC path.\n   *\n   * Same interface as require('path').resolve.\n   *\n   * Much faster than path.resolve() when called multiple times for the same\n   * path, because the resolved Path objects are cached.  Much slower\n   * otherwise.\n   */\n  resolvePosix(...paths: string[]): string {\n    // first figure out the minimum number of paths we have to test\n    // we always start at cwd, but any absolutes will bump the start\n    let r = ''\n    for (let i = paths.length - 1; i >= 0; i--) {\n      const p = paths[i]\n      if (!p || p === '.') continue\n      r = r ? `${p}/${r}` : p\n      if (this.isAbsolute(p)) {\n        break\n      }\n    }\n    const cached = this.#resolvePosixCache.get(r)\n    if (cached !== undefined) {\n      return cached\n    }\n    const result = this.cwd.resolve(r).fullpathPosix()\n    this.#resolvePosixCache.set(r, result)\n    return result\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or entry\n   */\n  relative(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relative()\n  }\n\n  /**\n   * find the relative path from the cwd to the supplied path string or\n   * entry, using / as the path delimiter, even on Windows.\n   */\n  relativePosix(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.relativePosix()\n  }\n\n  /**\n   * Return the basename for the provided string or Path object\n   */\n  basename(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.name\n  }\n\n  /**\n   * Return the dirname for the provided string or Path object\n   */\n  dirname(entry: PathBase | string = this.cwd): string {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return (entry.parent || entry).fullpath()\n  }\n\n  /**\n   * Return an array of known child entries.\n   *\n   * First argument may be either a string, or a Path object.\n   *\n   * If the Path cannot or does not contain any children, then an empty array\n   * is returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   *\n   * Unlike `fs.readdir()`, the `withFileTypes` option defaults to `true`. Set\n   * `{ withFileTypes: false }` to return strings.\n   */\n\n  readdir(): Promise\n  readdir(opts: { withFileTypes: true }): Promise\n  readdir(opts: { withFileTypes: false }): Promise\n  readdir(opts: { withFileTypes: boolean }): Promise\n  readdir(entry: PathBase | string): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): Promise\n  readdir(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): Promise\n  async readdir(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else {\n      const p = await entry.readdir()\n      return withFileTypes ? p : p.map(e => e.name)\n    }\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readdir}\n   */\n  readdirSync(): PathBase[]\n  readdirSync(opts: { withFileTypes: true }): PathBase[]\n  readdirSync(opts: { withFileTypes: false }): string[]\n  readdirSync(opts: { withFileTypes: boolean }): PathBase[] | string[]\n  readdirSync(entry: PathBase | string): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: true },\n  ): PathBase[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: false },\n  ): string[]\n  readdirSync(\n    entry: PathBase | string,\n    opts: { withFileTypes: boolean },\n  ): PathBase[] | string[]\n  readdirSync(\n    entry: PathBase | string | { withFileTypes: boolean } = this.cwd,\n    opts: { withFileTypes: boolean } = {\n      withFileTypes: true,\n    },\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const { withFileTypes = true } = opts\n    if (!entry.canReaddir()) {\n      return []\n    } else if (withFileTypes) {\n      return entry.readdirSync()\n    } else {\n      return entry.readdirSync().map(e => e.name)\n    }\n  }\n\n  /**\n   * Call lstat() on the string or Path object, and update all known\n   * information that can be determined.\n   *\n   * Note that unlike `fs.lstat()`, the returned value does not contain some\n   * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that\n   * information is required, you will need to call `fs.lstat` yourself.\n   *\n   * If the Path refers to a nonexistent file, or if the lstat call fails for\n   * any reason, `undefined` is returned.  Otherwise the updated Path object is\n   * returned.\n   *\n   * Results are cached, and thus may be out of date if the filesystem is\n   * mutated.\n   */\n  async lstat(\n    entry: string | PathBase = this.cwd,\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstat()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.lstat}\n   */\n  lstatSync(entry: string | PathBase = this.cwd): PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    }\n    return entry.lstatSync()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to the target of a\n   * symbolic link.\n   *\n   * If the path is not a symbolic link, or if the readlink call fails for any\n   * reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  readlink(): Promise\n  readlink(opt: { withFileTypes: false }): Promise\n  readlink(opt: { withFileTypes: true }): Promise\n  readlink(opt: {\n    withFileTypes: boolean\n  }): Promise\n  readlink(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  readlink(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async readlink(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.readlink()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * synchronous {@link PathScurryBase.readlink}\n   */\n  readlinkSync(): string | undefined\n  readlinkSync(opt: { withFileTypes: false }): string | undefined\n  readlinkSync(opt: { withFileTypes: true }): PathBase | undefined\n  readlinkSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  readlinkSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.readlinkSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Return the Path object or string path corresponding to path as resolved\n   * by realpath(3).\n   *\n   * If the realpath call fails for any reason, `undefined` is returned.\n   *\n   * Result is cached, and thus may be outdated if the filesystem is mutated.\n   *\n   * `{withFileTypes}` option defaults to `false`.\n   *\n   * On success, returns a Path object if `withFileTypes` option is true,\n   * otherwise a string.\n   */\n  realpath(): Promise\n  realpath(opt: { withFileTypes: false }): Promise\n  realpath(opt: { withFileTypes: true }): Promise\n  realpath(opt: {\n    withFileTypes: boolean\n  }): Promise\n  realpath(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): Promise\n  realpath(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): Promise\n  async realpath(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = await entry.realpath()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  realpathSync(): string | undefined\n  realpathSync(opt: { withFileTypes: false }): string | undefined\n  realpathSync(opt: { withFileTypes: true }): PathBase | undefined\n  realpathSync(opt: {\n    withFileTypes: boolean\n  }): PathBase | string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt?: { withFileTypes: false },\n  ): string | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: true },\n  ): PathBase | undefined\n  realpathSync(\n    entry: string | PathBase,\n    opt: { withFileTypes: boolean },\n  ): string | PathBase | undefined\n  realpathSync(\n    entry: string | PathBase | { withFileTypes: boolean } = this.cwd,\n    { withFileTypes }: { withFileTypes: boolean } = {\n      withFileTypes: false,\n    },\n  ): string | PathBase | undefined {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      withFileTypes = entry.withFileTypes\n      entry = this.cwd\n    }\n    const e = entry.realpathSync()\n    return withFileTypes ? e : e?.fullpath()\n  }\n\n  /**\n   * Asynchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walk(): Promise\n  walk(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(opts: WalkOptionsWithFileTypesFalse): Promise\n  walk(opts: WalkOptions): Promise\n  walk(entry: string | PathBase): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Promise\n  walk(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Promise\n  async walk(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Promise {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const walk = (\n      dir: PathBase,\n      cb: (er?: NodeJS.ErrnoException) => void,\n    ) => {\n      dirs.add(dir)\n      dir.readdirCB((er, entries) => {\n        /* c8 ignore start */\n        if (er) {\n          return cb(er)\n        }\n        /* c8 ignore stop */\n        let len = entries.length\n        if (!len) return cb()\n        const next = () => {\n          if (--len === 0) {\n            cb()\n          }\n        }\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            results.push(withFileTypes ? e : e.fullpath())\n          }\n          if (follow && e.isSymbolicLink()) {\n            e.realpath()\n              .then(r => (r?.isUnknown() ? r.lstat() : r))\n              .then(r =>\n                r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next(),\n              )\n          } else {\n            if (e.shouldWalk(dirs, walkFilter)) {\n              walk(e, next)\n            } else {\n              next()\n            }\n          }\n        }\n      }, true) // zalgooooooo\n    }\n\n    const start = entry\n    return new Promise((res, rej) => {\n      walk(start, er => {\n        /* c8 ignore start */\n        if (er) return rej(er)\n        /* c8 ignore stop */\n        res(results as PathBase[] | string[])\n      })\n    })\n  }\n\n  /**\n   * Synchronously walk the directory tree, returning an array of\n   * all path strings or Path objects found.\n   *\n   * Note that this will be extremely memory-hungry on large filesystems.\n   * In such cases, it may be better to use the stream or async iterator\n   * walk implementation.\n   */\n  walkSync(): PathBase[]\n  walkSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): PathBase[]\n  walkSync(opts: WalkOptionsWithFileTypesFalse): string[]\n  walkSync(opts: WalkOptions): string[] | PathBase[]\n  walkSync(entry: string | PathBase): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): PathBase[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): string[]\n  walkSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): PathBase[] | string[]\n  walkSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): PathBase[] | string[] {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results: (string | PathBase)[] = []\n    if (!filter || filter(entry)) {\n      results.push(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          results.push(withFileTypes ? e : e.fullpath())\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n    return results as string[] | PathBase[]\n  }\n\n  /**\n   * Support for `for await`\n   *\n   * Alias for {@link PathScurryBase.iterate}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  [Symbol.asyncIterator]() {\n    return this.iterate()\n  }\n\n  /**\n   * Async generator form of {@link PathScurryBase.walk}\n   *\n   * Note: As of Node 19, this is very slow, compared to other methods of\n   * walking, especially if most/all of the directory tree has been previously\n   * walked.  Consider using {@link PathScurryBase.stream} if memory overhead\n   * and backpressure are concerns, or {@link PathScurryBase.walk} if not.\n   */\n  iterate(): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(opts: WalkOptions): AsyncGenerator\n  iterate(entry: string | PathBase): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): AsyncGenerator\n  iterate(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    options: WalkOptions = {},\n  ): AsyncGenerator {\n    // iterating async over the stream is significantly more performant,\n    // especially in the warm-cache scenario, because it buffers up directory\n    // entries in the background instead of waiting for a yield for each one.\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      options = entry\n      entry = this.cwd\n    }\n    return this.stream(entry, options)[Symbol.asyncIterator]()\n  }\n\n  /**\n   * Iterating over a PathScurry performs a synchronous walk.\n   *\n   * Alias for {@link PathScurryBase.iterateSync}\n   */\n  [Symbol.iterator]() {\n    return this.iterateSync()\n  }\n\n  iterateSync(): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(opts: WalkOptions): Generator\n  iterateSync(entry: string | PathBase): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Generator\n  iterateSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Generator\n  *iterateSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Generator {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    if (!filter || filter(entry)) {\n      yield withFileTypes ? entry : entry.fullpath()\n    }\n    const dirs = new Set([entry])\n    for (const dir of dirs) {\n      const entries = dir.readdirSync()\n      for (const e of entries) {\n        if (!filter || filter(e)) {\n          yield withFileTypes ? e : e.fullpath()\n        }\n        let r: PathBase | undefined = e\n        if (e.isSymbolicLink()) {\n          if (!(follow && (r = e.realpathSync()))) continue\n          if (r.isUnknown()) r.lstatSync()\n        }\n        if (r.shouldWalk(dirs, walkFilter)) {\n          dirs.add(r)\n        }\n      }\n    }\n  }\n\n  /**\n   * Stream form of {@link PathScurryBase.walk}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   */\n  stream(): Minipass\n  stream(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  stream(opts: WalkOptionsWithFileTypesFalse): Minipass\n  stream(opts: WalkOptions): Minipass\n  stream(entry: string | PathBase): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  stream(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  stream(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const dirs = new Set()\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n\n        processing++\n        dirs.add(dir)\n\n        const onReaddir = (\n          er: null | NodeJS.ErrnoException,\n          entries: PathBase[],\n          didRealpaths: boolean = false,\n        ) => {\n          /* c8 ignore start */\n          if (er) return results.emit('error', er)\n          /* c8 ignore stop */\n          if (follow && !didRealpaths) {\n            const promises: Promise[] = []\n            for (const e of entries) {\n              if (e.isSymbolicLink()) {\n                promises.push(\n                  e\n                    .realpath()\n                    .then((r: PathBase | undefined) =>\n                      r?.isUnknown() ? r.lstat() : r,\n                    ),\n                )\n              }\n            }\n            if (promises.length) {\n              Promise.all(promises).then(() =>\n                onReaddir(null, entries, true),\n              )\n              return\n            }\n          }\n\n          for (const e of entries) {\n            if (e && (!filter || filter(e))) {\n              if (!results.write(withFileTypes ? e : e.fullpath())) {\n                paused = true\n              }\n            }\n          }\n\n          processing--\n          for (const e of entries) {\n            const r = e.realpathCached() || e\n            if (r.shouldWalk(dirs, walkFilter)) {\n              queue.push(r)\n            }\n          }\n          if (paused && !results.flowing) {\n            results.once('drain', process)\n          } else if (!sync) {\n            process()\n          }\n        }\n\n        // zalgo containment\n        let sync = true\n        dir.readdirCB(onReaddir, true)\n        sync = false\n      }\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  /**\n   * Synchronous form of {@link PathScurryBase.stream}\n   *\n   * Returns a Minipass stream that emits {@link PathBase} objects by default,\n   * or strings if `{ withFileTypes: false }` is set in the options.\n   *\n   * Will complete the walk in a single tick if the stream is consumed fully.\n   * Otherwise, will pause as needed for stream backpressure.\n   */\n  streamSync(): Minipass\n  streamSync(\n    opts: WalkOptionsWithFileTypesTrue | WalkOptionsWithFileTypesUnset,\n  ): Minipass\n  streamSync(opts: WalkOptionsWithFileTypesFalse): Minipass\n  streamSync(opts: WalkOptions): Minipass\n  streamSync(entry: string | PathBase): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesUnset | WalkOptionsWithFileTypesTrue,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptionsWithFileTypesFalse,\n  ): Minipass\n  streamSync(\n    entry: string | PathBase,\n    opts: WalkOptions,\n  ): Minipass | Minipass\n  streamSync(\n    entry: string | PathBase | WalkOptions = this.cwd,\n    opts: WalkOptions = {},\n  ): Minipass | Minipass {\n    if (typeof entry === 'string') {\n      entry = this.cwd.resolve(entry)\n    } else if (!(entry instanceof PathBase)) {\n      opts = entry\n      entry = this.cwd\n    }\n    const {\n      withFileTypes = true,\n      follow = false,\n      filter,\n      walkFilter,\n    } = opts\n    const results = new Minipass({ objectMode: true })\n    const dirs = new Set()\n    if (!filter || filter(entry)) {\n      results.write(withFileTypes ? entry : entry.fullpath())\n    }\n    const queue: PathBase[] = [entry]\n    let processing = 0\n    const process = () => {\n      let paused = false\n      while (!paused) {\n        const dir = queue.shift()\n        if (!dir) {\n          if (processing === 0) results.end()\n          return\n        }\n        processing++\n        dirs.add(dir)\n\n        const entries = dir.readdirSync()\n        for (const e of entries) {\n          if (!filter || filter(e)) {\n            if (!results.write(withFileTypes ? e : e.fullpath())) {\n              paused = true\n            }\n          }\n        }\n        processing--\n        for (const e of entries) {\n          let r: PathBase | undefined = e\n          if (e.isSymbolicLink()) {\n            if (!(follow && (r = e.realpathSync()))) continue\n            if (r.isUnknown()) r.lstatSync()\n          }\n          if (r.shouldWalk(dirs, walkFilter)) {\n            queue.push(r)\n          }\n        }\n      }\n      if (paused && !results.flowing) results.once('drain', process)\n    }\n    process()\n    return results as Minipass | Minipass\n  }\n\n  chdir(path: string | Path = this.cwd) {\n    const oldCwd = this.cwd\n    this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path\n    this.cwd[setAsCwd](oldCwd)\n  }\n}\n\n/**\n * Options provided to all walk methods.\n */\nexport interface WalkOptions {\n  /**\n   * Return results as {@link PathBase} objects rather than strings.\n   * When set to false, results are fully resolved paths, as returned by\n   * {@link PathBase.fullpath}.\n   * @default true\n   */\n  withFileTypes?: boolean\n\n  /**\n   *  Attempt to read directory entries from symbolic links. Otherwise, only\n   *  actual directories are traversed. Regardless of this setting, a given\n   *  target path will only ever be walked once, meaning that a symbolic link\n   *  to a previously traversed directory will never be followed.\n   *\n   *  Setting this imposes a slight performance penalty, because `readlink`\n   *  must be called on all symbolic links encountered, in order to avoid\n   *  infinite cycles.\n   * @default false\n   */\n  follow?: boolean\n\n  /**\n   * Only return entries where the provided function returns true.\n   *\n   * This will not prevent directories from being traversed, even if they do\n   * not pass the filter, though it will prevent directories themselves from\n   * being included in the result set.  See {@link walkFilter}\n   *\n   * Asynchronous functions are not supported here.\n   *\n   * By default, if no filter is provided, all entries and traversed\n   * directories are included.\n   */\n  filter?: (entry: PathBase) => boolean\n\n  /**\n   * Only traverse directories (and in the case of {@link follow} being set to\n   * true, symbolic links to directories) if the provided function returns\n   * true.\n   *\n   * This will not prevent directories from being included in the result set,\n   * even if they do not pass the supplied filter function.  See {@link filter}\n   * to do that.\n   *\n   * Asynchronous functions are not supported here.\n   */\n  walkFilter?: (entry: PathBase) => boolean\n}\n\nexport type WalkOptionsWithFileTypesUnset = WalkOptions & {\n  withFileTypes?: undefined\n}\nexport type WalkOptionsWithFileTypesTrue = WalkOptions & {\n  withFileTypes: true\n}\nexport type WalkOptionsWithFileTypesFalse = WalkOptions & {\n  withFileTypes: false\n}\n\n/**\n * Windows implementation of {@link PathScurryBase}\n *\n * Defaults to case insensitve, uses `'\\\\'` to generate path strings.  Uses\n * {@link PathWin32} for Path objects.\n */\nexport class PathScurryWin32 extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '\\\\' = '\\\\'\n\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, win32, '\\\\', { ...opts, nocase })\n    this.nocase = nocase\n    for (let p: PathBase | undefined = this.cwd; p; p = p.parent) {\n      p.nocase = this.nocase\n    }\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(dir: string): string {\n    // if the path starts with a single separator, it's not a UNC, and we'll\n    // just get separator as the root, and driveFromUNC will return \\\n    // In that case, mount \\ on the root from the cwd.\n    return win32.parse(dir).root.toUpperCase()\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathWin32(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return (\n      p.startsWith('/') || p.startsWith('\\\\') || /^[a-z]:(\\/|\\\\)/i.test(p)\n    )\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for all posix systems other than Darwin.\n *\n * Defaults to case-sensitive matching, uses `'/'` to generate path strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryPosix extends PathScurryBase {\n  /**\n   * separator for generating path strings\n   */\n  sep: '/' = '/'\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = false } = opts\n    super(cwd, posix, '/', { ...opts, nocase })\n    this.nocase = nocase\n  }\n\n  /**\n   * @internal\n   */\n  parseRootPath(_dir: string): string {\n    return '/'\n  }\n\n  /**\n   * @internal\n   */\n  newRoot(fs: FSValue) {\n    return new PathPosix(\n      this.rootPath,\n      IFDIR,\n      undefined,\n      this.roots,\n      this.nocase,\n      this.childrenCache(),\n      { fs },\n    )\n  }\n\n  /**\n   * Return true if the provided path string is an absolute path\n   */\n  isAbsolute(p: string): boolean {\n    return p.startsWith('/')\n  }\n}\n\n/**\n * {@link PathScurryBase} implementation for Darwin (macOS) systems.\n *\n * Defaults to case-insensitive matching, uses `'/'` for generating path\n * strings.\n *\n * Uses {@link PathPosix} for Path objects.\n */\nexport class PathScurryDarwin extends PathScurryPosix {\n  constructor(\n    cwd: URL | string = process.cwd(),\n    opts: PathScurryOpts = {},\n  ) {\n    const { nocase = true } = opts\n    super(cwd, { ...opts, nocase })\n  }\n}\n\n/**\n * Default {@link PathBase} implementation for the current platform.\n *\n * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.\n */\nexport const Path = process.platform === 'win32' ? PathWin32 : PathPosix\nexport type Path = PathBase | InstanceType\n\n/**\n * Default {@link PathScurryBase} implementation for the current platform.\n *\n * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on\n * Darwin (macOS) systems, {@link PathScurryPosix} on all others.\n */\nexport const PathScurry:\n  | typeof PathScurryWin32\n  | typeof PathScurryDarwin\n  | typeof PathScurryPosix =\n  process.platform === 'win32' ? PathScurryWin32\n  : process.platform === 'darwin' ? PathScurryDarwin\n  : PathScurryPosix\nexport type PathScurry = PathScurryBase | InstanceType\n"]}
\ No newline at end of file
diff --git a/node_modules/path-scurry/dist/esm/package.json b/node_modules/path-scurry/dist/esm/package.json
new file mode 100644
index 00000000..3dbc1ca5
--- /dev/null
+++ b/node_modules/path-scurry/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/node_modules/path-scurry/package.json b/node_modules/path-scurry/package.json
new file mode 100644
index 00000000..68123fb7
--- /dev/null
+++ b/node_modules/path-scurry/package.json
@@ -0,0 +1,72 @@
+{
+  "name": "path-scurry",
+  "version": "2.0.2",
+  "description": "walk paths fast and efficiently",
+  "author": "Isaac Z. Schlueter  (https://blog.izs.me)",
+  "main": "./dist/commonjs/index.js",
+  "type": "module",
+  "exports": {
+    "./package.json": "./package.json",
+    ".": {
+      "import": {
+        "types": "./dist/esm/index.d.ts",
+        "default": "./dist/esm/index.js"
+      },
+      "require": {
+        "types": "./dist/commonjs/index.d.ts",
+        "default": "./dist/commonjs/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "license": "BlueOak-1.0.0",
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "prepare": "tshy",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "tap",
+    "snap": "tap",
+    "format": "prettier --write . --log-level warn",
+    "typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts",
+    "bench": "bash ./scripts/bench.sh"
+  },
+  "devDependencies": {
+    "@nodelib/fs.walk": "^3.0.1",
+    "@types/node": "^25.3.0",
+    "mkdirp": "^3.0.0",
+    "prettier": "^3.3.2",
+    "rimraf": "^6.1.3",
+    "tap": "^21.6.1",
+    "ts-node": "^10.9.2",
+    "tshy": "^3.3.2",
+    "typedoc": "^0.28.17"
+  },
+  "engines": {
+    "node": "18 || 20 || >=22"
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/isaacs"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/path-scurry"
+  },
+  "dependencies": {
+    "lru-cache": "^11.0.0",
+    "minipass": "^7.1.2"
+  },
+  "tshy": {
+    "selfLink": false,
+    "exports": {
+      "./package.json": "./package.json",
+      ".": "./src/index.ts"
+    }
+  },
+  "types": "./dist/commonjs/index.d.ts",
+  "module": "./dist/esm/index.js"
+}
diff --git a/node_modules/picocolors/LICENSE b/node_modules/picocolors/LICENSE
new file mode 100644
index 00000000..46c9b95d
--- /dev/null
+++ b/node_modules/picocolors/LICENSE
@@ -0,0 +1,15 @@
+ISC License
+
+Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/picocolors/README.md b/node_modules/picocolors/README.md
new file mode 100644
index 00000000..8e47aa8e
--- /dev/null
+++ b/node_modules/picocolors/README.md
@@ -0,0 +1,21 @@
+# picocolors
+
+The tiniest and the fastest library for terminal output formatting with ANSI colors.
+
+```javascript
+import pc from "picocolors"
+
+console.log(
+  pc.green(`How are ${pc.italic(`you`)} doing?`)
+)
+```
+
+- **No dependencies.**
+- **14 times** smaller and **2 times** faster than chalk.
+- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist.
+- Node.js v6+ & browsers support. Support for both CJS and ESM projects.
+- TypeScript type declarations included.
+- [`NO_COLOR`](https://no-color.org/) friendly.
+
+## Docs
+Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub.
diff --git a/node_modules/picocolors/package.json b/node_modules/picocolors/package.json
new file mode 100644
index 00000000..372d4b64
--- /dev/null
+++ b/node_modules/picocolors/package.json
@@ -0,0 +1,25 @@
+{
+  "name": "picocolors",
+  "version": "1.1.1",
+  "main": "./picocolors.js",
+  "types": "./picocolors.d.ts",
+  "browser": {
+    "./picocolors.js": "./picocolors.browser.js"
+  },
+  "sideEffects": false,
+  "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors",
+  "files": [
+    "picocolors.*",
+    "types.d.ts"
+  ],
+  "keywords": [
+    "terminal",
+    "colors",
+    "formatting",
+    "cli",
+    "console"
+  ],
+  "author": "Alexey Raspopov",
+  "repository": "alexeyraspopov/picocolors",
+  "license": "ISC"
+}
diff --git a/node_modules/picocolors/picocolors.browser.js b/node_modules/picocolors/picocolors.browser.js
new file mode 100644
index 00000000..9dcf637c
--- /dev/null
+++ b/node_modules/picocolors/picocolors.browser.js
@@ -0,0 +1,4 @@
+var x=String;
+var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}};
+module.exports=create();
+module.exports.createColors = create;
diff --git a/node_modules/picocolors/picocolors.d.ts b/node_modules/picocolors/picocolors.d.ts
new file mode 100644
index 00000000..94e146a8
--- /dev/null
+++ b/node_modules/picocolors/picocolors.d.ts
@@ -0,0 +1,5 @@
+import { Colors } from "./types"
+
+declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors }
+
+export = picocolors
diff --git a/node_modules/picocolors/picocolors.js b/node_modules/picocolors/picocolors.js
new file mode 100644
index 00000000..e32df854
--- /dev/null
+++ b/node_modules/picocolors/picocolors.js
@@ -0,0 +1,75 @@
+let p = process || {}, argv = p.argv || [], env = p.env || {}
+let isColorSupported =
+	!(!!env.NO_COLOR || argv.includes("--no-color")) &&
+	(!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI)
+
+let formatter = (open, close, replace = open) =>
+	input => {
+		let string = "" + input, index = string.indexOf(close, open.length)
+		return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
+	}
+
+let replaceClose = (string, close, replace, index) => {
+	let result = "", cursor = 0
+	do {
+		result += string.substring(cursor, index) + replace
+		cursor = index + close.length
+		index = string.indexOf(close, cursor)
+	} while (~index)
+	return result + string.substring(cursor)
+}
+
+let createColors = (enabled = isColorSupported) => {
+	let f = enabled ? formatter : () => String
+	return {
+		isColorSupported: enabled,
+		reset: f("\x1b[0m", "\x1b[0m"),
+		bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
+		dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
+		italic: f("\x1b[3m", "\x1b[23m"),
+		underline: f("\x1b[4m", "\x1b[24m"),
+		inverse: f("\x1b[7m", "\x1b[27m"),
+		hidden: f("\x1b[8m", "\x1b[28m"),
+		strikethrough: f("\x1b[9m", "\x1b[29m"),
+
+		black: f("\x1b[30m", "\x1b[39m"),
+		red: f("\x1b[31m", "\x1b[39m"),
+		green: f("\x1b[32m", "\x1b[39m"),
+		yellow: f("\x1b[33m", "\x1b[39m"),
+		blue: f("\x1b[34m", "\x1b[39m"),
+		magenta: f("\x1b[35m", "\x1b[39m"),
+		cyan: f("\x1b[36m", "\x1b[39m"),
+		white: f("\x1b[37m", "\x1b[39m"),
+		gray: f("\x1b[90m", "\x1b[39m"),
+
+		bgBlack: f("\x1b[40m", "\x1b[49m"),
+		bgRed: f("\x1b[41m", "\x1b[49m"),
+		bgGreen: f("\x1b[42m", "\x1b[49m"),
+		bgYellow: f("\x1b[43m", "\x1b[49m"),
+		bgBlue: f("\x1b[44m", "\x1b[49m"),
+		bgMagenta: f("\x1b[45m", "\x1b[49m"),
+		bgCyan: f("\x1b[46m", "\x1b[49m"),
+		bgWhite: f("\x1b[47m", "\x1b[49m"),
+
+		blackBright: f("\x1b[90m", "\x1b[39m"),
+		redBright: f("\x1b[91m", "\x1b[39m"),
+		greenBright: f("\x1b[92m", "\x1b[39m"),
+		yellowBright: f("\x1b[93m", "\x1b[39m"),
+		blueBright: f("\x1b[94m", "\x1b[39m"),
+		magentaBright: f("\x1b[95m", "\x1b[39m"),
+		cyanBright: f("\x1b[96m", "\x1b[39m"),
+		whiteBright: f("\x1b[97m", "\x1b[39m"),
+
+		bgBlackBright: f("\x1b[100m", "\x1b[49m"),
+		bgRedBright: f("\x1b[101m", "\x1b[49m"),
+		bgGreenBright: f("\x1b[102m", "\x1b[49m"),
+		bgYellowBright: f("\x1b[103m", "\x1b[49m"),
+		bgBlueBright: f("\x1b[104m", "\x1b[49m"),
+		bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
+		bgCyanBright: f("\x1b[106m", "\x1b[49m"),
+		bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
+	}
+}
+
+module.exports = createColors()
+module.exports.createColors = createColors
diff --git a/node_modules/picocolors/types.d.ts b/node_modules/picocolors/types.d.ts
new file mode 100644
index 00000000..cd1aec46
--- /dev/null
+++ b/node_modules/picocolors/types.d.ts
@@ -0,0 +1,51 @@
+export type Formatter = (input: string | number | null | undefined) => string
+
+export interface Colors {
+	isColorSupported: boolean
+
+	reset: Formatter
+	bold: Formatter
+	dim: Formatter
+	italic: Formatter
+	underline: Formatter
+	inverse: Formatter
+	hidden: Formatter
+	strikethrough: Formatter
+
+	black: Formatter
+	red: Formatter
+	green: Formatter
+	yellow: Formatter
+	blue: Formatter
+	magenta: Formatter
+	cyan: Formatter
+	white: Formatter
+	gray: Formatter
+
+	bgBlack: Formatter
+	bgRed: Formatter
+	bgGreen: Formatter
+	bgYellow: Formatter
+	bgBlue: Formatter
+	bgMagenta: Formatter
+	bgCyan: Formatter
+	bgWhite: Formatter
+
+	blackBright: Formatter
+	redBright: Formatter
+	greenBright: Formatter
+	yellowBright: Formatter
+	blueBright: Formatter
+	magentaBright: Formatter
+	cyanBright: Formatter
+	whiteBright: Formatter
+
+	bgBlackBright: Formatter
+	bgRedBright: Formatter
+	bgGreenBright: Formatter
+	bgYellowBright: Formatter
+	bgBlueBright: Formatter
+	bgMagentaBright: Formatter
+	bgCyanBright: Formatter
+	bgWhiteBright: Formatter
+}
diff --git a/node_modules/playwright-core/LICENSE b/node_modules/playwright-core/LICENSE
new file mode 100644
index 00000000..4ace03dd
--- /dev/null
+++ b/node_modules/playwright-core/LICENSE
@@ -0,0 +1,202 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Portions Copyright (c) Microsoft Corporation.
+   Portions Copyright 2017 Google Inc.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/node_modules/playwright-core/NOTICE b/node_modules/playwright-core/NOTICE
new file mode 100644
index 00000000..814ec169
--- /dev/null
+++ b/node_modules/playwright-core/NOTICE
@@ -0,0 +1,5 @@
+Playwright
+Copyright (c) Microsoft Corporation
+
+This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer),
+available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).
diff --git a/node_modules/playwright-core/README.md b/node_modules/playwright-core/README.md
new file mode 100644
index 00000000..422b3739
--- /dev/null
+++ b/node_modules/playwright-core/README.md
@@ -0,0 +1,3 @@
+# playwright-core
+
+This package contains the no-browser flavor of [Playwright](http://github.com/microsoft/playwright).
diff --git a/node_modules/playwright-core/ThirdPartyNotices.txt b/node_modules/playwright-core/ThirdPartyNotices.txt
new file mode 100644
index 00000000..369e2025
--- /dev/null
+++ b/node_modules/playwright-core/ThirdPartyNotices.txt
@@ -0,0 +1,13 @@
+microsoft/playwright-core
+
+THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
+
+This package bundles third-party software inside individual files under
+`lib/`. Each bundled output has a sidecar `.js.LICENSE` file next
+to it listing every npm package whose source was inlined into that
+bundle, together with the full license text for each.
+
+For example:
+- lib/utilsBundle.js.LICENSE
+
+This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
diff --git a/node_modules/playwright-core/bin/install_media_pack.ps1 b/node_modules/playwright-core/bin/install_media_pack.ps1
new file mode 100644
index 00000000..61707542
--- /dev/null
+++ b/node_modules/playwright-core/bin/install_media_pack.ps1
@@ -0,0 +1,5 @@
+$osInfo = Get-WmiObject -Class Win32_OperatingSystem
+# check if running on Windows Server
+if ($osInfo.ProductType -eq 3) {
+  Install-WindowsFeature Server-Media-Foundation
+}
diff --git a/node_modules/playwright-core/bin/install_webkit_wsl.ps1 b/node_modules/playwright-core/bin/install_webkit_wsl.ps1
new file mode 100644
index 00000000..ccaaf156
--- /dev/null
+++ b/node_modules/playwright-core/bin/install_webkit_wsl.ps1
@@ -0,0 +1,33 @@
+$ErrorActionPreference = 'Stop'
+
+# This script sets up a WSL distribution that will be used to run WebKit.
+
+$Distribution = "playwright"
+$Username = "pwuser"
+
+$distributions = (wsl --list --quiet) -split "\r?\n"
+if ($distributions -contains $Distribution) {
+    Write-Host "WSL distribution '$Distribution' already exists. Skipping installation."
+} else {
+    Write-Host "Installing new WSL distribution '$Distribution'..."
+    $VhdSize = "10GB"
+    wsl --install -d Ubuntu-24.04 --name $Distribution --no-launch --vhd-size $VhdSize
+    wsl -d $Distribution -u root adduser --gecos GECOS --disabled-password $Username
+}
+
+$pwshDirname = (Resolve-Path -Path $PSScriptRoot).Path;
+$playwrightCoreRoot = Resolve-Path (Join-Path $pwshDirname "..")
+
+$initScript = @"
+if [ ! -f "/home/$Username/node/bin/node" ]; then
+  mkdir -p /home/$Username/node
+  curl -fsSL https://nodejs.org/dist/v22.17.0/node-v22.17.0-linux-x64.tar.xz -o /home/$Username/node/node-v22.17.0-linux-x64.tar.xz
+  tar -xJf /home/$Username/node/node-v22.17.0-linux-x64.tar.xz -C /home/$Username/node --strip-components=1
+  sudo -u $Username echo 'export PATH=/home/$Username/node/bin:\`$PATH' >> /home/$Username/.profile
+fi
+/home/$Username/node/bin/node cli.js install-deps webkit
+sudo -u $Username PLAYWRIGHT_SKIP_BROWSER_GC=1 /home/$Username/node/bin/node cli.js install webkit
+"@ -replace "\r\n", "`n"
+
+wsl -d $Distribution --cd $playwrightCoreRoot -u root -- bash -c "$initScript"
+Write-Host "Done!"
\ No newline at end of file
diff --git a/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh b/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh
new file mode 100644
index 00000000..13d55dfa
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+set -e
+set -x
+
+if [[ $(arch) == "aarch64" ]]; then
+  echo "ERROR: not supported on Linux Arm64"
+  exit 1
+fi
+
+if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
+  if [[ ! -f "/etc/os-release" ]]; then
+    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
+    exit 1
+  fi
+
+  ID=$(bash -c 'source /etc/os-release && echo $ID')
+  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
+    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
+    exit 1
+  fi
+fi
+
+# 1. make sure to remove old beta if any.
+if dpkg --get-selections | grep -q "^google-chrome-beta[[:space:]]*install$" >/dev/null; then
+  apt-get remove -y google-chrome-beta
+fi
+
+# 2. Update apt lists (needed to install curl and chrome dependencies)
+apt-get update
+
+# 3. Install curl to download chrome
+if ! command -v curl >/dev/null; then
+  apt-get install -y curl
+fi
+
+# 4. download chrome beta from dl.google.com and install it.
+cd /tmp
+curl -L -O https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
+apt-get install -y ./google-chrome-beta_current_amd64.deb
+rm -rf ./google-chrome-beta_current_amd64.deb
+cd -
+google-chrome-beta --version
diff --git a/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh b/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh
new file mode 100644
index 00000000..60b4b7fc
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+set -e
+set -x
+
+rm -rf "/Applications/Google Chrome Beta.app"
+cd /tmp
+curl -L --retry 3 -o ./googlechromebeta.dmg https://dl.google.com/chrome/mac/universal/beta/googlechromebeta.dmg
+hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechromebeta.dmg ./googlechromebeta.dmg
+cp -pR "/Volumes/googlechromebeta.dmg/Google Chrome Beta.app" /Applications
+hdiutil detach /Volumes/googlechromebeta.dmg
+rm -rf /tmp/googlechromebeta.dmg
+
+/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version
diff --git a/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 b/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1
new file mode 100644
index 00000000..3fbe5515
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1
@@ -0,0 +1,24 @@
+$ErrorActionPreference = 'Stop'
+
+$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi'
+
+Write-Host "Downloading Google Chrome Beta"
+$wc = New-Object net.webclient
+$msiInstaller = "$env:temp\google-chrome-beta.msi"
+$wc.Downloadfile($url, $msiInstaller)
+
+Write-Host "Installing Google Chrome Beta"
+$arguments = "/i `"$msiInstaller`" /quiet"
+Start-Process msiexec.exe -ArgumentList $arguments -Wait
+Remove-Item $msiInstaller
+
+$suffix = "\\Google\\Chrome Beta\\Application\\chrome.exe"
+if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
+    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
+} elseif (Test-Path "${env:ProgramFiles}$suffix") {
+    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
+} else {
+    Write-Host "ERROR: Failed to install Google Chrome Beta."
+    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
+    exit 1
+}
diff --git a/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh b/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh
new file mode 100644
index 00000000..64bc1393
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+set -e
+set -x
+
+if [[ $(arch) == "aarch64" ]]; then
+  echo "ERROR: not supported on Linux Arm64"
+  exit 1
+fi
+
+if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
+  if [[ ! -f "/etc/os-release" ]]; then
+    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
+    exit 1
+  fi
+
+  ID=$(bash -c 'source /etc/os-release && echo $ID')
+  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
+    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
+    exit 1
+  fi
+fi
+
+# 1. make sure to remove old stable if any.
+if dpkg --get-selections | grep -q "^google-chrome[[:space:]]*install$" >/dev/null; then
+  apt-get remove -y google-chrome
+fi
+
+# 2. Update apt lists (needed to install curl and chrome dependencies)
+apt-get update
+
+# 3. Install curl to download chrome
+if ! command -v curl >/dev/null; then
+  apt-get install -y curl
+fi
+
+# 4. download chrome stable from dl.google.com and install it.
+cd /tmp
+curl -L -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+apt-get install -y ./google-chrome-stable_current_amd64.deb
+rm -rf ./google-chrome-stable_current_amd64.deb
+cd -
+google-chrome --version
diff --git a/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh b/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh
new file mode 100644
index 00000000..7db7a0f1
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+set -e
+set -x
+
+rm -rf "/Applications/Google Chrome.app"
+cd /tmp
+curl -L --retry 3 -o ./googlechrome.dmg https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg
+hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechrome.dmg ./googlechrome.dmg
+cp -pR "/Volumes/googlechrome.dmg/Google Chrome.app" /Applications
+hdiutil detach /Volumes/googlechrome.dmg
+rm -rf /tmp/googlechrome.dmg
+/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
diff --git a/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 b/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1
new file mode 100644
index 00000000..7ca2dbaf
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1
@@ -0,0 +1,24 @@
+$ErrorActionPreference = 'Stop'
+$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi'
+
+$wc = New-Object net.webclient
+$msiInstaller = "$env:temp\google-chrome.msi"
+Write-Host "Downloading Google Chrome"
+$wc.Downloadfile($url, $msiInstaller)
+
+Write-Host "Installing Google Chrome"
+$arguments = "/i `"$msiInstaller`" /quiet"
+Start-Process msiexec.exe -ArgumentList $arguments -Wait
+Remove-Item $msiInstaller
+
+
+$suffix = "\\Google\\Chrome\\Application\\chrome.exe"
+if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
+    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
+} elseif (Test-Path "${env:ProgramFiles}$suffix") {
+    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
+} else {
+    Write-Host "ERROR: Failed to install Google Chrome."
+    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
+    exit 1
+}
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh b/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh
new file mode 100644
index 00000000..e1f156a0
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+
+if [[ $(arch) == "aarch64" ]]; then
+  echo "ERROR: not supported on Linux Arm64"
+  exit 1
+fi
+
+if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
+  if [[ ! -f "/etc/os-release" ]]; then
+    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
+    exit 1
+  fi
+
+  ID=$(bash -c 'source /etc/os-release && echo $ID')
+  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
+    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
+    exit 1
+  fi
+fi
+
+# 1. make sure to remove old beta if any.
+if dpkg --get-selections | grep -q "^microsoft-edge-beta[[:space:]]*install$" >/dev/null; then
+  apt-get remove -y microsoft-edge-beta
+fi
+
+# 2. Install curl to download Microsoft gpg key
+if ! command -v curl >/dev/null; then
+  apt-get update
+  apt-get install -y curl
+fi
+
+# GnuPG is not preinstalled in slim images
+if ! command -v gpg >/dev/null; then
+  apt-get update
+  apt-get install -y gpg
+fi
+
+# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
+curl -L https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
+install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
+sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
+rm /tmp/microsoft.gpg
+apt-get update && apt-get install -y microsoft-edge-beta
+
+microsoft-edge-beta --version
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh b/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh
new file mode 100644
index 00000000..528a0e71
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+set -e
+set -x
+
+cd /tmp
+curl -L --retry 3 -o ./msedge_beta.pkg "$1"
+# Note: there's no way to uninstall previously installed MSEdge.
+# However, running PKG again seems to update installation.
+sudo installer -pkg /tmp/msedge_beta.pkg -target /
+rm -rf /tmp/msedge_beta.pkg
+/Applications/Microsoft\ Edge\ Beta.app/Contents/MacOS/Microsoft\ Edge\ Beta --version
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 b/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1
new file mode 100644
index 00000000..cce0d0bf
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1
@@ -0,0 +1,23 @@
+$ErrorActionPreference = 'Stop'
+$url = $args[0]
+
+Write-Host "Downloading Microsoft Edge Beta"
+$wc = New-Object net.webclient
+$msiInstaller = "$env:temp\microsoft-edge-beta.msi"
+$wc.Downloadfile($url, $msiInstaller)
+
+Write-Host "Installing Microsoft Edge Beta"
+$arguments = "/i `"$msiInstaller`" /quiet"
+Start-Process msiexec.exe -ArgumentList $arguments -Wait
+Remove-Item $msiInstaller
+
+$suffix = "\\Microsoft\\Edge Beta\\Application\\msedge.exe"
+if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
+    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
+} elseif (Test-Path "${env:ProgramFiles}$suffix") {
+    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
+} else {
+    Write-Host "ERROR: Failed to install Microsoft Edge Beta."
+    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
+    exit 1
+}
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh b/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh
new file mode 100644
index 00000000..6c1a151c
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+
+if [[ $(arch) == "aarch64" ]]; then
+  echo "ERROR: not supported on Linux Arm64"
+  exit 1
+fi
+
+if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
+  if [[ ! -f "/etc/os-release" ]]; then
+    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
+    exit 1
+  fi
+
+  ID=$(bash -c 'source /etc/os-release && echo $ID')
+  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
+    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
+    exit 1
+  fi
+fi
+
+# 1. make sure to remove old dev if any.
+if dpkg --get-selections | grep -q "^microsoft-edge-dev[[:space:]]*install$" >/dev/null; then
+  apt-get remove -y microsoft-edge-dev
+fi
+
+# 2. Install curl to download Microsoft gpg key
+if ! command -v curl >/dev/null; then
+  apt-get update
+  apt-get install -y curl
+fi
+
+# GnuPG is not preinstalled in slim images
+if ! command -v gpg >/dev/null; then
+  apt-get update
+  apt-get install -y gpg
+fi
+
+# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
+curl -L https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
+install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
+sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
+rm /tmp/microsoft.gpg
+apt-get update && apt-get install -y microsoft-edge-dev
+
+microsoft-edge-dev --version
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh b/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh
new file mode 100644
index 00000000..e35ea4e6
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+set -e
+set -x
+
+cd /tmp
+curl -L --retry 3 -o ./msedge_dev.pkg "$1"
+# Note: there's no way to uninstall previously installed MSEdge.
+# However, running PKG again seems to update installation.
+sudo installer -pkg /tmp/msedge_dev.pkg -target /
+rm -rf /tmp/msedge_dev.pkg
+/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev --version
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 b/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1
new file mode 100644
index 00000000..22e6db84
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1
@@ -0,0 +1,23 @@
+$ErrorActionPreference = 'Stop'
+$url = $args[0]
+
+Write-Host "Downloading Microsoft Edge Dev"
+$wc = New-Object net.webclient
+$msiInstaller = "$env:temp\microsoft-edge-dev.msi"
+$wc.Downloadfile($url, $msiInstaller)
+
+Write-Host "Installing Microsoft Edge Dev"
+$arguments = "/i `"$msiInstaller`" /quiet"
+Start-Process msiexec.exe -ArgumentList $arguments -Wait
+Remove-Item $msiInstaller
+
+$suffix = "\\Microsoft\\Edge Dev\\Application\\msedge.exe"
+if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
+    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
+} elseif (Test-Path "${env:ProgramFiles}$suffix") {
+    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
+} else {
+    Write-Host "ERROR: Failed to install Microsoft Edge Dev."
+    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
+    exit 1
+}
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh b/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh
new file mode 100644
index 00000000..93bd766b
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+
+if [[ $(arch) == "aarch64" ]]; then
+  echo "ERROR: not supported on Linux Arm64"
+  exit 1
+fi
+
+if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
+  if [[ ! -f "/etc/os-release" ]]; then
+    echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
+    exit 1
+  fi
+
+  ID=$(bash -c 'source /etc/os-release && echo $ID')
+  if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
+    echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
+    exit 1
+  fi
+fi
+
+# 1. make sure to remove old stable if any.
+if dpkg --get-selections | grep -q "^microsoft-edge-stable[[:space:]]*install$" >/dev/null; then
+  apt-get remove -y microsoft-edge-stable
+fi
+
+# 2. Install curl to download Microsoft gpg key
+if ! command -v curl >/dev/null; then
+  apt-get update
+  apt-get install -y curl
+fi
+
+# GnuPG is not preinstalled in slim images
+if ! command -v gpg >/dev/null; then
+  apt-get update
+  apt-get install -y gpg
+fi
+
+# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
+curl -L https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
+install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
+sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-stable.list'
+rm /tmp/microsoft.gpg
+apt-get update && apt-get install -y microsoft-edge-stable
+
+microsoft-edge-stable --version
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh b/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh
new file mode 100644
index 00000000..44e5a56f
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+set -e
+set -x
+
+cd /tmp
+curl -L --retry 3 -o ./msedge_stable.pkg "$1"
+# Note: there's no way to uninstall previously installed MSEdge.
+# However, running PKG again seems to update installation.
+sudo installer -pkg /tmp/msedge_stable.pkg -target /
+rm -rf /tmp/msedge_stable.pkg
+/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version
diff --git a/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 b/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1
new file mode 100644
index 00000000..31fdf513
--- /dev/null
+++ b/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1
@@ -0,0 +1,24 @@
+$ErrorActionPreference = 'Stop'
+
+$url = $args[0]
+
+Write-Host "Downloading Microsoft Edge"
+$wc = New-Object net.webclient
+$msiInstaller = "$env:temp\microsoft-edge-stable.msi"
+$wc.Downloadfile($url, $msiInstaller)
+
+Write-Host "Installing Microsoft Edge"
+$arguments = "/i `"$msiInstaller`" /quiet"
+Start-Process msiexec.exe -ArgumentList $arguments -Wait
+Remove-Item $msiInstaller
+
+$suffix = "\\Microsoft\\Edge\\Application\\msedge.exe"
+if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
+    (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
+} elseif (Test-Path "${env:ProgramFiles}$suffix") {
+    (Get-Item "${env:ProgramFiles}$suffix").VersionInfo
+} else {
+    Write-Host "ERROR: Failed to install Microsoft Edge."
+    Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
+    exit 1
+}
\ No newline at end of file
diff --git a/node_modules/playwright-core/browsers.json b/node_modules/playwright-core/browsers.json
new file mode 100644
index 00000000..a0651c74
--- /dev/null
+++ b/node_modules/playwright-core/browsers.json
@@ -0,0 +1,81 @@
+{
+  "comment": "Do not edit this file, use utils/roll_browser.js",
+  "browsers": [
+    {
+      "name": "chromium",
+      "revision": "1228",
+      "installByDefault": true,
+      "browserVersion": "149.0.7827.55",
+      "title": "Chrome for Testing"
+    },
+    {
+      "name": "chromium-headless-shell",
+      "revision": "1228",
+      "installByDefault": true,
+      "browserVersion": "149.0.7827.55",
+      "title": "Chrome Headless Shell"
+    },
+    {
+      "name": "chromium-tip-of-tree",
+      "revision": "1432",
+      "installByDefault": false,
+      "browserVersion": "151.0.7886.0",
+      "title": "Chrome Canary for Testing"
+    },
+    {
+      "name": "chromium-tip-of-tree-headless-shell",
+      "revision": "1432",
+      "installByDefault": false,
+      "browserVersion": "151.0.7886.0",
+      "title": "Chrome Canary Headless Shell"
+    },
+    {
+      "name": "firefox",
+      "revision": "1532",
+      "installByDefault": true,
+      "browserVersion": "151.0",
+      "title": "Firefox"
+    },
+    {
+      "name": "firefox-beta",
+      "revision": "1526",
+      "installByDefault": false,
+      "browserVersion": "152.0b1",
+      "title": "Firefox Beta"
+    },
+    {
+      "name": "webkit",
+      "revision": "2311",
+      "installByDefault": true,
+      "revisionOverrides": {
+        "mac14": "2251",
+        "mac14-arm64": "2251",
+        "debian11-x64": "2105",
+        "debian11-arm64": "2105",
+        "ubuntu20.04-x64": "2092",
+        "ubuntu20.04-arm64": "2092"
+      },
+      "browserVersion": "26.5",
+      "title": "WebKit"
+    },
+    {
+      "name": "ffmpeg",
+      "revision": "1011",
+      "installByDefault": true,
+      "revisionOverrides": {
+        "mac12": "1010",
+        "mac12-arm64": "1010"
+      }
+    },
+    {
+      "name": "winldd",
+      "revision": "1007",
+      "installByDefault": false
+    },
+    {
+      "name": "android",
+      "revision": "1001",
+      "installByDefault": false
+    }
+  ]
+}
diff --git a/node_modules/playwright-core/cli.js b/node_modules/playwright-core/cli.js
new file mode 100644
index 00000000..f275a033
--- /dev/null
+++ b/node_modules/playwright-core/cli.js
@@ -0,0 +1,21 @@
+#!/usr/bin/env node
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+const { libCli, libCliTestStub } = require('./lib/coreBundle');
+const { program } = require('./lib/utilsBundle');
+libCli.decorateProgram(program);
+libCliTestStub.decorateProgram(program);
+program.parse(process.argv);
diff --git a/node_modules/playwright-core/index.d.ts b/node_modules/playwright-core/index.d.ts
new file mode 100644
index 00000000..97c14936
--- /dev/null
+++ b/node_modules/playwright-core/index.d.ts
@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export * from './types/types';
diff --git a/node_modules/playwright-core/index.js b/node_modules/playwright-core/index.js
new file mode 100644
index 00000000..9fc51a4d
--- /dev/null
+++ b/node_modules/playwright-core/index.js
@@ -0,0 +1,17 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+require('./lib/bootstrap');
+module.exports = require('./lib/coreBundle').inprocess.playwright;
diff --git a/node_modules/playwright-core/index.mjs b/node_modules/playwright-core/index.mjs
new file mode 100644
index 00000000..3b3c75b0
--- /dev/null
+++ b/node_modules/playwright-core/index.mjs
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import playwright from './index.js';
+
+export const chromium = playwright.chromium;
+export const firefox = playwright.firefox;
+export const webkit = playwright.webkit;
+export const selectors = playwright.selectors;
+export const devices = playwright.devices;
+export const errors = playwright.errors;
+export const request = playwright.request;
+export const _electron = playwright._electron;
+export const _android = playwright._android;
+export default playwright;
diff --git a/node_modules/playwright-core/lib/bootstrap.js b/node_modules/playwright-core/lib/bootstrap.js
new file mode 100644
index 00000000..9825a9a4
--- /dev/null
+++ b/node_modules/playwright-core/lib/bootstrap.js
@@ -0,0 +1,88 @@
+"use strict";
+const minimumMajorNodeVersion = 18;
+const currentNodeVersion = process.versions.node;
+const major = +currentNodeVersion.split(".")[0];
+if (major < minimumMajorNodeVersion) {
+  console.error(
+    "You are running Node.js " + currentNodeVersion + `.
+Playwright requires Node.js ${minimumMajorNodeVersion} or higher. 
+Please update your version of Node.js.`
+  );
+  process.exit(1);
+}
+if (process.env.PW_INSTRUMENT_MODULES) {
+  const Module = require("module");
+  const originalLoad = Module._load;
+  const root = { name: "", selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
+  let current = root;
+  const stack = [];
+  Module._load = function(request, _parent, _isMain) {
+    const node = { name: request, selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
+    current.children.push(node);
+    stack.push(current);
+    current = node;
+    const start = performance.now();
+    let result;
+    try {
+      result = originalLoad.apply(this, arguments);
+    } catch (e) {
+      current = stack.pop();
+      current.children.pop();
+      throw e;
+    }
+    const duration = performance.now() - start;
+    node.totalMs = duration;
+    node.selfMs = Math.max(0, duration - node.childrenMs);
+    current = stack.pop();
+    current.childrenMs += duration;
+    return result;
+  };
+  process.on("exit", () => {
+    function printTree(node, prefix, isLast, lines2, depth) {
+      if (node.totalMs < 1 && depth > 0)
+        return;
+      const connector = depth === 0 ? "" : isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
+      const time = `${node.totalMs.toFixed(1).padStart(8)}ms`;
+      const self = node.children.length ? ` (self: ${node.selfMs.toFixed(1)}ms)` : "";
+      lines2.push(`${time}  ${prefix}${connector}${node.name}${self}`);
+      const childPrefix = prefix + (depth === 0 ? "" : isLast ? "    " : "\u2502   ");
+      const sorted2 = node.children.slice().sort((a, b) => b.totalMs - a.totalMs);
+      for (let i = 0; i < sorted2.length; i++)
+        printTree(sorted2[i], childPrefix, i === sorted2.length - 1, lines2, depth + 1);
+    }
+    let totalModules = 0;
+    function count(n) {
+      totalModules++;
+      n.children.forEach(count);
+    }
+    root.children.forEach(count);
+    const lines = [];
+    const sorted = root.children.slice().sort((a, b) => b.totalMs - a.totalMs);
+    for (let i = 0; i < sorted.length; i++)
+      printTree(sorted[i], "", i === sorted.length - 1, lines, 0);
+    const totalMs = root.children.reduce((s, c) => s + c.totalMs, 0);
+    process.stderr.write(`
+--- Module load tree: ${totalModules} modules, ${totalMs.toFixed(0)}ms total ---
+` + lines.join("\n") + "\n");
+    const flat = /* @__PURE__ */ new Map();
+    function gather(n) {
+      const existing = flat.get(n.name);
+      if (existing) {
+        existing.selfMs += n.selfMs;
+        existing.totalMs += n.totalMs;
+        existing.count++;
+      } else {
+        flat.set(n.name, { selfMs: n.selfMs, totalMs: n.totalMs, count: 1 });
+      }
+      n.children.forEach(gather);
+    }
+    root.children.forEach(gather);
+    const top50 = [...flat.entries()].sort((a, b) => b[1].selfMs - a[1].selfMs).slice(0, 50);
+    const flatLines = top50.map(
+      ([mod, { selfMs, totalMs: totalMs2, count: count2 }]) => `${selfMs.toFixed(1).padStart(8)}ms self ${totalMs2.toFixed(1).padStart(8)}ms total  (x${String(count2).padStart(3)})  ${mod}`
+    );
+    process.stderr.write(`
+--- Top 50 modules by self time ---
+` + flatLines.join("\n") + "\n");
+  });
+}
diff --git a/node_modules/playwright-core/lib/coreBundle.js b/node_modules/playwright-core/lib/coreBundle.js
new file mode 100644
index 00000000..1d36a373
--- /dev/null
+++ b/node_modules/playwright-core/lib/coreBundle.js
@@ -0,0 +1,73385 @@
+"use strict";
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __esm = (fn, res) => function __init() {
+  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
+};
+var __commonJS = (cb, mod) => function __require() {
+  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
+};
+var __export = (target, all) => {
+  for (var name in all)
+    __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+  if (from && typeof from === "object" || typeof from === "function") {
+    for (let key of __getOwnPropNames(from))
+      if (!__hasOwnProp.call(to, key) && key !== except)
+        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+  }
+  return to;
+};
+var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
+  // If the importer is in node compatibility mode or this is not an ESM
+  // file that has been converted to a CommonJS file using a Babel-
+  // compatible transform (i.e. "__esModule" has not been set), then set
+  // "default" to the CommonJS "module.exports" for node compatibility.
+  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
+  mod
+));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+
+// packages/isomorphic/ariaSnapshot.ts
+function ariaNodesEqual(a, b) {
+  if (a.role !== b.role || a.name !== b.name)
+    return false;
+  if (!ariaPropsEqual(a, b) || hasPointerCursor(a) !== hasPointerCursor(b))
+    return false;
+  const aKeys = Object.keys(a.props);
+  const bKeys = Object.keys(b.props);
+  return aKeys.length === bKeys.length && aKeys.every((k) => a.props[k] === b.props[k]);
+}
+function hasPointerCursor(ariaNode) {
+  return ariaNode.box.cursor === "pointer";
+}
+function ariaPropsEqual(a, b) {
+  return a.active === b.active && a.checked === b.checked && a.disabled === b.disabled && a.expanded === b.expanded && a.invalid === b.invalid && a.selected === b.selected && a.level === b.level && a.pressed === b.pressed;
+}
+function parseAriaSnapshotUnsafe(yaml3, text2, options = {}) {
+  const result2 = parseAriaSnapshot(yaml3, text2, options);
+  if (result2.errors.length)
+    throw new Error(result2.errors[0].message);
+  return result2.fragment;
+}
+function parseAriaSnapshot(yaml3, text2, options = {}) {
+  const lineCounter = new yaml3.LineCounter();
+  const parseOptions = {
+    keepSourceTokens: true,
+    lineCounter,
+    ...options
+  };
+  const yamlDoc = yaml3.parseDocument(text2, parseOptions);
+  const errors = [];
+  const convertRange = (range) => {
+    return [lineCounter.linePos(range[0]), lineCounter.linePos(range[1])];
+  };
+  const addError = (error) => {
+    errors.push({
+      message: error.message,
+      range: [lineCounter.linePos(error.pos[0]), lineCounter.linePos(error.pos[1])]
+    });
+  };
+  const convertSeq = (container, seq) => {
+    for (const item of seq.items) {
+      const itemIsString = item instanceof yaml3.Scalar && typeof item.value === "string";
+      if (itemIsString) {
+        const childNode = KeyParser.parse(item, parseOptions, errors);
+        if (childNode) {
+          container.children = container.children || [];
+          container.children.push(childNode);
+        }
+        continue;
+      }
+      const itemIsMap = item instanceof yaml3.YAMLMap;
+      if (itemIsMap) {
+        convertMap(container, item);
+        continue;
+      }
+      errors.push({
+        message: "Sequence items should be strings or maps",
+        range: convertRange(item.range || seq.range)
+      });
+    }
+  };
+  const convertMap = (container, map) => {
+    for (const entry of map.items) {
+      container.children = container.children || [];
+      const keyIsString = entry.key instanceof yaml3.Scalar && typeof entry.key.value === "string";
+      if (!keyIsString) {
+        errors.push({
+          message: "Only string keys are supported",
+          range: convertRange(entry.key.range || map.range)
+        });
+        continue;
+      }
+      const key = entry.key;
+      const value2 = entry.value;
+      if (key.value === "text") {
+        const valueIsString = value2 instanceof yaml3.Scalar && typeof value2.value === "string";
+        if (!valueIsString) {
+          errors.push({
+            message: "Text value should be a string",
+            range: convertRange(entry.value.range || map.range)
+          });
+          continue;
+        }
+        container.children.push({
+          kind: "text",
+          text: textValue(value2.value)
+        });
+        continue;
+      }
+      if (key.value === "/children") {
+        const valueIsString = value2 instanceof yaml3.Scalar && typeof value2.value === "string";
+        if (!valueIsString || value2.value !== "contain" && value2.value !== "equal" && value2.value !== "deep-equal") {
+          errors.push({
+            message: 'Strict value should be "contain", "equal" or "deep-equal"',
+            range: convertRange(entry.value.range || map.range)
+          });
+          continue;
+        }
+        container.containerMode = value2.value;
+        continue;
+      }
+      if (key.value.startsWith("/")) {
+        const valueIsString = value2 instanceof yaml3.Scalar && typeof value2.value === "string";
+        if (!valueIsString) {
+          errors.push({
+            message: "Property value should be a string",
+            range: convertRange(entry.value.range || map.range)
+          });
+          continue;
+        }
+        container.props = container.props ?? {};
+        container.props[key.value.slice(1)] = textValue(value2.value);
+        continue;
+      }
+      const childNode = KeyParser.parse(key, parseOptions, errors);
+      if (!childNode)
+        continue;
+      const valueIsScalar = value2 instanceof yaml3.Scalar;
+      if (valueIsScalar) {
+        const type3 = typeof value2.value;
+        if (type3 !== "string" && type3 !== "number" && type3 !== "boolean") {
+          errors.push({
+            message: "Node value should be a string or a sequence",
+            range: convertRange(entry.value.range || map.range)
+          });
+          continue;
+        }
+        container.children.push({
+          ...childNode,
+          children: [{
+            kind: "text",
+            text: textValue(String(value2.value))
+          }]
+        });
+        continue;
+      }
+      const valueIsSequence = value2 instanceof yaml3.YAMLSeq;
+      if (valueIsSequence) {
+        container.children.push(childNode);
+        convertSeq(childNode, value2);
+        continue;
+      }
+      errors.push({
+        message: "Map values should be strings or sequences",
+        range: convertRange(entry.value.range || map.range)
+      });
+    }
+  };
+  const fragment = { kind: "role", role: "fragment" };
+  yamlDoc.errors.forEach(addError);
+  if (errors.length)
+    return { errors, fragment };
+  if (!(yamlDoc.contents instanceof yaml3.YAMLSeq)) {
+    errors.push({
+      message: 'Aria snapshot must be a YAML sequence, elements starting with " -"',
+      range: yamlDoc.contents ? convertRange(yamlDoc.contents.range) : [{ line: 0, col: 0 }, { line: 0, col: 0 }]
+    });
+  }
+  if (errors.length)
+    return { errors, fragment };
+  convertSeq(fragment, yamlDoc.contents);
+  if (errors.length)
+    return { errors, fragment: emptyFragment };
+  if (fragment.children?.length === 1 && (!fragment.containerMode || fragment.containerMode === "contain"))
+    return { fragment: fragment.children[0], errors: [] };
+  return { fragment, errors: [] };
+}
+function normalizeWhitespace(text2) {
+  return text2.replace(/[\u200b\u00ad]/g, "").replace(/[\r\n\s\t]+/g, " ").trim();
+}
+function textValue(value2) {
+  return {
+    raw: value2,
+    normalized: normalizeWhitespace(value2)
+  };
+}
+function findNewNode(from, to) {
+  function fillMap(root, map, position) {
+    let size = 1;
+    let childPosition = position + size;
+    for (const child of root.children || []) {
+      if (typeof child === "string") {
+        size++;
+        childPosition++;
+      } else {
+        size += fillMap(child, map, childPosition);
+        childPosition += size;
+      }
+    }
+    if (!["none", "presentation", "fragment", "iframe", "generic"].includes(root.role) && root.name) {
+      let byRole = map.get(root.role);
+      if (!byRole) {
+        byRole = /* @__PURE__ */ new Map();
+        map.set(root.role, byRole);
+      }
+      const existing = byRole.get(root.name);
+      const sizeAndPosition = size * 100 - position;
+      if (!existing || existing.sizeAndPosition < sizeAndPosition)
+        byRole.set(root.name, { node: root, sizeAndPosition });
+    }
+    return size;
+  }
+  const fromMap = /* @__PURE__ */ new Map();
+  if (from)
+    fillMap(from, fromMap, 0);
+  const toMap = /* @__PURE__ */ new Map();
+  fillMap(to, toMap, 0);
+  const result2 = [];
+  for (const [role, byRole] of toMap) {
+    for (const [name, byName] of byRole) {
+      const inFrom = fromMap.get(role)?.get(name);
+      if (!inFrom)
+        result2.push(byName);
+    }
+  }
+  result2.sort((a, b) => b.sizeAndPosition - a.sizeAndPosition);
+  return result2[0]?.node;
+}
+var emptyFragment, KeyParser, ParserError;
+var init_ariaSnapshot = __esm({
+  "packages/isomorphic/ariaSnapshot.ts"() {
+    "use strict";
+    emptyFragment = { kind: "role", role: "fragment" };
+    KeyParser = class _KeyParser {
+      static parse(text2, options, errors) {
+        try {
+          return new _KeyParser(text2.value)._parse();
+        } catch (e) {
+          if (e instanceof ParserError) {
+            const message = options.prettyErrors === false ? e.message : e.message + ":\n\n" + text2.value + "\n" + " ".repeat(e.pos) + "^\n";
+            errors.push({
+              message,
+              range: [options.lineCounter.linePos(text2.range[0]), options.lineCounter.linePos(text2.range[0] + e.pos)]
+            });
+            return null;
+          }
+          throw e;
+        }
+      }
+      constructor(input) {
+        this._input = input;
+        this._pos = 0;
+        this._length = input.length;
+      }
+      _peek() {
+        return this._input[this._pos] || "";
+      }
+      _next() {
+        if (this._pos < this._length)
+          return this._input[this._pos++];
+        return null;
+      }
+      _eof() {
+        return this._pos >= this._length;
+      }
+      _isWhitespace() {
+        return !this._eof() && /\s/.test(this._peek());
+      }
+      _skipWhitespace() {
+        while (this._isWhitespace())
+          this._pos++;
+      }
+      _readIdentifier(type3) {
+        if (this._eof())
+          this._throwError(`Unexpected end of input when expecting ${type3}`);
+        const start3 = this._pos;
+        while (!this._eof() && /[a-zA-Z]/.test(this._peek()))
+          this._pos++;
+        return this._input.slice(start3, this._pos);
+      }
+      _readString() {
+        let result2 = "";
+        let escaped2 = false;
+        while (!this._eof()) {
+          const ch = this._next();
+          if (escaped2) {
+            result2 += ch;
+            escaped2 = false;
+          } else if (ch === "\\") {
+            escaped2 = true;
+          } else if (ch === '"') {
+            return result2;
+          } else {
+            result2 += ch;
+          }
+        }
+        this._throwError("Unterminated string");
+      }
+      _throwError(message, offset = 0) {
+        throw new ParserError(message, offset || this._pos);
+      }
+      _readRegex() {
+        let result2 = "";
+        let escaped2 = false;
+        let insideClass = false;
+        while (!this._eof()) {
+          const ch = this._next();
+          if (escaped2) {
+            result2 += ch;
+            escaped2 = false;
+          } else if (ch === "\\") {
+            escaped2 = true;
+            result2 += ch;
+          } else if (ch === "/" && !insideClass) {
+            return { pattern: result2 };
+          } else if (ch === "[") {
+            insideClass = true;
+            result2 += ch;
+          } else if (ch === "]" && insideClass) {
+            result2 += ch;
+            insideClass = false;
+          } else {
+            result2 += ch;
+          }
+        }
+        this._throwError("Unterminated regex");
+      }
+      _readStringOrRegex() {
+        const ch = this._peek();
+        if (ch === '"') {
+          this._next();
+          return normalizeWhitespace(this._readString());
+        }
+        if (ch === "/") {
+          this._next();
+          return this._readRegex();
+        }
+        return null;
+      }
+      _readAttributes(result2) {
+        let errorPos = this._pos;
+        while (true) {
+          this._skipWhitespace();
+          if (this._peek() === "[") {
+            this._next();
+            this._skipWhitespace();
+            errorPos = this._pos;
+            const flagName = this._readIdentifier("attribute");
+            this._skipWhitespace();
+            let flagValue = "";
+            if (this._peek() === "=") {
+              this._next();
+              this._skipWhitespace();
+              errorPos = this._pos;
+              while (this._peek() !== "]" && !this._isWhitespace() && !this._eof())
+                flagValue += this._next();
+            }
+            this._skipWhitespace();
+            if (this._peek() !== "]")
+              this._throwError("Expected ]");
+            this._next();
+            this._applyAttribute(result2, flagName, flagValue || "true", errorPos);
+          } else {
+            break;
+          }
+        }
+      }
+      _parse() {
+        this._skipWhitespace();
+        const role = this._readIdentifier("role");
+        this._skipWhitespace();
+        const name = this._readStringOrRegex() || "";
+        const result2 = { kind: "role", role, name };
+        this._readAttributes(result2);
+        this._skipWhitespace();
+        if (!this._eof())
+          this._throwError("Unexpected input");
+        return result2;
+      }
+      _applyAttribute(node, key, value2, errorPos) {
+        if (key === "checked") {
+          this._assert(value2 === "true" || value2 === "false" || value2 === "mixed", 'Value of "checked" attribute must be a boolean or "mixed"', errorPos);
+          node.checked = value2 === "true" ? true : value2 === "false" ? false : "mixed";
+          return;
+        }
+        if (key === "disabled") {
+          this._assert(value2 === "true" || value2 === "false", 'Value of "disabled" attribute must be a boolean', errorPos);
+          node.disabled = value2 === "true";
+          return;
+        }
+        if (key === "expanded") {
+          this._assert(value2 === "true" || value2 === "false", 'Value of "expanded" attribute must be a boolean', errorPos);
+          node.expanded = value2 === "true";
+          return;
+        }
+        if (key === "active") {
+          this._assert(value2 === "true" || value2 === "false", 'Value of "active" attribute must be a boolean', errorPos);
+          node.active = value2 === "true";
+          return;
+        }
+        if (key === "invalid") {
+          this._assert(value2 === "true" || value2 === "false" || value2 === "grammar" || value2 === "spelling", 'Value of "invalid" attribute must be a boolean, "grammar" or "spelling"', errorPos);
+          node.invalid = value2 === "true" ? true : value2 === "false" ? false : value2;
+          return;
+        }
+        if (key === "level") {
+          this._assert(!isNaN(Number(value2)), 'Value of "level" attribute must be a number', errorPos);
+          node.level = Number(value2);
+          return;
+        }
+        if (key === "pressed") {
+          this._assert(value2 === "true" || value2 === "false" || value2 === "mixed", 'Value of "pressed" attribute must be a boolean or "mixed"', errorPos);
+          node.pressed = value2 === "true" ? true : value2 === "false" ? false : "mixed";
+          return;
+        }
+        if (key === "selected") {
+          this._assert(value2 === "true" || value2 === "false", 'Value of "selected" attribute must be a boolean', errorPos);
+          node.selected = value2 === "true";
+          return;
+        }
+        this._assert(false, `Unsupported attribute [${key}]`, errorPos);
+      }
+      _assert(value2, message, valuePos) {
+        if (!value2)
+          this._throwError(message || "Assertion error", valuePos);
+      }
+    };
+    ParserError = class extends Error {
+      constructor(message, pos) {
+        super(message);
+        this.pos = pos;
+      }
+    };
+  }
+});
+
+// packages/isomorphic/stringUtils.ts
+function escapeWithQuotes(text2, char = "'") {
+  const stringified = JSON.stringify(text2);
+  const escapedText = stringified.substring(1, stringified.length - 1).replace(/\\"/g, '"');
+  if (char === "'")
+    return char + escapedText.replace(/[']/g, "\\'") + char;
+  if (char === '"')
+    return char + escapedText.replace(/["]/g, '\\"') + char;
+  if (char === "`")
+    return char + escapedText.replace(/[`]/g, "\\`") + char;
+  throw new Error("Invalid escape char");
+}
+function escapeTemplateString(text2) {
+  return text2.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
+}
+function isString(obj) {
+  return typeof obj === "string" || obj instanceof String;
+}
+function toTitleCase(name) {
+  return name.charAt(0).toUpperCase() + name.substring(1);
+}
+function toSnakeCase(name) {
+  return name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toLowerCase();
+}
+function formatObject(value2, indent = "  ", mode = "multiline") {
+  if (typeof value2 === "string")
+    return escapeWithQuotes(value2, "'");
+  if (Array.isArray(value2))
+    return `[${value2.map((o) => formatObject(o)).join(", ")}]`;
+  if (typeof value2 === "object") {
+    const keys = Object.keys(value2).filter((key) => key !== "timeout" && value2[key] !== void 0).sort();
+    if (!keys.length)
+      return "{}";
+    const tokens = [];
+    for (const key of keys)
+      tokens.push(`${key}: ${formatObject(value2[key])}`);
+    if (mode === "multiline")
+      return `{
+${tokens.map((t) => indent + t).join(`,
+`)}
+}`;
+    return `{ ${tokens.join(", ")} }`;
+  }
+  return String(value2);
+}
+function formatObjectOrVoid(value2, indent = "  ") {
+  const result2 = formatObject(value2, indent);
+  return result2 === "{}" ? "" : result2;
+}
+function quoteCSSAttributeValue(text2) {
+  return `"${text2.replace(/["\\]/g, (char) => "\\" + char)}"`;
+}
+function cacheNormalizedWhitespaces() {
+  normalizedWhitespaceCache = /* @__PURE__ */ new Map();
+}
+function normalizeWhiteSpace(text2) {
+  let result2 = normalizedWhitespaceCache?.get(text2);
+  if (result2 === void 0) {
+    result2 = text2.replace(/[\u200b\u00ad]/g, "").trim().replace(/\s+/g, " ");
+    normalizedWhitespaceCache?.set(text2, result2);
+  }
+  return result2;
+}
+function normalizeEscapedRegexQuotes(source11) {
+  return source11.replace(/(^|[^\\])(\\\\)*\\(['"`])/g, "$1$2$3");
+}
+function escapeRegexForSelector(re2) {
+  if (re2.unicode || re2.unicodeSets)
+    return String(re2);
+  return String(re2).replace(/(^|[^\\])(\\\\)*(["'`])/g, "$1$2\\$3").replace(/>>/g, "\\>\\>");
+}
+function escapeForTextSelector(text2, exact) {
+  if (typeof text2 !== "string")
+    return escapeRegexForSelector(text2);
+  return `${JSON.stringify(text2)}${exact ? "s" : "i"}`;
+}
+function escapeForAttributeSelector(value2, exact) {
+  if (typeof value2 !== "string")
+    return escapeRegexForSelector(value2);
+  return `"${value2.replace(/\\/g, "\\\\").replace(/["]/g, '\\"')}"${exact ? "s" : "i"}`;
+}
+function trimString(input, cap, suffix = "") {
+  if (input.length <= cap)
+    return input;
+  const chars = [...input];
+  if (chars.length > cap)
+    return chars.slice(0, cap - suffix.length).join("") + suffix;
+  return chars.join("");
+}
+function trimStringWithEllipsis(input, cap) {
+  return trimString(input, cap, "\u2026");
+}
+function escapeRegExp(s) {
+  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+}
+function escapeHTMLAttribute(s) {
+  return s.replace(/[&<>"']/ug, (char) => escaped[char]);
+}
+function escapeHTML(s) {
+  return s.replace(/[&<]/ug, (char) => escaped[char]);
+}
+function longestCommonSubstring(s1, s2) {
+  const n = s1.length;
+  const m = s2.length;
+  let maxLen = 0;
+  let endingIndex = 0;
+  const dp = Array(n + 1).fill(null).map(() => Array(m + 1).fill(0));
+  for (let i = 1; i <= n; i++) {
+    for (let j = 1; j <= m; j++) {
+      if (s1[i - 1] === s2[j - 1]) {
+        dp[i][j] = dp[i - 1][j - 1] + 1;
+        if (dp[i][j] > maxLen) {
+          maxLen = dp[i][j];
+          endingIndex = i;
+        }
+      }
+    }
+  }
+  return s1.slice(endingIndex - maxLen, endingIndex);
+}
+function parseRegex(regex) {
+  if (regex[0] !== "/")
+    throw new Error(`Invalid regex, must start with '/': ${regex}`);
+  const lastSlash = regex.lastIndexOf("/");
+  if (lastSlash <= 0)
+    throw new Error(`Invalid regex, must end with '/' followed by optional flags: ${regex}`);
+  const source11 = regex.slice(1, lastSlash);
+  const flags = regex.slice(lastSlash + 1);
+  return new RegExp(source11, flags);
+}
+function tomlBasicString(value2) {
+  return JSON.stringify(value2);
+}
+function tomlArray(values) {
+  return `[${values.map((value2) => tomlBasicString(value2)).join(", ")}]`;
+}
+function tomlMultilineBasicString(value2) {
+  const escaped2 = value2.replace(/\\/g, "\\\\").replace(/"""/g, '\\"\\"\\"');
+  return `"""
+${escaped2}
+"""`;
+}
+function stripAnsiEscapes(str) {
+  return str.replace(ansiRegex, "");
+}
+var normalizedWhitespaceCache, escaped, ansiRegex;
+var init_stringUtils = __esm({
+  "packages/isomorphic/stringUtils.ts"() {
+    "use strict";
+    escaped = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
+    ansiRegex = new RegExp("([\\u001B\\u009B][[\\]()#?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{0,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))", "g");
+  }
+});
+
+// packages/isomorphic/rtti.ts
+function isRegExp(obj) {
+  return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
+}
+function isRegexString(value2) {
+  try {
+    new RegExp(value2);
+    return true;
+  } catch {
+    return false;
+  }
+}
+function isObject(obj) {
+  return typeof obj === "object" && obj !== null;
+}
+function isError(obj) {
+  return obj instanceof Error || obj && Object.getPrototypeOf(obj)?.name === "Error";
+}
+var init_rtti = __esm({
+  "packages/isomorphic/rtti.ts"() {
+    "use strict";
+    init_stringUtils();
+  }
+});
+
+// packages/isomorphic/expectUtils.ts
+function serializeExpectedTextValues(items, options = {}) {
+  return items.map((i) => ({
+    string: isString(i) ? i : void 0,
+    regexSource: isRegExp(i) ? i.source : void 0,
+    regexFlags: isRegExp(i) ? i.flags : void 0,
+    matchSubstring: options.matchSubstring,
+    ignoreCase: options.ignoreCase,
+    normalizeWhiteSpace: options.normalizeWhiteSpace
+  }));
+}
+var init_expectUtils = __esm({
+  "packages/isomorphic/expectUtils.ts"() {
+    "use strict";
+    init_rtti();
+  }
+});
+
+// packages/isomorphic/assert.ts
+function assert(value2, message) {
+  if (!value2)
+    throw new Error(message || "Assertion error");
+}
+var init_assert = __esm({
+  "packages/isomorphic/assert.ts"() {
+    "use strict";
+  }
+});
+
+// packages/isomorphic/base64.ts
+function base64ByteLength(data) {
+  if (!data)
+    return 0;
+  const padding = data[data.length - 2] === "=" ? 2 : data[data.length - 1] === "=" ? 1 : 0;
+  return Math.max(0, Math.floor(data.length * 3 / 4) - padding);
+}
+var init_base64 = __esm({
+  "packages/isomorphic/base64.ts"() {
+    "use strict";
+  }
+});
+
+// packages/isomorphic/colors.ts
+var webColors, noColors, applyStyle;
+var init_colors = __esm({
+  "packages/isomorphic/colors.ts"() {
+    "use strict";
+    webColors = {
+      enabled: true,
+      reset: (text2) => applyStyle(0, 0, text2),
+      bold: (text2) => applyStyle(1, 22, text2),
+      dim: (text2) => applyStyle(2, 22, text2),
+      italic: (text2) => applyStyle(3, 23, text2),
+      underline: (text2) => applyStyle(4, 24, text2),
+      inverse: (text2) => applyStyle(7, 27, text2),
+      hidden: (text2) => applyStyle(8, 28, text2),
+      strikethrough: (text2) => applyStyle(9, 29, text2),
+      black: (text2) => applyStyle(30, 39, text2),
+      red: (text2) => applyStyle(31, 39, text2),
+      green: (text2) => applyStyle(32, 39, text2),
+      yellow: (text2) => applyStyle(33, 39, text2),
+      blue: (text2) => applyStyle(34, 39, text2),
+      magenta: (text2) => applyStyle(35, 39, text2),
+      cyan: (text2) => applyStyle(36, 39, text2),
+      white: (text2) => applyStyle(37, 39, text2),
+      gray: (text2) => applyStyle(90, 39, text2),
+      grey: (text2) => applyStyle(90, 39, text2)
+    };
+    noColors = {
+      enabled: false,
+      reset: (t) => t,
+      bold: (t) => t,
+      dim: (t) => t,
+      italic: (t) => t,
+      underline: (t) => t,
+      inverse: (t) => t,
+      hidden: (t) => t,
+      strikethrough: (t) => t,
+      black: (t) => t,
+      red: (t) => t,
+      green: (t) => t,
+      yellow: (t) => t,
+      blue: (t) => t,
+      magenta: (t) => t,
+      cyan: (t) => t,
+      white: (t) => t,
+      gray: (t) => t,
+      grey: (t) => t
+    };
+    applyStyle = (open5, close3, text2) => `\x1B[${open5}m${text2}\x1B[${close3}m`;
+  }
+});
+
+// packages/isomorphic/headers.ts
+function headersObjectToArray(headers, separator, setCookieSeparator) {
+  if (!setCookieSeparator)
+    setCookieSeparator = separator;
+  const result2 = [];
+  for (const name in headers) {
+    const values = headers[name];
+    if (values === void 0)
+      continue;
+    if (separator) {
+      const sep = name.toLowerCase() === "set-cookie" ? setCookieSeparator : separator;
+      for (const value2 of values.split(sep))
+        result2.push({ name, value: value2.trim() });
+    } else {
+      result2.push({ name, value: values });
+    }
+  }
+  return result2;
+}
+function headersArrayToObject(headers, lowerCase) {
+  const result2 = {};
+  for (const { name, value: value2 } of headers)
+    result2[lowerCase ? name.toLowerCase() : name] = value2;
+  return result2;
+}
+var init_headers = __esm({
+  "packages/isomorphic/headers.ts"() {
+    "use strict";
+  }
+});
+
+// packages/isomorphic/imageUtils.ts
+function padImageToSize(image, size) {
+  if (image.width === size.width && image.height === size.height)
+    return image;
+  const buffer = new Uint8Array(size.width * size.height * 4);
+  for (let y = 0; y < size.height; y++) {
+    for (let x = 0; x < size.width; x++) {
+      const to = (y * size.width + x) * 4;
+      if (y < image.height && x < image.width) {
+        const from = (y * image.width + x) * 4;
+        buffer[to] = image.data[from];
+        buffer[to + 1] = image.data[from + 1];
+        buffer[to + 2] = image.data[from + 2];
+        buffer[to + 3] = image.data[from + 3];
+      } else {
+        buffer[to] = 0;
+        buffer[to + 1] = 0;
+        buffer[to + 2] = 0;
+        buffer[to + 3] = 0;
+      }
+    }
+  }
+  return { data: Buffer.from(buffer), width: size.width, height: size.height };
+}
+function scaleImageToSize(image, size) {
+  const { data: src, width: w1, height: h1 } = image;
+  const w2 = Math.max(1, Math.floor(size.width));
+  const h2 = Math.max(1, Math.floor(size.height));
+  if (w1 === w2 && h1 === h2)
+    return image;
+  if (w1 <= 0 || h1 <= 0)
+    throw new Error("Invalid input image");
+  if (size.width <= 0 || size.height <= 0 || !isFinite(size.width) || !isFinite(size.height))
+    throw new Error("Invalid output dimensions");
+  const clamp = (v, lo, hi) => v < lo ? lo : v > hi ? hi : v;
+  const weights = (t, o) => {
+    const t2 = t * t;
+    const t3 = t2 * t;
+    o[0] = -0.5 * t + 1 * t2 - 0.5 * t3;
+    o[1] = 1 - 2.5 * t2 + 1.5 * t3;
+    o[2] = 0.5 * t + 2 * t2 - 1.5 * t3;
+    o[3] = -0.5 * t2 + 0.5 * t3;
+  };
+  const srcRowStride = w1 * 4;
+  const dstRowStride = w2 * 4;
+  const xOff = new Int32Array(w2 * 4);
+  const xW = new Float32Array(w2 * 4);
+  const wx = new Float32Array(4);
+  const xScale = w1 / w2;
+  for (let x = 0; x < w2; x++) {
+    const sx = (x + 0.5) * xScale - 0.5;
+    const sxi = Math.floor(sx);
+    const t = sx - sxi;
+    weights(t, wx);
+    const b = x * 4;
+    const i0 = clamp(sxi - 1, 0, w1 - 1);
+    const i1 = clamp(sxi + 0, 0, w1 - 1);
+    const i2 = clamp(sxi + 1, 0, w1 - 1);
+    const i3 = clamp(sxi + 2, 0, w1 - 1);
+    xOff[b + 0] = i0 << 2;
+    xOff[b + 1] = i1 << 2;
+    xOff[b + 2] = i2 << 2;
+    xOff[b + 3] = i3 << 2;
+    xW[b + 0] = wx[0];
+    xW[b + 1] = wx[1];
+    xW[b + 2] = wx[2];
+    xW[b + 3] = wx[3];
+  }
+  const yRow = new Int32Array(h2 * 4);
+  const yW = new Float32Array(h2 * 4);
+  const wy = new Float32Array(4);
+  const yScale = h1 / h2;
+  for (let y = 0; y < h2; y++) {
+    const sy = (y + 0.5) * yScale - 0.5;
+    const syi = Math.floor(sy);
+    const t = sy - syi;
+    weights(t, wy);
+    const b = y * 4;
+    const j0 = clamp(syi - 1, 0, h1 - 1);
+    const j1 = clamp(syi + 0, 0, h1 - 1);
+    const j2 = clamp(syi + 1, 0, h1 - 1);
+    const j3 = clamp(syi + 2, 0, h1 - 1);
+    yRow[b + 0] = j0 * srcRowStride;
+    yRow[b + 1] = j1 * srcRowStride;
+    yRow[b + 2] = j2 * srcRowStride;
+    yRow[b + 3] = j3 * srcRowStride;
+    yW[b + 0] = wy[0];
+    yW[b + 1] = wy[1];
+    yW[b + 2] = wy[2];
+    yW[b + 3] = wy[3];
+  }
+  const dst = new Uint8Array(w2 * h2 * 4);
+  for (let y = 0; y < h2; y++) {
+    const yb = y * 4;
+    const rb0 = yRow[yb + 0];
+    const rb1 = yRow[yb + 1];
+    const rb2 = yRow[yb + 2];
+    const rb3 = yRow[yb + 3];
+    const wy0 = yW[yb + 0];
+    const wy1 = yW[yb + 1];
+    const wy2 = yW[yb + 2];
+    const wy3 = yW[yb + 3];
+    const dstBase = y * dstRowStride;
+    for (let x = 0; x < w2; x++) {
+      const xb = x * 4;
+      const xo0 = xOff[xb + 0];
+      const xo1 = xOff[xb + 1];
+      const xo2 = xOff[xb + 2];
+      const xo3 = xOff[xb + 3];
+      const wx0 = xW[xb + 0];
+      const wx1 = xW[xb + 1];
+      const wx2 = xW[xb + 2];
+      const wx3 = xW[xb + 3];
+      const di = dstBase + (x << 2);
+      for (let c = 0; c < 4; c++) {
+        const r0 = src[rb0 + xo0 + c] * wx0 + src[rb0 + xo1 + c] * wx1 + src[rb0 + xo2 + c] * wx2 + src[rb0 + xo3 + c] * wx3;
+        const r1 = src[rb1 + xo0 + c] * wx0 + src[rb1 + xo1 + c] * wx1 + src[rb1 + xo2 + c] * wx2 + src[rb1 + xo3 + c] * wx3;
+        const r2 = src[rb2 + xo0 + c] * wx0 + src[rb2 + xo1 + c] * wx1 + src[rb2 + xo2 + c] * wx2 + src[rb2 + xo3 + c] * wx3;
+        const r3 = src[rb3 + xo0 + c] * wx0 + src[rb3 + xo1 + c] * wx1 + src[rb3 + xo2 + c] * wx2 + src[rb3 + xo3 + c] * wx3;
+        const v = r0 * wy0 + r1 * wy1 + r2 * wy2 + r3 * wy3;
+        dst[di + c] = v < 0 ? 0 : v > 255 ? 255 : v | 0;
+      }
+    }
+  }
+  return { data: Buffer.from(dst.buffer), width: w2, height: h2 };
+}
+var init_imageUtils = __esm({
+  "packages/isomorphic/imageUtils.ts"() {
+    "use strict";
+  }
+});
+
+// packages/isomorphic/jsonSchema.ts
+function validate(value2, schema, path59) {
+  const errors = [];
+  if (schema.oneOf) {
+    let bestErrors;
+    for (const variant of schema.oneOf) {
+      const variantErrors = validate(value2, variant, path59);
+      if (variantErrors.length === 0)
+        return [];
+      if (!bestErrors || variantErrors.length < bestErrors.length)
+        bestErrors = variantErrors;
+    }
+    if (bestErrors.length === 1 && bestErrors[0].startsWith(`${path59}: expected `))
+      return [`${path59}: does not match any of the expected types`];
+    return bestErrors;
+  }
+  if (schema.type === "string") {
+    if (typeof value2 !== "string") {
+      errors.push(`${path59}: expected string, got ${typeof value2}`);
+      return errors;
+    }
+    if (schema.pattern && !cachedRegex(schema.pattern).test(value2))
+      errors.push(schema.patternError || `${path59}: must match pattern "${schema.pattern}"`);
+    return errors;
+  }
+  if (schema.type === "array") {
+    if (!Array.isArray(value2)) {
+      errors.push(`${path59}: expected array, got ${typeof value2}`);
+      return errors;
+    }
+    if (schema.items) {
+      for (let i = 0; i < value2.length; i++)
+        errors.push(...validate(value2[i], schema.items, `${path59}[${i}]`));
+    }
+    return errors;
+  }
+  if (schema.type === "object") {
+    if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) {
+      errors.push(`${path59}: expected object, got ${Array.isArray(value2) ? "array" : typeof value2}`);
+      return errors;
+    }
+    const obj = value2;
+    for (const key of schema.required || []) {
+      if (obj[key] === void 0)
+        errors.push(`${path59}.${key}: required`);
+    }
+    for (const [key, propSchema] of Object.entries(schema.properties || {})) {
+      if (obj[key] !== void 0)
+        errors.push(...validate(obj[key], propSchema, `${path59}.${key}`));
+    }
+    return errors;
+  }
+  return errors;
+}
+function cachedRegex(pattern) {
+  let regex = regexCache.get(pattern);
+  if (!regex) {
+    regex = new RegExp(pattern);
+    regexCache.set(pattern, regex);
+  }
+  return regex;
+}
+var regexCache;
+var init_jsonSchema = __esm({
+  "packages/isomorphic/jsonSchema.ts"() {
+    "use strict";
+    regexCache = /* @__PURE__ */ new Map();
+  }
+});
+
+// packages/isomorphic/cssTokenizer.ts
+function digit(code) {
+  return between(code, 48, 57);
+}
+function hexdigit(code) {
+  return digit(code) || between(code, 65, 70) || between(code, 97, 102);
+}
+function uppercaseletter(code) {
+  return between(code, 65, 90);
+}
+function lowercaseletter(code) {
+  return between(code, 97, 122);
+}
+function letter(code) {
+  return uppercaseletter(code) || lowercaseletter(code);
+}
+function nonascii(code) {
+  return code >= 128;
+}
+function namestartchar(code) {
+  return letter(code) || nonascii(code) || code === 95;
+}
+function namechar(code) {
+  return namestartchar(code) || digit(code) || code === 45;
+}
+function nonprintable(code) {
+  return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;
+}
+function newline(code) {
+  return code === 10;
+}
+function whitespace(code) {
+  return newline(code) || code === 9 || code === 32;
+}
+function preprocess(str) {
+  const codepoints = [];
+  for (let i = 0; i < str.length; i++) {
+    let code = str.charCodeAt(i);
+    if (code === 13 && str.charCodeAt(i + 1) === 10) {
+      code = 10;
+      i++;
+    }
+    if (code === 13 || code === 12)
+      code = 10;
+    if (code === 0)
+      code = 65533;
+    if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {
+      const lead = code - 55296;
+      const trail = str.charCodeAt(i + 1) - 56320;
+      code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;
+      i++;
+    }
+    codepoints.push(code);
+  }
+  return codepoints;
+}
+function stringFromCode(code) {
+  if (code <= 65535)
+    return String.fromCharCode(code);
+  code -= Math.pow(2, 16);
+  const lead = Math.floor(code / Math.pow(2, 10)) + 55296;
+  const trail = code % Math.pow(2, 10) + 56320;
+  return String.fromCharCode(lead) + String.fromCharCode(trail);
+}
+function tokenize(str1) {
+  const str = preprocess(str1);
+  let i = -1;
+  const tokens = [];
+  let code;
+  let line = 0;
+  let column = 0;
+  let lastLineLength = 0;
+  const incrLineno = function() {
+    line += 1;
+    lastLineLength = column;
+    column = 0;
+  };
+  const locStart = { line, column };
+  const codepoint = function(i2) {
+    if (i2 >= str.length)
+      return -1;
+    return str[i2];
+  };
+  const next = function(num) {
+    if (num === void 0)
+      num = 1;
+    if (num > 3)
+      throw "Spec Error: no more than three codepoints of lookahead.";
+    return codepoint(i + num);
+  };
+  const consume = function(num) {
+    if (num === void 0)
+      num = 1;
+    i += num;
+    code = codepoint(i);
+    if (newline(code))
+      incrLineno();
+    else
+      column += num;
+    return true;
+  };
+  const reconsume = function() {
+    i -= 1;
+    if (newline(code)) {
+      line -= 1;
+      column = lastLineLength;
+    } else {
+      column -= 1;
+    }
+    locStart.line = line;
+    locStart.column = column;
+    return true;
+  };
+  const eof = function(codepoint2) {
+    if (codepoint2 === void 0)
+      codepoint2 = code;
+    return codepoint2 === -1;
+  };
+  const donothing = function() {
+  };
+  const parseerror = function() {
+  };
+  const consumeAToken = function() {
+    consumeComments();
+    consume();
+    if (whitespace(code)) {
+      while (whitespace(next()))
+        consume();
+      return new WhitespaceToken();
+    } else if (code === 34) {
+      return consumeAStringToken();
+    } else if (code === 35) {
+      if (namechar(next()) || areAValidEscape(next(1), next(2))) {
+        const token = new HashToken("");
+        if (wouldStartAnIdentifier(next(1), next(2), next(3)))
+          token.type = "id";
+        token.value = consumeAName();
+        return token;
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 36) {
+      if (next() === 61) {
+        consume();
+        return new SuffixMatchToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 39) {
+      return consumeAStringToken();
+    } else if (code === 40) {
+      return new OpenParenToken();
+    } else if (code === 41) {
+      return new CloseParenToken();
+    } else if (code === 42) {
+      if (next() === 61) {
+        consume();
+        return new SubstringMatchToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 43) {
+      if (startsWithANumber()) {
+        reconsume();
+        return consumeANumericToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 44) {
+      return new CommaToken();
+    } else if (code === 45) {
+      if (startsWithANumber()) {
+        reconsume();
+        return consumeANumericToken();
+      } else if (next(1) === 45 && next(2) === 62) {
+        consume(2);
+        return new CDCToken();
+      } else if (startsWithAnIdentifier()) {
+        reconsume();
+        return consumeAnIdentlikeToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 46) {
+      if (startsWithANumber()) {
+        reconsume();
+        return consumeANumericToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 58) {
+      return new ColonToken();
+    } else if (code === 59) {
+      return new SemicolonToken();
+    } else if (code === 60) {
+      if (next(1) === 33 && next(2) === 45 && next(3) === 45) {
+        consume(3);
+        return new CDOToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 64) {
+      if (wouldStartAnIdentifier(next(1), next(2), next(3)))
+        return new AtKeywordToken(consumeAName());
+      else
+        return new DelimToken(code);
+    } else if (code === 91) {
+      return new OpenSquareToken();
+    } else if (code === 92) {
+      if (startsWithAValidEscape()) {
+        reconsume();
+        return consumeAnIdentlikeToken();
+      } else {
+        parseerror();
+        return new DelimToken(code);
+      }
+    } else if (code === 93) {
+      return new CloseSquareToken();
+    } else if (code === 94) {
+      if (next() === 61) {
+        consume();
+        return new PrefixMatchToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 123) {
+      return new OpenCurlyToken();
+    } else if (code === 124) {
+      if (next() === 61) {
+        consume();
+        return new DashMatchToken();
+      } else if (next() === 124) {
+        consume();
+        return new ColumnToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (code === 125) {
+      return new CloseCurlyToken();
+    } else if (code === 126) {
+      if (next() === 61) {
+        consume();
+        return new IncludeMatchToken();
+      } else {
+        return new DelimToken(code);
+      }
+    } else if (digit(code)) {
+      reconsume();
+      return consumeANumericToken();
+    } else if (namestartchar(code)) {
+      reconsume();
+      return consumeAnIdentlikeToken();
+    } else if (eof()) {
+      return new EOFToken();
+    } else {
+      return new DelimToken(code);
+    }
+  };
+  const consumeComments = function() {
+    while (next(1) === 47 && next(2) === 42) {
+      consume(2);
+      while (true) {
+        consume();
+        if (code === 42 && next() === 47) {
+          consume();
+          break;
+        } else if (eof()) {
+          parseerror();
+          return;
+        }
+      }
+    }
+  };
+  const consumeANumericToken = function() {
+    const num = consumeANumber();
+    if (wouldStartAnIdentifier(next(1), next(2), next(3))) {
+      const token = new DimensionToken();
+      token.value = num.value;
+      token.repr = num.repr;
+      token.type = num.type;
+      token.unit = consumeAName();
+      return token;
+    } else if (next() === 37) {
+      consume();
+      const token = new PercentageToken();
+      token.value = num.value;
+      token.repr = num.repr;
+      return token;
+    } else {
+      const token = new NumberToken();
+      token.value = num.value;
+      token.repr = num.repr;
+      token.type = num.type;
+      return token;
+    }
+  };
+  const consumeAnIdentlikeToken = function() {
+    const str2 = consumeAName();
+    if (str2.toLowerCase() === "url" && next() === 40) {
+      consume();
+      while (whitespace(next(1)) && whitespace(next(2)))
+        consume();
+      if (next() === 34 || next() === 39)
+        return new FunctionToken(str2);
+      else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))
+        return new FunctionToken(str2);
+      else
+        return consumeAURLToken();
+    } else if (next() === 40) {
+      consume();
+      return new FunctionToken(str2);
+    } else {
+      return new IdentToken(str2);
+    }
+  };
+  const consumeAStringToken = function(endingCodePoint) {
+    if (endingCodePoint === void 0)
+      endingCodePoint = code;
+    let string = "";
+    while (consume()) {
+      if (code === endingCodePoint || eof()) {
+        return new StringToken(string);
+      } else if (newline(code)) {
+        parseerror();
+        reconsume();
+        return new BadStringToken();
+      } else if (code === 92) {
+        if (eof(next()))
+          donothing();
+        else if (newline(next()))
+          consume();
+        else
+          string += stringFromCode(consumeEscape());
+      } else {
+        string += stringFromCode(code);
+      }
+    }
+    throw new Error("Internal error");
+  };
+  const consumeAURLToken = function() {
+    const token = new URLToken("");
+    while (whitespace(next()))
+      consume();
+    if (eof(next()))
+      return token;
+    while (consume()) {
+      if (code === 41 || eof()) {
+        return token;
+      } else if (whitespace(code)) {
+        while (whitespace(next()))
+          consume();
+        if (next() === 41 || eof(next())) {
+          consume();
+          return token;
+        } else {
+          consumeTheRemnantsOfABadURL();
+          return new BadURLToken();
+        }
+      } else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {
+        parseerror();
+        consumeTheRemnantsOfABadURL();
+        return new BadURLToken();
+      } else if (code === 92) {
+        if (startsWithAValidEscape()) {
+          token.value += stringFromCode(consumeEscape());
+        } else {
+          parseerror();
+          consumeTheRemnantsOfABadURL();
+          return new BadURLToken();
+        }
+      } else {
+        token.value += stringFromCode(code);
+      }
+    }
+    throw new Error("Internal error");
+  };
+  const consumeEscape = function() {
+    consume();
+    if (hexdigit(code)) {
+      const digits = [code];
+      for (let total = 0; total < 5; total++) {
+        if (hexdigit(next())) {
+          consume();
+          digits.push(code);
+        } else {
+          break;
+        }
+      }
+      if (whitespace(next()))
+        consume();
+      let value2 = parseInt(digits.map(function(x) {
+        return String.fromCharCode(x);
+      }).join(""), 16);
+      if (value2 > maximumallowedcodepoint)
+        value2 = 65533;
+      return value2;
+    } else if (eof()) {
+      return 65533;
+    } else {
+      return code;
+    }
+  };
+  const areAValidEscape = function(c1, c2) {
+    if (c1 !== 92)
+      return false;
+    if (newline(c2))
+      return false;
+    return true;
+  };
+  const startsWithAValidEscape = function() {
+    return areAValidEscape(code, next());
+  };
+  const wouldStartAnIdentifier = function(c1, c2, c3) {
+    if (c1 === 45)
+      return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);
+    else if (namestartchar(c1))
+      return true;
+    else if (c1 === 92)
+      return areAValidEscape(c1, c2);
+    else
+      return false;
+  };
+  const startsWithAnIdentifier = function() {
+    return wouldStartAnIdentifier(code, next(1), next(2));
+  };
+  const wouldStartANumber = function(c1, c2, c3) {
+    if (c1 === 43 || c1 === 45) {
+      if (digit(c2))
+        return true;
+      if (c2 === 46 && digit(c3))
+        return true;
+      return false;
+    } else if (c1 === 46) {
+      if (digit(c2))
+        return true;
+      return false;
+    } else if (digit(c1)) {
+      return true;
+    } else {
+      return false;
+    }
+  };
+  const startsWithANumber = function() {
+    return wouldStartANumber(code, next(1), next(2));
+  };
+  const consumeAName = function() {
+    let result2 = "";
+    while (consume()) {
+      if (namechar(code)) {
+        result2 += stringFromCode(code);
+      } else if (startsWithAValidEscape()) {
+        result2 += stringFromCode(consumeEscape());
+      } else {
+        reconsume();
+        return result2;
+      }
+    }
+    throw new Error("Internal parse error");
+  };
+  const consumeANumber = function() {
+    let repr = "";
+    let type3 = "integer";
+    if (next() === 43 || next() === 45) {
+      consume();
+      repr += stringFromCode(code);
+    }
+    while (digit(next())) {
+      consume();
+      repr += stringFromCode(code);
+    }
+    if (next(1) === 46 && digit(next(2))) {
+      consume();
+      repr += stringFromCode(code);
+      consume();
+      repr += stringFromCode(code);
+      type3 = "number";
+      while (digit(next())) {
+        consume();
+        repr += stringFromCode(code);
+      }
+    }
+    const c1 = next(1);
+    const c2 = next(2);
+    const c3 = next(3);
+    if ((c1 === 69 || c1 === 101) && digit(c2)) {
+      consume();
+      repr += stringFromCode(code);
+      consume();
+      repr += stringFromCode(code);
+      type3 = "number";
+      while (digit(next())) {
+        consume();
+        repr += stringFromCode(code);
+      }
+    } else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {
+      consume();
+      repr += stringFromCode(code);
+      consume();
+      repr += stringFromCode(code);
+      consume();
+      repr += stringFromCode(code);
+      type3 = "number";
+      while (digit(next())) {
+        consume();
+        repr += stringFromCode(code);
+      }
+    }
+    const value2 = convertAStringToANumber(repr);
+    return { type: type3, value: value2, repr };
+  };
+  const convertAStringToANumber = function(string) {
+    return +string;
+  };
+  const consumeTheRemnantsOfABadURL = function() {
+    while (consume()) {
+      if (code === 41 || eof()) {
+        return;
+      } else if (startsWithAValidEscape()) {
+        consumeEscape();
+        donothing();
+      } else {
+        donothing();
+      }
+    }
+  };
+  let iterationCount = 0;
+  while (!eof(next())) {
+    tokens.push(consumeAToken());
+    iterationCount++;
+    if (iterationCount > str.length * 2)
+      throw new Error("I'm infinite-looping!");
+  }
+  return tokens;
+}
+function escapeIdent(string) {
+  string = "" + string;
+  let result2 = "";
+  const firstcode = string.charCodeAt(0);
+  for (let i = 0; i < string.length; i++) {
+    const code = string.charCodeAt(i);
+    if (code === 0)
+      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
+    if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)
+      result2 += "\\" + code.toString(16) + " ";
+    else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))
+      result2 += string[i];
+    else
+      result2 += "\\" + string[i];
+  }
+  return result2;
+}
+function escapeHash(string) {
+  string = "" + string;
+  let result2 = "";
+  for (let i = 0; i < string.length; i++) {
+    const code = string.charCodeAt(i);
+    if (code === 0)
+      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
+    if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))
+      result2 += string[i];
+    else
+      result2 += "\\" + code.toString(16) + " ";
+  }
+  return result2;
+}
+function escapeString(string) {
+  string = "" + string;
+  let result2 = "";
+  for (let i = 0; i < string.length; i++) {
+    const code = string.charCodeAt(i);
+    if (code === 0)
+      throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
+    if (between(code, 1, 31) || code === 127)
+      result2 += "\\" + code.toString(16) + " ";
+    else if (code === 34 || code === 92)
+      result2 += "\\" + string[i];
+    else
+      result2 += string[i];
+  }
+  return result2;
+}
+var between, maximumallowedcodepoint, InvalidCharacterError, CSSParserToken, BadStringToken, BadURLToken, WhitespaceToken, CDOToken, CDCToken, ColonToken, SemicolonToken, CommaToken, GroupingToken, OpenCurlyToken, CloseCurlyToken, OpenSquareToken, CloseSquareToken, OpenParenToken, CloseParenToken, IncludeMatchToken, DashMatchToken, PrefixMatchToken, SuffixMatchToken, SubstringMatchToken, ColumnToken, EOFToken, DelimToken, StringValuedToken, IdentToken, FunctionToken, AtKeywordToken, HashToken, StringToken, URLToken, NumberToken, PercentageToken, DimensionToken;
+var init_cssTokenizer = __esm({
+  "packages/isomorphic/cssTokenizer.ts"() {
+    "use strict";
+    between = function(num, first, last) {
+      return num >= first && num <= last;
+    };
+    maximumallowedcodepoint = 1114111;
+    InvalidCharacterError = class extends Error {
+      constructor(message) {
+        super(message);
+        this.name = "InvalidCharacterError";
+      }
+    };
+    CSSParserToken = class {
+      constructor() {
+        this.tokenType = "";
+      }
+      toJSON() {
+        return { token: this.tokenType };
+      }
+      toString() {
+        return this.tokenType;
+      }
+      toSource() {
+        return "" + this;
+      }
+    };
+    BadStringToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "BADSTRING";
+      }
+    };
+    BadURLToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "BADURL";
+      }
+    };
+    WhitespaceToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "WHITESPACE";
+      }
+      toString() {
+        return "WS";
+      }
+      toSource() {
+        return " ";
+      }
+    };
+    CDOToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "CDO";
+      }
+      toSource() {
+        return "";
+      }
+    };
+    ColonToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = ":";
+      }
+    };
+    SemicolonToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = ";";
+      }
+    };
+    CommaToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = ",";
+      }
+    };
+    GroupingToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.value = "";
+        this.mirror = "";
+      }
+    };
+    OpenCurlyToken = class extends GroupingToken {
+      constructor() {
+        super();
+        this.tokenType = "{";
+        this.value = "{";
+        this.mirror = "}";
+      }
+    };
+    CloseCurlyToken = class extends GroupingToken {
+      constructor() {
+        super();
+        this.tokenType = "}";
+        this.value = "}";
+        this.mirror = "{";
+      }
+    };
+    OpenSquareToken = class extends GroupingToken {
+      constructor() {
+        super();
+        this.tokenType = "[";
+        this.value = "[";
+        this.mirror = "]";
+      }
+    };
+    CloseSquareToken = class extends GroupingToken {
+      constructor() {
+        super();
+        this.tokenType = "]";
+        this.value = "]";
+        this.mirror = "[";
+      }
+    };
+    OpenParenToken = class extends GroupingToken {
+      constructor() {
+        super();
+        this.tokenType = "(";
+        this.value = "(";
+        this.mirror = ")";
+      }
+    };
+    CloseParenToken = class extends GroupingToken {
+      constructor() {
+        super();
+        this.tokenType = ")";
+        this.value = ")";
+        this.mirror = "(";
+      }
+    };
+    IncludeMatchToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "~=";
+      }
+    };
+    DashMatchToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "|=";
+      }
+    };
+    PrefixMatchToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "^=";
+      }
+    };
+    SuffixMatchToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "$=";
+      }
+    };
+    SubstringMatchToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "*=";
+      }
+    };
+    ColumnToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "||";
+      }
+    };
+    EOFToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.tokenType = "EOF";
+      }
+      toSource() {
+        return "";
+      }
+    };
+    DelimToken = class extends CSSParserToken {
+      constructor(code) {
+        super();
+        this.tokenType = "DELIM";
+        this.value = "";
+        this.value = stringFromCode(code);
+      }
+      toString() {
+        return "DELIM(" + this.value + ")";
+      }
+      toJSON() {
+        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
+        json.value = this.value;
+        return json;
+      }
+      toSource() {
+        if (this.value === "\\")
+          return "\\\n";
+        else
+          return this.value;
+      }
+    };
+    StringValuedToken = class extends CSSParserToken {
+      constructor() {
+        super(...arguments);
+        this.value = "";
+      }
+      ASCIIMatch(str) {
+        return this.value.toLowerCase() === str.toLowerCase();
+      }
+      toJSON() {
+        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
+        json.value = this.value;
+        return json;
+      }
+    };
+    IdentToken = class extends StringValuedToken {
+      constructor(val) {
+        super();
+        this.tokenType = "IDENT";
+        this.value = val;
+      }
+      toString() {
+        return "IDENT(" + this.value + ")";
+      }
+      toSource() {
+        return escapeIdent(this.value);
+      }
+    };
+    FunctionToken = class extends StringValuedToken {
+      constructor(val) {
+        super();
+        this.tokenType = "FUNCTION";
+        this.value = val;
+        this.mirror = ")";
+      }
+      toString() {
+        return "FUNCTION(" + this.value + ")";
+      }
+      toSource() {
+        return escapeIdent(this.value) + "(";
+      }
+    };
+    AtKeywordToken = class extends StringValuedToken {
+      constructor(val) {
+        super();
+        this.tokenType = "AT-KEYWORD";
+        this.value = val;
+      }
+      toString() {
+        return "AT(" + this.value + ")";
+      }
+      toSource() {
+        return "@" + escapeIdent(this.value);
+      }
+    };
+    HashToken = class extends StringValuedToken {
+      constructor(val) {
+        super();
+        this.tokenType = "HASH";
+        this.value = val;
+        this.type = "unrestricted";
+      }
+      toString() {
+        return "HASH(" + this.value + ")";
+      }
+      toJSON() {
+        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
+        json.value = this.value;
+        json.type = this.type;
+        return json;
+      }
+      toSource() {
+        if (this.type === "id")
+          return "#" + escapeIdent(this.value);
+        else
+          return "#" + escapeHash(this.value);
+      }
+    };
+    StringToken = class extends StringValuedToken {
+      constructor(val) {
+        super();
+        this.tokenType = "STRING";
+        this.value = val;
+      }
+      toString() {
+        return '"' + escapeString(this.value) + '"';
+      }
+    };
+    URLToken = class extends StringValuedToken {
+      constructor(val) {
+        super();
+        this.tokenType = "URL";
+        this.value = val;
+      }
+      toString() {
+        return "URL(" + this.value + ")";
+      }
+      toSource() {
+        return 'url("' + escapeString(this.value) + '")';
+      }
+    };
+    NumberToken = class extends CSSParserToken {
+      constructor() {
+        super();
+        this.tokenType = "NUMBER";
+        this.type = "integer";
+        this.repr = "";
+      }
+      toString() {
+        if (this.type === "integer")
+          return "INT(" + this.value + ")";
+        return "NUMBER(" + this.value + ")";
+      }
+      toJSON() {
+        const json = super.toJSON();
+        json.value = this.value;
+        json.type = this.type;
+        json.repr = this.repr;
+        return json;
+      }
+      toSource() {
+        return this.repr;
+      }
+    };
+    PercentageToken = class extends CSSParserToken {
+      constructor() {
+        super();
+        this.tokenType = "PERCENTAGE";
+        this.repr = "";
+      }
+      toString() {
+        return "PERCENTAGE(" + this.value + ")";
+      }
+      toJSON() {
+        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
+        json.value = this.value;
+        json.repr = this.repr;
+        return json;
+      }
+      toSource() {
+        return this.repr + "%";
+      }
+    };
+    DimensionToken = class extends CSSParserToken {
+      constructor() {
+        super();
+        this.tokenType = "DIMENSION";
+        this.type = "integer";
+        this.repr = "";
+        this.unit = "";
+      }
+      toString() {
+        return "DIM(" + this.value + "," + this.unit + ")";
+      }
+      toJSON() {
+        const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
+        json.value = this.value;
+        json.type = this.type;
+        json.repr = this.repr;
+        json.unit = this.unit;
+        return json;
+      }
+      toSource() {
+        const source11 = this.repr;
+        let unit = escapeIdent(this.unit);
+        if (unit[0].toLowerCase() === "e" && (unit[1] === "-" || between(unit.charCodeAt(1), 48, 57))) {
+          unit = "\\65 " + unit.slice(1, unit.length);
+        }
+        return source11 + unit;
+      }
+    };
+  }
+});
+
+// packages/isomorphic/cssParser.ts
+function isInvalidSelectorError(error) {
+  return error instanceof InvalidSelectorError;
+}
+function parseCSS(selector, customNames) {
+  let tokens;
+  try {
+    tokens = tokenize(selector);
+    if (!(tokens[tokens.length - 1] instanceof EOFToken))
+      tokens.push(new EOFToken());
+  } catch (e) {
+    const newMessage = e.message + ` while parsing css selector "${selector}". Did you mean to CSS.escape it?`;
+    const index = (e.stack || "").indexOf(e.message);
+    if (index !== -1)
+      e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length);
+    e.message = newMessage;
+    throw e;
+  }
+  const unsupportedToken = tokens.find((token) => {
+    return token instanceof AtKeywordToken || token instanceof BadStringToken || token instanceof BadURLToken || token instanceof ColumnToken || token instanceof CDOToken || token instanceof CDCToken || token instanceof SemicolonToken || // TODO: Consider using these for something, e.g. to escape complex strings.
+    // For example :xpath{ (//div/bar[@attr="foo"])[2]/baz }
+    // Or this way :xpath( {complex-xpath-goes-here("hello")} )
+    token instanceof OpenCurlyToken || token instanceof CloseCurlyToken || // TODO: Consider treating these as strings?
+    token instanceof URLToken || token instanceof PercentageToken;
+  });
+  if (unsupportedToken)
+    throw new InvalidSelectorError(`Unsupported token "${unsupportedToken.toSource()}" while parsing css selector "${selector}". Did you mean to CSS.escape it?`);
+  let pos = 0;
+  const names = /* @__PURE__ */ new Set();
+  function unexpected() {
+    return new InvalidSelectorError(`Unexpected token "${tokens[pos].toSource()}" while parsing css selector "${selector}". Did you mean to CSS.escape it?`);
+  }
+  function skipWhitespace() {
+    while (tokens[pos] instanceof WhitespaceToken)
+      pos++;
+  }
+  function isIdent(p = pos) {
+    return tokens[p] instanceof IdentToken;
+  }
+  function isString2(p = pos) {
+    return tokens[p] instanceof StringToken;
+  }
+  function isNumber(p = pos) {
+    return tokens[p] instanceof NumberToken;
+  }
+  function isComma(p = pos) {
+    return tokens[p] instanceof CommaToken;
+  }
+  function isOpenParen(p = pos) {
+    return tokens[p] instanceof OpenParenToken;
+  }
+  function isCloseParen(p = pos) {
+    return tokens[p] instanceof CloseParenToken;
+  }
+  function isFunction2(p = pos) {
+    return tokens[p] instanceof FunctionToken;
+  }
+  function isStar(p = pos) {
+    return tokens[p] instanceof DelimToken && tokens[p].value === "*";
+  }
+  function isEOF(p = pos) {
+    return tokens[p] instanceof EOFToken;
+  }
+  function isClauseCombinator(p = pos) {
+    return tokens[p] instanceof DelimToken && [">", "+", "~"].includes(tokens[p].value);
+  }
+  function isSelectorClauseEnd(p = pos) {
+    return isComma(p) || isCloseParen(p) || isEOF(p) || isClauseCombinator(p) || tokens[p] instanceof WhitespaceToken;
+  }
+  function consumeFunctionArguments() {
+    const result3 = [consumeArgument()];
+    while (true) {
+      skipWhitespace();
+      if (!isComma())
+        break;
+      pos++;
+      result3.push(consumeArgument());
+    }
+    return result3;
+  }
+  function consumeArgument() {
+    skipWhitespace();
+    if (isNumber())
+      return tokens[pos++].value;
+    if (isString2())
+      return tokens[pos++].value;
+    return consumeComplexSelector();
+  }
+  function consumeComplexSelector() {
+    const result3 = { simples: [] };
+    skipWhitespace();
+    if (isClauseCombinator()) {
+      result3.simples.push({ selector: { functions: [{ name: "scope", args: [] }] }, combinator: "" });
+    } else {
+      result3.simples.push({ selector: consumeSimpleSelector(), combinator: "" });
+    }
+    while (true) {
+      skipWhitespace();
+      if (isClauseCombinator()) {
+        result3.simples[result3.simples.length - 1].combinator = tokens[pos++].value;
+        skipWhitespace();
+      } else if (isSelectorClauseEnd()) {
+        break;
+      }
+      result3.simples.push({ combinator: "", selector: consumeSimpleSelector() });
+    }
+    return result3;
+  }
+  function consumeSimpleSelector() {
+    let rawCSSString = "";
+    const functions = [];
+    while (!isSelectorClauseEnd()) {
+      if (isIdent() || isStar()) {
+        rawCSSString += tokens[pos++].toSource();
+      } else if (tokens[pos] instanceof HashToken) {
+        rawCSSString += tokens[pos++].toSource();
+      } else if (tokens[pos] instanceof DelimToken && tokens[pos].value === ".") {
+        pos++;
+        if (isIdent())
+          rawCSSString += "." + tokens[pos++].toSource();
+        else
+          throw unexpected();
+      } else if (tokens[pos] instanceof ColonToken) {
+        pos++;
+        if (isIdent()) {
+          if (!customNames.has(tokens[pos].value.toLowerCase())) {
+            rawCSSString += ":" + tokens[pos++].toSource();
+          } else {
+            const name = tokens[pos++].value.toLowerCase();
+            functions.push({ name, args: [] });
+            names.add(name);
+          }
+        } else if (isFunction2()) {
+          const name = tokens[pos++].value.toLowerCase();
+          if (!customNames.has(name)) {
+            rawCSSString += `:${name}(${consumeBuiltinFunctionArguments()})`;
+          } else {
+            functions.push({ name, args: consumeFunctionArguments() });
+            names.add(name);
+          }
+          skipWhitespace();
+          if (!isCloseParen())
+            throw unexpected();
+          pos++;
+        } else {
+          throw unexpected();
+        }
+      } else if (tokens[pos] instanceof OpenSquareToken) {
+        rawCSSString += "[";
+        pos++;
+        while (!(tokens[pos] instanceof CloseSquareToken) && !isEOF())
+          rawCSSString += tokens[pos++].toSource();
+        if (!(tokens[pos] instanceof CloseSquareToken))
+          throw unexpected();
+        rawCSSString += "]";
+        pos++;
+      } else {
+        throw unexpected();
+      }
+    }
+    if (!rawCSSString && !functions.length)
+      throw unexpected();
+    return { css: rawCSSString || void 0, functions };
+  }
+  function consumeBuiltinFunctionArguments() {
+    let s = "";
+    let balance = 1;
+    while (!isEOF()) {
+      if (isOpenParen() || isFunction2())
+        balance++;
+      if (isCloseParen())
+        balance--;
+      if (!balance)
+        break;
+      s += tokens[pos++].toSource();
+    }
+    return s;
+  }
+  const result2 = consumeFunctionArguments();
+  if (!isEOF())
+    throw unexpected();
+  if (result2.some((arg) => typeof arg !== "object" || !("simples" in arg)))
+    throw new InvalidSelectorError(`Error while parsing css selector "${selector}". Did you mean to CSS.escape it?`);
+  return { selector: result2, names: Array.from(names) };
+}
+function serializeSelector(args) {
+  return args.map((arg) => {
+    if (typeof arg === "string")
+      return `"${arg}"`;
+    if (typeof arg === "number")
+      return String(arg);
+    return arg.simples.map(({ selector, combinator }) => {
+      let s = selector.css || "";
+      s = s + selector.functions.map((func) => `:${func.name}(${serializeSelector(func.args)})`).join("");
+      if (combinator)
+        s += " " + combinator;
+      return s;
+    }).join(" ");
+  }).join(", ");
+}
+var InvalidSelectorError;
+var init_cssParser = __esm({
+  "packages/isomorphic/cssParser.ts"() {
+    "use strict";
+    init_cssTokenizer();
+    InvalidSelectorError = class extends Error {
+    };
+  }
+});
+
+// packages/isomorphic/selectorParser.ts
+function parseSelector(selector) {
+  const parsedStrings = parseSelectorString(selector);
+  const parts = [];
+  for (const part of parsedStrings.parts) {
+    if (part.name === "css" || part.name === "css:light") {
+      if (part.name === "css:light")
+        part.body = ":light(" + part.body + ")";
+      const parsedCSS = parseCSS(part.body, customCSSNames);
+      parts.push({
+        name: "css",
+        body: parsedCSS.selector,
+        source: part.body
+      });
+      continue;
+    }
+    if (kNestedSelectorNames.has(part.name)) {
+      let innerSelector;
+      let distance;
+      try {
+        const unescaped = JSON.parse("[" + part.body + "]");
+        if (!Array.isArray(unescaped) || unescaped.length < 1 || unescaped.length > 2 || typeof unescaped[0] !== "string")
+          throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);
+        innerSelector = unescaped[0];
+        if (unescaped.length === 2) {
+          if (typeof unescaped[1] !== "number" || !kNestedSelectorNamesWithDistance.has(part.name))
+            throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);
+          distance = unescaped[1];
+        }
+      } catch (e) {
+        throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);
+      }
+      const nested = { name: part.name, source: part.body, body: { parsed: parseSelector(innerSelector), distance } };
+      const lastFrame = [...nested.body.parsed.parts].reverse().find((part2) => part2.name === "internal:control" && part2.body === "enter-frame");
+      const lastFrameIndex = lastFrame ? nested.body.parsed.parts.indexOf(lastFrame) : -1;
+      if (lastFrameIndex !== -1 && selectorPartsEqual(nested.body.parsed.parts.slice(0, lastFrameIndex + 1), parts.slice(0, lastFrameIndex + 1)))
+        nested.body.parsed.parts.splice(0, lastFrameIndex + 1);
+      parts.push(nested);
+      continue;
+    }
+    parts.push({ ...part, source: part.body });
+  }
+  if (kNestedSelectorNames.has(parts[0].name))
+    throw new InvalidSelectorError(`"${parts[0].name}" selector cannot be first`);
+  return {
+    capture: parsedStrings.capture,
+    parts
+  };
+}
+function splitSelectorByFrame(selectorText) {
+  const selector = parseSelector(selectorText);
+  const result2 = [];
+  let chunk = {
+    parts: []
+  };
+  let chunkStartIndex = 0;
+  for (let i = 0; i < selector.parts.length; ++i) {
+    const part = selector.parts[i];
+    if (part.name === "internal:control" && part.body === "enter-frame") {
+      if (!chunk.parts.length)
+        throw new InvalidSelectorError("Selector cannot start with entering frame, select the iframe first");
+      result2.push(chunk);
+      chunk = { parts: [] };
+      chunkStartIndex = i + 1;
+      continue;
+    }
+    if (selector.capture === i)
+      chunk.capture = i - chunkStartIndex;
+    chunk.parts.push(part);
+  }
+  if (!chunk.parts.length)
+    throw new InvalidSelectorError(`Selector cannot end with entering frame, while parsing selector ${selectorText}`);
+  result2.push(chunk);
+  if (typeof selector.capture === "number" && typeof result2[result2.length - 1].capture !== "number")
+    throw new InvalidSelectorError(`Can not capture the selector before diving into the frame. Only use * after the last frame has been selected`);
+  return result2;
+}
+function selectorPartsEqual(list1, list2) {
+  return stringifySelector({ parts: list1 }) === stringifySelector({ parts: list2 });
+}
+function stringifySelector(selector, forceEngineName) {
+  if (typeof selector === "string")
+    return selector;
+  return selector.parts.map((p, i) => {
+    let includeEngine = true;
+    if (!forceEngineName && i !== selector.capture) {
+      if (p.name === "css")
+        includeEngine = false;
+      else if (p.name === "xpath" && p.source.startsWith("//") || p.source.startsWith(".."))
+        includeEngine = false;
+    }
+    const prefix = includeEngine ? p.name + "=" : "";
+    return `${i === selector.capture ? "*" : ""}${prefix}${p.source}`;
+  }).join(" >> ");
+}
+function visitAllSelectorParts(selector, visitor) {
+  const visit = (selector2, nested) => {
+    for (const part of selector2.parts) {
+      visitor(part, nested);
+      if (kNestedSelectorNames.has(part.name))
+        visit(part.body.parsed, true);
+    }
+  };
+  visit(selector, false);
+}
+function parseSelectorString(selector) {
+  let index = 0;
+  let quote5;
+  let start3 = 0;
+  const result2 = { parts: [] };
+  const append = () => {
+    const part = selector.substring(start3, index).trim();
+    const eqIndex = part.indexOf("=");
+    let name;
+    let body;
+    if (eqIndex !== -1 && part.substring(0, eqIndex).trim().match(/^[a-zA-Z_0-9-+:*]+$/)) {
+      name = part.substring(0, eqIndex).trim();
+      body = part.substring(eqIndex + 1);
+    } else if (part.length > 1 && part[0] === '"' && part[part.length - 1] === '"') {
+      name = "text";
+      body = part;
+    } else if (part.length > 1 && part[0] === "'" && part[part.length - 1] === "'") {
+      name = "text";
+      body = part;
+    } else if (/^\(*\/\//.test(part) || part.startsWith("..")) {
+      name = "xpath";
+      body = part;
+    } else {
+      name = "css";
+      body = part;
+    }
+    let capture = false;
+    if (name[0] === "*") {
+      capture = true;
+      name = name.substring(1);
+    }
+    result2.parts.push({ name, body });
+    if (capture) {
+      if (result2.capture !== void 0)
+        throw new InvalidSelectorError(`Only one of the selectors can capture using * modifier`);
+      result2.capture = result2.parts.length - 1;
+    }
+  };
+  if (!selector.includes(">>")) {
+    index = selector.length;
+    append();
+    return result2;
+  }
+  const shouldIgnoreTextSelectorQuote = () => {
+    const prefix = selector.substring(start3, index);
+    const match = prefix.match(/^\s*text\s*=(.*)$/);
+    return !!match && !!match[1];
+  };
+  while (index < selector.length) {
+    const c = selector[index];
+    if (c === "\\" && index + 1 < selector.length) {
+      index += 2;
+    } else if (c === quote5) {
+      quote5 = void 0;
+      index++;
+    } else if (!quote5 && (c === '"' || c === "'" || c === "`") && !shouldIgnoreTextSelectorQuote()) {
+      quote5 = c;
+      index++;
+    } else if (!quote5 && c === ">" && selector[index + 1] === ">") {
+      append();
+      index += 2;
+      start3 = index;
+    } else {
+      index++;
+    }
+  }
+  append();
+  return result2;
+}
+function parseAttributeSelector(selector, allowUnquotedStrings) {
+  let wp = 0;
+  let EOL = selector.length === 0;
+  const next = () => selector[wp] || "";
+  const eat1 = () => {
+    const result3 = next();
+    ++wp;
+    EOL = wp >= selector.length;
+    return result3;
+  };
+  const syntaxError = (stage) => {
+    if (EOL)
+      throw new InvalidSelectorError(`Unexpected end of selector while parsing selector \`${selector}\``);
+    throw new InvalidSelectorError(`Error while parsing selector \`${selector}\` - unexpected symbol "${next()}" at position ${wp}` + (stage ? " during " + stage : ""));
+  };
+  function skipSpaces() {
+    while (!EOL && /\s/.test(next()))
+      eat1();
+  }
+  function isCSSNameChar(char) {
+    return char >= "\x80" || char >= "0" && char <= "9" || char >= "A" && char <= "Z" || char >= "a" && char <= "z" || char >= "0" && char <= "9" || char === "_" || char === "-";
+  }
+  function readIdentifier() {
+    let result3 = "";
+    skipSpaces();
+    while (!EOL && isCSSNameChar(next()))
+      result3 += eat1();
+    return result3;
+  }
+  function readQuotedString(quote5) {
+    let result3 = eat1();
+    if (result3 !== quote5)
+      syntaxError("parsing quoted string");
+    while (!EOL && next() !== quote5) {
+      if (next() === "\\")
+        eat1();
+      result3 += eat1();
+    }
+    if (next() !== quote5)
+      syntaxError("parsing quoted string");
+    result3 += eat1();
+    return result3;
+  }
+  function readRegularExpression() {
+    if (eat1() !== "/")
+      syntaxError("parsing regular expression");
+    let source11 = "";
+    let inClass = false;
+    while (!EOL) {
+      if (next() === "\\") {
+        source11 += eat1();
+        if (EOL)
+          syntaxError("parsing regular expression");
+      } else if (inClass && next() === "]") {
+        inClass = false;
+      } else if (!inClass && next() === "[") {
+        inClass = true;
+      } else if (!inClass && next() === "/") {
+        break;
+      }
+      source11 += eat1();
+    }
+    if (eat1() !== "/")
+      syntaxError("parsing regular expression");
+    let flags = "";
+    while (!EOL && next().match(/[dgimsuy]/))
+      flags += eat1();
+    try {
+      return new RegExp(source11, flags);
+    } catch (e) {
+      throw new InvalidSelectorError(`Error while parsing selector \`${selector}\`: ${e.message}`);
+    }
+  }
+  function readAttributeToken() {
+    let token = "";
+    skipSpaces();
+    if (next() === `'` || next() === `"`)
+      token = readQuotedString(next()).slice(1, -1);
+    else
+      token = readIdentifier();
+    if (!token)
+      syntaxError("parsing property path");
+    return token;
+  }
+  function readOperator() {
+    skipSpaces();
+    let op = "";
+    if (!EOL)
+      op += eat1();
+    if (!EOL && op !== "=")
+      op += eat1();
+    if (!["=", "*=", "^=", "$=", "|=", "~="].includes(op))
+      syntaxError("parsing operator");
+    return op;
+  }
+  function readAttribute() {
+    eat1();
+    const jsonPath = [];
+    jsonPath.push(readAttributeToken());
+    skipSpaces();
+    while (next() === ".") {
+      eat1();
+      jsonPath.push(readAttributeToken());
+      skipSpaces();
+    }
+    if (next() === "]") {
+      eat1();
+      return { name: jsonPath.join("."), jsonPath, op: "", value: null, caseSensitive: false };
+    }
+    const operator = readOperator();
+    let value2 = void 0;
+    let caseSensitive = true;
+    skipSpaces();
+    if (next() === "/") {
+      if (operator !== "=")
+        throw new InvalidSelectorError(`Error while parsing selector \`${selector}\` - cannot use ${operator} in attribute with regular expression`);
+      value2 = readRegularExpression();
+    } else if (next() === `'` || next() === `"`) {
+      value2 = readQuotedString(next()).slice(1, -1);
+      skipSpaces();
+      if (next() === "i" || next() === "I") {
+        caseSensitive = false;
+        eat1();
+      } else if (next() === "s" || next() === "S") {
+        caseSensitive = true;
+        eat1();
+      }
+    } else {
+      value2 = "";
+      while (!EOL && (isCSSNameChar(next()) || next() === "+" || next() === "."))
+        value2 += eat1();
+      if (value2 === "true") {
+        value2 = true;
+      } else if (value2 === "false") {
+        value2 = false;
+      } else {
+        if (!allowUnquotedStrings) {
+          value2 = +value2;
+          if (Number.isNaN(value2))
+            syntaxError("parsing attribute value");
+        }
+      }
+    }
+    skipSpaces();
+    if (next() !== "]")
+      syntaxError("parsing attribute value");
+    eat1();
+    if (operator !== "=" && typeof value2 !== "string")
+      throw new InvalidSelectorError(`Error while parsing selector \`${selector}\` - cannot use ${operator} in attribute with non-string matching value - ${value2}`);
+    return { name: jsonPath.join("."), jsonPath, op: operator, value: value2, caseSensitive };
+  }
+  const result2 = {
+    name: "",
+    attributes: []
+  };
+  result2.name = readIdentifier();
+  skipSpaces();
+  while (next() === "[") {
+    result2.attributes.push(readAttribute());
+    skipSpaces();
+  }
+  if (!EOL)
+    syntaxError(void 0);
+  if (!result2.name && !result2.attributes.length)
+    throw new InvalidSelectorError(`Error while parsing selector \`${selector}\` - selector cannot be empty`);
+  return result2;
+}
+var kNestedSelectorNames, kNestedSelectorNamesWithDistance, customCSSNames;
+var init_selectorParser = __esm({
+  "packages/isomorphic/selectorParser.ts"() {
+    "use strict";
+    init_cssParser();
+    init_cssParser();
+    kNestedSelectorNames = /* @__PURE__ */ new Set(["internal:has", "internal:has-not", "internal:and", "internal:or", "internal:chain", "left-of", "right-of", "above", "below", "near"]);
+    kNestedSelectorNamesWithDistance = /* @__PURE__ */ new Set(["left-of", "right-of", "above", "below", "near"]);
+    customCSSNames = /* @__PURE__ */ new Set(["not", "is", "where", "has", "scope", "light", "visible", "text", "text-matches", "text-is", "has-text", "above", "below", "right-of", "left-of", "near", "nth-match"]);
+  }
+});
+
+// packages/isomorphic/locatorGenerators.ts
+function asLocatorDescription(lang, selector) {
+  try {
+    const parsed = parseSelector(selector);
+    const customDescription = parseCustomDescription(parsed);
+    if (customDescription)
+      return customDescription;
+    return innerAsLocators(new generators[lang](), parsed, false, 1)[0];
+  } catch (e) {
+    return selector;
+  }
+}
+function locatorCustomDescription(selector) {
+  try {
+    const parsed = parseSelector(selector);
+    return parseCustomDescription(parsed);
+  } catch (e) {
+    return void 0;
+  }
+}
+function parseCustomDescription(parsed) {
+  const lastPart = parsed.parts[parsed.parts.length - 1];
+  if (lastPart?.name === "internal:describe") {
+    const description = JSON.parse(lastPart.body);
+    if (typeof description === "string")
+      return description;
+  }
+  return void 0;
+}
+function asLocator(lang, selector, isFrameLocator = false) {
+  return asLocators(lang, selector, isFrameLocator, 1)[0];
+}
+function asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, preferredQuote) {
+  try {
+    return innerAsLocators(new generators[lang](preferredQuote), parseSelector(selector), isFrameLocator, maxOutputSize);
+  } catch (e) {
+    return [selector];
+  }
+}
+function innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) {
+  const parts = [...parsed.parts];
+  const tokens = [];
+  let nextBase = isFrameLocator ? "frame-locator" : "page";
+  for (let index = 0; index < parts.length; index++) {
+    const part = parts[index];
+    const base = nextBase;
+    nextBase = "locator";
+    if (part.name === "internal:describe")
+      continue;
+    if (part.name === "nth") {
+      if (part.body === "0")
+        tokens.push([factory.generateLocator(base, "first", ""), factory.generateLocator(base, "nth", "0")]);
+      else if (part.body === "-1")
+        tokens.push([factory.generateLocator(base, "last", ""), factory.generateLocator(base, "nth", "-1")]);
+      else
+        tokens.push([factory.generateLocator(base, "nth", part.body)]);
+      continue;
+    }
+    if (part.name === "visible") {
+      tokens.push([factory.generateLocator(base, "visible", part.body), factory.generateLocator(base, "default", `visible=${part.body}`)]);
+      continue;
+    }
+    if (part.name === "internal:text") {
+      const { exact, text: text2 } = detectExact(part.body);
+      tokens.push([factory.generateLocator(base, "text", text2, { exact })]);
+      continue;
+    }
+    if (part.name === "internal:has-text") {
+      const { exact, text: text2 } = detectExact(part.body);
+      if (!exact) {
+        tokens.push([factory.generateLocator(base, "has-text", text2, { exact })]);
+        continue;
+      }
+    }
+    if (part.name === "internal:has-not-text") {
+      const { exact, text: text2 } = detectExact(part.body);
+      if (!exact) {
+        tokens.push([factory.generateLocator(base, "has-not-text", text2, { exact })]);
+        continue;
+      }
+    }
+    if (part.name === "internal:has") {
+      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
+      tokens.push(inners.map((inner) => factory.generateLocator(base, "has", inner)));
+      continue;
+    }
+    if (part.name === "internal:has-not") {
+      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
+      tokens.push(inners.map((inner) => factory.generateLocator(base, "hasNot", inner)));
+      continue;
+    }
+    if (part.name === "internal:and") {
+      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
+      tokens.push(inners.map((inner) => factory.generateLocator(base, "and", inner)));
+      continue;
+    }
+    if (part.name === "internal:or") {
+      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
+      tokens.push(inners.map((inner) => factory.generateLocator(base, "or", inner)));
+      continue;
+    }
+    if (part.name === "internal:chain") {
+      const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);
+      tokens.push(inners.map((inner) => factory.generateLocator(base, "chain", inner)));
+      continue;
+    }
+    if (part.name === "internal:label") {
+      const { exact, text: text2 } = detectExact(part.body);
+      tokens.push([factory.generateLocator(base, "label", text2, { exact })]);
+      continue;
+    }
+    if (part.name === "internal:role") {
+      const attrSelector = parseAttributeSelector(part.body, true);
+      const options = { attrs: [] };
+      for (const attr of attrSelector.attributes) {
+        if (attr.name === "name") {
+          if (options.exact !== void 0 && options.exact !== attr.caseSensitive)
+            throw new Error(`Conflicting exactness in internal:role selector: ${stringifySelector({ parts: [part] })}`);
+          options.exact = attr.caseSensitive;
+          options.name = attr.value;
+        } else if (attr.name === "description") {
+          if (options.exact !== void 0 && options.exact !== attr.caseSensitive)
+            throw new Error(`Conflicting exactness in internal:role selector: ${stringifySelector({ parts: [part] })}`);
+          options.exact = attr.caseSensitive;
+          options.description = attr.value;
+        } else {
+          if (attr.name === "level" && typeof attr.value === "string")
+            attr.value = +attr.value;
+          options.attrs.push({ name: attr.name === "include-hidden" ? "includeHidden" : attr.name, value: attr.value });
+        }
+      }
+      tokens.push([factory.generateLocator(base, "role", attrSelector.name, options)]);
+      continue;
+    }
+    if (part.name === "internal:testid") {
+      const attrSelector = parseAttributeSelector(part.body, true);
+      const { value: value2 } = attrSelector.attributes[0];
+      tokens.push([factory.generateLocator(base, "test-id", value2)]);
+      continue;
+    }
+    if (part.name === "internal:attr") {
+      const attrSelector = parseAttributeSelector(part.body, true);
+      const { name, value: value2, caseSensitive } = attrSelector.attributes[0];
+      const text2 = value2;
+      const exact = !!caseSensitive;
+      if (name === "placeholder") {
+        tokens.push([factory.generateLocator(base, "placeholder", text2, { exact })]);
+        continue;
+      }
+      if (name === "alt") {
+        tokens.push([factory.generateLocator(base, "alt", text2, { exact })]);
+        continue;
+      }
+      if (name === "title") {
+        tokens.push([factory.generateLocator(base, "title", text2, { exact })]);
+        continue;
+      }
+    }
+    if (part.name === "internal:control" && part.body === "enter-frame") {
+      const lastTokens = tokens[tokens.length - 1];
+      const lastPart = parts[index - 1];
+      const transformed = lastTokens.map((token) => factory.chainLocators([token, factory.generateLocator(base, "frame", "")]));
+      if (["xpath", "css"].includes(lastPart.name)) {
+        transformed.push(
+          factory.generateLocator(base, "frame-locator", stringifySelector({ parts: [lastPart] })),
+          factory.generateLocator(base, "frame-locator", stringifySelector({ parts: [lastPart] }, true))
+        );
+      }
+      lastTokens.splice(0, lastTokens.length, ...transformed);
+      nextBase = "frame-locator";
+      continue;
+    }
+    const nextPart = parts[index + 1];
+    const selectorPart = stringifySelector({ parts: [part] });
+    const locatorPart = factory.generateLocator(base, "default", selectorPart);
+    if (nextPart && ["internal:has-text", "internal:has-not-text"].includes(nextPart.name)) {
+      const { exact, text: text2 } = detectExact(nextPart.body);
+      if (!exact) {
+        const nextLocatorPart = factory.generateLocator("locator", nextPart.name === "internal:has-text" ? "has-text" : "has-not-text", text2, { exact });
+        const options = {};
+        if (nextPart.name === "internal:has-text")
+          options.hasText = text2;
+        else
+          options.hasNotText = text2;
+        const combinedPart = factory.generateLocator(base, "default", selectorPart, options);
+        tokens.push([factory.chainLocators([locatorPart, nextLocatorPart]), combinedPart]);
+        index++;
+        continue;
+      }
+    }
+    let locatorPartWithEngine;
+    if (["xpath", "css"].includes(part.name)) {
+      const selectorPart2 = stringifySelector(
+        { parts: [part] },
+        /* forceEngineName */
+        true
+      );
+      locatorPartWithEngine = factory.generateLocator(base, "default", selectorPart2);
+    }
+    tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean));
+  }
+  return combineTokens(factory, tokens, maxOutputSize);
+}
+function combineTokens(factory, tokens, maxOutputSize) {
+  const currentTokens = tokens.map(() => "");
+  const result2 = [];
+  const visit = (index) => {
+    if (index === tokens.length) {
+      result2.push(factory.chainLocators(currentTokens));
+      return result2.length < maxOutputSize;
+    }
+    for (const taken of tokens[index]) {
+      currentTokens[index] = taken;
+      if (!visit(index + 1))
+        return false;
+    }
+    return true;
+  };
+  visit(0);
+  return result2;
+}
+function detectExact(text2) {
+  let exact = false;
+  const match = text2.match(/^\/(.*)\/([igm]*)$/);
+  if (match)
+    return { text: new RegExp(match[1], match[2]) };
+  if (text2.endsWith('"')) {
+    text2 = JSON.parse(text2);
+    exact = true;
+  } else if (text2.endsWith('"s')) {
+    text2 = JSON.parse(text2.substring(0, text2.length - 1));
+    exact = true;
+  } else if (text2.endsWith('"i')) {
+    text2 = JSON.parse(text2.substring(0, text2.length - 1));
+    exact = false;
+  }
+  return { exact, text: text2 };
+}
+function isRegExp2(obj) {
+  return obj instanceof RegExp;
+}
+var JavaScriptLocatorFactory, PythonLocatorFactory, JavaLocatorFactory, CSharpLocatorFactory, JsonlLocatorFactory, generators;
+var init_locatorGenerators = __esm({
+  "packages/isomorphic/locatorGenerators.ts"() {
+    "use strict";
+    init_selectorParser();
+    init_stringUtils();
+    JavaScriptLocatorFactory = class {
+      constructor(preferredQuote) {
+        this.preferredQuote = preferredQuote;
+      }
+      generateLocator(base, kind, body, options = {}) {
+        switch (kind) {
+          case "default":
+            if (options.hasText !== void 0)
+              return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`;
+            if (options.hasNotText !== void 0)
+              return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`;
+            return `locator(${this.quote(body)})`;
+          case "frame-locator":
+            return `frameLocator(${this.quote(body)})`;
+          case "frame":
+            return `contentFrame()`;
+          case "nth":
+            return `nth(${body})`;
+          case "first":
+            return `first()`;
+          case "last":
+            return `last()`;
+          case "visible":
+            return `filter({ visible: ${body === "true" ? "true" : "false"} })`;
+          case "role":
+            const attrs = [];
+            if (isRegExp2(options.name))
+              attrs.push(`name: ${this.regexToSourceString(options.name)}`);
+            else if (typeof options.name === "string")
+              attrs.push(`name: ${this.quote(options.name)}`);
+            if (isRegExp2(options.description))
+              attrs.push(`description: ${this.regexToSourceString(options.description)}`);
+            else if (typeof options.description === "string")
+              attrs.push(`description: ${this.quote(options.description)}`);
+            if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))
+              attrs.push(`exact: true`);
+            for (const { name, value: value2 } of options.attrs)
+              attrs.push(`${name}: ${typeof value2 === "string" ? this.quote(value2) : value2}`);
+            const attrString = attrs.length ? `, { ${attrs.join(", ")} }` : "";
+            return `getByRole(${this.quote(body)}${attrString})`;
+          case "has-text":
+            return `filter({ hasText: ${this.toHasText(body)} })`;
+          case "has-not-text":
+            return `filter({ hasNotText: ${this.toHasText(body)} })`;
+          case "has":
+            return `filter({ has: ${body} })`;
+          case "hasNot":
+            return `filter({ hasNot: ${body} })`;
+          case "and":
+            return `and(${body})`;
+          case "or":
+            return `or(${body})`;
+          case "chain":
+            return `locator(${body})`;
+          case "test-id":
+            return `getByTestId(${this.toTestIdValue(body)})`;
+          case "text":
+            return this.toCallWithExact("getByText", body, !!options.exact);
+          case "alt":
+            return this.toCallWithExact("getByAltText", body, !!options.exact);
+          case "placeholder":
+            return this.toCallWithExact("getByPlaceholder", body, !!options.exact);
+          case "label":
+            return this.toCallWithExact("getByLabel", body, !!options.exact);
+          case "title":
+            return this.toCallWithExact("getByTitle", body, !!options.exact);
+          default:
+            throw new Error("Unknown selector kind " + kind);
+        }
+      }
+      chainLocators(locators) {
+        return locators.join(".");
+      }
+      regexToSourceString(re2) {
+        return normalizeEscapedRegexQuotes(String(re2));
+      }
+      toCallWithExact(method, body, exact) {
+        if (isRegExp2(body))
+          return `${method}(${this.regexToSourceString(body)})`;
+        return exact ? `${method}(${this.quote(body)}, { exact: true })` : `${method}(${this.quote(body)})`;
+      }
+      toHasText(body) {
+        if (isRegExp2(body))
+          return this.regexToSourceString(body);
+        return this.quote(body);
+      }
+      toTestIdValue(value2) {
+        if (isRegExp2(value2))
+          return this.regexToSourceString(value2);
+        return this.quote(value2);
+      }
+      quote(text2) {
+        return escapeWithQuotes(text2, this.preferredQuote ?? "'");
+      }
+    };
+    PythonLocatorFactory = class {
+      generateLocator(base, kind, body, options = {}) {
+        switch (kind) {
+          case "default":
+            if (options.hasText !== void 0)
+              return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`;
+            if (options.hasNotText !== void 0)
+              return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`;
+            return `locator(${this.quote(body)})`;
+          case "frame-locator":
+            return `frame_locator(${this.quote(body)})`;
+          case "frame":
+            return `content_frame`;
+          case "nth":
+            return `nth(${body})`;
+          case "first":
+            return `first`;
+          case "last":
+            return `last`;
+          case "visible":
+            return `filter(visible=${body === "true" ? "True" : "False"})`;
+          case "role":
+            const attrs = [];
+            if (isRegExp2(options.name))
+              attrs.push(`name=${this.regexToString(options.name)}`);
+            else if (typeof options.name === "string")
+              attrs.push(`name=${this.quote(options.name)}`);
+            if (isRegExp2(options.description))
+              attrs.push(`description=${this.regexToString(options.description)}`);
+            else if (typeof options.description === "string")
+              attrs.push(`description=${this.quote(options.description)}`);
+            if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))
+              attrs.push(`exact=True`);
+            for (const { name, value: value2 } of options.attrs) {
+              let valueString = typeof value2 === "string" ? this.quote(value2) : value2;
+              if (typeof value2 === "boolean")
+                valueString = value2 ? "True" : "False";
+              attrs.push(`${toSnakeCase(name)}=${valueString}`);
+            }
+            const attrString = attrs.length ? `, ${attrs.join(", ")}` : "";
+            return `get_by_role(${this.quote(body)}${attrString})`;
+          case "has-text":
+            return `filter(has_text=${this.toHasText(body)})`;
+          case "has-not-text":
+            return `filter(has_not_text=${this.toHasText(body)})`;
+          case "has":
+            return `filter(has=${body})`;
+          case "hasNot":
+            return `filter(has_not=${body})`;
+          case "and":
+            return `and_(${body})`;
+          case "or":
+            return `or_(${body})`;
+          case "chain":
+            return `locator(${body})`;
+          case "test-id":
+            return `get_by_test_id(${this.toTestIdValue(body)})`;
+          case "text":
+            return this.toCallWithExact("get_by_text", body, !!options.exact);
+          case "alt":
+            return this.toCallWithExact("get_by_alt_text", body, !!options.exact);
+          case "placeholder":
+            return this.toCallWithExact("get_by_placeholder", body, !!options.exact);
+          case "label":
+            return this.toCallWithExact("get_by_label", body, !!options.exact);
+          case "title":
+            return this.toCallWithExact("get_by_title", body, !!options.exact);
+          default:
+            throw new Error("Unknown selector kind " + kind);
+        }
+      }
+      chainLocators(locators) {
+        return locators.join(".");
+      }
+      regexToString(body) {
+        const suffix = body.flags.includes("i") ? ", re.IGNORECASE" : "";
+        return `re.compile(r"${normalizeEscapedRegexQuotes(body.source).replace(/\\\//, "/").replace(/"/g, '\\"')}"${suffix})`;
+      }
+      toCallWithExact(method, body, exact) {
+        if (isRegExp2(body))
+          return `${method}(${this.regexToString(body)})`;
+        if (exact)
+          return `${method}(${this.quote(body)}, exact=True)`;
+        return `${method}(${this.quote(body)})`;
+      }
+      toHasText(body) {
+        if (isRegExp2(body))
+          return this.regexToString(body);
+        return `${this.quote(body)}`;
+      }
+      toTestIdValue(value2) {
+        if (isRegExp2(value2))
+          return this.regexToString(value2);
+        return this.quote(value2);
+      }
+      quote(text2) {
+        return escapeWithQuotes(text2, '"');
+      }
+    };
+    JavaLocatorFactory = class {
+      generateLocator(base, kind, body, options = {}) {
+        let clazz;
+        switch (base) {
+          case "page":
+            clazz = "Page";
+            break;
+          case "frame-locator":
+            clazz = "FrameLocator";
+            break;
+          case "locator":
+            clazz = "Locator";
+            break;
+        }
+        switch (kind) {
+          case "default":
+            if (options.hasText !== void 0)
+              return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`;
+            if (options.hasNotText !== void 0)
+              return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`;
+            return `locator(${this.quote(body)})`;
+          case "frame-locator":
+            return `frameLocator(${this.quote(body)})`;
+          case "frame":
+            return `contentFrame()`;
+          case "nth":
+            return `nth(${body})`;
+          case "first":
+            return `first()`;
+          case "last":
+            return `last()`;
+          case "visible":
+            return `filter(new ${clazz}.FilterOptions().setVisible(${body === "true" ? "true" : "false"}))`;
+          case "role":
+            const attrs = [];
+            if (isRegExp2(options.name))
+              attrs.push(`.setName(${this.regexToString(options.name)})`);
+            else if (typeof options.name === "string")
+              attrs.push(`.setName(${this.quote(options.name)})`);
+            if (isRegExp2(options.description))
+              attrs.push(`.setDescription(${this.regexToString(options.description)})`);
+            else if (typeof options.description === "string")
+              attrs.push(`.setDescription(${this.quote(options.description)})`);
+            if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))
+              attrs.push(`.setExact(true)`);
+            for (const { name, value: value2 } of options.attrs)
+              attrs.push(`.set${toTitleCase(name)}(${typeof value2 === "string" ? this.quote(value2) : value2})`);
+            const attrString = attrs.length ? `, new ${clazz}.GetByRoleOptions()${attrs.join("")}` : "";
+            return `getByRole(AriaRole.${toSnakeCase(body).toUpperCase()}${attrString})`;
+          case "has-text":
+            return `filter(new ${clazz}.FilterOptions().setHasText(${this.toHasText(body)}))`;
+          case "has-not-text":
+            return `filter(new ${clazz}.FilterOptions().setHasNotText(${this.toHasText(body)}))`;
+          case "has":
+            return `filter(new ${clazz}.FilterOptions().setHas(${body}))`;
+          case "hasNot":
+            return `filter(new ${clazz}.FilterOptions().setHasNot(${body}))`;
+          case "and":
+            return `and(${body})`;
+          case "or":
+            return `or(${body})`;
+          case "chain":
+            return `locator(${body})`;
+          case "test-id":
+            return `getByTestId(${this.toTestIdValue(body)})`;
+          case "text":
+            return this.toCallWithExact(clazz, "getByText", body, !!options.exact);
+          case "alt":
+            return this.toCallWithExact(clazz, "getByAltText", body, !!options.exact);
+          case "placeholder":
+            return this.toCallWithExact(clazz, "getByPlaceholder", body, !!options.exact);
+          case "label":
+            return this.toCallWithExact(clazz, "getByLabel", body, !!options.exact);
+          case "title":
+            return this.toCallWithExact(clazz, "getByTitle", body, !!options.exact);
+          default:
+            throw new Error("Unknown selector kind " + kind);
+        }
+      }
+      chainLocators(locators) {
+        return locators.join(".");
+      }
+      regexToString(body) {
+        const suffix = body.flags.includes("i") ? ", Pattern.CASE_INSENSITIVE" : "";
+        return `Pattern.compile(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;
+      }
+      toCallWithExact(clazz, method, body, exact) {
+        if (isRegExp2(body))
+          return `${method}(${this.regexToString(body)})`;
+        if (exact)
+          return `${method}(${this.quote(body)}, new ${clazz}.${toTitleCase(method)}Options().setExact(true))`;
+        return `${method}(${this.quote(body)})`;
+      }
+      toHasText(body) {
+        if (isRegExp2(body))
+          return this.regexToString(body);
+        return this.quote(body);
+      }
+      toTestIdValue(value2) {
+        if (isRegExp2(value2))
+          return this.regexToString(value2);
+        return this.quote(value2);
+      }
+      quote(text2) {
+        return escapeWithQuotes(text2, '"');
+      }
+    };
+    CSharpLocatorFactory = class {
+      generateLocator(base, kind, body, options = {}) {
+        switch (kind) {
+          case "default":
+            if (options.hasText !== void 0)
+              return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`;
+            if (options.hasNotText !== void 0)
+              return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`;
+            return `Locator(${this.quote(body)})`;
+          case "frame-locator":
+            return `FrameLocator(${this.quote(body)})`;
+          case "frame":
+            return `ContentFrame`;
+          case "nth":
+            return `Nth(${body})`;
+          case "first":
+            return `First`;
+          case "last":
+            return `Last`;
+          case "visible":
+            return `Filter(new() { Visible = ${body === "true" ? "true" : "false"} })`;
+          case "role":
+            const attrs = [];
+            if (isRegExp2(options.name))
+              attrs.push(`NameRegex = ${this.regexToString(options.name)}`);
+            else if (typeof options.name === "string")
+              attrs.push(`Name = ${this.quote(options.name)}`);
+            if (isRegExp2(options.description))
+              attrs.push(`DescriptionRegex = ${this.regexToString(options.description)}`);
+            else if (typeof options.description === "string")
+              attrs.push(`Description = ${this.quote(options.description)}`);
+            if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))
+              attrs.push(`Exact = true`);
+            for (const { name, value: value2 } of options.attrs)
+              attrs.push(`${toTitleCase(name)} = ${typeof value2 === "string" ? this.quote(value2) : value2}`);
+            const attrString = attrs.length ? `, new() { ${attrs.join(", ")} }` : "";
+            return `GetByRole(AriaRole.${toTitleCase(body)}${attrString})`;
+          case "has-text":
+            return `Filter(new() { ${this.toHasText(body)} })`;
+          case "has-not-text":
+            return `Filter(new() { ${this.toHasNotText(body)} })`;
+          case "has":
+            return `Filter(new() { Has = ${body} })`;
+          case "hasNot":
+            return `Filter(new() { HasNot = ${body} })`;
+          case "and":
+            return `And(${body})`;
+          case "or":
+            return `Or(${body})`;
+          case "chain":
+            return `Locator(${body})`;
+          case "test-id":
+            return `GetByTestId(${this.toTestIdValue(body)})`;
+          case "text":
+            return this.toCallWithExact("GetByText", body, !!options.exact);
+          case "alt":
+            return this.toCallWithExact("GetByAltText", body, !!options.exact);
+          case "placeholder":
+            return this.toCallWithExact("GetByPlaceholder", body, !!options.exact);
+          case "label":
+            return this.toCallWithExact("GetByLabel", body, !!options.exact);
+          case "title":
+            return this.toCallWithExact("GetByTitle", body, !!options.exact);
+          default:
+            throw new Error("Unknown selector kind " + kind);
+        }
+      }
+      chainLocators(locators) {
+        return locators.join(".");
+      }
+      regexToString(body) {
+        const suffix = body.flags.includes("i") ? ", RegexOptions.IgnoreCase" : "";
+        return `new Regex(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;
+      }
+      toCallWithExact(method, body, exact) {
+        if (isRegExp2(body))
+          return `${method}(${this.regexToString(body)})`;
+        if (exact)
+          return `${method}(${this.quote(body)}, new() { Exact = true })`;
+        return `${method}(${this.quote(body)})`;
+      }
+      toHasText(body) {
+        if (isRegExp2(body))
+          return `HasTextRegex = ${this.regexToString(body)}`;
+        return `HasText = ${this.quote(body)}`;
+      }
+      toTestIdValue(value2) {
+        if (isRegExp2(value2))
+          return this.regexToString(value2);
+        return this.quote(value2);
+      }
+      toHasNotText(body) {
+        if (isRegExp2(body))
+          return `HasNotTextRegex = ${this.regexToString(body)}`;
+        return `HasNotText = ${this.quote(body)}`;
+      }
+      quote(text2) {
+        return escapeWithQuotes(text2, '"');
+      }
+    };
+    JsonlLocatorFactory = class {
+      generateLocator(base, kind, body, options = {}) {
+        return JSON.stringify({
+          kind,
+          body,
+          options
+        });
+      }
+      chainLocators(locators) {
+        const objects = locators.map((l) => JSON.parse(l));
+        for (let i = 0; i < objects.length - 1; ++i)
+          objects[i].next = objects[i + 1];
+        return JSON.stringify(objects[0]);
+      }
+    };
+    generators = {
+      javascript: JavaScriptLocatorFactory,
+      python: PythonLocatorFactory,
+      java: JavaLocatorFactory,
+      csharp: CSharpLocatorFactory,
+      jsonl: JsonlLocatorFactory
+    };
+  }
+});
+
+// packages/isomorphic/stackTrace.ts
+function captureRawStack() {
+  const stackTraceLimit = Error.stackTraceLimit;
+  Error.stackTraceLimit = 50;
+  const error = new Error();
+  const stack = error.stack || "";
+  Error.stackTraceLimit = stackTraceLimit;
+  return stack.split("\n");
+}
+function parseStackFrame(text2, pathSeparator, showInternalStackFrames) {
+  const match = text2 && text2.match(re);
+  if (!match)
+    return null;
+  let fname = match[2];
+  let file = match[7];
+  if (!file)
+    return null;
+  if (!showInternalStackFrames && (file.startsWith("internal") || file.startsWith("node:")))
+    return null;
+  const line = match[8];
+  const column = match[9];
+  const closeParen = match[11] === ")";
+  const frame = {
+    file: "",
+    line: 0,
+    column: 0
+  };
+  if (line)
+    frame.line = Number(line);
+  if (column)
+    frame.column = Number(column);
+  if (closeParen && file) {
+    let closes = 0;
+    for (let i = file.length - 1; i > 0; i--) {
+      if (file.charAt(i) === ")") {
+        closes++;
+      } else if (file.charAt(i) === "(" && file.charAt(i - 1) === " ") {
+        closes--;
+        if (closes === -1 && file.charAt(i - 1) === " ") {
+          const before = file.slice(0, i - 1);
+          const after = file.slice(i + 1);
+          file = after;
+          fname += ` (${before}`;
+          break;
+        }
+      }
+    }
+  }
+  if (fname) {
+    const methodMatch = fname.match(methodRe);
+    if (methodMatch)
+      fname = methodMatch[1];
+  }
+  if (file) {
+    if (file.startsWith("file://"))
+      file = fileURLToPath(file, pathSeparator);
+    frame.file = file;
+  }
+  if (fname)
+    frame.function = fname;
+  return frame;
+}
+function rewriteErrorMessage(e, newMessage) {
+  const lines = (e.stack?.split("\n") || []).filter((l) => l.startsWith("    at "));
+  e.message = newMessage;
+  const errorTitle = `${e.name}: ${e.message}`;
+  if (lines.length)
+    e.stack = `${errorTitle}
+${lines.join("\n")}`;
+  return e;
+}
+function stringifyStackFrames(frames) {
+  const stackLines = [];
+  for (const frame of frames) {
+    if (frame.function)
+      stackLines.push(`    at ${frame.function} (${frame.file}:${frame.line}:${frame.column})`);
+    else
+      stackLines.push(`    at ${frame.file}:${frame.line}:${frame.column}`);
+  }
+  return stackLines;
+}
+function splitErrorMessage(message) {
+  const separationIdx = message.indexOf(":");
+  return {
+    name: separationIdx !== -1 ? message.slice(0, separationIdx) : "",
+    message: separationIdx !== -1 && separationIdx + 2 <= message.length ? message.substring(separationIdx + 2) : message
+  };
+}
+function parseErrorStack(stack, pathSeparator, showInternalStackFrames = false) {
+  const lines = stack.split("\n");
+  let firstStackLine = lines.findIndex((line) => line.startsWith("    at "));
+  if (firstStackLine === -1)
+    firstStackLine = lines.length;
+  const message = lines.slice(0, firstStackLine).join("\n");
+  const stackLines = lines.slice(firstStackLine);
+  let location2;
+  for (const line of stackLines) {
+    const frame = parseStackFrame(line, pathSeparator, showInternalStackFrames);
+    if (!frame || !frame.file)
+      continue;
+    if (belongsToNodeModules(frame.file, pathSeparator))
+      continue;
+    location2 = { file: frame.file, column: frame.column || 0, line: frame.line || 0 };
+    break;
+  }
+  return { message, stackLines, location: location2 };
+}
+function belongsToNodeModules(file, pathSeparator) {
+  return file.includes(`${pathSeparator}node_modules${pathSeparator}`);
+}
+function fileURLToPath(fileUrl, pathSeparator) {
+  if (!fileUrl.startsWith("file://"))
+    return fileUrl;
+  let path59 = decodeURIComponent(fileUrl.slice(7));
+  if (path59.startsWith("/") && /^[a-zA-Z]:/.test(path59.slice(1)))
+    path59 = path59.slice(1);
+  return path59.replace(/\//g, pathSeparator);
+}
+var re, methodRe;
+var init_stackTrace = __esm({
+  "packages/isomorphic/stackTrace.ts"() {
+    "use strict";
+    re = new RegExp(
+      "^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"
+    );
+    methodRe = /^(.*?) \[as (.*?)\]$/;
+  }
+});
+
+// packages/isomorphic/manualPromise.ts
+function signalToPromise(signal) {
+  if (signal.aborted)
+    return { promise: Promise.resolve(), dispose: () => {
+    } };
+  let dispose;
+  const promise = new Promise((resolve) => {
+    const onAbort = () => resolve();
+    signal.addEventListener("abort", onAbort, { once: true });
+    dispose = () => signal.removeEventListener("abort", onAbort);
+  });
+  return { promise, dispose };
+}
+function cloneError(error, frames) {
+  const clone = new Error();
+  clone.name = error.name;
+  clone.message = error.message;
+  clone.stack = [error.name + ":" + error.message, ...frames].join("\n");
+  return clone;
+}
+var ManualPromise, LongStandingScope;
+var init_manualPromise = __esm({
+  "packages/isomorphic/manualPromise.ts"() {
+    "use strict";
+    init_stackTrace();
+    ManualPromise = class extends Promise {
+      constructor() {
+        let resolve;
+        let reject;
+        super((f, r) => {
+          resolve = f;
+          reject = r;
+        });
+        this._isDone = false;
+        this._resolve = resolve;
+        this._reject = reject;
+      }
+      isDone() {
+        return this._isDone;
+      }
+      resolve(t) {
+        this._isDone = true;
+        this._resolve(t);
+      }
+      reject(e) {
+        this._isDone = true;
+        this._reject(e);
+      }
+      static get [Symbol.species]() {
+        return Promise;
+      }
+      get [Symbol.toStringTag]() {
+        return "ManualPromise";
+      }
+    };
+    LongStandingScope = class {
+      constructor() {
+        this._terminatePromises = /* @__PURE__ */ new Map();
+        this._isClosed = false;
+      }
+      reject(error) {
+        this._isClosed = true;
+        this._terminateError = error;
+        for (const p of this._terminatePromises.keys())
+          p.resolve(error);
+      }
+      close(error) {
+        this._isClosed = true;
+        this._closeError = error;
+        for (const [p, frames] of this._terminatePromises)
+          p.resolve(cloneError(error, frames));
+      }
+      isClosed() {
+        return this._isClosed;
+      }
+      static async raceMultiple(scopes, promise) {
+        return Promise.race(scopes.map((s) => s.race(promise)));
+      }
+      async race(promise) {
+        return this._race(Array.isArray(promise) ? promise : [promise], false);
+      }
+      async safeRace(promise, defaultValue) {
+        return this._race([promise], true, defaultValue);
+      }
+      async _race(promises, safe, defaultValue) {
+        const terminatePromise = new ManualPromise();
+        const frames = captureRawStack();
+        if (this._terminateError)
+          terminatePromise.resolve(this._terminateError);
+        if (this._closeError)
+          terminatePromise.resolve(cloneError(this._closeError, frames));
+        this._terminatePromises.set(terminatePromise, frames);
+        try {
+          return await Promise.race([
+            terminatePromise.then((e) => safe ? defaultValue : Promise.reject(e)),
+            ...promises
+          ]);
+        } finally {
+          this._terminatePromises.delete(terminatePromise);
+        }
+      }
+    };
+  }
+});
+
+// packages/isomorphic/mimeType.ts
+function isJsonMimeType(mimeType) {
+  return !!mimeType.match(/^(application\/json|application\/.*?\+json|text\/(x-)?json)(;\s*charset=.*)?$/);
+}
+function isXmlMimeType(mimeType) {
+  return !!mimeType.match(/^(application\/xml|application\/.*?\+xml|text\/xml)(;\s*charset=.*)?$/);
+}
+function isTextualMimeType(mimeType) {
+  return !!mimeType.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/);
+}
+function getMimeTypeForPath(path59) {
+  const dotIndex = path59.lastIndexOf(".");
+  if (dotIndex === -1)
+    return null;
+  const extension = path59.substring(dotIndex + 1);
+  return types.get(extension) || null;
+}
+function getExtensionForMimeType(contentType) {
+  const subtype = (contentType ?? "").split(";")[0].split("/")[1]?.trim().toLowerCase() ?? "";
+  if (!subtype)
+    return "bin";
+  const tail = subtype.includes("+") ? subtype.split("+").pop() : subtype;
+  if (tail === "plain")
+    return "txt";
+  if (tail === "javascript" || tail === "ecmascript")
+    return "js";
+  if (tail === "jpeg")
+    return "jpg";
+  return tail.replace(/[^a-z0-9]/g, "") || "bin";
+}
+var types;
+var init_mimeType = __esm({
+  "packages/isomorphic/mimeType.ts"() {
+    "use strict";
+    types = /* @__PURE__ */ new Map([
+      ["ez", "application/andrew-inset"],
+      ["aw", "application/applixware"],
+      ["atom", "application/atom+xml"],
+      ["atomcat", "application/atomcat+xml"],
+      ["atomdeleted", "application/atomdeleted+xml"],
+      ["atomsvc", "application/atomsvc+xml"],
+      ["dwd", "application/atsc-dwd+xml"],
+      ["held", "application/atsc-held+xml"],
+      ["rsat", "application/atsc-rsat+xml"],
+      ["bdoc", "application/bdoc"],
+      ["xcs", "application/calendar+xml"],
+      ["ccxml", "application/ccxml+xml"],
+      ["cdfx", "application/cdfx+xml"],
+      ["cdmia", "application/cdmi-capability"],
+      ["cdmic", "application/cdmi-container"],
+      ["cdmid", "application/cdmi-domain"],
+      ["cdmio", "application/cdmi-object"],
+      ["cdmiq", "application/cdmi-queue"],
+      ["cu", "application/cu-seeme"],
+      ["mpd", "application/dash+xml"],
+      ["davmount", "application/davmount+xml"],
+      ["dbk", "application/docbook+xml"],
+      ["dssc", "application/dssc+der"],
+      ["xdssc", "application/dssc+xml"],
+      ["ecma", "application/ecmascript"],
+      ["es", "application/ecmascript"],
+      ["emma", "application/emma+xml"],
+      ["emotionml", "application/emotionml+xml"],
+      ["epub", "application/epub+zip"],
+      ["exi", "application/exi"],
+      ["exp", "application/express"],
+      ["fdt", "application/fdt+xml"],
+      ["pfr", "application/font-tdpfr"],
+      ["geojson", "application/geo+json"],
+      ["gml", "application/gml+xml"],
+      ["gpx", "application/gpx+xml"],
+      ["gxf", "application/gxf"],
+      ["gz", "application/gzip"],
+      ["hjson", "application/hjson"],
+      ["stk", "application/hyperstudio"],
+      ["ink", "application/inkml+xml"],
+      ["inkml", "application/inkml+xml"],
+      ["ipfix", "application/ipfix"],
+      ["its", "application/its+xml"],
+      ["ear", "application/java-archive"],
+      ["jar", "application/java-archive"],
+      ["war", "application/java-archive"],
+      ["ser", "application/java-serialized-object"],
+      ["class", "application/java-vm"],
+      ["js", "application/javascript"],
+      ["mjs", "application/javascript"],
+      ["json", "application/json"],
+      ["map", "application/json"],
+      ["json5", "application/json5"],
+      ["jsonml", "application/jsonml+json"],
+      ["jsonld", "application/ld+json"],
+      ["lgr", "application/lgr+xml"],
+      ["lostxml", "application/lost+xml"],
+      ["hqx", "application/mac-binhex40"],
+      ["cpt", "application/mac-compactpro"],
+      ["mads", "application/mads+xml"],
+      ["webmanifest", "application/manifest+json"],
+      ["mrc", "application/marc"],
+      ["mrcx", "application/marcxml+xml"],
+      ["ma", "application/mathematica"],
+      ["mb", "application/mathematica"],
+      ["nb", "application/mathematica"],
+      ["mathml", "application/mathml+xml"],
+      ["mbox", "application/mbox"],
+      ["mscml", "application/mediaservercontrol+xml"],
+      ["metalink", "application/metalink+xml"],
+      ["meta4", "application/metalink4+xml"],
+      ["mets", "application/mets+xml"],
+      ["maei", "application/mmt-aei+xml"],
+      ["musd", "application/mmt-usd+xml"],
+      ["mods", "application/mods+xml"],
+      ["m21", "application/mp21"],
+      ["mp21", "application/mp21"],
+      ["m4p", "application/mp4"],
+      ["mp4s", "application/mp4"],
+      ["doc", "application/msword"],
+      ["dot", "application/msword"],
+      ["mxf", "application/mxf"],
+      ["nq", "application/n-quads"],
+      ["nt", "application/n-triples"],
+      ["cjs", "application/node"],
+      ["bin", "application/octet-stream"],
+      ["bpk", "application/octet-stream"],
+      ["buffer", "application/octet-stream"],
+      ["deb", "application/octet-stream"],
+      ["deploy", "application/octet-stream"],
+      ["dist", "application/octet-stream"],
+      ["distz", "application/octet-stream"],
+      ["dll", "application/octet-stream"],
+      ["dmg", "application/octet-stream"],
+      ["dms", "application/octet-stream"],
+      ["dump", "application/octet-stream"],
+      ["elc", "application/octet-stream"],
+      ["exe", "application/octet-stream"],
+      ["img", "application/octet-stream"],
+      ["iso", "application/octet-stream"],
+      ["lrf", "application/octet-stream"],
+      ["mar", "application/octet-stream"],
+      ["msi", "application/octet-stream"],
+      ["msm", "application/octet-stream"],
+      ["msp", "application/octet-stream"],
+      ["pkg", "application/octet-stream"],
+      ["so", "application/octet-stream"],
+      ["oda", "application/oda"],
+      ["opf", "application/oebps-package+xml"],
+      ["ogx", "application/ogg"],
+      ["omdoc", "application/omdoc+xml"],
+      ["onepkg", "application/onenote"],
+      ["onetmp", "application/onenote"],
+      ["onetoc", "application/onenote"],
+      ["onetoc2", "application/onenote"],
+      ["oxps", "application/oxps"],
+      ["relo", "application/p2p-overlay+xml"],
+      ["xer", "application/patch-ops-error+xml"],
+      ["pdf", "application/pdf"],
+      ["pgp", "application/pgp-encrypted"],
+      ["asc", "application/pgp-signature"],
+      ["sig", "application/pgp-signature"],
+      ["prf", "application/pics-rules"],
+      ["p10", "application/pkcs10"],
+      ["p7c", "application/pkcs7-mime"],
+      ["p7m", "application/pkcs7-mime"],
+      ["p7s", "application/pkcs7-signature"],
+      ["p8", "application/pkcs8"],
+      ["ac", "application/pkix-attr-cert"],
+      ["cer", "application/pkix-cert"],
+      ["crl", "application/pkix-crl"],
+      ["pkipath", "application/pkix-pkipath"],
+      ["pki", "application/pkixcmp"],
+      ["pls", "application/pls+xml"],
+      ["ai", "application/postscript"],
+      ["eps", "application/postscript"],
+      ["ps", "application/postscript"],
+      ["provx", "application/provenance+xml"],
+      ["pskcxml", "application/pskc+xml"],
+      ["raml", "application/raml+yaml"],
+      ["owl", "application/rdf+xml"],
+      ["rdf", "application/rdf+xml"],
+      ["rif", "application/reginfo+xml"],
+      ["rnc", "application/relax-ng-compact-syntax"],
+      ["rl", "application/resource-lists+xml"],
+      ["rld", "application/resource-lists-diff+xml"],
+      ["rs", "application/rls-services+xml"],
+      ["rapd", "application/route-apd+xml"],
+      ["sls", "application/route-s-tsid+xml"],
+      ["rusd", "application/route-usd+xml"],
+      ["gbr", "application/rpki-ghostbusters"],
+      ["mft", "application/rpki-manifest"],
+      ["roa", "application/rpki-roa"],
+      ["rsd", "application/rsd+xml"],
+      ["rss", "application/rss+xml"],
+      ["rtf", "application/rtf"],
+      ["sbml", "application/sbml+xml"],
+      ["scq", "application/scvp-cv-request"],
+      ["scs", "application/scvp-cv-response"],
+      ["spq", "application/scvp-vp-request"],
+      ["spp", "application/scvp-vp-response"],
+      ["sdp", "application/sdp"],
+      ["senmlx", "application/senml+xml"],
+      ["sensmlx", "application/sensml+xml"],
+      ["setpay", "application/set-payment-initiation"],
+      ["setreg", "application/set-registration-initiation"],
+      ["shf", "application/shf+xml"],
+      ["sieve", "application/sieve"],
+      ["siv", "application/sieve"],
+      ["smi", "application/smil+xml"],
+      ["smil", "application/smil+xml"],
+      ["rq", "application/sparql-query"],
+      ["srx", "application/sparql-results+xml"],
+      ["gram", "application/srgs"],
+      ["grxml", "application/srgs+xml"],
+      ["sru", "application/sru+xml"],
+      ["ssdl", "application/ssdl+xml"],
+      ["ssml", "application/ssml+xml"],
+      ["swidtag", "application/swid+xml"],
+      ["tei", "application/tei+xml"],
+      ["teicorpus", "application/tei+xml"],
+      ["tfi", "application/thraud+xml"],
+      ["tsd", "application/timestamped-data"],
+      ["toml", "application/toml"],
+      ["trig", "application/trig"],
+      ["ttml", "application/ttml+xml"],
+      ["ubj", "application/ubjson"],
+      ["rsheet", "application/urc-ressheet+xml"],
+      ["td", "application/urc-targetdesc+xml"],
+      ["vxml", "application/voicexml+xml"],
+      ["wasm", "application/wasm"],
+      ["wgt", "application/widget"],
+      ["hlp", "application/winhlp"],
+      ["wsdl", "application/wsdl+xml"],
+      ["wspolicy", "application/wspolicy+xml"],
+      ["xaml", "application/xaml+xml"],
+      ["xav", "application/xcap-att+xml"],
+      ["xca", "application/xcap-caps+xml"],
+      ["xdf", "application/xcap-diff+xml"],
+      ["xel", "application/xcap-el+xml"],
+      ["xns", "application/xcap-ns+xml"],
+      ["xenc", "application/xenc+xml"],
+      ["xht", "application/xhtml+xml"],
+      ["xhtml", "application/xhtml+xml"],
+      ["xlf", "application/xliff+xml"],
+      ["rng", "application/xml"],
+      ["xml", "application/xml"],
+      ["xsd", "application/xml"],
+      ["xsl", "application/xml"],
+      ["dtd", "application/xml-dtd"],
+      ["xop", "application/xop+xml"],
+      ["xpl", "application/xproc+xml"],
+      ["*xsl", "application/xslt+xml"],
+      ["xslt", "application/xslt+xml"],
+      ["xspf", "application/xspf+xml"],
+      ["mxml", "application/xv+xml"],
+      ["xhvml", "application/xv+xml"],
+      ["xvm", "application/xv+xml"],
+      ["xvml", "application/xv+xml"],
+      ["yang", "application/yang"],
+      ["yin", "application/yin+xml"],
+      ["zip", "application/zip"],
+      ["*3gpp", "audio/3gpp"],
+      ["adp", "audio/adpcm"],
+      ["amr", "audio/amr"],
+      ["au", "audio/basic"],
+      ["snd", "audio/basic"],
+      ["kar", "audio/midi"],
+      ["mid", "audio/midi"],
+      ["midi", "audio/midi"],
+      ["rmi", "audio/midi"],
+      ["mxmf", "audio/mobile-xmf"],
+      ["*mp3", "audio/mp3"],
+      ["m4a", "audio/mp4"],
+      ["mp4a", "audio/mp4"],
+      ["m2a", "audio/mpeg"],
+      ["m3a", "audio/mpeg"],
+      ["mp2", "audio/mpeg"],
+      ["mp2a", "audio/mpeg"],
+      ["mp3", "audio/mpeg"],
+      ["mpga", "audio/mpeg"],
+      ["oga", "audio/ogg"],
+      ["ogg", "audio/ogg"],
+      ["opus", "audio/ogg"],
+      ["spx", "audio/ogg"],
+      ["s3m", "audio/s3m"],
+      ["sil", "audio/silk"],
+      ["wav", "audio/wav"],
+      ["*wav", "audio/wave"],
+      ["weba", "audio/webm"],
+      ["xm", "audio/xm"],
+      ["ttc", "font/collection"],
+      ["otf", "font/otf"],
+      ["ttf", "font/ttf"],
+      ["woff", "font/woff"],
+      ["woff2", "font/woff2"],
+      ["exr", "image/aces"],
+      ["apng", "image/apng"],
+      ["avif", "image/avif"],
+      ["bmp", "image/bmp"],
+      ["cgm", "image/cgm"],
+      ["drle", "image/dicom-rle"],
+      ["emf", "image/emf"],
+      ["fits", "image/fits"],
+      ["g3", "image/g3fax"],
+      ["gif", "image/gif"],
+      ["heic", "image/heic"],
+      ["heics", "image/heic-sequence"],
+      ["heif", "image/heif"],
+      ["heifs", "image/heif-sequence"],
+      ["hej2", "image/hej2k"],
+      ["hsj2", "image/hsj2"],
+      ["ief", "image/ief"],
+      ["jls", "image/jls"],
+      ["jp2", "image/jp2"],
+      ["jpg2", "image/jp2"],
+      ["jpe", "image/jpeg"],
+      ["jpeg", "image/jpeg"],
+      ["jpg", "image/jpeg"],
+      ["jph", "image/jph"],
+      ["jhc", "image/jphc"],
+      ["jpm", "image/jpm"],
+      ["jpf", "image/jpx"],
+      ["jpx", "image/jpx"],
+      ["jxr", "image/jxr"],
+      ["jxra", "image/jxra"],
+      ["jxrs", "image/jxrs"],
+      ["jxs", "image/jxs"],
+      ["jxsc", "image/jxsc"],
+      ["jxsi", "image/jxsi"],
+      ["jxss", "image/jxss"],
+      ["ktx", "image/ktx"],
+      ["ktx2", "image/ktx2"],
+      ["png", "image/png"],
+      ["sgi", "image/sgi"],
+      ["svg", "image/svg+xml"],
+      ["svgz", "image/svg+xml"],
+      ["t38", "image/t38"],
+      ["tif", "image/tiff"],
+      ["tiff", "image/tiff"],
+      ["tfx", "image/tiff-fx"],
+      ["webp", "image/webp"],
+      ["wmf", "image/wmf"],
+      ["disposition-notification", "message/disposition-notification"],
+      ["u8msg", "message/global"],
+      ["u8dsn", "message/global-delivery-status"],
+      ["u8mdn", "message/global-disposition-notification"],
+      ["u8hdr", "message/global-headers"],
+      ["eml", "message/rfc822"],
+      ["mime", "message/rfc822"],
+      ["3mf", "model/3mf"],
+      ["gltf", "model/gltf+json"],
+      ["glb", "model/gltf-binary"],
+      ["iges", "model/iges"],
+      ["igs", "model/iges"],
+      ["mesh", "model/mesh"],
+      ["msh", "model/mesh"],
+      ["silo", "model/mesh"],
+      ["mtl", "model/mtl"],
+      ["obj", "model/obj"],
+      ["stpx", "model/step+xml"],
+      ["stpz", "model/step+zip"],
+      ["stpxz", "model/step-xml+zip"],
+      ["stl", "model/stl"],
+      ["vrml", "model/vrml"],
+      ["wrl", "model/vrml"],
+      ["*x3db", "model/x3d+binary"],
+      ["x3dbz", "model/x3d+binary"],
+      ["x3db", "model/x3d+fastinfoset"],
+      ["*x3dv", "model/x3d+vrml"],
+      ["x3dvz", "model/x3d+vrml"],
+      ["x3d", "model/x3d+xml"],
+      ["x3dz", "model/x3d+xml"],
+      ["x3dv", "model/x3d-vrml"],
+      ["appcache", "text/cache-manifest"],
+      ["manifest", "text/cache-manifest"],
+      ["ics", "text/calendar"],
+      ["ifb", "text/calendar"],
+      ["coffee", "text/coffeescript"],
+      ["litcoffee", "text/coffeescript"],
+      ["css", "text/css"],
+      ["csv", "text/csv"],
+      ["htm", "text/html"],
+      ["html", "text/html"],
+      ["shtml", "text/html"],
+      ["jade", "text/jade"],
+      ["jsx", "text/jsx"],
+      ["less", "text/less"],
+      ["markdown", "text/markdown"],
+      ["md", "text/markdown"],
+      ["mml", "text/mathml"],
+      ["mdx", "text/mdx"],
+      ["n3", "text/n3"],
+      ["conf", "text/plain"],
+      ["def", "text/plain"],
+      ["in", "text/plain"],
+      ["ini", "text/plain"],
+      ["list", "text/plain"],
+      ["log", "text/plain"],
+      ["text", "text/plain"],
+      ["txt", "text/plain"],
+      ["rtx", "text/richtext"],
+      ["*rtf", "text/rtf"],
+      ["sgm", "text/sgml"],
+      ["sgml", "text/sgml"],
+      ["shex", "text/shex"],
+      ["slim", "text/slim"],
+      ["slm", "text/slim"],
+      ["spdx", "text/spdx"],
+      ["styl", "text/stylus"],
+      ["stylus", "text/stylus"],
+      ["tsv", "text/tab-separated-values"],
+      ["man", "text/troff"],
+      ["me", "text/troff"],
+      ["ms", "text/troff"],
+      ["roff", "text/troff"],
+      ["t", "text/troff"],
+      ["tr", "text/troff"],
+      ["ttl", "text/turtle"],
+      ["uri", "text/uri-list"],
+      ["uris", "text/uri-list"],
+      ["urls", "text/uri-list"],
+      ["vcard", "text/vcard"],
+      ["vtt", "text/vtt"],
+      ["*xml", "text/xml"],
+      ["yaml", "text/yaml"],
+      ["yml", "text/yaml"],
+      ["3gp", "video/3gpp"],
+      ["3gpp", "video/3gpp"],
+      ["3g2", "video/3gpp2"],
+      ["h261", "video/h261"],
+      ["h263", "video/h263"],
+      ["h264", "video/h264"],
+      ["m4s", "video/iso.segment"],
+      ["jpgv", "video/jpeg"],
+      ["jpm", "video/jpm"],
+      ["jpgm", "video/jpm"],
+      ["mj2", "video/mj2"],
+      ["mjp2", "video/mj2"],
+      ["ts", "application/typescript"],
+      ["mp4", "video/mp4"],
+      ["mp4v", "video/mp4"],
+      ["mpg4", "video/mp4"],
+      ["m1v", "video/mpeg"],
+      ["m2v", "video/mpeg"],
+      ["mpe", "video/mpeg"],
+      ["mpeg", "video/mpeg"],
+      ["mpg", "video/mpeg"],
+      ["ogv", "video/ogg"],
+      ["mov", "video/quicktime"],
+      ["qt", "video/quicktime"],
+      ["webm", "video/webm"]
+    ]);
+  }
+});
+
+// packages/isomorphic/multimap.ts
+var MultiMap;
+var init_multimap = __esm({
+  "packages/isomorphic/multimap.ts"() {
+    "use strict";
+    MultiMap = class {
+      constructor() {
+        this._map = /* @__PURE__ */ new Map();
+      }
+      set(key, value2) {
+        let values = this._map.get(key);
+        if (!values) {
+          values = [];
+          this._map.set(key, values);
+        }
+        values.push(value2);
+      }
+      get(key) {
+        return this._map.get(key) || [];
+      }
+      has(key) {
+        return this._map.has(key);
+      }
+      delete(key, value2) {
+        const values = this._map.get(key);
+        if (!values)
+          return;
+        if (values.includes(value2))
+          this._map.set(key, values.filter((v) => value2 !== v));
+      }
+      deleteAll(key) {
+        this._map.delete(key);
+      }
+      hasValue(key, value2) {
+        const values = this._map.get(key);
+        if (!values)
+          return false;
+        return values.includes(value2);
+      }
+      get size() {
+        return this._map.size;
+      }
+      [Symbol.iterator]() {
+        return this._map[Symbol.iterator]();
+      }
+      keys() {
+        return this._map.keys();
+      }
+      values() {
+        const result2 = [];
+        for (const key of this.keys())
+          result2.push(...this.get(key));
+        return result2;
+      }
+      clear() {
+        this._map.clear();
+      }
+    };
+  }
+});
+
+// packages/isomorphic/protocolMetainfo.ts
+function getMetainfo(metadata) {
+  return methodMetainfo.get(metadata.type + "." + metadata.method);
+}
+var methodMetainfo;
+var init_protocolMetainfo = __esm({
+  "packages/isomorphic/protocolMetainfo.ts"() {
+    "use strict";
+    methodMetainfo = /* @__PURE__ */ new Map([
+      ["Android.devices", { internal: true }],
+      ["AndroidSocket.write", { internal: true }],
+      ["AndroidSocket.close", { internal: true }],
+      ["AndroidDevice.wait", { title: "Wait" }],
+      ["AndroidDevice.fill", { title: 'Fill "{text}"' }],
+      ["AndroidDevice.tap", { title: "Tap" }],
+      ["AndroidDevice.drag", { title: "Drag" }],
+      ["AndroidDevice.fling", { title: "Fling" }],
+      ["AndroidDevice.longTap", { title: "Long tap" }],
+      ["AndroidDevice.pinchClose", { title: "Pinch close" }],
+      ["AndroidDevice.pinchOpen", { title: "Pinch open" }],
+      ["AndroidDevice.scroll", { title: "Scroll" }],
+      ["AndroidDevice.swipe", { title: "Swipe" }],
+      ["AndroidDevice.info", { internal: true }],
+      ["AndroidDevice.screenshot", { title: "Screenshot" }],
+      ["AndroidDevice.inputType", { title: "Type" }],
+      ["AndroidDevice.inputPress", { title: "Press" }],
+      ["AndroidDevice.inputTap", { title: "Tap" }],
+      ["AndroidDevice.inputSwipe", { title: "Swipe" }],
+      ["AndroidDevice.inputDrag", { title: "Drag" }],
+      ["AndroidDevice.launchBrowser", { title: "Launch browser" }],
+      ["AndroidDevice.open", { title: "Open app" }],
+      ["AndroidDevice.shell", { title: "Execute shell command", group: "configuration" }],
+      ["AndroidDevice.installApk", { title: "Install apk" }],
+      ["AndroidDevice.push", { title: "Push" }],
+      ["AndroidDevice.connectToWebView", { title: "Connect to Web View" }],
+      ["AndroidDevice.close", { internal: true }],
+      ["APIRequestContext.fetch", { title: '{method} "{url}"' }],
+      ["APIRequestContext.fetchResponseBody", { title: "Get response body", group: "getter" }],
+      ["APIRequestContext.fetchLog", { internal: true }],
+      ["APIRequestContext.storageState", { title: "Get storage state", group: "configuration" }],
+      ["APIRequestContext.disposeAPIResponse", { internal: true }],
+      ["APIRequestContext.dispose", { internal: true, potentiallyClosesScope: true }],
+      ["Artifact.pathAfterFinished", { internal: true }],
+      ["Artifact.saveAs", { internal: true }],
+      ["Artifact.saveAsStream", { internal: true }],
+      ["Artifact.failure", { internal: true }],
+      ["Artifact.stream", { internal: true }],
+      ["Artifact.cancel", { internal: true }],
+      ["Artifact.delete", { internal: true, potentiallyClosesScope: true }],
+      ["Stream.read", { internal: true }],
+      ["Stream.close", { internal: true }],
+      ["WritableStream.write", { internal: true }],
+      ["WritableStream.close", { internal: true }],
+      ["Browser.startServer", { title: "Start server" }],
+      ["Browser.stopServer", { title: "Stop server" }],
+      ["Browser.close", { title: "Close browser", pause: true, potentiallyClosesScope: true }],
+      ["Browser.killForTests", { internal: true, potentiallyClosesScope: true }],
+      ["Browser.defaultUserAgentForTest", { internal: true }],
+      ["Browser.newContext", { title: "Create context" }],
+      ["Browser.newContextForReuse", { internal: true }],
+      ["Browser.disconnectFromReusedContext", { internal: true }],
+      ["Browser.newBrowserCDPSession", { title: "Create CDP session", group: "configuration" }],
+      ["Browser.startTracing", { title: "Start browser tracing", group: "configuration" }],
+      ["Browser.stopTracing", { title: "Stop browser tracing", group: "configuration" }],
+      ["BrowserContext.addCookies", { title: "Add cookies", group: "configuration" }],
+      ["BrowserContext.addInitScript", { title: "Add init script", group: "configuration" }],
+      ["BrowserContext.clearCookies", { title: "Clear cookies", group: "configuration" }],
+      ["BrowserContext.clearPermissions", { title: "Clear permissions", group: "configuration" }],
+      ["BrowserContext.close", { title: "Close context", pause: true, potentiallyClosesScope: true }],
+      ["BrowserContext.cookies", { title: "Get cookies", group: "getter" }],
+      ["BrowserContext.exposeBinding", { title: "Expose binding", group: "configuration" }],
+      ["BrowserContext.grantPermissions", { title: "Grant permissions", group: "configuration" }],
+      ["BrowserContext.newPage", { title: "Create page" }],
+      ["BrowserContext.registerSelectorEngine", { internal: true }],
+      ["BrowserContext.setTestIdAttributeName", { internal: true }],
+      ["BrowserContext.setExtraHTTPHeaders", { title: "Set extra HTTP headers", group: "configuration" }],
+      ["BrowserContext.setGeolocation", { title: "Set geolocation", group: "configuration" }],
+      ["BrowserContext.setHTTPCredentials", { title: "Set HTTP credentials", group: "configuration" }],
+      ["BrowserContext.setNetworkInterceptionPatterns", { title: "Route requests", group: "route" }],
+      ["BrowserContext.setWebSocketInterceptionPatterns", { title: "Route WebSockets", group: "route" }],
+      ["BrowserContext.setOffline", { title: "Set offline mode" }],
+      ["BrowserContext.storageState", { title: "Get storage state", group: "configuration" }],
+      ["BrowserContext.setStorageState", { title: "Set storage state", group: "configuration" }],
+      ["BrowserContext.pause", { title: "Pause" }],
+      ["BrowserContext.enableRecorder", { internal: true }],
+      ["BrowserContext.disableRecorder", { internal: true }],
+      ["BrowserContext.exposeConsoleApi", { internal: true }],
+      ["BrowserContext.newCDPSession", { title: "Create CDP session", group: "configuration" }],
+      ["BrowserContext.createTempFiles", { internal: true }],
+      ["BrowserContext.updateSubscription", { internal: true }],
+      ["BrowserContext.clockFastForward", { title: 'Fast forward clock "{ticksNumber|ticksString}"' }],
+      ["BrowserContext.clockInstall", { title: 'Install clock "{timeNumber|timeString}"' }],
+      ["BrowserContext.clockPauseAt", { title: 'Pause clock "{timeNumber|timeString}"' }],
+      ["BrowserContext.clockResume", { title: "Resume clock" }],
+      ["BrowserContext.clockRunFor", { title: 'Run clock "{ticksNumber|ticksString}"' }],
+      ["BrowserContext.clockSetFixedTime", { title: 'Set fixed time "{timeNumber|timeString}"' }],
+      ["BrowserContext.clockSetSystemTime", { title: 'Set system time "{timeNumber|timeString}"' }],
+      ["BrowserContext.credentialsInstall", { title: "Install virtual WebAuthn authenticator", group: "configuration" }],
+      ["BrowserContext.credentialsCreate", { title: 'Create virtual credential for "{rpId}"', group: "configuration" }],
+      ["BrowserContext.credentialsGet", { title: "Get virtual credentials", group: "configuration" }],
+      ["BrowserContext.credentialsDelete", { title: "Delete virtual credential", group: "configuration" }],
+      ["BrowserType.launch", { title: "Launch browser" }],
+      ["BrowserType.launchPersistentContext", { title: "Launch persistent context" }],
+      ["BrowserType.connectOverCDP", { title: "Connect over CDP" }],
+      ["BrowserType.connectToWorker", { title: "Connect to worker" }],
+      ["Disposable.dispose", { internal: true, potentiallyClosesScope: true }],
+      ["Electron.launch", { title: "Launch electron" }],
+      ["ElectronApplication.browserWindow", { internal: true }],
+      ["ElectronApplication.evaluateExpression", { title: "Evaluate" }],
+      ["ElectronApplication.evaluateExpressionHandle", { title: "Evaluate" }],
+      ["ElectronApplication.updateSubscription", { internal: true }],
+      ["Frame.evalOnSelector", { title: "Evaluate", snapshot: true, pause: true }],
+      ["Frame.evalOnSelectorAll", { title: "Evaluate", snapshot: true, pause: true }],
+      ["Frame.addScriptTag", { title: "Add script tag", snapshot: true, pause: true }],
+      ["Frame.addStyleTag", { title: "Add style tag", snapshot: true, pause: true }],
+      ["Frame.ariaSnapshot", { title: "Aria snapshot", group: "getter" }],
+      ["Frame.blur", { title: "Blur", slowMo: true, snapshot: true, pause: true }],
+      ["Frame.check", { title: "Check", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.click", { title: "Click", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true, potentiallyClosesScope: true }],
+      ["Frame.content", { title: "Get content", snapshot: true, pause: true }],
+      ["Frame.dragAndDrop", { title: "Drag and drop", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.drop", { title: "Drop files or data onto an element", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.dblclick", { title: "Double click", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.dispatchEvent", { title: 'Dispatch "{type}"', slowMo: true, snapshot: true, pause: true }],
+      ["Frame.evaluateExpression", { title: "Evaluate", snapshot: true, pause: true }],
+      ["Frame.evaluateExpressionHandle", { title: "Evaluate", snapshot: true, pause: true }],
+      ["Frame.fill", { title: 'Fill "{value}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.focus", { title: "Focus", slowMo: true, snapshot: true, pause: true }],
+      ["Frame.frameElement", { title: "Get frame element", group: "getter" }],
+      ["Frame.resolveSelector", { internal: true }],
+      ["Frame.highlight", { internal: true }],
+      ["Frame.hideHighlight", { internal: true }],
+      ["Frame.getAttribute", { title: 'Get attribute "{name}"', snapshot: true, pause: true, group: "getter" }],
+      ["Frame.goto", { title: 'Navigate to "{url}"', slowMo: true, snapshot: true, pause: true }],
+      ["Frame.hover", { title: "Hover", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.innerHTML", { title: "Get HTML", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.innerText", { title: "Get inner text", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.inputValue", { title: "Get input value", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.isChecked", { title: "Is checked", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.isDisabled", { title: "Is disabled", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.isEnabled", { title: "Is enabled", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.isHidden", { title: "Is hidden", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.isVisible", { title: "Is visible", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.isEditable", { title: "Is editable", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.press", { title: 'Press "{key}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.querySelector", { title: "Query selector", snapshot: true }],
+      ["Frame.querySelectorAll", { title: "Query selector all", snapshot: true }],
+      ["Frame.queryCount", { title: "Query count", snapshot: true, pause: true }],
+      ["Frame.selectOption", { title: "Select option", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.setContent", { title: "Set content", snapshot: true, pause: true }],
+      ["Frame.setInputFiles", { title: "Set input files", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.tap", { title: "Tap", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.textContent", { title: "Get text content", snapshot: true, pause: true, group: "getter" }],
+      ["Frame.title", { title: "Get page title", group: "getter" }],
+      ["Frame.type", { title: 'Type "{text}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.uncheck", { title: "Uncheck", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["Frame.waitForTimeout", { title: "Wait for timeout", snapshot: true }],
+      ["Frame.waitForFunction", { title: "Wait for function", snapshot: true, pause: true }],
+      ["Frame.waitForSelector", { title: "Wait for selector", snapshot: true }],
+      ["Frame.expect", { title: 'Expect "{expression}"', snapshot: true, pause: true }],
+      ["JSHandle.dispose", { internal: true, potentiallyClosesScope: true }],
+      ["ElementHandle.dispose", { internal: true, potentiallyClosesScope: true }],
+      ["JSHandle.evaluateExpression", { title: "Evaluate", snapshot: true, pause: true }],
+      ["ElementHandle.evaluateExpression", { title: "Evaluate", snapshot: true, pause: true }],
+      ["JSHandle.evaluateExpressionHandle", { title: "Evaluate", snapshot: true, pause: true }],
+      ["ElementHandle.evaluateExpressionHandle", { title: "Evaluate", snapshot: true, pause: true }],
+      ["JSHandle.getPropertyList", { title: "Get property list", group: "getter" }],
+      ["ElementHandle.getPropertyList", { title: "Get property list", group: "getter" }],
+      ["JSHandle.getProperty", { title: "Get JS property", group: "getter" }],
+      ["ElementHandle.getProperty", { title: "Get JS property", group: "getter" }],
+      ["JSHandle.jsonValue", { title: "Get JSON value", group: "getter" }],
+      ["ElementHandle.jsonValue", { title: "Get JSON value", group: "getter" }],
+      ["ElementHandle.evalOnSelector", { title: "Evaluate", snapshot: true, pause: true }],
+      ["ElementHandle.evalOnSelectorAll", { title: "Evaluate", snapshot: true, pause: true }],
+      ["ElementHandle.boundingBox", { title: "Get bounding box", snapshot: true, pause: true }],
+      ["ElementHandle.check", { title: "Check", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.click", { title: "Click", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.contentFrame", { title: "Get content frame", group: "getter" }],
+      ["ElementHandle.dblclick", { title: "Double click", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.dispatchEvent", { title: "Dispatch event", slowMo: true, snapshot: true, pause: true }],
+      ["ElementHandle.fill", { title: 'Fill "{value}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.focus", { title: "Focus", slowMo: true, snapshot: true, pause: true }],
+      ["ElementHandle.getAttribute", { title: "Get attribute", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.hover", { title: "Hover", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.innerHTML", { title: "Get HTML", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.innerText", { title: "Get inner text", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.inputValue", { title: "Get input value", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.isChecked", { title: "Is checked", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.isDisabled", { title: "Is disabled", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.isEditable", { title: "Is editable", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.isEnabled", { title: "Is enabled", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.isHidden", { title: "Is hidden", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.isVisible", { title: "Is visible", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.ownerFrame", { title: "Get owner frame", group: "getter" }],
+      ["ElementHandle.press", { title: 'Press "{key}"', slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.querySelector", { title: "Query selector", snapshot: true }],
+      ["ElementHandle.querySelectorAll", { title: "Query selector all", snapshot: true }],
+      ["ElementHandle.screenshot", { title: "Screenshot", snapshot: true, pause: true }],
+      ["ElementHandle.scrollIntoViewIfNeeded", { title: "Scroll into view", slowMo: true, snapshot: true, pause: true }],
+      ["ElementHandle.selectOption", { title: "Select option", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.selectText", { title: "Select text", slowMo: true, snapshot: true, pause: true }],
+      ["ElementHandle.setInputFiles", { title: "Set input files", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.tap", { title: "Tap", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.textContent", { title: "Get text content", snapshot: true, pause: true, group: "getter" }],
+      ["ElementHandle.type", { title: "Type", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.uncheck", { title: "Uncheck", slowMo: true, snapshot: true, pause: true, input: true, isAutoWaiting: true }],
+      ["ElementHandle.waitForElementState", { title: "Wait for state", snapshot: true, pause: true }],
+      ["ElementHandle.waitForSelector", { title: "Wait for selector", snapshot: true }],
+      ["LocalUtils.zip", { internal: true }],
+      ["LocalUtils.harOpen", { internal: true }],
+      ["LocalUtils.harLookup", { internal: true }],
+      ["LocalUtils.harClose", { internal: true }],
+      ["LocalUtils.harUnzip", { internal: true }],
+      ["LocalUtils.connect", { internal: true }],
+      ["LocalUtils.tracingStarted", { internal: true }],
+      ["LocalUtils.addStackToTracingNoReply", { internal: true }],
+      ["LocalUtils.traceDiscarded", { internal: true }],
+      ["LocalUtils.globToRegex", { internal: true }],
+      ["Request.response", { internal: true }],
+      ["Request.rawRequestHeaders", { internal: true }],
+      ["Route.redirectNavigationRequest", { internal: true }],
+      ["Route.abort", { title: "Abort request", group: "route" }],
+      ["Route.continue", { title: "Continue request", group: "route" }],
+      ["Route.fulfill", { title: "Fulfill request", group: "route" }],
+      ["WebSocketRoute.connect", { title: "Connect WebSocket to server", group: "route" }],
+      ["WebSocketRoute.ensureOpened", { internal: true }],
+      ["WebSocketRoute.sendToPage", { title: "Send WebSocket message", group: "route" }],
+      ["WebSocketRoute.sendToServer", { title: "Send WebSocket message", group: "route" }],
+      ["WebSocketRoute.closePage", { internal: true }],
+      ["WebSocketRoute.closeServer", { internal: true }],
+      ["Response.body", { title: "Get response body", group: "getter" }],
+      ["Response.securityDetails", { internal: true }],
+      ["Response.serverAddr", { internal: true }],
+      ["Response.rawResponseHeaders", { internal: true }],
+      ["Response.httpVersion", { internal: true }],
+      ["Response.sizes", { internal: true }],
+      ["Page.addInitScript", { title: "Add init script", group: "configuration" }],
+      ["Page.close", { title: "Close page", pause: true, potentiallyClosesScope: true }],
+      ["Page.runBeforeUnload", { title: "Run beforeunload", pause: true }],
+      ["Page.clearConsoleMessages", { title: "Clear console messages" }],
+      ["Page.consoleMessages", { title: "Get console messages", group: "getter" }],
+      ["Page.emulateMedia", { title: "Emulate media", snapshot: true, pause: true }],
+      ["Page.exposeBinding", { title: "Expose binding", group: "configuration" }],
+      ["Page.goBack", { title: "Go back", slowMo: true, snapshot: true, pause: true }],
+      ["Page.goForward", { title: "Go forward", slowMo: true, snapshot: true, pause: true }],
+      ["Page.requestGC", { title: "Request garbage collection", group: "configuration" }],
+      ["Page.registerLocatorHandler", { title: "Register locator handler" }],
+      ["Page.resolveLocatorHandlerNoReply", { internal: true }],
+      ["Page.unregisterLocatorHandler", { title: "Unregister locator handler" }],
+      ["Page.reload", { title: "Reload", slowMo: true, snapshot: true, pause: true }],
+      ["Page.expectScreenshot", { title: "Expect screenshot", snapshot: true, pause: true }],
+      ["Page.screenshot", { title: "Screenshot", snapshot: true, pause: true }],
+      ["Page.setExtraHTTPHeaders", { title: "Set extra HTTP headers", group: "configuration" }],
+      ["Page.setNetworkInterceptionPatterns", { title: "Route requests", group: "route" }],
+      ["Page.setWebSocketInterceptionPatterns", { title: "Route WebSockets", group: "route" }],
+      ["Page.setViewportSize", { title: "Set viewport size", snapshot: true, pause: true }],
+      ["Page.keyboardDown", { title: 'Key down "{key}"', slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.keyboardUp", { title: 'Key up "{key}"', slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.keyboardInsertText", { title: 'Insert "{text}"', slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.keyboardType", { title: 'Type "{text}"', slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.keyboardPress", { title: 'Press "{key}"', slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.mouseMove", { title: "Mouse move", slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.mouseDown", { title: "Mouse down", slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.mouseUp", { title: "Mouse up", slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.mouseClick", { title: "Click", slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.mouseWheel", { title: "Mouse wheel", slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.touchscreenTap", { title: "Tap", slowMo: true, snapshot: true, pause: true, input: true }],
+      ["Page.clearPageErrors", { title: "Clear page errors" }],
+      ["Page.pageErrors", { title: "Get page errors", group: "getter" }],
+      ["Page.pdf", { title: "PDF" }],
+      ["Page.requests", { title: "Get network requests", group: "getter" }],
+      ["Page.startJSCoverage", { title: "Start JS coverage", group: "configuration" }],
+      ["Page.stopJSCoverage", { title: "Stop JS coverage", group: "configuration" }],
+      ["Page.startCSSCoverage", { title: "Start CSS coverage", group: "configuration" }],
+      ["Page.stopCSSCoverage", { title: "Stop CSS coverage", group: "configuration" }],
+      ["Page.bringToFront", { title: "Bring to front" }],
+      ["Page.pickLocator", { title: "Pick locator", group: "configuration" }],
+      ["Page.cancelPickLocator", { title: "Cancel pick locator", group: "configuration" }],
+      ["Page.hideHighlight", { title: "Hide all element highlights", group: "configuration" }],
+      ["Page.screencastShowOverlay", { title: "Show overlay", group: "configuration" }],
+      ["Page.screencastRemoveOverlay", { title: "Remove overlay", group: "configuration" }],
+      ["Page.screencastChapter", { title: "Show chapter overlay", group: "configuration" }],
+      ["Page.screencastSetOverlayVisible", { title: "Set overlay visibility", group: "configuration" }],
+      ["Page.screencastShowActions", { title: "Show actions", group: "configuration" }],
+      ["Page.screencastHideActions", { title: "Remove actions", group: "configuration" }],
+      ["Page.screencastStart", { title: "Start screencast", group: "configuration" }],
+      ["Page.screencastStop", { title: "Stop screencast", group: "configuration" }],
+      ["Page.updateSubscription", { internal: true }],
+      ["Page.setDockTile", { internal: true }],
+      ["Page.webStorageItems", { title: "Get WebStorage items", group: "getter" }],
+      ["Page.webStorageGetItem", { title: "Get WebStorage item", group: "getter" }],
+      ["Page.webStorageSetItem", { title: "Set WebStorage item", group: "configuration" }],
+      ["Page.webStorageRemoveItem", { title: "Remove WebStorage item", group: "configuration" }],
+      ["Page.webStorageClear", { title: "Clear WebStorage", group: "configuration" }],
+      ["Root.initialize", { internal: true }],
+      ["Playwright.newRequest", { title: "Create request context" }],
+      ["DebugController.initialize", { internal: true }],
+      ["DebugController.setReportStateChanged", { internal: true }],
+      ["DebugController.setRecorderMode", { internal: true }],
+      ["DebugController.highlight", { internal: true }],
+      ["DebugController.hideHighlight", { internal: true }],
+      ["DebugController.resume", { internal: true }],
+      ["DebugController.kill", { internal: true }],
+      ["SocksSupport.socksConnected", { internal: true }],
+      ["SocksSupport.socksFailed", { internal: true }],
+      ["SocksSupport.socksData", { internal: true }],
+      ["SocksSupport.socksError", { internal: true }],
+      ["SocksSupport.socksEnd", { internal: true }],
+      ["JsonPipe.send", { internal: true }],
+      ["JsonPipe.close", { internal: true }],
+      ["CDPSession.send", { title: "Send CDP command", group: "configuration" }],
+      ["CDPSession.detach", { title: "Detach CDP session", potentiallyClosesScope: true, group: "configuration" }],
+      ["BindingCall.reject", { internal: true }],
+      ["BindingCall.resolve", { internal: true }],
+      ["Debugger.requestPause", { title: "Pause on next call", group: "configuration" }],
+      ["Debugger.resume", { title: "Resume", group: "configuration" }],
+      ["Debugger.next", { title: "Step to next call", group: "configuration" }],
+      ["Debugger.runTo", { title: "Run to location", group: "configuration" }],
+      ["Dialog.accept", { title: "Accept dialog" }],
+      ["Dialog.dismiss", { title: "Dismiss dialog" }],
+      ["Tracing.tracingStart", { title: "Start tracing", group: "configuration" }],
+      ["Tracing.tracingStartChunk", { title: "Start tracing", group: "configuration" }],
+      ["Tracing.tracingGroup", { title: 'Trace "{name}"' }],
+      ["Tracing.tracingGroupEnd", { title: "Group end" }],
+      ["Tracing.tracingStopChunk", { title: "Stop tracing", group: "configuration" }],
+      ["Tracing.tracingStop", { title: "Stop tracing", group: "configuration" }],
+      ["Tracing.harStart", { internal: true }],
+      ["Tracing.harExport", { internal: true }],
+      ["Worker.disconnect", { title: "Disconnect from worker", potentiallyClosesScope: true }],
+      ["Worker.evaluateExpression", { title: "Evaluate" }],
+      ["Worker.evaluateExpressionHandle", { title: "Evaluate" }],
+      ["Worker.updateSubscription", { internal: true }]
+    ]);
+  }
+});
+
+// packages/isomorphic/protocolFormatter.ts
+function formatProtocolParam(params2, alternatives) {
+  return _formatProtocolParam(params2, alternatives)?.replaceAll("\n", "\\n");
+}
+function _formatProtocolParam(params2, alternatives) {
+  if (!params2)
+    return void 0;
+  for (const name of alternatives.split("|")) {
+    if (name === "url") {
+      try {
+        const urlObject = new URL(params2[name]);
+        if (urlObject.protocol === "data:")
+          return urlObject.protocol;
+        if (["about:", "chrome:", "edge:"].includes(urlObject.protocol))
+          return params2[name];
+        return urlObject.pathname + urlObject.search;
+      } catch (error) {
+        if (params2[name] !== void 0)
+          return params2[name];
+      }
+    }
+    if (name === "timeNumber" && params2[name] !== void 0) {
+      return new Date(params2[name]).toString();
+    }
+    const value2 = deepParam(params2, name);
+    if (value2 !== void 0)
+      return value2;
+  }
+}
+function deepParam(params2, name) {
+  const tokens = name.split(".");
+  let current = params2;
+  for (const token of tokens) {
+    if (typeof current !== "object" || current === null)
+      return void 0;
+    current = current[token];
+  }
+  if (current === void 0)
+    return void 0;
+  return String(current);
+}
+function renderTitleForCall(metadata) {
+  const titleFormat = metadata.title ?? getMetainfo(metadata)?.title ?? metadata.method;
+  return titleFormat.replace(/\{([^}]+)\}/g, (fullMatch, p1) => {
+    return formatProtocolParam(metadata.params, p1) ?? fullMatch;
+  });
+}
+function getActionGroup(metadata) {
+  return getMetainfo(metadata)?.group;
+}
+var init_protocolFormatter = __esm({
+  "packages/isomorphic/protocolFormatter.ts"() {
+    "use strict";
+    init_protocolMetainfo();
+  }
+});
+
+// packages/isomorphic/semaphore.ts
+var Semaphore;
+var init_semaphore = __esm({
+  "packages/isomorphic/semaphore.ts"() {
+    "use strict";
+    init_manualPromise();
+    Semaphore = class {
+      constructor(max) {
+        this._acquired = 0;
+        this._queue = [];
+        this._max = max;
+      }
+      setMax(max) {
+        this._max = max;
+      }
+      acquire() {
+        const lock2 = new ManualPromise();
+        this._queue.push(lock2);
+        this._flush();
+        return lock2;
+      }
+      release() {
+        --this._acquired;
+        this._flush();
+      }
+      _flush() {
+        while (this._acquired < this._max && this._queue.length) {
+          ++this._acquired;
+          this._queue.shift().resolve();
+        }
+      }
+    };
+  }
+});
+
+// packages/isomorphic/formatUtils.ts
+function msToString(ms) {
+  if (ms < 0 || !isFinite(ms))
+    return "-";
+  if (ms === 0)
+    return "0ms";
+  if (ms < 1e3)
+    return ms.toFixed(0) + "ms";
+  const seconds = ms / 1e3;
+  if (seconds < 60)
+    return seconds.toFixed(1) + "s";
+  const minutes = seconds / 60;
+  if (minutes < 60)
+    return minutes.toFixed(1) + "m";
+  const hours = minutes / 60;
+  if (hours < 24)
+    return hours.toFixed(1) + "h";
+  const days = hours / 24;
+  return days.toFixed(1) + "d";
+}
+function bytesToString(bytes) {
+  if (bytes < 0 || !isFinite(bytes))
+    return "-";
+  if (bytes === 0)
+    return "0";
+  if (bytes < 1e3)
+    return bytes.toFixed(0);
+  const kb = bytes / 1024;
+  if (kb < 1e3)
+    return kb.toFixed(1) + "K";
+  const mb = kb / 1024;
+  if (mb < 1e3)
+    return mb.toFixed(1) + "M";
+  const gb = mb / 1024;
+  return gb.toFixed(1) + "G";
+}
+var init_formatUtils = __esm({
+  "packages/isomorphic/formatUtils.ts"() {
+    "use strict";
+  }
+});
+
+// packages/isomorphic/time.ts
+function setTimeOrigin(origin) {
+  _timeOrigin = origin;
+  _timeShift = performance.timeOrigin - origin;
+}
+function timeOrigin() {
+  return _timeOrigin;
+}
+function monotonicTime() {
+  return Math.floor((performance.now() + _timeShift) * 1e3) / 1e3;
+}
+var _timeOrigin, _timeShift, DEFAULT_PLAYWRIGHT_TIMEOUT, DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT;
+var init_time = __esm({
+  "packages/isomorphic/time.ts"() {
+    "use strict";
+    _timeOrigin = performance.timeOrigin;
+    _timeShift = 0;
+    DEFAULT_PLAYWRIGHT_TIMEOUT = 3e4;
+    DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT = 3 * 60 * 1e3;
+  }
+});
+
+// packages/isomorphic/timeoutRunner.ts
+async function raceAgainstDeadline(cb, deadline) {
+  let timer;
+  return await Promise.race([
+    cb().then((result2) => {
+      return { result: result2, timedOut: false };
+    }),
+    new Promise((resolve) => {
+      if (!deadline)
+        return;
+      timer = setTimeout(() => resolve({ timedOut: true }), deadline - monotonicTime());
+    })
+  ]).finally(() => {
+    clearTimeout(timer);
+  });
+}
+async function pollAgainstDeadline(callback, deadline, pollIntervals = [100, 250, 500, 1e3]) {
+  const lastPollInterval = pollIntervals.pop() ?? 1e3;
+  let lastResult;
+  const wrappedCallback = () => Promise.resolve().then(callback);
+  while (true) {
+    const time = monotonicTime();
+    if (deadline && time >= deadline)
+      break;
+    const received = await raceAgainstDeadline(wrappedCallback, deadline);
+    if (received.timedOut)
+      break;
+    lastResult = received.result.result;
+    if (!received.result.continuePolling)
+      return { result: lastResult, timedOut: false };
+    const interval = pollIntervals.shift() ?? lastPollInterval;
+    if (deadline && deadline <= monotonicTime() + interval)
+      break;
+    await new Promise((x) => setTimeout(x, interval));
+  }
+  return { timedOut: true, result: lastResult };
+}
+var init_timeoutRunner = __esm({
+  "packages/isomorphic/timeoutRunner.ts"() {
+    "use strict";
+    init_time();
+  }
+});
+
+// packages/isomorphic/trace/snapshotServer.ts
+function removeHash(url2) {
+  try {
+    const u = new URL(url2);
+    u.hash = "";
+    return u.toString();
+  } catch (e) {
+    return url2;
+  }
+}
+var SnapshotServer;
+var init_snapshotServer = __esm({
+  "packages/isomorphic/trace/snapshotServer.ts"() {
+    "use strict";
+    SnapshotServer = class {
+      constructor(snapshotStorage, resourceLoader) {
+        this._snapshotIds = /* @__PURE__ */ new Map();
+        this._snapshotStorage = snapshotStorage;
+        this._resourceLoader = resourceLoader;
+      }
+      serveSnapshot(pageOrFrameId, searchParams, snapshotUrl) {
+        const snapshot3 = this._snapshot(pageOrFrameId, searchParams);
+        if (!snapshot3)
+          return new Response(null, { status: 404 });
+        const renderedSnapshot = snapshot3.render();
+        this._snapshotIds.set(snapshotUrl, snapshot3);
+        return new Response(renderedSnapshot.html, { status: 200, headers: { "Content-Type": "text/html; charset=utf-8" } });
+      }
+      async serveClosestScreenshot(pageOrFrameId, searchParams) {
+        const snapshot3 = this._snapshot(pageOrFrameId, searchParams);
+        const sha1 = snapshot3?.closestScreenshot();
+        if (!sha1)
+          return new Response(null, { status: 404 });
+        return new Response(await this._resourceLoader(sha1));
+      }
+      serveSnapshotInfo(pageOrFrameId, searchParams) {
+        const snapshot3 = this._snapshot(pageOrFrameId, searchParams);
+        return this._respondWithJson(snapshot3 ? {
+          viewport: snapshot3.viewport(),
+          url: snapshot3.snapshot().frameUrl,
+          timestamp: snapshot3.snapshot().timestamp,
+          wallTime: snapshot3.snapshot().wallTime
+        } : {
+          error: "No snapshot found"
+        });
+      }
+      _snapshot(pageOrFrameId, params2) {
+        const name = params2.get("name");
+        return this._snapshotStorage.snapshotByName(pageOrFrameId, name);
+      }
+      _respondWithJson(object) {
+        return new Response(JSON.stringify(object), {
+          status: 200,
+          headers: {
+            "Cache-Control": "public, max-age=31536000",
+            "Content-Type": "application/json"
+          }
+        });
+      }
+      async serveResource(requestUrlAlternatives, method, snapshotUrl) {
+        let resource;
+        const snapshot3 = this._snapshotIds.get(snapshotUrl);
+        for (const requestUrl of requestUrlAlternatives) {
+          resource = snapshot3?.resourceByUrl(removeHash(requestUrl), method);
+          if (resource)
+            break;
+        }
+        if (!resource)
+          return new Response(null, { status: 404 });
+        const sha1 = resource.response.content._sha1;
+        const content = sha1 ? await this._resourceLoader(sha1) || new Blob([]) : new Blob([]);
+        let contentType = resource.response.content.mimeType;
+        const isTextEncoding = /^text\/|^application\/(javascript|json)/.test(contentType);
+        if (isTextEncoding && !contentType.includes("charset"))
+          contentType = `${contentType}; charset=utf-8`;
+        const headers = new Headers();
+        if (contentType !== "x-unknown")
+          headers.set("Content-Type", contentType);
+        for (const { name, value: value2 } of resource.response.headers)
+          headers.set(name, value2);
+        headers.delete("Content-Encoding");
+        headers.delete("Access-Control-Allow-Origin");
+        headers.set("Access-Control-Allow-Origin", "*");
+        headers.delete("Content-Length");
+        headers.set("Content-Length", String(content.size));
+        if (this._snapshotStorage.hasResourceOverride(resource.request.url))
+          headers.set("Cache-Control", "no-store, no-cache, max-age=0");
+        else
+          headers.set("Cache-Control", "public, max-age=31536000");
+        const { status } = resource.response;
+        const isNullBodyStatus = status === 101 || status === 204 || status === 205 || status === 304;
+        return new Response(isNullBodyStatus ? null : content, {
+          headers,
+          status: resource.response.status,
+          statusText: resource.response.statusText
+        });
+      }
+    };
+  }
+});
+
+// packages/isomorphic/urlMatch.ts
+function isHttpUrl(url2, base) {
+  try {
+    return ["http:", "https:"].includes(new URL(url2, base).protocol);
+  } catch {
+    return false;
+  }
+}
+function globToRegexPattern(glob) {
+  const tokens = ["^"];
+  let inGroup = false;
+  for (let i = 0; i < glob.length; ++i) {
+    const c = glob[i];
+    if (c === "\\" && i + 1 < glob.length) {
+      const char = glob[++i];
+      tokens.push(escapedChars.has(char) ? "\\" + char : char);
+      continue;
+    }
+    if (c === "*") {
+      const charBefore = glob[i - 1];
+      let starCount = 1;
+      while (glob[i + 1] === "*") {
+        starCount++;
+        i++;
+      }
+      if (starCount > 1) {
+        const charAfter = glob[i + 1];
+        if (charAfter === "/") {
+          if (charBefore === "/")
+            tokens.push("((.+/)|)");
+          else
+            tokens.push("(.*/)");
+          ++i;
+        } else {
+          tokens.push("(.*)");
+        }
+      } else {
+        tokens.push("([^/]*)");
+      }
+      continue;
+    }
+    switch (c) {
+      case "{":
+        if (inGroup)
+          throw new Error(`Invalid glob pattern ${JSON.stringify(glob)}: nested '{' is not supported`);
+        inGroup = true;
+        tokens.push("(");
+        break;
+      case "}":
+        if (!inGroup)
+          throw new Error(`Invalid glob pattern ${JSON.stringify(glob)}: unmatched '}'`);
+        inGroup = false;
+        tokens.push(")");
+        break;
+      case ",":
+        if (inGroup) {
+          tokens.push("|");
+          break;
+        }
+        tokens.push("\\" + c);
+        break;
+      default:
+        tokens.push(escapedChars.has(c) ? "\\" + c : c);
+    }
+  }
+  if (inGroup)
+    throw new Error(`Invalid glob pattern ${JSON.stringify(glob)}: unmatched '{'`);
+  tokens.push("$");
+  return tokens.join("");
+}
+function isRegExp3(obj) {
+  return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
+}
+function serializeURLPattern(v) {
+  return {
+    hash: v.hash,
+    hostname: v.hostname,
+    password: v.password,
+    pathname: v.pathname,
+    port: v.port,
+    protocol: v.protocol,
+    search: v.search,
+    username: v.username
+  };
+}
+function serializeURLMatch(match) {
+  if (isString(match))
+    return { glob: match };
+  if (isRegExp3(match))
+    return { regexSource: match.source, regexFlags: match.flags };
+  if (isURLPattern(match))
+    return { urlPattern: serializeURLPattern(match) };
+  return void 0;
+}
+function deserializeURLPattern(v) {
+  if (typeof globalThis.URLPattern !== "function")
+    return () => true;
+  return new globalThis.URLPattern({
+    hash: v.hash,
+    hostname: v.hostname,
+    password: v.password,
+    pathname: v.pathname,
+    port: v.port,
+    protocol: v.protocol,
+    search: v.search,
+    username: v.username
+  });
+}
+function deserializeURLMatch(match) {
+  if (match.regexSource)
+    return new RegExp(match.regexSource, match.regexFlags);
+  if (match.urlPattern)
+    return deserializeURLPattern(match.urlPattern);
+  return match.glob;
+}
+function urlMatchesEqual(match1, match2) {
+  if (isRegExp3(match1) && isRegExp3(match2))
+    return match1.source === match2.source && match1.flags === match2.flags;
+  return match1 === match2;
+}
+function urlMatches(baseURL, urlString, match, webSocketUrl) {
+  if (match === void 0 || match === "")
+    return true;
+  if (isString(match))
+    match = new RegExp(resolveGlobToRegexPattern(baseURL, match, webSocketUrl));
+  if (isRegExp3(match)) {
+    const r = match.test(urlString);
+    return r;
+  }
+  const url2 = parseURL(urlString);
+  if (!url2)
+    return false;
+  if (isURLPattern(match))
+    return match.test(url2.href);
+  if (typeof match !== "function")
+    throw new Error("url parameter should be string, RegExp, URLPattern or function");
+  return match(url2);
+}
+function resolveGlobToRegexPattern(baseURL, glob, webSocketUrl) {
+  if (webSocketUrl)
+    baseURL = toWebSocketBaseUrl(baseURL);
+  glob = resolveGlobBase(baseURL, glob);
+  return globToRegexPattern(glob);
+}
+function toWebSocketBaseUrl(baseURL) {
+  if (baseURL && /^https?:\/\//.test(baseURL))
+    baseURL = baseURL.replace(/^http/, "ws");
+  return baseURL;
+}
+function resolveGlobBase(baseURL, match) {
+  if (!match.startsWith("*")) {
+    let mapToken2 = function(original, replacement) {
+      if (original.length === 0)
+        return "";
+      tokenMap.set(replacement, original);
+      return replacement;
+    };
+    var mapToken = mapToken2;
+    const tokenMap = /* @__PURE__ */ new Map();
+    match = match.replaceAll(/\\\\\?/g, "?");
+    if (match.startsWith("about:") || match.startsWith("data:") || match.startsWith("chrome:") || match.startsWith("edge:") || match.startsWith("file:"))
+      return match;
+    const relativePath = match.split("/").map((token, index) => {
+      if (token === "." || token === ".." || token === "")
+        return token;
+      if (index === 0 && token.endsWith(":")) {
+        if (token.indexOf("*") !== -1 || token.indexOf("{") !== -1)
+          return mapToken2(token, "http:");
+        return token;
+      }
+      const questionIndex = token.indexOf("?");
+      if (questionIndex === -1)
+        return mapToken2(token, `$_${index}_$`);
+      const newPrefix = mapToken2(token.substring(0, questionIndex), `$_${index}_$`);
+      const newSuffix = mapToken2(token.substring(questionIndex), `?$_${index}_$`);
+      return newPrefix + newSuffix;
+    }).join("/");
+    const result2 = resolveBaseURL(baseURL, relativePath);
+    let resolved = result2.resolved;
+    for (const [token, original] of tokenMap) {
+      const normalize = result2.caseInsensitivePart?.includes(token);
+      resolved = resolved.replace(token, normalize ? original.toLowerCase() : original);
+    }
+    match = resolved;
+  }
+  return match;
+}
+function parseURL(url2) {
+  try {
+    return new URL(url2);
+  } catch (e) {
+    return null;
+  }
+}
+function constructURLBasedOnBaseURL(baseURL, givenURL) {
+  try {
+    return resolveBaseURL(baseURL, givenURL).resolved;
+  } catch (e) {
+    return givenURL;
+  }
+}
+function resolveBaseURL(baseURL, givenURL) {
+  try {
+    const url2 = new URL(givenURL, baseURL);
+    const resolved = url2.toString();
+    const caseInsensitivePrefix = url2.origin;
+    return { resolved, caseInsensitivePart: caseInsensitivePrefix };
+  } catch (e) {
+    return { resolved: givenURL };
+  }
+}
+var escapedChars, isURLPattern;
+var init_urlMatch = __esm({
+  "packages/isomorphic/urlMatch.ts"() {
+    "use strict";
+    init_stringUtils();
+    escapedChars = /* @__PURE__ */ new Set(["$", "^", "+", ".", "*", "(", ")", "|", "\\", "?", "{", "}", "[", "]"]);
+    isURLPattern = (v) => typeof globalThis.URLPattern === "function" && v instanceof globalThis.URLPattern;
+  }
+});
+
+// packages/isomorphic/locatorUtils.ts
+function getByAttributeTextSelector(attrName, text2, options) {
+  return `internal:attr=[${attrName}=${escapeForAttributeSelector(text2, options?.exact || false)}]`;
+}
+function encodeTestIdAttributeName(testIdAttributeName2) {
+  return testIdAttributeName2.includes(",") ? JSON.stringify(testIdAttributeName2) : testIdAttributeName2;
+}
+function getByTestIdSelector(testIdAttributeName2, testId) {
+  return `internal:testid=[${encodeTestIdAttributeName(testIdAttributeName2)}=${escapeForAttributeSelector(testId, true)}]`;
+}
+function getByLabelSelector(text2, options) {
+  return "internal:label=" + escapeForTextSelector(text2, !!options?.exact);
+}
+function getByAltTextSelector(text2, options) {
+  return getByAttributeTextSelector("alt", text2, options);
+}
+function getByTitleSelector(text2, options) {
+  return getByAttributeTextSelector("title", text2, options);
+}
+function getByPlaceholderSelector(text2, options) {
+  return getByAttributeTextSelector("placeholder", text2, options);
+}
+function getByTextSelector(text2, options) {
+  return "internal:text=" + escapeForTextSelector(text2, !!options?.exact);
+}
+function getByRoleSelector(role, options = {}) {
+  const props = [];
+  if (options.checked !== void 0)
+    props.push(["checked", String(options.checked)]);
+  if (options.disabled !== void 0)
+    props.push(["disabled", String(options.disabled)]);
+  if (options.selected !== void 0)
+    props.push(["selected", String(options.selected)]);
+  if (options.expanded !== void 0)
+    props.push(["expanded", String(options.expanded)]);
+  if (options.includeHidden !== void 0)
+    props.push(["include-hidden", String(options.includeHidden)]);
+  if (options.level !== void 0)
+    props.push(["level", String(options.level)]);
+  if (options.name !== void 0)
+    props.push(["name", escapeForAttributeSelector(options.name, !!options.exact)]);
+  if (options.description !== void 0)
+    props.push(["description", escapeForAttributeSelector(options.description, !!options.exact)]);
+  if (options.pressed !== void 0)
+    props.push(["pressed", String(options.pressed)]);
+  return `internal:role=${role}${props.map(([n, v]) => `[${n}=${v}]`).join("")}`;
+}
+var init_locatorUtils = __esm({
+  "packages/isomorphic/locatorUtils.ts"() {
+    "use strict";
+    init_stringUtils();
+  }
+});
+
+// packages/isomorphic/locatorParser.ts
+function parseLocator(locator2, testIdAttributeName2) {
+  locator2 = locator2.replace(/AriaRole\s*\.\s*([\w]+)/g, (_, group) => group.toLowerCase()).replace(/(get_by_role|getByRole)\s*\(\s*(?:["'`])([^'"`]+)['"`]/g, (_, group1, group2) => `${group1}(${group2.toLowerCase()}`);
+  const params2 = [];
+  let template = "";
+  for (let i = 0; i < locator2.length; ++i) {
+    const quote5 = locator2[i];
+    if (quote5 !== '"' && quote5 !== "'" && quote5 !== "`" && quote5 !== "/") {
+      template += quote5;
+      continue;
+    }
+    const isRegexEscaping = locator2[i - 1] === "r" || locator2[i] === "/";
+    ++i;
+    let text2 = "";
+    while (i < locator2.length) {
+      if (locator2[i] === "\\") {
+        if (isRegexEscaping) {
+          if (locator2[i + 1] !== quote5)
+            text2 += locator2[i];
+          ++i;
+          text2 += locator2[i];
+        } else {
+          ++i;
+          if (locator2[i] === "n")
+            text2 += "\n";
+          else if (locator2[i] === "r")
+            text2 += "\r";
+          else if (locator2[i] === "t")
+            text2 += "	";
+          else
+            text2 += locator2[i];
+        }
+        ++i;
+        continue;
+      }
+      if (locator2[i] !== quote5) {
+        text2 += locator2[i++];
+        continue;
+      }
+      break;
+    }
+    params2.push({ quote: quote5, text: text2 });
+    template += (quote5 === "/" ? "r" : "") + "$" + params2.length;
+  }
+  template = template.toLowerCase().replace(/get_by_alt_text/g, "getbyalttext").replace(/get_by_test_id/g, "getbytestid").replace(/get_by_([\w]+)/g, "getby$1").replace(/has_not_text/g, "hasnottext").replace(/has_text/g, "hastext").replace(/has_not/g, "hasnot").replace(/frame_locator/g, "framelocator").replace(/content_frame/g, "contentframe").replace(/[{}\s]/g, "").replace(/new\(\)/g, "").replace(/new[\w]+\.[\w]+options\(\)/g, "").replace(/\.set/g, ",set").replace(/\.or_\(/g, "or(").replace(/\.and_\(/g, "and(").replace(/:/g, "=").replace(/,re\.ignorecase/g, "i").replace(/,pattern.case_insensitive/g, "i").replace(/,regexoptions.ignorecase/g, "i").replace(/re.compile\(([^)]+)\)/g, "$1").replace(/pattern.compile\(([^)]+)\)/g, "r$1").replace(/newregex\(([^)]+)\)/g, "r$1").replace(/string=/g, "=").replace(/regex=/g, "=").replace(/,,/g, ",").replace(/,\)/g, ")");
+  const preferredQuote = params2.map((p) => p.quote).filter((quote5) => "'\"`".includes(quote5))[0];
+  return { selector: transform(template, params2, testIdAttributeName2), preferredQuote };
+}
+function countParams(template) {
+  return [...template.matchAll(/\$\d+/g)].length;
+}
+function shiftParams(template, sub) {
+  return template.replace(/\$(\d+)/g, (_, ordinal) => `$${ordinal - sub}`);
+}
+function transform(template, params2, testIdAttributeName2) {
+  while (true) {
+    const hasMatch = template.match(/filter\(,?(has=|hasnot=|sethas\(|sethasnot\()/);
+    if (!hasMatch)
+      break;
+    const start3 = hasMatch.index + hasMatch[0].length;
+    let balance = 0;
+    let end = start3;
+    for (; end < template.length; end++) {
+      if (template[end] === "(")
+        balance++;
+      else if (template[end] === ")")
+        balance--;
+      if (balance < 0)
+        break;
+    }
+    let prefix = template.substring(0, start3);
+    let extraSymbol = 0;
+    if (["sethas(", "sethasnot("].includes(hasMatch[1])) {
+      extraSymbol = 1;
+      prefix = prefix.replace(/sethas\($/, "has=").replace(/sethasnot\($/, "hasnot=");
+    }
+    const paramsCountBeforeHas = countParams(template.substring(0, start3));
+    const hasTemplate = shiftParams(template.substring(start3, end), paramsCountBeforeHas);
+    const paramsCountInHas = countParams(hasTemplate);
+    const hasParams = params2.slice(paramsCountBeforeHas, paramsCountBeforeHas + paramsCountInHas);
+    const hasSelector = JSON.stringify(transform(hasTemplate, hasParams, testIdAttributeName2));
+    template = prefix.replace(/=$/, "2=") + `$${paramsCountBeforeHas + 1}` + shiftParams(template.substring(end + extraSymbol), paramsCountInHas - 1);
+    const paramsBeforeHas = params2.slice(0, paramsCountBeforeHas);
+    const paramsAfterHas = params2.slice(paramsCountBeforeHas + paramsCountInHas);
+    params2 = paramsBeforeHas.concat([{ quote: '"', text: hasSelector }]).concat(paramsAfterHas);
+  }
+  template = template.replace(/\,set([\w]+)\(([^)]+)\)/g, (_, group1, group2) => "," + group1.toLowerCase() + "=" + group2.toLowerCase()).replace(/framelocator\(([^)]+)\)/g, "$1.internal:control=enter-frame").replace(/contentframe(\(\))?/g, "internal:control=enter-frame").replace(/locator\(([^)]+),hastext=([^),]+)\)/g, "locator($1).internal:has-text=$2").replace(/locator\(([^)]+),hasnottext=([^),]+)\)/g, "locator($1).internal:has-not-text=$2").replace(/locator\(([^)]+),hastext=([^),]+)\)/g, "locator($1).internal:has-text=$2").replace(/locator\(([^)]+)\)/g, "$1").replace(/getbyrole\(([^)]+)\)/g, "internal:role=$1").replace(/getbytext\(([^)]+)\)/g, "internal:text=$1").replace(/getbylabel\(([^)]+)\)/g, "internal:label=$1").replace(/getbytestid\(([^)]+)\)/g, `internal:testid=[${encodeTestIdAttributeName(testIdAttributeName2)}=$1]`).replace(/getby(placeholder|alt|title)(?:text)?\(([^)]+)\)/g, "internal:attr=[$1=$2]").replace(/first(\(\))?/g, "nth=0").replace(/last(\(\))?/g, "nth=-1").replace(/nth\(([^)]+)\)/g, "nth=$1").replace(/filter\(,?visible=true\)/g, "visible=true").replace(/filter\(,?visible=false\)/g, "visible=false").replace(/filter\(,?hastext=([^)]+)\)/g, "internal:has-text=$1").replace(/filter\(,?hasnottext=([^)]+)\)/g, "internal:has-not-text=$1").replace(/filter\(,?has2=([^)]+)\)/g, "internal:has=$1").replace(/filter\(,?hasnot2=([^)]+)\)/g, "internal:has-not=$1").replace(/,exact=false/g, "").replace(/(,name=\$\d+)(,description=\$\d+),exact=true/g, "$1s$2s").replace(/,exact=true/g, "s").replace(/,includehidden=/g, ",include-hidden=").replace(/\,/g, "][");
+  const parts = template.split(".");
+  for (let index = 0; index < parts.length - 1; index++) {
+    if (parts[index] === "internal:control=enter-frame" && parts[index + 1].startsWith("nth=")) {
+      const [nth] = parts.splice(index, 1);
+      parts.splice(index + 1, 0, nth);
+    }
+  }
+  return parts.map((t) => {
+    if (!t.startsWith("internal:") || t === "internal:control")
+      return t.replace(/\$(\d+)/g, (_, ordinal) => {
+        const param = params2[+ordinal - 1];
+        return param.text;
+      });
+    t = t.includes("[") ? t.replace(/\]/, "") + "]" : t;
+    t = t.replace(/(?:r)\$(\d+)(i)?/g, (_, ordinal, suffix) => {
+      const param = params2[+ordinal - 1];
+      if (t.startsWith("internal:attr") || t.startsWith("internal:testid") || t.startsWith("internal:role"))
+        return escapeForAttributeSelector(new RegExp(param.text), false) + (suffix || "");
+      return escapeForTextSelector(new RegExp(param.text, suffix), false);
+    }).replace(/\$(\d+)(i|s)?/g, (_, ordinal, suffix) => {
+      const param = params2[+ordinal - 1];
+      if (t.startsWith("internal:has=") || t.startsWith("internal:has-not="))
+        return param.text;
+      if (t.startsWith("internal:testid"))
+        return escapeForAttributeSelector(param.text, true);
+      if (t.startsWith("internal:attr") || t.startsWith("internal:role"))
+        return escapeForAttributeSelector(param.text, suffix === "s");
+      return escapeForTextSelector(param.text, suffix === "s");
+    });
+    return t;
+  }).join(" >> ");
+}
+function locatorOrSelectorAsSelector(language, locator2, testIdAttributeName2 = "data-testid") {
+  try {
+    return unsafeLocatorOrSelectorAsSelector(language, locator2, testIdAttributeName2);
+  } catch (e) {
+    return "";
+  }
+}
+function unsafeLocatorOrSelectorAsSelector(language, locator2, testIdAttributeName2 = "data-testid") {
+  try {
+    parseSelector(locator2);
+    return locator2;
+  } catch (e) {
+  }
+  const { selector, preferredQuote } = parseLocator(locator2, testIdAttributeName2);
+  const locators = asLocators(language, selector, void 0, void 0, preferredQuote);
+  const digest = digestForComparison(language, locator2);
+  if (locators.some((candidate) => digestForComparison(language, candidate) === digest))
+    return selector;
+  return "";
+}
+function digestForComparison(language, locator2) {
+  locator2 = locator2.replace(/\s/g, "");
+  if (language === "javascript")
+    locator2 = locator2.replace(/\\?["`]/g, "'").replace(/,{}/g, "");
+  return locator2;
+}
+var init_locatorParser = __esm({
+  "packages/isomorphic/locatorParser.ts"() {
+    "use strict";
+    init_locatorGenerators();
+    init_locatorUtils();
+    init_selectorParser();
+    init_stringUtils();
+  }
+});
+
+// packages/isomorphic/trace/snapshotRenderer.ts
+function findClosest(items, metric, target) {
+  return items.find((item, index) => {
+    if (index === items.length - 1)
+      return true;
+    const next = items[index + 1];
+    return Math.abs(metric(item) - target) < Math.abs(metric(next) - target);
+  });
+}
+function isNodeNameAttributesChildNodesSnapshot(n) {
+  return Array.isArray(n) && typeof n[0] === "string";
+}
+function isSubtreeReferenceSnapshot(n) {
+  return Array.isArray(n) && Array.isArray(n[0]);
+}
+function snapshotNodes(snapshot3) {
+  if (!snapshot3._nodes) {
+    const nodes = [];
+    const visit = (n) => {
+      if (typeof n === "string") {
+        nodes.push(n);
+      } else if (isNodeNameAttributesChildNodesSnapshot(n)) {
+        const [, , ...children] = n;
+        for (const child of children)
+          visit(child);
+        nodes.push(n);
+      }
+    };
+    visit(snapshot3.html);
+    snapshot3._nodes = nodes;
+  }
+  return snapshot3._nodes;
+}
+function snapshotScript(viewport, ...targetIds) {
+  function applyPlaywrightAttributes(blankSnapshotUrl2, viewport2, ...targetIds2) {
+    const win = window;
+    const searchParams = new URLSearchParams(win.location.search);
+    const shouldPopulateCanvasFromScreenshot = searchParams.has("shouldPopulateCanvasFromScreenshot");
+    const isUnderTest2 = searchParams.has("isUnderTest");
+    const frameBoundingRectsInfo = {
+      viewport: viewport2,
+      frames: /* @__PURE__ */ new WeakMap()
+    };
+    win["__playwright_frame_bounding_rects__"] = frameBoundingRectsInfo;
+    const kPointerWarningTitle = "Recorded click position in absolute coordinates did not match the center of the clicked element. This is either due to the use of provided offset, or due to a difference between the test runner and the trace viewer operating systems.";
+    const scrollTops = [];
+    const scrollLefts = [];
+    const targetElements = [];
+    const canvasElements = [];
+    let topSnapshotWindow = win;
+    while (topSnapshotWindow !== topSnapshotWindow.parent && !topSnapshotWindow.location.pathname.match(/\/page@[a-z0-9]+$/))
+      topSnapshotWindow = topSnapshotWindow.parent;
+    const visit = (root) => {
+      for (const e of root.querySelectorAll(`[__playwright_scroll_top_]`))
+        scrollTops.push(e);
+      for (const e of root.querySelectorAll(`[__playwright_scroll_left_]`))
+        scrollLefts.push(e);
+      for (const element2 of root.querySelectorAll(`[__playwright_value_]`)) {
+        const inputElement = element2;
+        if (inputElement.type !== "file")
+          inputElement.value = inputElement.getAttribute("__playwright_value_");
+        element2.removeAttribute("__playwright_value_");
+      }
+      for (const element2 of root.querySelectorAll(`[__playwright_checked_]`)) {
+        element2.checked = element2.getAttribute("__playwright_checked_") === "true";
+        element2.removeAttribute("__playwright_checked_");
+      }
+      for (const element2 of root.querySelectorAll(`[__playwright_selected_]`)) {
+        element2.selected = element2.getAttribute("__playwright_selected_") === "true";
+        element2.removeAttribute("__playwright_selected_");
+      }
+      for (const element2 of root.querySelectorAll(`[__playwright_popover_open_]`)) {
+        try {
+          element2.showPopover();
+        } catch {
+        }
+        element2.removeAttribute("__playwright_popover_open_");
+      }
+      for (const element2 of root.querySelectorAll(`[__playwright_dialog_open_]`)) {
+        try {
+          if (element2.getAttribute("__playwright_dialog_open_") === "modal")
+            element2.showModal();
+          else
+            element2.show();
+        } catch {
+        }
+        element2.removeAttribute("__playwright_dialog_open_");
+      }
+      const highlightTarget = (target) => {
+        const style = target.style;
+        style.outline = "2px solid #006ab1";
+        style.backgroundColor = "#6fa8dc7f";
+        targetElements.push(target);
+      };
+      for (const target of root.querySelectorAll(`[__playwright_target__=""]`))
+        highlightTarget(target);
+      for (const targetId of targetIds2) {
+        if (!targetId)
+          continue;
+        for (const target of root.querySelectorAll(`[__playwright_target__="${targetId}"]`))
+          highlightTarget(target);
+      }
+      for (const iframe of root.querySelectorAll("iframe, frame")) {
+        const boundingRectJson = iframe.getAttribute("__playwright_bounding_rect__");
+        iframe.removeAttribute("__playwright_bounding_rect__");
+        const boundingRect = boundingRectJson ? JSON.parse(boundingRectJson) : void 0;
+        if (boundingRect)
+          frameBoundingRectsInfo.frames.set(iframe, { boundingRect, scrollLeft: 0, scrollTop: 0 });
+        const src = iframe.getAttribute("__playwright_src__");
+        if (!src) {
+          iframe.setAttribute("src", blankSnapshotUrl2);
+        } else {
+          const url2 = new URL(win.location.href);
+          const index = url2.pathname.lastIndexOf("/snapshot/");
+          if (index !== -1)
+            url2.pathname = url2.pathname.substring(0, index + 1);
+          url2.pathname += src.substring(1);
+          iframe.setAttribute("src", url2.toString());
+        }
+      }
+      {
+        const body = root.querySelector(`body[__playwright_custom_elements__]`);
+        if (body && win.customElements) {
+          const customElements = (body.getAttribute("__playwright_custom_elements__") || "").split(",");
+          for (const elementName of customElements)
+            win.customElements.define(elementName, class extends HTMLElement {
+            });
+        }
+      }
+      for (const element2 of root.querySelectorAll(`template[__playwright_shadow_root_]`)) {
+        const template = element2;
+        const shadowRoot = template.parentElement.attachShadow({ mode: "open" });
+        shadowRoot.appendChild(template.content);
+        template.remove();
+        visit(shadowRoot);
+      }
+      for (const element2 of root.querySelectorAll("a"))
+        element2.addEventListener("click", (event) => {
+          event.preventDefault();
+        });
+      if ("adoptedStyleSheets" in root) {
+        const adoptedSheets = [...root.adoptedStyleSheets];
+        for (const element2 of root.querySelectorAll(`template[__playwright_style_sheet_]`)) {
+          const template = element2;
+          const sheet = new CSSStyleSheet();
+          sheet.replaceSync(template.getAttribute("__playwright_style_sheet_"));
+          adoptedSheets.push(sheet);
+        }
+        root.adoptedStyleSheets = adoptedSheets;
+      }
+      canvasElements.push(...root.querySelectorAll("canvas"));
+    };
+    const onLoad = () => {
+      win.removeEventListener("load", onLoad);
+      for (const element2 of scrollTops) {
+        element2.scrollTop = +element2.getAttribute("__playwright_scroll_top_");
+        element2.removeAttribute("__playwright_scroll_top_");
+        if (frameBoundingRectsInfo.frames.has(element2))
+          frameBoundingRectsInfo.frames.get(element2).scrollTop = element2.scrollTop;
+      }
+      for (const element2 of scrollLefts) {
+        element2.scrollLeft = +element2.getAttribute("__playwright_scroll_left_");
+        element2.removeAttribute("__playwright_scroll_left_");
+        if (frameBoundingRectsInfo.frames.has(element2))
+          frameBoundingRectsInfo.frames.get(element2).scrollLeft = element2.scrollLeft;
+      }
+      win.document.styleSheets[0].disabled = true;
+      const search = new URL(win.location.href).searchParams;
+      const isTopFrame = win === topSnapshotWindow;
+      if (isTopFrame && search.get("pointX") && search.get("pointY")) {
+        const pointX = +search.get("pointX");
+        const pointY = +search.get("pointY");
+        const pointElement = win.document.createElement("x-pw-pointer");
+        pointElement.style.position = "fixed";
+        pointElement.style.backgroundColor = "#f44336";
+        pointElement.style.width = "20px";
+        pointElement.style.height = "20px";
+        pointElement.style.borderRadius = "10px";
+        pointElement.style.margin = "-10px 0 0 -10px";
+        pointElement.style.zIndex = "2147483646";
+        pointElement.style.display = "flex";
+        pointElement.style.alignItems = "center";
+        pointElement.style.justifyContent = "center";
+        const target = targetElements[0];
+        const targetBox = target?.getBoundingClientRect();
+        const targetCenter = target ? { x: targetBox.left + targetBox.width / 2, y: targetBox.top + targetBox.height / 2 } : null;
+        pointElement.style.left = (targetCenter?.x ?? pointX) + "px";
+        pointElement.style.top = (targetCenter?.y ?? pointY) + "px";
+        const isAligned = !targetCenter || Math.abs(targetCenter.x - pointX) <= 10 && Math.abs(targetCenter.y - pointY) <= 10;
+        if (!isAligned) {
+          const warningElement = win.document.createElement("x-pw-pointer-warning");
+          warningElement.textContent = "\u26A0";
+          warningElement.style.fontSize = "19px";
+          warningElement.style.color = "white";
+          warningElement.style.marginTop = "-3.5px";
+          warningElement.style.userSelect = "none";
+          pointElement.appendChild(warningElement);
+          pointElement.setAttribute("title", kPointerWarningTitle);
+        }
+        win.document.documentElement.appendChild(pointElement);
+      }
+      if (canvasElements.length > 0) {
+        let drawCheckerboard2 = function(context2, canvas) {
+          function createCheckerboardPattern() {
+            const pattern = win.document.createElement("canvas");
+            pattern.width = pattern.width / Math.floor(pattern.width / 24);
+            pattern.height = pattern.height / Math.floor(pattern.height / 24);
+            const context3 = pattern.getContext("2d");
+            context3.fillStyle = "lightgray";
+            context3.fillRect(0, 0, pattern.width, pattern.height);
+            context3.fillStyle = "white";
+            context3.fillRect(0, 0, pattern.width / 2, pattern.height / 2);
+            context3.fillRect(pattern.width / 2, pattern.height / 2, pattern.width, pattern.height);
+            return context3.createPattern(pattern, "repeat");
+          }
+          context2.fillStyle = createCheckerboardPattern();
+          context2.fillRect(0, 0, canvas.width, canvas.height);
+        };
+        var drawCheckerboard = drawCheckerboard2;
+        const img = new Image();
+        img.onload = () => {
+          for (const canvas of canvasElements) {
+            const context2 = canvas.getContext("2d");
+            const boundingRectAttribute = canvas.getAttribute("__playwright_bounding_rect__");
+            canvas.removeAttribute("__playwright_bounding_rect__");
+            if (!boundingRectAttribute)
+              continue;
+            let boundingRect;
+            try {
+              boundingRect = JSON.parse(boundingRectAttribute);
+            } catch (e) {
+              continue;
+            }
+            let currWindow = win;
+            while (currWindow !== topSnapshotWindow) {
+              const iframe = currWindow.frameElement;
+              currWindow = currWindow.parent;
+              const iframeInfo = currWindow["__playwright_frame_bounding_rects__"]?.frames.get(iframe);
+              if (!iframeInfo?.boundingRect)
+                break;
+              const leftOffset = iframeInfo.boundingRect.left - iframeInfo.scrollLeft;
+              const topOffset = iframeInfo.boundingRect.top - iframeInfo.scrollTop;
+              boundingRect.left += leftOffset;
+              boundingRect.top += topOffset;
+              boundingRect.right += leftOffset;
+              boundingRect.bottom += topOffset;
+            }
+            const { width, height } = topSnapshotWindow["__playwright_frame_bounding_rects__"].viewport;
+            boundingRect.left = boundingRect.left / width;
+            boundingRect.top = boundingRect.top / height;
+            boundingRect.right = boundingRect.right / width;
+            boundingRect.bottom = boundingRect.bottom / height;
+            const partiallyUncaptured = boundingRect.right > 1 || boundingRect.bottom > 1;
+            const fullyUncaptured = boundingRect.left > 1 || boundingRect.top > 1;
+            if (fullyUncaptured) {
+              canvas.title = `Playwright couldn't capture canvas contents because it's located outside the viewport.`;
+              continue;
+            }
+            drawCheckerboard2(context2, canvas);
+            if (shouldPopulateCanvasFromScreenshot) {
+              context2.drawImage(img, boundingRect.left * img.width, boundingRect.top * img.height, (boundingRect.right - boundingRect.left) * img.width, (boundingRect.bottom - boundingRect.top) * img.height, 0, 0, canvas.width, canvas.height);
+              if (partiallyUncaptured)
+                canvas.title = `Playwright couldn't capture full canvas contents because it's located partially outside the viewport.`;
+              else
+                canvas.title = `Canvas contents are displayed on a best-effort basis based on viewport screenshots taken during test execution.`;
+            } else {
+              canvas.title = "Canvas content display is disabled.";
+            }
+            if (isUnderTest2)
+              console.log(`canvas drawn:`, JSON.stringify([boundingRect.left, boundingRect.top, boundingRect.right - boundingRect.left, boundingRect.bottom - boundingRect.top].map((v) => Math.floor(v * 100))));
+          }
+        };
+        img.onerror = () => {
+          for (const canvas of canvasElements) {
+            const context2 = canvas.getContext("2d");
+            drawCheckerboard2(context2, canvas);
+            canvas.title = `Playwright couldn't show canvas contents because the screenshot failed to load.`;
+          }
+        };
+        img.src = location.href.replace("/snapshot", "/closest-screenshot");
+      }
+    };
+    const onDOMContentLoaded = () => visit(win.document);
+    win.addEventListener("load", onLoad);
+    win.addEventListener("DOMContentLoaded", onDOMContentLoaded);
+  }
+  const safe = (value2) => JSON.stringify(value2).replace(/ `, ${safe(String(id))}`).join("")})`;
+}
+function rewriteURLForCustomProtocol(href) {
+  if (href.startsWith(kLegacyBlobPrefix))
+    href = href.substring(kLegacyBlobPrefix.length);
+  try {
+    const url2 = new URL(href);
+    if (url2.protocol === "javascript:" || url2.protocol === "vbscript:")
+      return "javascript:void(0)";
+    const isBlob = url2.protocol === "blob:";
+    const isFile = url2.protocol === "file:";
+    if (!isBlob && !isFile && schemas.includes(url2.protocol))
+      return href;
+    const prefix = "pw-" + url2.protocol.slice(0, url2.protocol.length - 1);
+    if (!isFile)
+      url2.protocol = "https:";
+    url2.hostname = url2.hostname ? `${prefix}--${url2.hostname}` : prefix;
+    if (isFile) {
+      url2.protocol = "https:";
+    }
+    return url2.toString();
+  } catch {
+    return href;
+  }
+}
+function rewriteURLsInStyleSheetForCustomProtocol(text2) {
+  return text2.replace(urlInCSSRegex, (match, protocol) => {
+    const isBlob = protocol === "blob:";
+    const isFile = protocol === "file:";
+    if (!isBlob && !isFile && schemas.includes(protocol))
+      return match;
+    return match.replace(protocol + "//", `https://pw-${protocol.slice(0, -1)}--`);
+  });
+}
+function escapeURLsInStyleSheet(text2) {
+  const replacer = (match, url2) => {
+    if (url2.includes(" frame.frameSwapWallTime, wallTime) : findClosest(this._screencastFrames, (frame) => frame.timestamp, timestamp);
+        return closestFrame?.sha1;
+      }
+      render() {
+        const result2 = [];
+        const visit = (n, snapshotIndex, parentTag, parentAttrs) => {
+          if (typeof n === "string") {
+            if (parentTag === "STYLE" || parentTag === "style")
+              result2.push(escapeURLsInStyleSheet(rewriteURLsInStyleSheetForCustomProtocol(n)));
+            else
+              result2.push(escapeHTML(n));
+            return;
+          }
+          if (isSubtreeReferenceSnapshot(n)) {
+            const referenceIndex = snapshotIndex - n[0][0];
+            if (referenceIndex >= 0 && referenceIndex <= snapshotIndex) {
+              const nodes = snapshotNodes(this._snapshots[referenceIndex]);
+              const nodeIndex = n[0][1];
+              if (nodeIndex >= 0 && nodeIndex < nodes.length)
+                return visit(nodes[nodeIndex], referenceIndex, parentTag, parentAttrs);
+            }
+          } else if (isNodeNameAttributesChildNodesSnapshot(n)) {
+            const [name, nodeAttrs, ...children] = n;
+            if (name.toUpperCase() === "SCRIPT")
+              return;
+            const upperName = name.toUpperCase();
+            const nodeName = upperName === "NOSCRIPT" ? "X-NOSCRIPT" : name;
+            const attrs = Object.entries(nodeAttrs || {});
+            result2.push("<", nodeName);
+            const kCurrentSrcAttribute = "__playwright_current_src__";
+            const isFrame = upperName === "IFRAME" || upperName === "FRAME";
+            const isAnchor = upperName === "A";
+            const isImg = upperName === "IMG";
+            const isMeta = upperName === "META";
+            const isImgWithCurrentSrc = isImg && attrs.some((a) => a[0] === kCurrentSrcAttribute);
+            const isSourceInsidePictureWithCurrentSrc = upperName === "SOURCE" && parentTag === "PICTURE" && parentAttrs?.some((a) => a[0] === kCurrentSrcAttribute);
+            const hasUnsafeHttpEquiv = isMeta && attrs.some((a) => a[0].toLowerCase() === "http-equiv" && !kAllowedMetaHttpEquivs.has(a[1].trim().toLowerCase()));
+            for (const [attr, value2] of attrs) {
+              let attrName = attr;
+              if (attr.toLowerCase().startsWith("on"))
+                continue;
+              if (isFrame && attr.toLowerCase() === "src") {
+                attrName = "__playwright_src__";
+              }
+              if (isFrame && (attr.toLowerCase() === "srcdoc" || attr.toLowerCase() === "sandbox")) {
+                attrName = "__playwright_" + attr.toLowerCase() + "__";
+              }
+              if (upperName === "OBJECT" && attr.toLowerCase() === "data")
+                attrName = "__playwright_data__";
+              if (upperName === "EMBED" && attr.toLowerCase() === "src")
+                attrName = "__playwright_src__";
+              if (isImg && attr === kCurrentSrcAttribute) {
+                attrName = "src";
+              }
+              if (["src", "srcset"].includes(attr.toLowerCase()) && (isImgWithCurrentSrc || isSourceInsidePictureWithCurrentSrc)) {
+                attrName = "_" + attrName;
+              }
+              if (hasUnsafeHttpEquiv && (attr.toLowerCase() === "http-equiv" || attr.toLowerCase() === "content")) {
+                attrName = "_" + attr;
+              }
+              let attrValue = value2;
+              if (!isAnchor && (attr.toLowerCase() === "href" || attr.toLowerCase() === "src" || attr === kCurrentSrcAttribute))
+                attrValue = rewriteURLForCustomProtocol(value2);
+              result2.push(" ", attrName, '="', escapeHTMLAttribute(attrValue), '"');
+            }
+            result2.push(">");
+            for (const child of children)
+              visit(child, snapshotIndex, nodeName, attrs);
+            if (!autoClosing.has(nodeName))
+              result2.push("");
+            return;
+          } else {
+            return;
+          }
+        };
+        const snapshot3 = this._snapshot;
+        const html = this._htmlCache.getOrCompute(this, () => {
+          visit(snapshot3.html, this._index, void 0, void 0);
+          const safeDoctype = snapshot3.doctype?.replace(/[^a-zA-Z0-9]/g, "");
+          const prefix = safeDoctype ? `` : "";
+          const html2 = prefix + [
+            // Hide the document in order to prevent flickering. We will unhide once script has processed shadow.
+            "",
+            ``
+          ].join("") + result2.join("");
+          return { value: html2, size: html2.length };
+        });
+        return { html, pageId: snapshot3.pageId, frameId: snapshot3.frameId, index: this._index };
+      }
+      resourceByUrl(url2, method) {
+        const snapshot3 = this._snapshot;
+        let sameFrameResource;
+        let otherFrameResource;
+        for (const resource of this._resources) {
+          if (typeof resource._monotonicTime === "number" && resource._monotonicTime >= snapshot3.timestamp)
+            break;
+          if (resource.response.status === 304) {
+            continue;
+          }
+          if (resource.request.url === url2 && resource.request.method === method) {
+            if (resource._frameref === snapshot3.frameId)
+              sameFrameResource = resource;
+            else
+              otherFrameResource = resource;
+          }
+        }
+        let result2 = sameFrameResource ?? otherFrameResource;
+        if (result2 && method.toUpperCase() === "GET") {
+          let override = snapshot3.resourceOverrides.find((o) => o.url === url2);
+          if (override?.ref) {
+            const index = this._index - override.ref;
+            if (index >= 0 && index < this._snapshots.length)
+              override = this._snapshots[index].resourceOverrides.find((o) => o.url === url2);
+          }
+          if (override?.sha1) {
+            result2 = {
+              ...result2,
+              response: {
+                ...result2.response,
+                content: {
+                  ...result2.response.content,
+                  _sha1: override.sha1
+                }
+              }
+            };
+          }
+        }
+        return result2;
+      }
+    };
+    autoClosing = /* @__PURE__ */ new Set(["AREA", "BASE", "BR", "COL", "COMMAND", "EMBED", "HR", "IMG", "INPUT", "KEYGEN", "LINK", "MENUITEM", "META", "PARAM", "SOURCE", "TRACK", "WBR"]);
+    kAllowedMetaHttpEquivs = /* @__PURE__ */ new Set(["content-type", "content-language", "default-style", "x-ua-compatible"]);
+    schemas = ["about:", "blob:", "data:", "file:", "ftp:", "http:", "https:", "mailto:", "sftp:", "ws:", "wss:"];
+    kLegacyBlobPrefix = "http://playwright.bloburl/#";
+    urlInCSSRegex = /url\(['"]?([\w-]+:)\/\//ig;
+    urlToEscapeRegex1 = /url\(\s*'([^']*)'\s*\)/ig;
+    urlToEscapeRegex2 = /url\(\s*"([^"]*)"\s*\)/ig;
+    blankSnapshotUrl = "data:text/html;base64," + btoa(``);
+  }
+});
+
+// packages/isomorphic/lruCache.ts
+var LRUCache;
+var init_lruCache = __esm({
+  "packages/isomorphic/lruCache.ts"() {
+    "use strict";
+    LRUCache = class {
+      constructor(maxSize) {
+        this._maxSize = maxSize;
+        this._map = /* @__PURE__ */ new Map();
+        this._size = 0;
+      }
+      getOrCompute(key, compute) {
+        if (this._map.has(key)) {
+          const result3 = this._map.get(key);
+          this._map.delete(key);
+          this._map.set(key, result3);
+          return result3.value;
+        }
+        const result2 = compute();
+        while (this._map.size && this._size + result2.size > this._maxSize) {
+          const [firstKey, firstValue] = this._map.entries().next().value;
+          this._size -= firstValue.size;
+          this._map.delete(firstKey);
+        }
+        this._map.set(key, result2);
+        this._size += result2.size;
+        return result2.value;
+      }
+    };
+  }
+});
+
+// packages/isomorphic/trace/snapshotStorage.ts
+var SnapshotStorage;
+var init_snapshotStorage = __esm({
+  "packages/isomorphic/trace/snapshotStorage.ts"() {
+    "use strict";
+    init_snapshotRenderer();
+    init_lruCache();
+    SnapshotStorage = class {
+      constructor() {
+        this._frameSnapshots = /* @__PURE__ */ new Map();
+        this._cache = new LRUCache(1e8);
+        // 100MB per each trace
+        this._contextToResources = /* @__PURE__ */ new Map();
+        this._resourceUrlsWithOverrides = /* @__PURE__ */ new Set();
+      }
+      addResource(contextId4, resource) {
+        resource.request.url = rewriteURLForCustomProtocol(resource.request.url);
+        this._ensureResourcesForContext(contextId4).push(resource);
+      }
+      addFrameSnapshot(contextId4, snapshot3, screencastFrames) {
+        for (const override of snapshot3.resourceOverrides)
+          override.url = rewriteURLForCustomProtocol(override.url);
+        let frameSnapshots = this._frameSnapshots.get(snapshot3.frameId);
+        if (!frameSnapshots) {
+          frameSnapshots = {
+            raw: [],
+            renderers: []
+          };
+          this._frameSnapshots.set(snapshot3.frameId, frameSnapshots);
+          if (snapshot3.isMainFrame)
+            this._frameSnapshots.set(snapshot3.pageId, frameSnapshots);
+        }
+        frameSnapshots.raw.push(snapshot3);
+        const resources = this._ensureResourcesForContext(contextId4);
+        const renderer = new SnapshotRenderer(this._cache, resources, frameSnapshots.raw, screencastFrames, frameSnapshots.raw.length - 1);
+        frameSnapshots.renderers.push(renderer);
+        return renderer;
+      }
+      snapshotByName(pageOrFrameId, snapshotName) {
+        const snapshot3 = this._frameSnapshots.get(pageOrFrameId);
+        return snapshot3?.renderers.find((r) => r.snapshotName === snapshotName);
+      }
+      snapshotsForTest() {
+        return [...this._frameSnapshots.keys()];
+      }
+      finalize() {
+        for (const resources of this._contextToResources.values())
+          resources.sort((a, b) => (a._monotonicTime || 0) - (b._monotonicTime || 0));
+        for (const frameSnapshots of this._frameSnapshots.values()) {
+          for (const snapshot3 of frameSnapshots.raw) {
+            for (const override of snapshot3.resourceOverrides)
+              this._resourceUrlsWithOverrides.add(override.url);
+          }
+        }
+      }
+      hasResourceOverride(url2) {
+        return this._resourceUrlsWithOverrides.has(url2);
+      }
+      _ensureResourcesForContext(contextId4) {
+        let resources = this._contextToResources.get(contextId4);
+        if (!resources) {
+          resources = [];
+          this._contextToResources.set(contextId4, resources);
+        }
+        return resources;
+      }
+    };
+  }
+});
+
+// packages/isomorphic/trace/traceUtils.ts
+function parseClientSideCallMetadata(data) {
+  const result2 = /* @__PURE__ */ new Map();
+  const { files, stacks } = data;
+  for (const s of stacks) {
+    const [id, ff] = s;
+    result2.set(`call@${id}`, ff.map((f) => ({ file: files[f[0]], line: f[1], column: f[2], function: f[3] })));
+  }
+  return result2;
+}
+function serializeClientSideCallMetadata(metadatas) {
+  const fileNames = /* @__PURE__ */ new Map();
+  const stacks = [];
+  for (const m of metadatas) {
+    if (!m.stack || !m.stack.length)
+      continue;
+    const stack = [];
+    for (const frame of m.stack) {
+      let ordinal = fileNames.get(frame.file);
+      if (typeof ordinal !== "number") {
+        ordinal = fileNames.size;
+        fileNames.set(frame.file, ordinal);
+      }
+      const stackFrame = [ordinal, frame.line || 0, frame.column || 0, frame.function || ""];
+      stack.push(stackFrame);
+    }
+    stacks.push([m.id, stack]);
+  }
+  return { files: [...fileNames.keys()], stacks };
+}
+var init_traceUtils = __esm({
+  "packages/isomorphic/trace/traceUtils.ts"() {
+    "use strict";
+  }
+});
+
+// packages/isomorphic/trace/traceModernizer.ts
+var TraceVersionError, latestVersion, TraceModernizer;
+var init_traceModernizer = __esm({
+  "packages/isomorphic/trace/traceModernizer.ts"() {
+    "use strict";
+    TraceVersionError = class extends Error {
+      constructor(message) {
+        super(message);
+        this.name = "TraceVersionError";
+      }
+    };
+    latestVersion = 8;
+    TraceModernizer = class {
+      constructor(contextEntry, snapshotStorage) {
+        this._actionMap = /* @__PURE__ */ new Map();
+        this._pageEntries = /* @__PURE__ */ new Map();
+        this._jsHandles = /* @__PURE__ */ new Map();
+        this._consoleObjects = /* @__PURE__ */ new Map();
+        this._contextEntry = contextEntry;
+        this._snapshotStorage = snapshotStorage;
+      }
+      appendTrace(trace) {
+        for (const line of trace.split("\n"))
+          this._appendEvent(line);
+      }
+      actions() {
+        return [...this._actionMap.values()];
+      }
+      _pageEntry(pageId4) {
+        let pageEntry = this._pageEntries.get(pageId4);
+        if (!pageEntry) {
+          pageEntry = {
+            pageId: pageId4,
+            screencastFrames: []
+          };
+          this._pageEntries.set(pageId4, pageEntry);
+          this._contextEntry.pages.push(pageEntry);
+        }
+        return pageEntry;
+      }
+      _appendEvent(line) {
+        if (!line)
+          return;
+        const events = this._modernize(JSON.parse(line));
+        for (const event of events)
+          this._innerAppendEvent(event);
+      }
+      _innerAppendEvent(event) {
+        const contextEntry = this._contextEntry;
+        switch (event.type) {
+          case "context-options": {
+            if (event.version > latestVersion)
+              throw new TraceVersionError("The trace was created by a newer version of Playwright and is not supported by this version of the viewer. Please use latest Playwright to open the trace.");
+            this._version = event.version;
+            contextEntry.origin = event.origin;
+            contextEntry.browserName = event.browserName;
+            contextEntry.channel = event.channel;
+            contextEntry.title = event.title;
+            contextEntry.platform = event.platform;
+            contextEntry.playwrightVersion = event.playwrightVersion;
+            contextEntry.wallTime = event.wallTime;
+            contextEntry.startTime = event.monotonicTime;
+            contextEntry.sdkLanguage = event.sdkLanguage;
+            contextEntry.options = event.options;
+            contextEntry.testIdAttributeName = event.testIdAttributeName;
+            contextEntry.contextId = event.contextId ?? "";
+            contextEntry.testTimeout = event.testTimeout;
+            break;
+          }
+          case "screencast-frame": {
+            this._pageEntry(event.pageId).screencastFrames.push(event);
+            break;
+          }
+          case "before": {
+            this._actionMap.set(event.callId, { ...event, type: "action", endTime: 0, log: [] });
+            break;
+          }
+          case "input": {
+            const existing = this._actionMap.get(event.callId);
+            existing.inputSnapshot = event.inputSnapshot;
+            existing.point = event.point;
+            break;
+          }
+          case "log": {
+            const existing = this._actionMap.get(event.callId);
+            if (!existing)
+              return;
+            existing.log.push({
+              time: event.time,
+              message: event.message
+            });
+            break;
+          }
+          case "after": {
+            const existing = this._actionMap.get(event.callId);
+            existing.afterSnapshot = event.afterSnapshot;
+            existing.endTime = event.endTime;
+            existing.result = event.result;
+            existing.error = event.error;
+            existing.attachments = event.attachments;
+            existing.annotations = event.annotations;
+            if (event.point)
+              existing.point = event.point;
+            break;
+          }
+          case "action": {
+            this._actionMap.set(event.callId, { ...event, log: [] });
+            break;
+          }
+          case "event": {
+            contextEntry.events.push(event);
+            break;
+          }
+          case "stdout": {
+            contextEntry.stdio.push(event);
+            break;
+          }
+          case "stderr": {
+            contextEntry.stdio.push(event);
+            break;
+          }
+          case "error": {
+            contextEntry.errors.push(event);
+            break;
+          }
+          case "console": {
+            contextEntry.events.push(event);
+            break;
+          }
+          case "resource-snapshot":
+            this._snapshotStorage.addResource(this._contextEntry.contextId, event.snapshot);
+            contextEntry.resources.push(event.snapshot);
+            break;
+          case "frame-snapshot":
+            this._snapshotStorage.addFrameSnapshot(this._contextEntry.contextId, event.snapshot, this._pageEntry(event.snapshot.pageId).screencastFrames);
+            break;
+        }
+        if ("pageId" in event && event.pageId)
+          this._pageEntry(event.pageId);
+        if (event.type === "action" || event.type === "before")
+          contextEntry.startTime = Math.min(contextEntry.startTime, event.startTime);
+        if (event.type === "action" || event.type === "after")
+          contextEntry.endTime = Math.max(contextEntry.endTime, event.endTime);
+        if (event.type === "event") {
+          contextEntry.startTime = Math.min(contextEntry.startTime, event.time);
+          contextEntry.endTime = Math.max(contextEntry.endTime, event.time);
+        }
+        if (event.type === "screencast-frame") {
+          contextEntry.startTime = Math.min(contextEntry.startTime, event.timestamp);
+          contextEntry.endTime = Math.max(contextEntry.endTime, event.timestamp);
+        }
+      }
+      _processedContextCreatedEvent() {
+        return this._version !== void 0;
+      }
+      _modernize(event) {
+        let version3 = this._version ?? event.version ?? 6;
+        let events = [event];
+        for (; version3 < latestVersion; ++version3)
+          events = this[`_modernize_${version3}_to_${version3 + 1}`].call(this, events);
+        return events;
+      }
+      _modernize_0_to_1(events) {
+        for (const event of events) {
+          if (event.type !== "action")
+            continue;
+          if (typeof event.metadata.error === "string")
+            event.metadata.error = { error: { name: "Error", message: event.metadata.error } };
+        }
+        return events;
+      }
+      _modernize_1_to_2(events) {
+        for (const event of events) {
+          if (event.type !== "frame-snapshot" || !event.snapshot.isMainFrame)
+            continue;
+          event.snapshot.viewport = this._contextEntry.options?.viewport || { width: 1280, height: 720 };
+        }
+        return events;
+      }
+      _modernize_2_to_3(events) {
+        for (const event of events) {
+          if (event.type !== "resource-snapshot" || event.snapshot.request)
+            continue;
+          const resource = event.snapshot;
+          event.snapshot = {
+            _frameref: resource.frameId,
+            request: {
+              url: resource.url,
+              method: resource.method,
+              headers: resource.requestHeaders,
+              postData: resource.requestSha1 ? { _sha1: resource.requestSha1 } : void 0
+            },
+            response: {
+              status: resource.status,
+              headers: resource.responseHeaders,
+              content: {
+                mimeType: resource.contentType,
+                _sha1: resource.responseSha1
+              }
+            },
+            _monotonicTime: resource.timestamp
+          };
+        }
+        return events;
+      }
+      _modernize_3_to_4(events) {
+        const result2 = [];
+        for (const event of events) {
+          const e = this._modernize_event_3_to_4(event);
+          if (e)
+            result2.push(e);
+        }
+        return result2;
+      }
+      _modernize_event_3_to_4(event) {
+        if (event.type !== "action" && event.type !== "event") {
+          return event;
+        }
+        const metadata = event.metadata;
+        if (metadata.internal || metadata.method.startsWith("tracing"))
+          return null;
+        if (event.type === "event") {
+          if (metadata.method === "__create__" && metadata.type === "ConsoleMessage") {
+            return {
+              type: "object",
+              class: metadata.type,
+              guid: metadata.params.guid,
+              initializer: metadata.params.initializer
+            };
+          }
+          return {
+            type: "event",
+            time: metadata.startTime,
+            class: metadata.type,
+            method: metadata.method,
+            params: metadata.params,
+            pageId: metadata.pageId
+          };
+        }
+        return {
+          type: "action",
+          callId: metadata.id,
+          startTime: metadata.startTime,
+          endTime: metadata.endTime,
+          apiName: metadata.apiName || metadata.type + "." + metadata.method,
+          class: metadata.type,
+          method: metadata.method,
+          params: metadata.params,
+          // eslint-disable-next-line no-restricted-globals
+          wallTime: metadata.wallTime || Date.now(),
+          log: metadata.log,
+          beforeSnapshot: metadata.snapshots.find((s) => s.title === "before")?.snapshotName,
+          inputSnapshot: metadata.snapshots.find((s) => s.title === "input")?.snapshotName,
+          afterSnapshot: metadata.snapshots.find((s) => s.title === "after")?.snapshotName,
+          error: metadata.error?.error,
+          result: metadata.result,
+          point: metadata.point,
+          pageId: metadata.pageId
+        };
+      }
+      _modernize_4_to_5(events) {
+        const result2 = [];
+        for (const event of events) {
+          const e = this._modernize_event_4_to_5(event);
+          if (e)
+            result2.push(e);
+        }
+        return result2;
+      }
+      _modernize_event_4_to_5(event) {
+        if (event.type === "event" && event.method === "__create__" && event.class === "JSHandle")
+          this._jsHandles.set(event.params.guid, event.params.initializer);
+        if (event.type === "object") {
+          if (event.class !== "ConsoleMessage")
+            return null;
+          const args = event.initializer.args?.map((arg) => {
+            if (arg.guid) {
+              const handle = this._jsHandles.get(arg.guid);
+              return { preview: handle?.preview || "", value: "" };
+            }
+            return { preview: arg.preview || "", value: arg.value || "" };
+          });
+          this._consoleObjects.set(event.guid, {
+            type: event.initializer.type,
+            text: event.initializer.text,
+            location: event.initializer.location,
+            args
+          });
+          return null;
+        }
+        if (event.type === "event" && event.method === "console") {
+          const consoleMessage = this._consoleObjects.get(event.params.message?.guid || "");
+          if (!consoleMessage)
+            return null;
+          return {
+            type: "console",
+            time: event.time,
+            pageId: event.pageId,
+            messageType: consoleMessage.type,
+            text: consoleMessage.text,
+            args: consoleMessage.args,
+            location: consoleMessage.location
+          };
+        }
+        return event;
+      }
+      _modernize_5_to_6(events) {
+        const result2 = [];
+        for (const event of events) {
+          result2.push(event);
+          if (event.type !== "after" || !event.log.length)
+            continue;
+          for (const log2 of event.log) {
+            result2.push({
+              type: "log",
+              callId: event.callId,
+              message: log2,
+              time: -1
+            });
+          }
+        }
+        return result2;
+      }
+      _modernize_6_to_7(events) {
+        const result2 = [];
+        if (!this._processedContextCreatedEvent() && events[0].type !== "context-options") {
+          const event = {
+            type: "context-options",
+            origin: "testRunner",
+            version: 6,
+            browserName: "",
+            options: {},
+            platform: "unknown",
+            wallTime: 0,
+            monotonicTime: 0,
+            sdkLanguage: "javascript",
+            contextId: ""
+          };
+          result2.push(event);
+        }
+        for (const event of events) {
+          if (event.type === "context-options") {
+            result2.push({ ...event, monotonicTime: 0, origin: "library", contextId: "" });
+            continue;
+          }
+          if (event.type === "before" || event.type === "action") {
+            if (!this._contextEntry.wallTime)
+              this._contextEntry.wallTime = event.wallTime;
+            const eventAsV6 = event;
+            const eventAsV7 = event;
+            eventAsV7.stepId = `${eventAsV6.apiName}@${eventAsV6.wallTime}`;
+            result2.push(eventAsV7);
+          } else {
+            result2.push(event);
+          }
+        }
+        return result2;
+      }
+      _modernize_7_to_8(events) {
+        const result2 = [];
+        for (const event of events) {
+          if (event.type === "before" || event.type === "action") {
+            const eventAsV7 = event;
+            const eventAsV8 = event;
+            if (eventAsV7.apiName) {
+              eventAsV8.title = eventAsV7.apiName;
+              delete eventAsV8.apiName;
+            }
+            eventAsV8.stepId = eventAsV7.stepId ?? eventAsV7.callId;
+            result2.push(eventAsV8);
+          } else {
+            result2.push(event);
+          }
+        }
+        return result2;
+      }
+    };
+  }
+});
+
+// packages/isomorphic/trace/traceLoader.ts
+function stripEncodingFromContentType(contentType) {
+  const charset = contentType.match(/^(.*);\s*charset=.*$/);
+  if (charset)
+    return charset[1];
+  return contentType;
+}
+function createEmptyContext() {
+  return {
+    origin: "testRunner",
+    startTime: Number.MAX_SAFE_INTEGER,
+    wallTime: Number.MAX_SAFE_INTEGER,
+    endTime: 0,
+    browserName: "",
+    options: {
+      deviceScaleFactor: 1,
+      isMobile: false,
+      viewport: { width: 1280, height: 800 }
+    },
+    pages: [],
+    resources: [],
+    actions: [],
+    events: [],
+    errors: [],
+    stdio: [],
+    hasSource: false,
+    contextId: ""
+  };
+}
+var TraceLoader;
+var init_traceLoader = __esm({
+  "packages/isomorphic/trace/traceLoader.ts"() {
+    "use strict";
+    init_traceUtils();
+    init_snapshotStorage();
+    init_traceModernizer();
+    TraceLoader = class {
+      constructor() {
+        this.contextEntries = [];
+        this._resourceToContentType = /* @__PURE__ */ new Map();
+      }
+      async load(backend, traceFile, unzipProgress) {
+        this._backend = backend;
+        const prefix = traceFile?.match(/(.+)\.trace$/)?.[1];
+        const prefixes = [];
+        let hasSource = false;
+        for (const entryName of await this._backend.entryNames()) {
+          const match = entryName.match(/(.+)\.trace$/);
+          if (match && (!prefix || prefix === match[1]))
+            prefixes.push(match[1] || "");
+          if (entryName.includes("src@"))
+            hasSource = true;
+        }
+        if (!prefixes.length)
+          throw new Error("Cannot find .trace file");
+        this._snapshotStorage = new SnapshotStorage();
+        const total = prefixes.length * 3;
+        let done = 0;
+        for (const prefix2 of prefixes) {
+          const contextEntry = createEmptyContext();
+          contextEntry.hasSource = hasSource;
+          const modernizer = new TraceModernizer(contextEntry, this._snapshotStorage);
+          const trace = await this._backend.readText(prefix2 + ".trace") || "";
+          modernizer.appendTrace(trace);
+          unzipProgress?.(++done, total);
+          const network = await this._backend.readText(prefix2 + ".network") || "";
+          modernizer.appendTrace(network);
+          unzipProgress?.(++done, total);
+          contextEntry.actions = modernizer.actions().sort((a1, a2) => a1.startTime - a2.startTime);
+          if (!backend.isLive()) {
+            for (const action of contextEntry.actions.slice().reverse()) {
+              if (!action.endTime && !action.error) {
+                for (const a of contextEntry.actions) {
+                  if (a.parentId === action.callId && action.endTime < a.endTime)
+                    action.endTime = a.endTime;
+                }
+              }
+            }
+          }
+          const stacks = await this._backend.readText(prefix2 + ".stacks");
+          if (stacks) {
+            const callMetadata = parseClientSideCallMetadata(JSON.parse(stacks));
+            for (const action of contextEntry.actions)
+              action.stack = action.stack || callMetadata.get(action.callId);
+          }
+          unzipProgress?.(++done, total);
+          for (const resource of contextEntry.resources) {
+            if (resource.request.postData?._sha1)
+              this._resourceToContentType.set(resource.request.postData._sha1, stripEncodingFromContentType(resource.request.postData.mimeType));
+            if (resource.response.content?._sha1)
+              this._resourceToContentType.set(resource.response.content._sha1, stripEncodingFromContentType(resource.response.content.mimeType));
+          }
+          this.contextEntries.push(contextEntry);
+        }
+        this._snapshotStorage.finalize();
+      }
+      async hasEntry(filename) {
+        return this._backend.hasEntry(filename);
+      }
+      async resourceForSha1(sha1) {
+        const blob = await this._backend.readBlob("resources/" + sha1);
+        const contentType = this._resourceToContentType.get(sha1);
+        if (!blob || contentType === void 0 || contentType === "x-unknown")
+          return blob;
+        return new Blob([blob], { type: contentType });
+      }
+      storage() {
+        return this._snapshotStorage;
+      }
+    };
+  }
+});
+
+// packages/isomorphic/trace/traceModel.ts
+function indexModel(context2) {
+  for (const page of context2.pages)
+    page[contextSymbol] = context2;
+  for (let i = 0; i < context2.actions.length; ++i) {
+    const action = context2.actions[i];
+    action[contextSymbol] = context2;
+  }
+  let lastNonRouteAction = void 0;
+  for (let i = context2.actions.length - 1; i >= 0; i--) {
+    const action = context2.actions[i];
+    action[nextInContextSymbol] = lastNonRouteAction;
+    if (action.class !== "Route")
+      lastNonRouteAction = action;
+  }
+  for (const event of context2.events)
+    event[contextSymbol] = context2;
+  for (const resource of context2.resources)
+    resource[contextSymbol] = context2;
+}
+function mergeActionsAndUpdateTiming(contexts) {
+  const result2 = [];
+  const actions = mergeActionsAndUpdateTimingSameTrace(contexts);
+  result2.push(...actions);
+  result2.sort((a1, a2) => {
+    if (a2.parentId === a1.callId)
+      return 1;
+    if (a1.parentId === a2.callId)
+      return -1;
+    return a1.endTime - a2.endTime;
+  });
+  for (let i = 1; i < result2.length; ++i)
+    result2[i][prevByEndTimeSymbol] = result2[i - 1];
+  result2.sort((a1, a2) => {
+    if (a2.parentId === a1.callId)
+      return -1;
+    if (a1.parentId === a2.callId)
+      return 1;
+    return a1.startTime - a2.startTime;
+  });
+  for (let i = 0; i + 1 < result2.length; ++i)
+    result2[i][nextByStartTimeSymbol] = result2[i + 1];
+  return result2;
+}
+function mergeActionsAndUpdateTimingSameTrace(contexts) {
+  const map = /* @__PURE__ */ new Map();
+  const libraryContexts = contexts.filter((context2) => context2.origin === "library");
+  const testRunnerContexts = contexts.filter((context2) => context2.origin === "testRunner");
+  if (!testRunnerContexts.length || !libraryContexts.length) {
+    return contexts.map((context2) => {
+      return context2.actions.map((action) => ({ ...action, context: context2 }));
+    }).flat();
+  }
+  for (const context2 of libraryContexts) {
+    for (const action of context2.actions) {
+      map.set(action.stepId || `tmp-step@${++lastTmpStepId}`, { ...action, context: context2 });
+    }
+  }
+  const delta = monotonicTimeDeltaBetweenLibraryAndRunner(testRunnerContexts, map);
+  if (delta)
+    adjustMonotonicTime(libraryContexts, delta);
+  const nonPrimaryIdToPrimaryId = /* @__PURE__ */ new Map();
+  for (const context2 of testRunnerContexts) {
+    for (const action of context2.actions) {
+      const existing = action.stepId && map.get(action.stepId);
+      if (existing) {
+        nonPrimaryIdToPrimaryId.set(action.callId, existing.callId);
+        if (action.error)
+          existing.error = action.error;
+        if (action.attachments)
+          existing.attachments = action.attachments;
+        if (action.annotations)
+          existing.annotations = action.annotations;
+        if (action.parentId)
+          existing.parentId = nonPrimaryIdToPrimaryId.get(action.parentId) ?? action.parentId;
+        if (action.group)
+          existing.group = action.group;
+        existing.startTime = action.startTime;
+        existing.endTime = action.endTime;
+        continue;
+      }
+      if (action.parentId)
+        action.parentId = nonPrimaryIdToPrimaryId.get(action.parentId) ?? action.parentId;
+      map.set(action.stepId || `tmp-step@${++lastTmpStepId}`, { ...action, context: context2 });
+    }
+  }
+  return [...map.values()];
+}
+function adjustMonotonicTime(contexts, monotonicTimeDelta) {
+  for (const context2 of contexts) {
+    context2.startTime += monotonicTimeDelta;
+    context2.endTime += monotonicTimeDelta;
+    for (const action of context2.actions) {
+      if (action.startTime)
+        action.startTime += monotonicTimeDelta;
+      if (action.endTime)
+        action.endTime += monotonicTimeDelta;
+    }
+    for (const event of context2.events)
+      event.time += monotonicTimeDelta;
+    for (const event of context2.stdio)
+      event.timestamp += monotonicTimeDelta;
+    for (const page of context2.pages) {
+      for (const frame of page.screencastFrames)
+        frame.timestamp += monotonicTimeDelta;
+    }
+    for (const resource of context2.resources) {
+      if (resource._monotonicTime)
+        resource._monotonicTime += monotonicTimeDelta;
+    }
+  }
+}
+function monotonicTimeDeltaBetweenLibraryAndRunner(nonPrimaryContexts, libraryActions) {
+  for (const context2 of nonPrimaryContexts) {
+    for (const action of context2.actions) {
+      if (!action.startTime)
+        continue;
+      const libraryAction = action.stepId ? libraryActions.get(action.stepId) : void 0;
+      if (libraryAction)
+        return action.startTime - libraryAction.startTime;
+    }
+  }
+  return 0;
+}
+function buildActionTree(actions) {
+  const itemMap = /* @__PURE__ */ new Map();
+  for (const action of actions) {
+    itemMap.set(action.callId, {
+      id: action.callId,
+      parent: void 0,
+      children: [],
+      action
+    });
+  }
+  const rootItem = { action: { ...kFakeRootAction }, id: "", parent: void 0, children: [] };
+  for (const item of itemMap.values()) {
+    rootItem.action.startTime = Math.min(rootItem.action.startTime, item.action.startTime);
+    rootItem.action.endTime = Math.max(rootItem.action.endTime, item.action.endTime);
+    const parent = item.action.parentId ? itemMap.get(item.action.parentId) || rootItem : rootItem;
+    parent.children.push(item);
+    item.parent = parent;
+  }
+  const inheritStack = (item) => {
+    for (const child of item.children) {
+      child.action.stack = child.action.stack ?? item.action.stack;
+      inheritStack(child);
+    }
+  };
+  inheritStack(rootItem);
+  return { rootItem, itemMap };
+}
+function context(action) {
+  return action[contextSymbol];
+}
+function nextInContext(action) {
+  return action[nextInContextSymbol];
+}
+function previousActionByEndTime(action) {
+  return action[prevByEndTimeSymbol];
+}
+function nextActionByStartTime(action) {
+  return action[nextByStartTimeSymbol];
+}
+function stats(action) {
+  let errors = 0;
+  let warnings = 0;
+  for (const event of eventsForAction(action)) {
+    if (event.type === "console") {
+      const type3 = event.messageType;
+      if (type3 === "warning")
+        ++warnings;
+      else if (type3 === "error")
+        ++errors;
+    }
+    if (event.type === "event" && event.method === "pageError")
+      ++errors;
+  }
+  return { errors, warnings };
+}
+function eventsForAction(action) {
+  let result2 = action[eventsSymbol];
+  if (result2)
+    return result2;
+  const nextAction = nextInContext(action);
+  result2 = context(action).events.filter((event) => {
+    return event.time >= action.startTime && (!nextAction || event.time < nextAction.startTime);
+  });
+  action[eventsSymbol] = result2;
+  return result2;
+}
+function collectSources(actions, errorDescriptors) {
+  const result2 = /* @__PURE__ */ new Map();
+  for (const action of actions) {
+    for (const frame of action.stack || []) {
+      let source11 = result2.get(frame.file);
+      if (!source11) {
+        source11 = { errors: [], content: void 0 };
+        result2.set(frame.file, source11);
+      }
+    }
+  }
+  for (const error of errorDescriptors) {
+    const { action, stack, message } = error;
+    if (!action || !stack)
+      continue;
+    result2.get(stack[0].file)?.errors.push({
+      line: stack[0].line || 0,
+      message
+    });
+  }
+  return result2;
+}
+var contextSymbol, nextInContextSymbol, prevByEndTimeSymbol, nextByStartTimeSymbol, eventsSymbol, TraceModel, lastTmpStepId, kFakeRootAction;
+var init_traceModel = __esm({
+  "packages/isomorphic/trace/traceModel.ts"() {
+    "use strict";
+    init_protocolFormatter();
+    contextSymbol = Symbol("context");
+    nextInContextSymbol = Symbol("nextInContext");
+    prevByEndTimeSymbol = Symbol("prevByEndTime");
+    nextByStartTimeSymbol = Symbol("nextByStartTime");
+    eventsSymbol = Symbol("events");
+    TraceModel = class {
+      constructor(traceUri, contexts) {
+        contexts.forEach((contextEntry) => indexModel(contextEntry));
+        const libraryContext = contexts.find((context2) => context2.origin === "library");
+        this.traceUri = traceUri;
+        this.browserName = libraryContext?.browserName || "";
+        this.sdkLanguage = libraryContext?.sdkLanguage;
+        this.channel = libraryContext?.channel;
+        this.testIdAttributeName = libraryContext?.testIdAttributeName;
+        this.platform = libraryContext?.platform || "";
+        this.playwrightVersion = contexts.find((c) => c.playwrightVersion)?.playwrightVersion;
+        this.title = libraryContext?.title || "";
+        this.options = libraryContext?.options || {};
+        this.testTimeout = contexts.find((c) => c.origin === "testRunner")?.testTimeout;
+        this.actions = mergeActionsAndUpdateTiming(contexts);
+        this.pages = [].concat(...contexts.map((c) => c.pages));
+        this.wallTime = contexts.map((c) => c.wallTime).reduce((prev, cur) => Math.min(prev || Number.MAX_VALUE, cur), Number.MAX_VALUE);
+        this.startTime = contexts.map((c) => c.startTime).reduce((prev, cur) => Math.min(prev, cur), Number.MAX_VALUE);
+        this.endTime = contexts.map((c) => c.endTime).reduce((prev, cur) => Math.max(prev, cur), Number.MIN_VALUE);
+        this.events = [].concat(...contexts.map((c) => c.events));
+        this.stdio = [].concat(...contexts.map((c) => c.stdio));
+        this.errors = [].concat(...contexts.map((c) => c.errors));
+        this.hasSource = contexts.some((c) => c.hasSource);
+        this.hasStepData = contexts.some((context2) => context2.origin === "testRunner");
+        this.resources = [...contexts.map((c) => c.resources)].flat().map((entry) => ({ ...entry, id: `${entry.pageref}-${entry.startedDateTime}-${entry.request.url}` }));
+        this.attachments = this.actions.flatMap((action) => action.attachments?.map((attachment) => ({ ...attachment, callId: action.callId, traceUri })) ?? []);
+        this.visibleAttachments = this.attachments.filter((attachment) => !attachment.name.startsWith("_"));
+        this.events.sort((a1, a2) => a1.time - a2.time);
+        this.resources.sort((a1, a2) => a1._monotonicTime - a2._monotonicTime);
+        this.errorDescriptors = this.hasStepData ? this._errorDescriptorsFromTestRunner() : this._errorDescriptorsFromActions();
+        this.sources = collectSources(this.actions, this.errorDescriptors);
+        this.actionCounters = /* @__PURE__ */ new Map();
+        for (const action of this.actions) {
+          action.group = action.group ?? getActionGroup({ type: action.class, method: action.method });
+          if (action.group)
+            this.actionCounters.set(action.group, 1 + (this.actionCounters.get(action.group) || 0));
+        }
+      }
+      createRelativeUrl(path59) {
+        const url2 = new URL("http://localhost/" + path59);
+        url2.searchParams.set("trace", this.traceUri);
+        return url2.toString().substring("http://localhost/".length);
+      }
+      failedAction() {
+        return this.actions.findLast((a) => a.error);
+      }
+      filteredActions(actionsFilter) {
+        const filter = new Set(actionsFilter);
+        return this.actions.filter((action) => !action.group || filter.has(action.group));
+      }
+      renderActionTree(filter) {
+        const actions = this.filteredActions(filter ?? []);
+        const { rootItem } = buildActionTree(actions);
+        const actionTree = [];
+        const visit = (actionItem, indent) => {
+          const title = renderTitleForCall({ ...actionItem.action, type: actionItem.action.class });
+          actionTree.push(`${indent}${title || actionItem.id}`);
+          for (const child of actionItem.children)
+            visit(child, indent + "  ");
+        };
+        rootItem.children.forEach((a) => visit(a, ""));
+        return actionTree;
+      }
+      _errorDescriptorsFromActions() {
+        const errors = [];
+        for (const action of this.actions || []) {
+          if (!action.error?.message)
+            continue;
+          errors.push({
+            action,
+            stack: action.stack,
+            message: action.error.message
+          });
+        }
+        return errors;
+      }
+      _errorDescriptorsFromTestRunner() {
+        return this.errors.filter((e) => !!e.message).map((error, i) => ({
+          stack: error.stack,
+          message: error.message
+        }));
+      }
+    };
+    lastTmpStepId = 0;
+    kFakeRootAction = {
+      type: "action",
+      callId: "",
+      startTime: 0,
+      endTime: 0,
+      class: "",
+      method: "",
+      params: {},
+      log: [],
+      context: {
+        origin: "library",
+        startTime: 0,
+        endTime: 0,
+        browserName: "",
+        wallTime: 0,
+        options: {},
+        pages: [],
+        resources: [],
+        actions: [],
+        events: [],
+        stdio: [],
+        errors: [],
+        hasSource: false,
+        contextId: ""
+      }
+    };
+  }
+});
+
+// packages/isomorphic/yaml.ts
+function yamlEscapeKeyIfNeeded(str) {
+  if (!yamlStringNeedsQuotes(str))
+    return str;
+  return `'` + str.replace(/'/g, `''`) + `'`;
+}
+function yamlEscapeValueIfNeeded(str) {
+  if (!yamlStringNeedsQuotes(str))
+    return str;
+  return '"' + str.replace(/[\\"\x00-\x1f\x7f-\x9f]/g, (c) => {
+    switch (c) {
+      case "\\":
+        return "\\\\";
+      case '"':
+        return '\\"';
+      case "\b":
+        return "\\b";
+      case "\f":
+        return "\\f";
+      case "\n":
+        return "\\n";
+      case "\r":
+        return "\\r";
+      case "	":
+        return "\\t";
+      default:
+        const code = c.charCodeAt(0);
+        return "\\x" + code.toString(16).padStart(2, "0");
+    }
+  }) + '"';
+}
+function yamlStringNeedsQuotes(str) {
+  if (str.length === 0)
+    return true;
+  if (/^\s|\s$/.test(str))
+    return true;
+  if (/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(str))
+    return true;
+  if (/^-/.test(str))
+    return true;
+  if (/[\n:](\s|$)/.test(str))
+    return true;
+  if (/\s#/.test(str))
+    return true;
+  if (/[\n\r]/.test(str))
+    return true;
+  if (/^[&*\],?!>|@"'#%]/.test(str))
+    return true;
+  if (/[{}`]/.test(str))
+    return true;
+  if (/^\[/.test(str))
+    return true;
+  if (!isNaN(Number(str)) || ["y", "n", "yes", "no", "true", "false", "on", "off", "null"].includes(str.toLowerCase()))
+    return true;
+  return false;
+}
+var init_yaml = __esm({
+  "packages/isomorphic/yaml.ts"() {
+    "use strict";
+  }
+});
+
+// packages/isomorphic/index.ts
+var isomorphic_exports = {};
+__export(isomorphic_exports, {
+  CSharpLocatorFactory: () => CSharpLocatorFactory,
+  DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT: () => DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT,
+  DEFAULT_PLAYWRIGHT_TIMEOUT: () => DEFAULT_PLAYWRIGHT_TIMEOUT,
+  InvalidSelectorError: () => InvalidSelectorError,
+  JavaLocatorFactory: () => JavaLocatorFactory,
+  JavaScriptLocatorFactory: () => JavaScriptLocatorFactory,
+  JsonlLocatorFactory: () => JsonlLocatorFactory,
+  KeyParser: () => KeyParser,
+  LongStandingScope: () => LongStandingScope,
+  ManualPromise: () => ManualPromise,
+  MultiMap: () => MultiMap,
+  ParserError: () => ParserError,
+  PythonLocatorFactory: () => PythonLocatorFactory,
+  Semaphore: () => Semaphore,
+  SnapshotServer: () => SnapshotServer,
+  SnapshotStorage: () => SnapshotStorage,
+  TraceLoader: () => TraceLoader,
+  TraceModel: () => TraceModel,
+  ansiRegex: () => ansiRegex,
+  ariaNodesEqual: () => ariaNodesEqual,
+  asLocator: () => asLocator,
+  asLocatorDescription: () => asLocatorDescription,
+  asLocators: () => asLocators,
+  assert: () => assert,
+  base64ByteLength: () => base64ByteLength,
+  buildActionTree: () => buildActionTree,
+  bytesToString: () => bytesToString,
+  cacheNormalizedWhitespaces: () => cacheNormalizedWhitespaces,
+  captureRawStack: () => captureRawStack,
+  constructURLBasedOnBaseURL: () => constructURLBasedOnBaseURL,
+  context: () => context,
+  customCSSNames: () => customCSSNames,
+  deserializeURLMatch: () => deserializeURLMatch,
+  escapeForAttributeSelector: () => escapeForAttributeSelector,
+  escapeForTextSelector: () => escapeForTextSelector,
+  escapeHTML: () => escapeHTML,
+  escapeHTMLAttribute: () => escapeHTMLAttribute,
+  escapeRegExp: () => escapeRegExp,
+  escapeTemplateString: () => escapeTemplateString,
+  escapeWithQuotes: () => escapeWithQuotes,
+  eventsForAction: () => eventsForAction,
+  findNewNode: () => findNewNode,
+  formatObject: () => formatObject,
+  formatObjectOrVoid: () => formatObjectOrVoid,
+  formatProtocolParam: () => formatProtocolParam,
+  getActionGroup: () => getActionGroup,
+  getExtensionForMimeType: () => getExtensionForMimeType,
+  getMetainfo: () => getMetainfo,
+  getMimeTypeForPath: () => getMimeTypeForPath,
+  globToRegexPattern: () => globToRegexPattern,
+  hasPointerCursor: () => hasPointerCursor,
+  headersArrayToObject: () => headersArrayToObject,
+  headersObjectToArray: () => headersObjectToArray,
+  isError: () => isError,
+  isHttpUrl: () => isHttpUrl,
+  isInvalidSelectorError: () => isInvalidSelectorError,
+  isJsonMimeType: () => isJsonMimeType,
+  isObject: () => isObject,
+  isRegExp: () => isRegExp,
+  isRegexString: () => isRegexString,
+  isString: () => isString,
+  isTextualMimeType: () => isTextualMimeType,
+  isURLPattern: () => isURLPattern,
+  isXmlMimeType: () => isXmlMimeType,
+  locatorCustomDescription: () => locatorCustomDescription,
+  locatorOrSelectorAsSelector: () => locatorOrSelectorAsSelector,
+  longestCommonSubstring: () => longestCommonSubstring,
+  methodMetainfo: () => methodMetainfo,
+  monotonicTime: () => monotonicTime,
+  msToString: () => msToString,
+  nextActionByStartTime: () => nextActionByStartTime,
+  noColors: () => noColors,
+  normalizeEscapedRegexQuotes: () => normalizeEscapedRegexQuotes,
+  normalizeWhiteSpace: () => normalizeWhiteSpace,
+  padImageToSize: () => padImageToSize,
+  parseAriaSnapshot: () => parseAriaSnapshot,
+  parseAriaSnapshotUnsafe: () => parseAriaSnapshotUnsafe,
+  parseAttributeSelector: () => parseAttributeSelector,
+  parseCSS: () => parseCSS,
+  parseClientSideCallMetadata: () => parseClientSideCallMetadata,
+  parseErrorStack: () => parseErrorStack,
+  parseRegex: () => parseRegex,
+  parseSelector: () => parseSelector,
+  parseStackFrame: () => parseStackFrame,
+  pollAgainstDeadline: () => pollAgainstDeadline,
+  previousActionByEndTime: () => previousActionByEndTime,
+  quoteCSSAttributeValue: () => quoteCSSAttributeValue,
+  raceAgainstDeadline: () => raceAgainstDeadline,
+  renderTitleForCall: () => renderTitleForCall,
+  resolveGlobToRegexPattern: () => resolveGlobToRegexPattern,
+  rewriteErrorMessage: () => rewriteErrorMessage,
+  scaleImageToSize: () => scaleImageToSize,
+  serializeClientSideCallMetadata: () => serializeClientSideCallMetadata,
+  serializeExpectedTextValues: () => serializeExpectedTextValues,
+  serializeSelector: () => serializeSelector,
+  serializeURLMatch: () => serializeURLMatch,
+  serializeURLPattern: () => serializeURLPattern,
+  setTimeOrigin: () => setTimeOrigin,
+  signalToPromise: () => signalToPromise,
+  splitErrorMessage: () => splitErrorMessage,
+  splitSelectorByFrame: () => splitSelectorByFrame,
+  stats: () => stats,
+  stringifySelector: () => stringifySelector,
+  stringifyStackFrames: () => stringifyStackFrames,
+  stripAnsiEscapes: () => stripAnsiEscapes,
+  textValue: () => textValue,
+  timeOrigin: () => timeOrigin,
+  toSnakeCase: () => toSnakeCase,
+  toTitleCase: () => toTitleCase,
+  tomlArray: () => tomlArray,
+  tomlBasicString: () => tomlBasicString,
+  tomlMultilineBasicString: () => tomlMultilineBasicString,
+  trimString: () => trimString,
+  trimStringWithEllipsis: () => trimStringWithEllipsis,
+  unsafeLocatorOrSelectorAsSelector: () => unsafeLocatorOrSelectorAsSelector,
+  urlMatches: () => urlMatches,
+  urlMatchesEqual: () => urlMatchesEqual,
+  validate: () => validate,
+  visitAllSelectorParts: () => visitAllSelectorParts,
+  webColors: () => webColors,
+  yamlEscapeKeyIfNeeded: () => yamlEscapeKeyIfNeeded,
+  yamlEscapeValueIfNeeded: () => yamlEscapeValueIfNeeded
+});
+var init_isomorphic = __esm({
+  "packages/isomorphic/index.ts"() {
+    "use strict";
+    init_ariaSnapshot();
+    init_expectUtils();
+    init_assert();
+    init_base64();
+    init_colors();
+    init_headers();
+    init_imageUtils();
+    init_jsonSchema();
+    init_locatorGenerators();
+    init_manualPromise();
+    init_mimeType();
+    init_multimap();
+    init_protocolFormatter();
+    init_protocolMetainfo();
+    init_rtti();
+    init_semaphore();
+    init_stackTrace();
+    init_stringUtils();
+    init_formatUtils();
+    init_time();
+    init_timeoutRunner();
+    init_snapshotServer();
+    init_urlMatch();
+    init_cssParser();
+    init_locatorParser();
+    init_selectorParser();
+    init_snapshotStorage();
+    init_traceLoader();
+    init_traceModel();
+    init_traceUtils();
+    init_yaml();
+  }
+});
+
+// packages/utils/ascii.ts
+function wrapInASCIIBox(text2, padding = 0) {
+  const lines = text2.split("\n");
+  const maxLength = Math.max(...lines.map((line) => line.length));
+  return [
+    "\u2554" + "\u2550".repeat(maxLength + padding * 2) + "\u2557",
+    ...lines.map((line) => "\u2551" + " ".repeat(padding) + line + " ".repeat(maxLength - line.length + padding) + "\u2551"),
+    "\u255A" + "\u2550".repeat(maxLength + padding * 2) + "\u255D"
+  ].join("\n");
+}
+function jsonStringifyForceASCII(object) {
+  return JSON.stringify(object).replace(
+    /[\u007f-\uffff]/g,
+    (c) => "\\u" + ("0000" + c.charCodeAt(0).toString(16)).slice(-4)
+  );
+}
+var init_ascii = __esm({
+  "packages/utils/ascii.ts"() {
+    "use strict";
+  }
+});
+
+// packages/utils/chromiumChannels.ts
+function defaultUserDataDirForChannel(channel) {
+  return channelToDefaultUserDataDir.get(channel)?.[process.platform];
+}
+function isChromiumChannelName(channel) {
+  return channelToDefaultUserDataDir.has(channel);
+}
+var import_os, import_path, channelToDefaultUserDataDir;
+var init_chromiumChannels = __esm({
+  "packages/utils/chromiumChannels.ts"() {
+    "use strict";
+    import_os = __toESM(require("os"));
+    import_path = __toESM(require("path"));
+    channelToDefaultUserDataDir = /* @__PURE__ */ new Map([
+      ["chrome", {
+        "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome"),
+        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome"),
+        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome", "User Data")
+      }],
+      ["chrome-beta", {
+        "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-beta"),
+        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Beta"),
+        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome Beta", "User Data")
+      }],
+      ["chrome-dev", {
+        "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-unstable"),
+        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Dev"),
+        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome Dev", "User Data")
+      }],
+      ["chrome-canary", {
+        "linux": import_path.default.join(import_os.default.homedir(), ".config", "google-chrome-canary"),
+        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Google", "Chrome Canary"),
+        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Google", "Chrome SxS", "User Data")
+      }],
+      ["msedge", {
+        "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge"),
+        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge"),
+        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge", "User Data")
+      }],
+      ["msedge-beta", {
+        "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-beta"),
+        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Beta"),
+        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge Beta", "User Data")
+      }],
+      ["msedge-dev", {
+        "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-dev"),
+        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Dev"),
+        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge Dev", "User Data")
+      }],
+      ["msedge-canary", {
+        "linux": import_path.default.join(import_os.default.homedir(), ".config", "microsoft-edge-canary"),
+        "darwin": import_path.default.join(import_os.default.homedir(), "Library", "Application Support", "Microsoft Edge Canary"),
+        "win32": import_path.default.join(process.env.LOCALAPPDATA || import_path.default.join(import_os.default.homedir(), "AppData", "Local"), "Microsoft", "Edge SxS", "User Data")
+      }]
+    ]);
+  }
+});
+
+// packages/utils/third_party/pixelmatch.js
+var require_pixelmatch = __commonJS({
+  "packages/utils/third_party/pixelmatch.js"(exports2, module2) {
+    "use strict";
+    module2.exports = pixelmatch2;
+    var defaultOptions = {
+      threshold: 0.1,
+      // matching threshold (0 to 1); smaller is more sensitive
+      includeAA: false,
+      // whether to skip anti-aliasing detection
+      alpha: 0.1,
+      // opacity of original image in diff output
+      aaColor: [255, 255, 0],
+      // color of anti-aliased pixels in diff output
+      diffColor: [255, 0, 0],
+      // color of different pixels in diff output
+      diffColorAlt: null,
+      // whether to detect dark on light differences between img1 and img2 and set an alternative color to differentiate between the two
+      diffMask: false
+      // draw the diff over a transparent background (a mask)
+    };
+    function pixelmatch2(img1, img2, output, width, height, options) {
+      if (!isPixelData(img1) || !isPixelData(img2) || output && !isPixelData(output))
+        throw new Error("Image data: Uint8Array, Uint8ClampedArray or Buffer expected.");
+      if (img1.length !== img2.length || output && output.length !== img1.length)
+        throw new Error("Image sizes do not match.");
+      if (img1.length !== width * height * 4) throw new Error("Image data size does not match width/height.");
+      options = Object.assign({}, defaultOptions, options);
+      const len = width * height;
+      const a32 = new Uint32Array(img1.buffer, img1.byteOffset, len);
+      const b32 = new Uint32Array(img2.buffer, img2.byteOffset, len);
+      let identical = true;
+      for (let i = 0; i < len; i++) {
+        if (a32[i] !== b32[i]) {
+          identical = false;
+          break;
+        }
+      }
+      if (identical) {
+        if (output && !options.diffMask) {
+          for (let i = 0; i < len; i++) drawGrayPixel(img1, 4 * i, options.alpha, output);
+        }
+        return 0;
+      }
+      const maxDelta = 35215 * options.threshold * options.threshold;
+      let diff2 = 0;
+      for (let y = 0; y < height; y++) {
+        for (let x = 0; x < width; x++) {
+          const pos = (y * width + x) * 4;
+          const delta = colorDelta(img1, img2, pos, pos);
+          if (Math.abs(delta) > maxDelta) {
+            if (!options.includeAA && (antialiased(img1, x, y, width, height, img2) || antialiased(img2, x, y, width, height, img1))) {
+              if (output && !options.diffMask) drawPixel2(output, pos, ...options.aaColor);
+            } else {
+              if (output) {
+                drawPixel2(output, pos, ...delta < 0 && options.diffColorAlt || options.diffColor);
+              }
+              diff2++;
+            }
+          } else if (output) {
+            if (!options.diffMask) drawGrayPixel(img1, pos, options.alpha, output);
+          }
+        }
+      }
+      return diff2;
+    }
+    function isPixelData(arr) {
+      return ArrayBuffer.isView(arr) && arr.constructor.BYTES_PER_ELEMENT === 1;
+    }
+    function antialiased(img, x1, y1, width, height, img2) {
+      const x0 = Math.max(x1 - 1, 0);
+      const y0 = Math.max(y1 - 1, 0);
+      const x2 = Math.min(x1 + 1, width - 1);
+      const y2 = Math.min(y1 + 1, height - 1);
+      const pos = (y1 * width + x1) * 4;
+      let zeroes = x1 === x0 || x1 === x2 || y1 === y0 || y1 === y2 ? 1 : 0;
+      let min = 0;
+      let max = 0;
+      let minX, minY, maxX, maxY;
+      for (let x = x0; x <= x2; x++) {
+        for (let y = y0; y <= y2; y++) {
+          if (x === x1 && y === y1) continue;
+          const delta = colorDelta(img, img, pos, (y * width + x) * 4, true);
+          if (delta === 0) {
+            zeroes++;
+            if (zeroes > 2) return false;
+          } else if (delta < min) {
+            min = delta;
+            minX = x;
+            minY = y;
+          } else if (delta > max) {
+            max = delta;
+            maxX = x;
+            maxY = y;
+          }
+        }
+      }
+      if (min === 0 || max === 0) return false;
+      return hasManySiblings(img, minX, minY, width, height) && hasManySiblings(img2, minX, minY, width, height) || hasManySiblings(img, maxX, maxY, width, height) && hasManySiblings(img2, maxX, maxY, width, height);
+    }
+    function hasManySiblings(img, x1, y1, width, height) {
+      const x0 = Math.max(x1 - 1, 0);
+      const y0 = Math.max(y1 - 1, 0);
+      const x2 = Math.min(x1 + 1, width - 1);
+      const y2 = Math.min(y1 + 1, height - 1);
+      const pos = (y1 * width + x1) * 4;
+      let zeroes = x1 === x0 || x1 === x2 || y1 === y0 || y1 === y2 ? 1 : 0;
+      for (let x = x0; x <= x2; x++) {
+        for (let y = y0; y <= y2; y++) {
+          if (x === x1 && y === y1) continue;
+          const pos2 = (y * width + x) * 4;
+          if (img[pos] === img[pos2] && img[pos + 1] === img[pos2 + 1] && img[pos + 2] === img[pos2 + 2] && img[pos + 3] === img[pos2 + 3]) zeroes++;
+          if (zeroes > 2) return true;
+        }
+      }
+      return false;
+    }
+    function colorDelta(img1, img2, k, m, yOnly) {
+      let r1 = img1[k + 0];
+      let g1 = img1[k + 1];
+      let b1 = img1[k + 2];
+      let a1 = img1[k + 3];
+      let r2 = img2[m + 0];
+      let g2 = img2[m + 1];
+      let b2 = img2[m + 2];
+      let a2 = img2[m + 3];
+      if (a1 === a2 && r1 === r2 && g1 === g2 && b1 === b2) return 0;
+      if (a1 < 255) {
+        a1 /= 255;
+        r1 = blend(r1, a1);
+        g1 = blend(g1, a1);
+        b1 = blend(b1, a1);
+      }
+      if (a2 < 255) {
+        a2 /= 255;
+        r2 = blend(r2, a2);
+        g2 = blend(g2, a2);
+        b2 = blend(b2, a2);
+      }
+      const y1 = rgb2y(r1, g1, b1);
+      const y2 = rgb2y(r2, g2, b2);
+      const y = y1 - y2;
+      if (yOnly) return y;
+      const i = rgb2i(r1, g1, b1) - rgb2i(r2, g2, b2);
+      const q = rgb2q(r1, g1, b1) - rgb2q(r2, g2, b2);
+      const delta = 0.5053 * y * y + 0.299 * i * i + 0.1957 * q * q;
+      return y1 > y2 ? -delta : delta;
+    }
+    function rgb2y(r, g, b) {
+      return r * 0.29889531 + g * 0.58662247 + b * 0.11448223;
+    }
+    function rgb2i(r, g, b) {
+      return r * 0.59597799 - g * 0.2741761 - b * 0.32180189;
+    }
+    function rgb2q(r, g, b) {
+      return r * 0.21147017 - g * 0.52261711 + b * 0.31114694;
+    }
+    function blend(c, a) {
+      return 255 + (c - 255) * a;
+    }
+    function drawPixel2(output, pos, r, g, b) {
+      output[pos + 0] = r;
+      output[pos + 1] = g;
+      output[pos + 2] = b;
+      output[pos + 3] = 255;
+    }
+    function drawGrayPixel(img, i, alpha, output) {
+      const r = img[i + 0];
+      const g = img[i + 1];
+      const b = img[i + 2];
+      const val = blend(rgb2y(r, g, b), alpha * img[i + 3] / 255);
+      drawPixel2(output, i, val, val, val);
+    }
+  }
+});
+
+// packages/utils/image_tools/colorUtils.ts
+function blendWithWhite(c, a) {
+  return 255 + (c - 255) * a;
+}
+function rgb2gray(r, g, b) {
+  return 77 * r + 150 * g + 29 * b + 128 >> 8;
+}
+function colorDeltaE94(rgb1, rgb2) {
+  const [l1, a1, b1] = xyz2lab(srgb2xyz(rgb1));
+  const [l2, a2, b2] = xyz2lab(srgb2xyz(rgb2));
+  const deltaL = l1 - l2;
+  const deltaA = a1 - a2;
+  const deltaB = b1 - b2;
+  const c1 = Math.sqrt(a1 ** 2 + b1 ** 2);
+  const c2 = Math.sqrt(a2 ** 2 + b2 ** 2);
+  const deltaC = c1 - c2;
+  let deltaH = deltaA ** 2 + deltaB ** 2 - deltaC ** 2;
+  deltaH = deltaH < 0 ? 0 : Math.sqrt(deltaH);
+  const k1 = 0.045;
+  const k2 = 0.015;
+  const kL = 1;
+  const kC = 1;
+  const kH = 1;
+  const sC = 1 + k1 * c1;
+  const sH = 1 + k2 * c1;
+  const sL = 1;
+  return Math.sqrt((deltaL / sL / kL) ** 2 + (deltaC / sC / kC) ** 2 + (deltaH / sH / kH) ** 2);
+}
+function srgb2xyz(rgb) {
+  let r = rgb[0] / 255;
+  let g = rgb[1] / 255;
+  let b = rgb[2] / 255;
+  r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
+  g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
+  b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
+  return [
+    r * 0.4124 + g * 0.3576 + b * 0.1805,
+    r * 0.2126 + g * 0.7152 + b * 0.0722,
+    r * 0.0193 + g * 0.1192 + b * 0.9505
+  ];
+}
+function xyz2lab(xyz) {
+  const x = xyz[0] / 0.950489;
+  const y = xyz[1];
+  const z31 = xyz[2] / 1.08884;
+  const fx = x > sigma_pow3 ? x ** (1 / 3) : x / 3 / sigma_pow2 + 4 / 29;
+  const fy = y > sigma_pow3 ? y ** (1 / 3) : y / 3 / sigma_pow2 + 4 / 29;
+  const fz = z31 > sigma_pow3 ? z31 ** (1 / 3) : z31 / 3 / sigma_pow2 + 4 / 29;
+  const l = 116 * fy - 16;
+  const a = 500 * (fx - fy);
+  const b = 200 * (fy - fz);
+  return [l, a, b];
+}
+var sigma_pow2, sigma_pow3;
+var init_colorUtils = __esm({
+  "packages/utils/image_tools/colorUtils.ts"() {
+    "use strict";
+    sigma_pow2 = 6 * 6 / 29 / 29;
+    sigma_pow3 = 6 * 6 * 6 / 29 / 29 / 29;
+  }
+});
+
+// packages/utils/image_tools/imageChannel.ts
+var ImageChannel;
+var init_imageChannel = __esm({
+  "packages/utils/image_tools/imageChannel.ts"() {
+    "use strict";
+    init_colorUtils();
+    ImageChannel = class _ImageChannel {
+      static intoRGB(width, height, data, options = {}) {
+        const {
+          paddingSize = 0,
+          paddingColorOdd = [255, 0, 255],
+          paddingColorEven = [0, 255, 0]
+        } = options;
+        const newWidth = width + 2 * paddingSize;
+        const newHeight = height + 2 * paddingSize;
+        const r = new Uint8Array(newWidth * newHeight);
+        const g = new Uint8Array(newWidth * newHeight);
+        const b = new Uint8Array(newWidth * newHeight);
+        for (let y = 0; y < newHeight; ++y) {
+          for (let x = 0; x < newWidth; ++x) {
+            const index = y * newWidth + x;
+            if (y >= paddingSize && y < newHeight - paddingSize && x >= paddingSize && x < newWidth - paddingSize) {
+              const offset = ((y - paddingSize) * width + (x - paddingSize)) * 4;
+              const alpha = data[offset + 3] === 255 ? 1 : data[offset + 3] / 255;
+              r[index] = blendWithWhite(data[offset], alpha);
+              g[index] = blendWithWhite(data[offset + 1], alpha);
+              b[index] = blendWithWhite(data[offset + 2], alpha);
+            } else {
+              const color = (y + x) % 2 === 0 ? paddingColorEven : paddingColorOdd;
+              r[index] = color[0];
+              g[index] = color[1];
+              b[index] = color[2];
+            }
+          }
+        }
+        return [
+          new _ImageChannel(newWidth, newHeight, r),
+          new _ImageChannel(newWidth, newHeight, g),
+          new _ImageChannel(newWidth, newHeight, b)
+        ];
+      }
+      constructor(width, height, data) {
+        this.data = data;
+        this.width = width;
+        this.height = height;
+      }
+      get(x, y) {
+        return this.data[y * this.width + x];
+      }
+      boundXY(x, y) {
+        return [
+          Math.min(Math.max(x, 0), this.width - 1),
+          Math.min(Math.max(y, 0), this.height - 1)
+        ];
+      }
+    };
+  }
+});
+
+// packages/utils/image_tools/stats.ts
+function ssim(stats2, x1, y1, x2, y2) {
+  const mean1 = stats2.meanC1(x1, y1, x2, y2);
+  const mean2 = stats2.meanC2(x1, y1, x2, y2);
+  const var1 = stats2.varianceC1(x1, y1, x2, y2);
+  const var2 = stats2.varianceC2(x1, y1, x2, y2);
+  const cov = stats2.covariance(x1, y1, x2, y2);
+  const c1 = (0.01 * DYNAMIC_RANGE) ** 2;
+  const c2 = (0.03 * DYNAMIC_RANGE) ** 2;
+  return (2 * mean1 * mean2 + c1) * (2 * cov + c2) / (mean1 ** 2 + mean2 ** 2 + c1) / (var1 + var2 + c2);
+}
+var DYNAMIC_RANGE, FastStats;
+var init_stats = __esm({
+  "packages/utils/image_tools/stats.ts"() {
+    "use strict";
+    DYNAMIC_RANGE = 2 ** 8 - 1;
+    FastStats = class {
+      constructor(c1, c2) {
+        this.c1 = c1;
+        this.c2 = c2;
+        const { width, height } = c1;
+        this._partialSumC1 = new Array(width * height);
+        this._partialSumC2 = new Array(width * height);
+        this._partialSumSq1 = new Array(width * height);
+        this._partialSumSq2 = new Array(width * height);
+        this._partialSumMult = new Array(width * height);
+        const recalc = (mx, idx, initial, x, y) => {
+          mx[idx] = initial;
+          if (y > 0)
+            mx[idx] += mx[(y - 1) * width + x];
+          if (x > 0)
+            mx[idx] += mx[y * width + x - 1];
+          if (x > 0 && y > 0)
+            mx[idx] -= mx[(y - 1) * width + x - 1];
+        };
+        for (let y = 0; y < height; ++y) {
+          for (let x = 0; x < width; ++x) {
+            const idx = y * width + x;
+            recalc(this._partialSumC1, idx, this.c1.data[idx], x, y);
+            recalc(this._partialSumC2, idx, this.c2.data[idx], x, y);
+            recalc(this._partialSumSq1, idx, this.c1.data[idx] * this.c1.data[idx], x, y);
+            recalc(this._partialSumSq2, idx, this.c2.data[idx] * this.c2.data[idx], x, y);
+            recalc(this._partialSumMult, idx, this.c1.data[idx] * this.c2.data[idx], x, y);
+          }
+        }
+      }
+      _sum(partialSum, x1, y1, x2, y2) {
+        const width = this.c1.width;
+        let result2 = partialSum[y2 * width + x2];
+        if (y1 > 0)
+          result2 -= partialSum[(y1 - 1) * width + x2];
+        if (x1 > 0)
+          result2 -= partialSum[y2 * width + x1 - 1];
+        if (x1 > 0 && y1 > 0)
+          result2 += partialSum[(y1 - 1) * width + x1 - 1];
+        return result2;
+      }
+      meanC1(x1, y1, x2, y2) {
+        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
+        return this._sum(this._partialSumC1, x1, y1, x2, y2) / N;
+      }
+      meanC2(x1, y1, x2, y2) {
+        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
+        return this._sum(this._partialSumC2, x1, y1, x2, y2) / N;
+      }
+      varianceC1(x1, y1, x2, y2) {
+        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
+        return (this._sum(this._partialSumSq1, x1, y1, x2, y2) - this._sum(this._partialSumC1, x1, y1, x2, y2) ** 2 / N) / N;
+      }
+      varianceC2(x1, y1, x2, y2) {
+        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
+        return (this._sum(this._partialSumSq2, x1, y1, x2, y2) - this._sum(this._partialSumC2, x1, y1, x2, y2) ** 2 / N) / N;
+      }
+      covariance(x1, y1, x2, y2) {
+        const N = (y2 - y1 + 1) * (x2 - x1 + 1);
+        return (this._sum(this._partialSumMult, x1, y1, x2, y2) - this._sum(this._partialSumC1, x1, y1, x2, y2) * this._sum(this._partialSumC2, x1, y1, x2, y2) / N) / N;
+      }
+    };
+  }
+});
+
+// packages/utils/image_tools/compare.ts
+function drawPixel(width, data, x, y, r, g, b) {
+  const idx = (y * width + x) * 4;
+  data[idx + 0] = r;
+  data[idx + 1] = g;
+  data[idx + 2] = b;
+  data[idx + 3] = 255;
+}
+function compare(actual, expected, diff2, width, height, options = {}) {
+  const {
+    maxColorDeltaE94 = 1
+  } = options;
+  const paddingSize = Math.max(VARIANCE_WINDOW_RADIUS, SSIM_WINDOW_RADIUS);
+  const paddingColorEven = [255, 0, 255];
+  const paddingColorOdd = [0, 255, 0];
+  const [r1, g1, b1] = ImageChannel.intoRGB(width, height, expected, {
+    paddingSize,
+    paddingColorEven,
+    paddingColorOdd
+  });
+  const [r2, g2, b2] = ImageChannel.intoRGB(width, height, actual, {
+    paddingSize,
+    paddingColorEven,
+    paddingColorOdd
+  });
+  const noop = (x, y) => {
+  };
+  const drawRedPixel = diff2 ? (x, y) => drawPixel(width, diff2, x - paddingSize, y - paddingSize, 255, 0, 0) : noop;
+  const drawYellowPixel = diff2 ? (x, y) => drawPixel(width, diff2, x - paddingSize, y - paddingSize, 255, 255, 0) : noop;
+  const drawGrayPixel = diff2 ? (x, y) => {
+    const gray = rgb2gray(r1.get(x, y), g1.get(x, y), b1.get(x, y));
+    const value2 = blendWithWhite(gray, 0.1);
+    drawPixel(width, diff2, x - paddingSize, y - paddingSize, value2, value2, value2);
+  } : noop;
+  let fastR;
+  let fastG;
+  let fastB;
+  let diffCount = 0;
+  for (let y = paddingSize; y < r1.height - paddingSize; ++y) {
+    for (let x = paddingSize; x < r1.width - paddingSize; ++x) {
+      if (r1.get(x, y) === r2.get(x, y) && g1.get(x, y) === g2.get(x, y) && b1.get(x, y) === b2.get(x, y)) {
+        drawGrayPixel(x, y);
+        continue;
+      }
+      const delta = colorDeltaE94(
+        [r1.get(x, y), g1.get(x, y), b1.get(x, y)],
+        [r2.get(x, y), g2.get(x, y), b2.get(x, y)]
+      );
+      if (delta <= maxColorDeltaE94) {
+        drawGrayPixel(x, y);
+        continue;
+      }
+      if (!fastR || !fastG || !fastB) {
+        fastR = new FastStats(r1, r2);
+        fastG = new FastStats(g1, g2);
+        fastB = new FastStats(b1, b2);
+      }
+      const [varX1, varY1] = r1.boundXY(x - VARIANCE_WINDOW_RADIUS, y - VARIANCE_WINDOW_RADIUS);
+      const [varX2, varY2] = r1.boundXY(x + VARIANCE_WINDOW_RADIUS, y + VARIANCE_WINDOW_RADIUS);
+      const var1 = fastR.varianceC1(varX1, varY1, varX2, varY2) + fastG.varianceC1(varX1, varY1, varX2, varY2) + fastB.varianceC1(varX1, varY1, varX2, varY2);
+      const var2 = fastR.varianceC2(varX1, varY1, varX2, varY2) + fastG.varianceC2(varX1, varY1, varX2, varY2) + fastB.varianceC2(varX1, varY1, varX2, varY2);
+      if (var1 === 0 || var2 === 0) {
+        drawRedPixel(x, y);
+        ++diffCount;
+        continue;
+      }
+      const [ssimX1, ssimY1] = r1.boundXY(x - SSIM_WINDOW_RADIUS, y - SSIM_WINDOW_RADIUS);
+      const [ssimX2, ssimY2] = r1.boundXY(x + SSIM_WINDOW_RADIUS, y + SSIM_WINDOW_RADIUS);
+      const ssimRGB = (ssim(fastR, ssimX1, ssimY1, ssimX2, ssimY2) + ssim(fastG, ssimX1, ssimY1, ssimX2, ssimY2) + ssim(fastB, ssimX1, ssimY1, ssimX2, ssimY2)) / 3;
+      const isAntialiased = ssimRGB >= 0.99;
+      if (isAntialiased) {
+        drawYellowPixel(x, y);
+      } else {
+        drawRedPixel(x, y);
+        ++diffCount;
+      }
+    }
+  }
+  return diffCount;
+}
+var SSIM_WINDOW_RADIUS, VARIANCE_WINDOW_RADIUS;
+var init_compare = __esm({
+  "packages/utils/image_tools/compare.ts"() {
+    "use strict";
+    init_colorUtils();
+    init_imageChannel();
+    init_stats();
+    SSIM_WINDOW_RADIUS = 15;
+    VARIANCE_WINDOW_RADIUS = 1;
+  }
+});
+
+// packages/utils/comparators.ts
+function getComparator(mimeType) {
+  if (mimeType === "image/png")
+    return compareImages.bind(null, "image/png");
+  if (mimeType === "image/jpeg")
+    return compareImages.bind(null, "image/jpeg");
+  if (mimeType === "text/plain")
+    return compareText;
+  return compareBuffersOrStrings;
+}
+function compareBuffersOrStrings(actualBuffer, expectedBuffer) {
+  if (typeof actualBuffer === "string")
+    return compareText(actualBuffer, expectedBuffer);
+  if (!actualBuffer || !(actualBuffer instanceof Buffer))
+    return { errorMessage: "Actual result should be a Buffer or a string." };
+  if (Buffer.compare(actualBuffer, expectedBuffer))
+    return { errorMessage: "Buffers differ" };
+  return null;
+}
+function compareImages(mimeType, actualBuffer, expectedBuffer, options = {}) {
+  if (!actualBuffer || !(actualBuffer instanceof Buffer))
+    return { errorMessage: "Actual result should be a Buffer." };
+  validateBuffer(expectedBuffer, mimeType);
+  let actual = mimeType === "image/png" ? PNG.sync.read(actualBuffer) : jpegjs.decode(actualBuffer, { maxMemoryUsageInMB: JPEG_JS_MAX_BUFFER_SIZE_IN_MB });
+  let expected = mimeType === "image/png" ? PNG.sync.read(expectedBuffer) : jpegjs.decode(expectedBuffer, { maxMemoryUsageInMB: JPEG_JS_MAX_BUFFER_SIZE_IN_MB });
+  const size = { width: Math.max(expected.width, actual.width), height: Math.max(expected.height, actual.height) };
+  let sizesMismatchError = "";
+  if (expected.width !== actual.width || expected.height !== actual.height) {
+    sizesMismatchError = `Expected an image ${expected.width}px by ${expected.height}px, received ${actual.width}px by ${actual.height}px. `;
+    actual = padImageToSize(actual, size);
+    expected = padImageToSize(expected, size);
+  }
+  const diff2 = new PNG({ width: size.width, height: size.height });
+  let count;
+  if (options.comparator === "ssim-cie94") {
+    count = compare(expected.data, actual.data, diff2.data, size.width, size.height, {
+      // All ΔE* formulae are originally designed to have the difference of 1.0 stand for a "just noticeable difference" (JND).
+      // See https://en.wikipedia.org/wiki/Color_difference#CIELAB_%CE%94E*
+      maxColorDeltaE94: 1
+    });
+  } else if ((options.comparator ?? "pixelmatch") === "pixelmatch") {
+    count = (0, import_pixelmatch.default)(expected.data, actual.data, diff2.data, size.width, size.height, {
+      threshold: options.threshold ?? 0.2
+    });
+  } else {
+    throw new Error(`Configuration specifies unknown comparator "${options.comparator}"`);
+  }
+  const maxDiffPixels1 = options.maxDiffPixels;
+  const maxDiffPixels2 = options.maxDiffPixelRatio !== void 0 ? expected.width * expected.height * options.maxDiffPixelRatio : void 0;
+  let maxDiffPixels;
+  if (maxDiffPixels1 !== void 0 && maxDiffPixels2 !== void 0)
+    maxDiffPixels = Math.min(maxDiffPixels1, maxDiffPixels2);
+  else
+    maxDiffPixels = maxDiffPixels1 ?? maxDiffPixels2 ?? 0;
+  const ratio = Math.ceil(count / (expected.width * expected.height) * 100) / 100;
+  const pixelsMismatchError = count > maxDiffPixels ? `${count} pixels (ratio ${ratio.toFixed(2)} of all image pixels) are different.` : "";
+  if (pixelsMismatchError || sizesMismatchError)
+    return { errorMessage: sizesMismatchError + pixelsMismatchError, diff: PNG.sync.write(diff2) };
+  return null;
+}
+function validateBuffer(buffer, mimeType) {
+  if (mimeType === "image/png") {
+    const pngMagicNumber = [137, 80, 78, 71, 13, 10, 26, 10];
+    if (buffer.length < pngMagicNumber.length || !pngMagicNumber.every((byte, index) => buffer[index] === byte))
+      throw new Error("Could not decode expected image as PNG.");
+  } else if (mimeType === "image/jpeg") {
+    const jpegMagicNumber = [255, 216];
+    if (buffer.length < jpegMagicNumber.length || !jpegMagicNumber.every((byte, index) => buffer[index] === byte))
+      throw new Error("Could not decode expected image as JPEG.");
+  }
+}
+function compareText(actual, expectedBuffer) {
+  if (typeof actual !== "string")
+    return { errorMessage: "Actual result should be a string" };
+  let expected = expectedBuffer.toString("utf-8");
+  if (expected === actual)
+    return null;
+  if (!actual.endsWith("\n"))
+    actual += "\n";
+  if (!expected.endsWith("\n"))
+    expected += "\n";
+  const lines = diff.createPatch("file", expected, actual, void 0, void 0, { context: 5 }).split("\n");
+  const coloredLines = lines.slice(4).map((line) => {
+    if (line.startsWith("-"))
+      return colors.green(line);
+    if (line.startsWith("+"))
+      return colors.red(line);
+    if (line.startsWith("@@"))
+      return colors.dim(line);
+    return line;
+  });
+  const errorMessage = coloredLines.join("\n");
+  return { errorMessage };
+}
+var import_pixelmatch, jpegjs, colors, diff, PNG, JPEG_JS_MAX_BUFFER_SIZE_IN_MB;
+var init_comparators = __esm({
+  "packages/utils/comparators.ts"() {
+    "use strict";
+    init_imageUtils();
+    import_pixelmatch = __toESM(require_pixelmatch());
+    init_compare();
+    jpegjs = require("./utilsBundle").jpegjs;
+    colors = require("./utilsBundle").colors;
+    diff = require("./utilsBundle").diff;
+    ({ PNG } = require("./utilsBundle"));
+    JPEG_JS_MAX_BUFFER_SIZE_IN_MB = 5 * 1024;
+  }
+});
+
+// packages/utils/crypto.ts
+function createGuid() {
+  return import_crypto.default.randomBytes(16).toString("hex");
+}
+function calculateSha1(buffer) {
+  const hash = import_crypto.default.createHash("sha1");
+  hash.update(buffer);
+  return hash.digest("hex");
+}
+function encodeBase128(value2) {
+  const bytes = [];
+  do {
+    let byte = value2 & 127;
+    value2 >>>= 7;
+    if (bytes.length > 0)
+      byte |= 128;
+    bytes.push(byte);
+  } while (value2 > 0);
+  return Buffer.from(bytes.reverse());
+}
+function generateSelfSignedCertificate() {
+  const { privateKey, publicKey } = import_crypto.default.generateKeyPairSync("rsa", { modulusLength: 2048 });
+  const publicKeyDer = publicKey.export({ type: "pkcs1", format: "der" });
+  const oneYearInMilliseconds = 365 * 24 * 60 * 60 * 1e3;
+  const notBefore = new Date((/* @__PURE__ */ new Date()).getTime() - oneYearInMilliseconds);
+  const notAfter = new Date((/* @__PURE__ */ new Date()).getTime() + oneYearInMilliseconds);
+  const tbsCertificate = DER.encodeSequence([
+    DER.encodeExplicitContextDependent(0, DER.encodeInteger(1)),
+    // version
+    DER.encodeInteger(1),
+    // serialNumber
+    DER.encodeSequence([
+      DER.encodeObjectIdentifier("1.2.840.113549.1.1.11"),
+      // sha256WithRSAEncryption PKCS #1
+      DER.encodeNull()
+    ]),
+    // signature
+    DER.encodeSequence([
+      DER.encodeSet([
+        DER.encodeSequence([
+          DER.encodeObjectIdentifier("2.5.4.3"),
+          // commonName X.520 DN component
+          DER.encodePrintableString("localhost")
+        ])
+      ]),
+      DER.encodeSet([
+        DER.encodeSequence([
+          DER.encodeObjectIdentifier("2.5.4.10"),
+          // organizationName X.520 DN component
+          DER.encodePrintableString("Playwright Client Certificate Support")
+        ])
+      ])
+    ]),
+    // issuer
+    DER.encodeSequence([
+      DER.encodeDate(notBefore),
+      // notBefore
+      DER.encodeDate(notAfter)
+      // notAfter
+    ]),
+    // validity
+    DER.encodeSequence([
+      DER.encodeSet([
+        DER.encodeSequence([
+          DER.encodeObjectIdentifier("2.5.4.3"),
+          // commonName X.520 DN component
+          DER.encodePrintableString("localhost")
+        ])
+      ]),
+      DER.encodeSet([
+        DER.encodeSequence([
+          DER.encodeObjectIdentifier("2.5.4.10"),
+          // organizationName X.520 DN component
+          DER.encodePrintableString("Playwright Client Certificate Support")
+        ])
+      ])
+    ]),
+    // subject
+    DER.encodeSequence([
+      DER.encodeSequence([
+        DER.encodeObjectIdentifier("1.2.840.113549.1.1.1"),
+        // rsaEncryption PKCS #1
+        DER.encodeNull()
+      ]),
+      DER.encodeBitString(publicKeyDer)
+    ])
+    // SubjectPublicKeyInfo
+  ]);
+  const signature = import_crypto.default.sign("sha256", tbsCertificate, privateKey);
+  const certificate = DER.encodeSequence([
+    tbsCertificate,
+    DER.encodeSequence([
+      DER.encodeObjectIdentifier("1.2.840.113549.1.1.11"),
+      // sha256WithRSAEncryption PKCS #1
+      DER.encodeNull()
+    ]),
+    DER.encodeBitString(signature)
+  ]);
+  const certPem = [
+    "-----BEGIN CERTIFICATE-----",
+    // Split the base64 string into lines of 64 characters
+    certificate.toString("base64").match(/.{1,64}/g).join("\n"),
+    "-----END CERTIFICATE-----"
+  ].join("\n");
+  return {
+    cert: certPem,
+    key: privateKey.export({ type: "pkcs1", format: "pem" })
+  };
+}
+var import_crypto, DER;
+var init_crypto = __esm({
+  "packages/utils/crypto.ts"() {
+    "use strict";
+    import_crypto = __toESM(require("crypto"));
+    init_assert();
+    DER = class {
+      static encodeSequence(data) {
+        return this._encode(48, Buffer.concat(data));
+      }
+      static encodeInteger(data) {
+        assert(data >= -128 && data <= 127);
+        return this._encode(2, Buffer.from([data]));
+      }
+      static encodeObjectIdentifier(oid) {
+        const parts = oid.split(".").map((v) => Number(v));
+        const output = [encodeBase128(40 * parts[0] + parts[1])];
+        for (let i = 2; i < parts.length; i++)
+          output.push(encodeBase128(parts[i]));
+        return this._encode(6, Buffer.concat(output));
+      }
+      static encodeNull() {
+        return Buffer.from([5, 0]);
+      }
+      static encodeSet(data) {
+        assert(data.length === 1, "Only one item in the set is supported. We'd need to sort the data to support more.");
+        return this._encode(49, Buffer.concat(data));
+      }
+      static encodeExplicitContextDependent(tag, data) {
+        return this._encode(160 + tag, data);
+      }
+      static encodePrintableString(data) {
+        return this._encode(19, Buffer.from(data));
+      }
+      static encodeBitString(data) {
+        const unusedBits = 0;
+        const content = Buffer.concat([Buffer.from([unusedBits]), data]);
+        return this._encode(3, content);
+      }
+      static encodeDate(date) {
+        const year = date.getUTCFullYear();
+        const isGeneralizedTime = year >= 2050;
+        const parts = [
+          isGeneralizedTime ? year.toString() : year.toString().slice(-2),
+          (date.getUTCMonth() + 1).toString().padStart(2, "0"),
+          date.getUTCDate().toString().padStart(2, "0"),
+          date.getUTCHours().toString().padStart(2, "0"),
+          date.getUTCMinutes().toString().padStart(2, "0"),
+          date.getUTCSeconds().toString().padStart(2, "0")
+        ];
+        const encodedDate = parts.join("") + "Z";
+        const tag = isGeneralizedTime ? 24 : 23;
+        return this._encode(tag, Buffer.from(encodedDate));
+      }
+      static _encode(tag, data) {
+        const lengthBytes = this._encodeLength(data.length);
+        return Buffer.concat([Buffer.from([tag]), lengthBytes, data]);
+      }
+      static _encodeLength(length) {
+        if (length < 128) {
+          return Buffer.from([length]);
+        } else {
+          const lengthBytes = [];
+          while (length > 0) {
+            lengthBytes.unshift(length & 255);
+            length >>= 8;
+          }
+          return Buffer.from([128 | lengthBytes.length, ...lengthBytes]);
+        }
+      }
+    };
+  }
+});
+
+// packages/utils/env.ts
+function getFromENV(name) {
+  let value2 = process.env[name];
+  value2 = value2 === void 0 ? process.env[`npm_config_${name.toLowerCase()}`] : value2;
+  value2 = value2 === void 0 ? process.env[`npm_package_config_${name.toLowerCase()}`] : value2;
+  return value2;
+}
+function getAsBooleanFromENV(name, defaultValue) {
+  const value2 = getFromENV(name);
+  if (value2 === "false" || value2 === "0")
+    return false;
+  if (value2)
+    return true;
+  return !!defaultValue;
+}
+function getPackageManager() {
+  const env = process.env.npm_config_user_agent || "";
+  if (env.includes("yarn"))
+    return "yarn";
+  if (env.includes("pnpm"))
+    return "pnpm";
+  return "npm";
+}
+function getPackageManagerExecCommand() {
+  const packageManager = getPackageManager();
+  if (packageManager === "yarn")
+    return "yarn";
+  if (packageManager === "pnpm")
+    return "pnpm exec";
+  return "npx";
+}
+function isLikelyNpxGlobal() {
+  return process.argv.length >= 2 && process.argv[1].includes("_npx");
+}
+function setPlaywrightTestProcessEnv() {
+  return process.env["PLAYWRIGHT_TEST"] = "1";
+}
+function guessClientName() {
+  if (process.env.CLAUDECODE)
+    return "Claude Code";
+  if (process.env.COPILOT_CLI)
+    return "GitHub Copilot";
+  return "playwright-cli";
+}
+function isCodingAgent() {
+  return !!process.env.CLAUDECODE || !!process.env.COPILOT_CLI;
+}
+var init_env = __esm({
+  "packages/utils/env.ts"() {
+    "use strict";
+  }
+});
+
+// packages/utils/debug.ts
+function debugMode() {
+  if (_debugMode === "console")
+    return "console";
+  if (_debugMode === "0" || _debugMode === "false")
+    return "";
+  return _debugMode ? "inspector" : "";
+}
+function isUnderTest() {
+  return _isUnderTest;
+}
+var _debugMode, _isUnderTest;
+var init_debug = __esm({
+  "packages/utils/debug.ts"() {
+    "use strict";
+    init_env();
+    _debugMode = getFromENV("PWDEBUG") || "";
+    _isUnderTest = getAsBooleanFromENV("PWTEST_UNDER_TEST");
+  }
+});
+
+// packages/utils/debugLogger.ts
+var import_fs, debug, debugLoggerColorMap, DebugLogger, debugLogger, kLogCount, RecentLogsCollector;
+var init_debugLogger = __esm({
+  "packages/utils/debugLogger.ts"() {
+    "use strict";
+    import_fs = __toESM(require("fs"));
+    debug = require("./utilsBundle").debug;
+    debugLoggerColorMap = {
+      "api": 45,
+      // cyan
+      "protocol": 34,
+      // green
+      "install": 34,
+      // green
+      "download": 34,
+      // green
+      "browser": 0,
+      // reset
+      "socks": 92,
+      // purple
+      "client-certificates": 92,
+      // purple
+      "error": 160,
+      // red,
+      "channel": 33,
+      // blue
+      "server": 45,
+      // cyan
+      "server:channel": 34,
+      // green
+      "server:metadata": 33,
+      // blue,
+      "recorder": 45
+      // cyan
+    };
+    DebugLogger = class {
+      constructor() {
+        this._debuggers = /* @__PURE__ */ new Map();
+        if (process.env.DEBUG_FILE) {
+          const ansiRegex2 = new RegExp([
+            "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
+            "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
+          ].join("|"), "g");
+          const stream3 = import_fs.default.createWriteStream(process.env.DEBUG_FILE);
+          debug.log = (data) => {
+            stream3.write(data.replace(ansiRegex2, ""));
+            stream3.write("\n");
+          };
+        }
+      }
+      log(name, message) {
+        let cachedDebugger = this._debuggers.get(name);
+        if (!cachedDebugger) {
+          cachedDebugger = debug(`pw:${name}`);
+          this._debuggers.set(name, cachedDebugger);
+          cachedDebugger.color = debugLoggerColorMap[name] || 0;
+        }
+        cachedDebugger(message);
+      }
+      isEnabled(name) {
+        return debug.enabled(`pw:${name}`);
+      }
+    };
+    debugLogger = new DebugLogger();
+    kLogCount = 150;
+    RecentLogsCollector = class {
+      constructor() {
+        this._logs = [];
+        this._listeners = [];
+      }
+      log(message) {
+        this._logs.push(message);
+        if (this._logs.length === kLogCount * 2)
+          this._logs.splice(0, kLogCount);
+        for (const listener of this._listeners)
+          listener(message);
+      }
+      recentLogs() {
+        if (this._logs.length > kLogCount)
+          return this._logs.slice(-kLogCount);
+        return this._logs;
+      }
+      onMessage(listener) {
+        for (const message of this._logs)
+          listener(message);
+        this._listeners.push(listener);
+      }
+    };
+  }
+});
+
+// packages/utils/eventsHelper.ts
+var EventsHelper, eventsHelper;
+var init_eventsHelper = __esm({
+  "packages/utils/eventsHelper.ts"() {
+    "use strict";
+    EventsHelper = class {
+      static addEventListener(emitter, eventName, handler) {
+        emitter.on(eventName, handler);
+        return { emitter, eventName, handler, dispose: async () => {
+          emitter.removeListener(eventName, handler);
+        } };
+      }
+      static removeEventListeners(listeners) {
+        for (const listener of listeners)
+          listener.emitter.removeListener(listener.eventName, listener.handler);
+        listeners.splice(0, listeners.length);
+      }
+    };
+    eventsHelper = EventsHelper;
+  }
+});
+
+// packages/utils/fileUtils.ts
+async function mkdirIfNeeded(filePath) {
+  await import_fs2.default.promises.mkdir(import_path2.default.dirname(filePath), { recursive: true }).catch(() => {
+  });
+}
+async function removeFolders(dirs) {
+  return await Promise.all(dirs.map(
+    (dir) => import_fs2.default.promises.rm(dir, { recursive: true, force: true, maxRetries: 10 }).catch((e) => e)
+  ));
+}
+function canAccessFile(file) {
+  if (!file)
+    return false;
+  try {
+    import_fs2.default.accessSync(file);
+    return true;
+  } catch (e) {
+    return false;
+  }
+}
+function isWritable(file) {
+  try {
+    import_fs2.default.accessSync(file, import_fs2.default.constants.W_OK);
+    return true;
+  } catch {
+    return false;
+  }
+}
+function isSystemDirectory(dir) {
+  const resolved = import_path2.default.resolve(dir);
+  if (process.platform === "win32") {
+    const systemRoot = import_path2.default.resolve(process.env.SystemRoot || "C:\\Windows");
+    return isPathInside(systemRoot.toLowerCase(), resolved.toLowerCase());
+  }
+  return resolved === "/";
+}
+async function copyFileAndMakeWritable(from, to) {
+  await import_fs2.default.promises.copyFile(from, to);
+  await import_fs2.default.promises.chmod(to, 436);
+}
+function addSuffixToFilePath(filePath, suffix) {
+  const ext = import_path2.default.extname(filePath);
+  const base = filePath.substring(0, filePath.length - ext.length);
+  return base + suffix + ext;
+}
+function sanitizeForFilePath(s) {
+  return s.replace(/[\x00-\x2C\x2E-\x2F\x3A-\x40\x5B-\x60\x7B-\x7F]+/g, "-");
+}
+function trimLongString(s, length = 100) {
+  if (s.length <= length)
+    return s;
+  const hash = calculateSha1(s);
+  const middle = `-${hash.substring(0, 5)}-`;
+  const start3 = Math.floor((length - middle.length) / 2);
+  const end = length - middle.length - start3;
+  return s.substring(0, start3) + middle + s.slice(-end);
+}
+function isPathInside(root, candidate) {
+  const resolvedRoot = import_path2.default.resolve(root);
+  const resolvedCandidate = import_path2.default.resolve(candidate);
+  if (resolvedCandidate === resolvedRoot)
+    return true;
+  return resolvedCandidate.startsWith(resolvedRoot + import_path2.default.sep);
+}
+function resolveWithinRoot(root, fileName) {
+  if (import_path2.default.isAbsolute(fileName))
+    return null;
+  const resolvedFile = import_path2.default.resolve(root, fileName);
+  return isPathInside(root, resolvedFile) ? resolvedFile : null;
+}
+function throwingResolveWithinRoot(root, fileName) {
+  const resolved = resolveWithinRoot(root, fileName);
+  if (!resolved)
+    throw new Error(`Path '${fileName}' escapes root directory`);
+  return resolved;
+}
+function toPosixPath(aPath) {
+  return aPath.split(import_path2.default.sep).join(import_path2.default.posix.sep);
+}
+function makeSocketPath(domain, name) {
+  const userNameHash = calculateSha1(process.env.USERNAME || process.env.USER || "default").slice(0, 8);
+  if (process.platform === "win32") {
+    const socketsDir = process.env.PWTEST_SOCKETS_DIR;
+    const suffix2 = socketsDir ? `-${calculateSha1(socketsDir).slice(0, 8)}` : "";
+    return `\\\\.\\pipe\\pw-${userNameHash}-${domain}-${name}${suffix2}`;
+  }
+  const baseDir = process.env.PWTEST_SOCKETS_DIR || import_path2.default.join(import_os2.default.tmpdir(), `pw-${userNameHash}`);
+  const dir = import_path2.default.join(baseDir, domain);
+  const suffix = ".sock";
+  const maxNameLength = UNIX_SOCKET_PATH_MAX - dir.length - import_path2.default.sep.length - suffix.length;
+  if (maxNameLength < 1)
+    throw new Error(`Socket directory path is too long (${dir.length} chars); set PWTEST_SOCKETS_DIR to a shorter location.`);
+  const fsFriendlyName = trimLongString(sanitizeForFilePath(name), maxNameLength);
+  const result2 = import_path2.default.join(dir, `${fsFriendlyName}${suffix}`);
+  import_fs2.default.mkdirSync(dir, { recursive: true });
+  return result2;
+}
+var import_fs2, import_os2, import_path2, existsAsync, UNIX_SOCKET_PATH_MAX;
+var init_fileUtils = __esm({
+  "packages/utils/fileUtils.ts"() {
+    "use strict";
+    import_fs2 = __toESM(require("fs"));
+    import_os2 = __toESM(require("os"));
+    import_path2 = __toESM(require("path"));
+    init_crypto();
+    existsAsync = (path59) => new Promise((resolve) => import_fs2.default.stat(path59, (err) => resolve(!err)));
+    UNIX_SOCKET_PATH_MAX = 103;
+  }
+});
+
+// packages/utils/linuxUtils.ts
+function getLinuxDistributionInfoSync() {
+  if (process.platform !== "linux")
+    return void 0;
+  if (!osRelease && !didFailToReadOSRelease) {
+    try {
+      const osReleaseText = import_fs3.default.readFileSync("/etc/os-release", "utf8");
+      const fields = parseOSReleaseText(osReleaseText);
+      osRelease = {
+        id: fields.get("id") ?? "",
+        version: fields.get("version_id") ?? ""
+      };
+    } catch (e) {
+      didFailToReadOSRelease = true;
+    }
+  }
+  return osRelease;
+}
+function parseOSReleaseText(osReleaseText) {
+  const fields = /* @__PURE__ */ new Map();
+  for (const line of osReleaseText.split("\n")) {
+    const tokens = line.split("=");
+    const name = tokens.shift();
+    let value2 = tokens.join("=").trim();
+    if (value2.startsWith('"') && value2.endsWith('"'))
+      value2 = value2.substring(1, value2.length - 1);
+    if (!name)
+      continue;
+    fields.set(name.toLowerCase(), value2);
+  }
+  return fields;
+}
+var import_fs3, didFailToReadOSRelease, osRelease;
+var init_linuxUtils = __esm({
+  "packages/utils/linuxUtils.ts"() {
+    "use strict";
+    import_fs3 = __toESM(require("fs"));
+    didFailToReadOSRelease = false;
+  }
+});
+
+// packages/utils/hostPlatform.ts
+function calculatePlatform() {
+  if (process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE) {
+    return {
+      hostPlatform: process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE,
+      isOfficiallySupportedPlatform: false
+    };
+  }
+  const platform = import_os3.default.platform();
+  if (platform === "darwin") {
+    const ver = import_os3.default.release().split(".").map((a) => parseInt(a, 10));
+    let macVersion = "";
+    if (ver[0] < 18) {
+      macVersion = "mac10.13";
+    } else if (ver[0] === 18) {
+      macVersion = "mac10.14";
+    } else if (ver[0] === 19) {
+      macVersion = "mac10.15";
+    } else if (ver[0] < 25) {
+      macVersion = "mac" + (ver[0] - 9);
+      if (import_os3.default.cpus().some((cpu) => cpu.model.includes("Apple")))
+        macVersion += "-arm64";
+    } else {
+      const LAST_STABLE_MACOS_MAJOR_VERSION = 26;
+      macVersion = "mac" + Math.min(ver[0] + 1, LAST_STABLE_MACOS_MAJOR_VERSION);
+      if (import_os3.default.cpus().some((cpu) => cpu.model.includes("Apple")))
+        macVersion += "-arm64";
+    }
+    return { hostPlatform: macVersion, isOfficiallySupportedPlatform: true };
+  }
+  if (platform === "linux") {
+    if (!["x64", "arm64"].includes(import_os3.default.arch()))
+      return { hostPlatform: "", isOfficiallySupportedPlatform: false };
+    const archSuffix = "-" + import_os3.default.arch();
+    const distroInfo = getLinuxDistributionInfoSync();
+    if (distroInfo?.id === "ubuntu" || distroInfo?.id === "pop" || distroInfo?.id === "neon" || distroInfo?.id === "tuxedo") {
+      const isUbuntu = distroInfo?.id === "ubuntu";
+      const version3 = distroInfo?.version;
+      const major2 = parseInt(distroInfo.version, 10);
+      if (major2 < 20)
+        return { hostPlatform: "ubuntu18.04" + archSuffix, isOfficiallySupportedPlatform: false };
+      if (major2 < 22)
+        return { hostPlatform: "ubuntu20.04" + archSuffix, isOfficiallySupportedPlatform: isUbuntu && version3 === "20.04" };
+      if (major2 < 24)
+        return { hostPlatform: "ubuntu22.04" + archSuffix, isOfficiallySupportedPlatform: isUbuntu && version3 === "22.04" };
+      if (major2 < 26)
+        return { hostPlatform: "ubuntu24.04" + archSuffix, isOfficiallySupportedPlatform: isUbuntu && version3 === "24.04" };
+      if (major2 < 28)
+        return { hostPlatform: "ubuntu26.04" + archSuffix, isOfficiallySupportedPlatform: isUbuntu && version3 === "26.04" };
+      return { hostPlatform: "ubuntu" + distroInfo.version + archSuffix, isOfficiallySupportedPlatform: false };
+    }
+    if (distroInfo?.id === "linuxmint") {
+      const mintMajor = parseInt(distroInfo.version, 10);
+      if (mintMajor <= 20)
+        return { hostPlatform: "ubuntu20.04" + archSuffix, isOfficiallySupportedPlatform: false };
+      if (mintMajor === 21)
+        return { hostPlatform: "ubuntu22.04" + archSuffix, isOfficiallySupportedPlatform: false };
+      return { hostPlatform: "ubuntu24.04" + archSuffix, isOfficiallySupportedPlatform: false };
+    }
+    if (distroInfo?.id === "debian" || distroInfo?.id === "raspbian") {
+      const isOfficiallySupportedPlatform2 = distroInfo?.id === "debian";
+      if (distroInfo?.version === "11")
+        return { hostPlatform: "debian11" + archSuffix, isOfficiallySupportedPlatform: isOfficiallySupportedPlatform2 };
+      if (distroInfo?.version === "12")
+        return { hostPlatform: "debian12" + archSuffix, isOfficiallySupportedPlatform: isOfficiallySupportedPlatform2 };
+      if (distroInfo?.version === "13")
+        return { hostPlatform: "debian13" + archSuffix, isOfficiallySupportedPlatform: isOfficiallySupportedPlatform2 };
+      if (distroInfo?.version === "")
+        return { hostPlatform: "debian13" + archSuffix, isOfficiallySupportedPlatform: isOfficiallySupportedPlatform2 };
+    }
+    return { hostPlatform: "ubuntu24.04" + archSuffix, isOfficiallySupportedPlatform: false };
+  }
+  if (platform === "win32")
+    return { hostPlatform: "win64", isOfficiallySupportedPlatform: true };
+  return { hostPlatform: "", isOfficiallySupportedPlatform: false };
+}
+function toShortPlatform(hostPlatform2) {
+  if (hostPlatform2 === "")
+    return "";
+  if (hostPlatform2 === "win64")
+    return "win-x64";
+  if (hostPlatform2.startsWith("mac"))
+    return hostPlatform2.endsWith("arm64") ? "mac-arm64" : "mac-x64";
+  return hostPlatform2.endsWith("arm64") ? "linux-arm64" : "linux-x64";
+}
+var import_os3, hostPlatform, isOfficiallySupportedPlatform, shortPlatform;
+var init_hostPlatform = __esm({
+  "packages/utils/hostPlatform.ts"() {
+    "use strict";
+    import_os3 = __toESM(require("os"));
+    init_linuxUtils();
+    ({ hostPlatform, isOfficiallySupportedPlatform } = calculatePlatform());
+    shortPlatform = toShortPlatform(hostPlatform);
+  }
+});
+
+// packages/utils/happyEyeballs.ts
+async function createSocket(host, port) {
+  return new Promise((resolve, reject) => {
+    if (import_net.default.isIP(host)) {
+      const socket = import_net.default.createConnection({ host, port });
+      socket.on("connect", () => resolve(socket));
+      socket.on("error", (error) => reject(error));
+    } else {
+      createConnectionAsync(
+        { host, port },
+        (err, socket) => {
+          if (err)
+            reject(err);
+          if (socket)
+            resolve(socket);
+        },
+        /* useTLS */
+        false
+      ).catch((err) => reject(err));
+    }
+  });
+}
+async function createConnectionAsync(options, oncreate, useTLS) {
+  const lookup = options.__testHookLookup || lookupAddresses;
+  const hostname = clientRequestArgsToHostName(options);
+  const addresses = await lookup(hostname);
+  const dnsLookupAt = monotonicTime();
+  const sockets = /* @__PURE__ */ new Set();
+  let firstError;
+  let errorCount = 0;
+  const handleError = (socket, err) => {
+    if (!sockets.delete(socket))
+      return;
+    ++errorCount;
+    firstError ??= err;
+    if (errorCount === addresses.length)
+      oncreate?.(firstError);
+  };
+  const connected = new ManualPromise();
+  for (const { address } of addresses) {
+    const socket = useTLS ? import_tls.default.connect({
+      ...options,
+      port: options.port,
+      host: address,
+      servername: hostname
+    }) : import_net.default.createConnection({
+      ...options,
+      port: options.port,
+      host: address
+    });
+    socket[kDNSLookupAt] = dnsLookupAt;
+    socket.on("connect", () => {
+      socket[kTCPConnectionAt] = monotonicTime();
+      connected.resolve();
+      oncreate?.(null, socket);
+      sockets.delete(socket);
+      for (const s of sockets)
+        s.destroy();
+      sockets.clear();
+    });
+    socket.on("timeout", () => {
+      socket.destroy();
+      handleError(socket, new Error("Connection timeout"));
+    });
+    socket.on("error", (e) => handleError(socket, e));
+    sockets.add(socket);
+    await Promise.race([
+      connected,
+      new Promise((f) => setTimeout(f, connectionAttemptDelayMs))
+    ]);
+    if (connected.isDone())
+      break;
+  }
+}
+async function lookupAddresses(hostname) {
+  const [v4Result, v6Result] = await Promise.allSettled([
+    import_dns.default.promises.lookup(hostname, { all: true, family: 4 }),
+    import_dns.default.promises.lookup(hostname, { all: true, family: 6 })
+  ]);
+  const v4Addresses = v4Result.status === "fulfilled" ? v4Result.value : [];
+  const v6Addresses = v6Result.status === "fulfilled" ? v6Result.value : [];
+  if (!v4Addresses.length && !v6Addresses.length) {
+    if (v4Result.status === "rejected")
+      throw v4Result.reason;
+    throw v6Result.reason;
+  }
+  const result2 = [];
+  for (let i = 0; i < Math.max(v4Addresses.length, v6Addresses.length); i++) {
+    if (v6Addresses[i])
+      result2.push(v6Addresses[i]);
+    if (v4Addresses[i])
+      result2.push(v4Addresses[i]);
+  }
+  return result2;
+}
+function clientRequestArgsToHostName(options) {
+  if (options.hostname)
+    return options.hostname;
+  if (options.host)
+    return options.host;
+  throw new Error("Either options.hostname or options.host must be provided");
+}
+function timingForSocket(socket) {
+  return {
+    dnsLookupAt: socket[kDNSLookupAt],
+    tcpConnectionAt: socket[kTCPConnectionAt]
+  };
+}
+var import_dns, import_http, import_https, import_net, import_tls, connectionAttemptDelayMs, kDNSLookupAt, kTCPConnectionAt, HttpHappyEyeballsAgent, HttpsHappyEyeballsAgent, httpsHappyEyeballsAgent, httpHappyEyeballsAgent;
+var init_happyEyeballs = __esm({
+  "packages/utils/happyEyeballs.ts"() {
+    "use strict";
+    import_dns = __toESM(require("dns"));
+    import_http = __toESM(require("http"));
+    import_https = __toESM(require("https"));
+    import_net = __toESM(require("net"));
+    import_tls = __toESM(require("tls"));
+    init_assert();
+    init_manualPromise();
+    init_time();
+    connectionAttemptDelayMs = 300;
+    kDNSLookupAt = Symbol("kDNSLookupAt");
+    kTCPConnectionAt = Symbol("kTCPConnectionAt");
+    HttpHappyEyeballsAgent = class extends import_http.default.Agent {
+      createConnection(options, oncreate) {
+        if (import_net.default.isIP(clientRequestArgsToHostName(options)))
+          return import_net.default.createConnection(options);
+        createConnectionAsync(
+          options,
+          oncreate,
+          /* useTLS */
+          false
+        ).catch((err) => oncreate?.(err));
+      }
+    };
+    HttpsHappyEyeballsAgent = class extends import_https.default.Agent {
+      createConnection(options, oncreate) {
+        if (import_net.default.isIP(clientRequestArgsToHostName(options)))
+          return import_tls.default.connect(options);
+        createConnectionAsync(
+          options,
+          oncreate,
+          /* useTLS */
+          true
+        ).catch((err) => oncreate?.(err));
+      }
+    };
+    httpsHappyEyeballsAgent = new HttpsHappyEyeballsAgent({ keepAlive: true });
+    httpHappyEyeballsAgent = new HttpHappyEyeballsAgent({ keepAlive: true });
+  }
+});
+
+// packages/utils/network.ts
+function httpRequest(params2, onResponse, onError) {
+  let url2 = new URL(params2.url);
+  const options = {
+    method: params2.method || "GET",
+    headers: params2.headers
+  };
+  if (params2.rejectUnauthorized !== void 0)
+    options.rejectUnauthorized = params2.rejectUnauthorized;
+  const proxyURL = getProxyForUrl(params2.url);
+  if (proxyURL) {
+    const parsedProxyURL = normalizeProxyURL(proxyURL);
+    if (params2.url.startsWith("http:")) {
+      options.path = url2.toString();
+      const headers = options.headers || {};
+      if (!Object.keys(headers).some((header) => header.toLowerCase() === "host"))
+        headers.host = url2.host;
+      options.headers = headers;
+      url2 = parsedProxyURL;
+    } else {
+      options.agent = new HttpsProxyAgent(parsedProxyURL);
+    }
+  }
+  options.agent ??= url2.protocol === "https:" ? httpsHappyEyeballsAgent : httpHappyEyeballsAgent;
+  let cancelRequest;
+  const requestCallback = (res) => {
+    const statusCode = res.statusCode || 0;
+    if (statusCode >= 300 && statusCode < 400 && res.headers.location) {
+      request2.destroy();
+      cancelRequest = httpRequest({ ...params2, url: new URL(res.headers.location, params2.url).toString() }, onResponse, onError).cancel;
+    } else {
+      onResponse(res);
+    }
+  };
+  const request2 = url2.protocol === "https:" ? import_https2.default.request(url2, options, requestCallback) : import_http2.default.request(url2, options, requestCallback);
+  request2.on("error", onError);
+  if (params2.socketTimeout !== void 0) {
+    request2.setTimeout(params2.socketTimeout, () => {
+      onError(new Error(`Request to ${params2.url} timed out after ${params2.socketTimeout}ms`));
+      request2.abort();
+    });
+  }
+  cancelRequest = (e) => {
+    try {
+      request2.destroy(e);
+    } catch {
+    }
+  };
+  request2.end(params2.data);
+  return { cancel: (e) => cancelRequest(e) };
+}
+function shouldBypassProxy(url2, bypass) {
+  if (!bypass)
+    return false;
+  const domains = bypass.split(",").map((s) => {
+    s = s.trim();
+    if (!s.startsWith("."))
+      s = "." + s;
+    return s;
+  });
+  const domain = "." + url2.hostname;
+  return domains.some((d) => domain.endsWith(d));
+}
+function normalizeProxyURL(proxy) {
+  proxy = proxy.trim();
+  if (!/^\w+:\/\//.test(proxy))
+    proxy = "http://" + proxy;
+  return new URL(proxy);
+}
+function createProxyAgent(proxy, forUrl) {
+  if (!proxy)
+    return;
+  if (forUrl && proxy.bypass && shouldBypassProxy(forUrl, proxy.bypass))
+    return;
+  const proxyURL = normalizeProxyURL(proxy.server);
+  if (proxyURL.protocol?.startsWith("socks")) {
+    if (proxyURL.protocol === "socks5:")
+      proxyURL.protocol = "socks5h:";
+    else if (proxyURL.protocol === "socks4:")
+      proxyURL.protocol = "socks4a:";
+    return new SocksProxyAgent(proxyURL);
+  }
+  if (proxy.username) {
+    proxyURL.username = proxy.username;
+    proxyURL.password = proxy.password || "";
+  }
+  if (forUrl && ["ws:", "wss:"].includes(forUrl.protocol)) {
+    return new HttpsProxyAgent(proxyURL);
+  }
+  return new HttpsProxyAgent(proxyURL);
+}
+function createHttpServer(...args) {
+  const server = import_http2.default.createServer(...args);
+  decorateServer(server);
+  return server;
+}
+function createHttpsServer(...args) {
+  const server = import_https2.default.createServer(...args);
+  decorateServer(server);
+  return server;
+}
+function createHttp2Server(...args) {
+  const server = import_http22.default.createSecureServer(...args);
+  decorateServer(server);
+  return server;
+}
+async function startHttpServer(server, options) {
+  const { host = "localhost", port = 0 } = options;
+  const errorPromise = new ManualPromise();
+  const errorListener = (error) => errorPromise.reject(error);
+  server.on("error", errorListener);
+  try {
+    server.listen(port, host);
+    await Promise.race([
+      new Promise((cb) => server.once("listening", cb)),
+      errorPromise
+    ]);
+  } finally {
+    server.removeListener("error", errorListener);
+  }
+}
+async function isURLAvailable(url2, ignoreHTTPSErrors, onLog, onStdErr) {
+  let statusCode = await httpStatusCode(url2, ignoreHTTPSErrors, onLog, onStdErr);
+  if (statusCode === 404 && url2.pathname === "/") {
+    const indexUrl = new URL(url2);
+    indexUrl.pathname = "/index.html";
+    statusCode = await httpStatusCode(indexUrl, ignoreHTTPSErrors, onLog, onStdErr);
+  }
+  return statusCode >= 200 && statusCode < 404;
+}
+async function httpStatusCode(url2, ignoreHTTPSErrors, onLog, onStdErr) {
+  return new Promise((resolve) => {
+    onLog?.(`HTTP GET: ${url2}`);
+    httpRequest({
+      url: url2.toString(),
+      headers: { Accept: "*/*" },
+      rejectUnauthorized: !ignoreHTTPSErrors
+    }, (res) => {
+      res.resume();
+      const statusCode = res.statusCode ?? 0;
+      onLog?.(`HTTP Status: ${statusCode}`);
+      resolve(statusCode);
+    }, (error) => {
+      if (error.code === "DEPTH_ZERO_SELF_SIGNED_CERT")
+        onStdErr?.(`[WebServer] Self-signed certificate detected. Try adding ignoreHTTPSErrors: true to config.webServer.`);
+      onLog?.(`Error while checking if ${url2} is available: ${error.message}`);
+      resolve(0);
+    });
+  });
+}
+function decorateServer(server) {
+  const sockets = /* @__PURE__ */ new Set();
+  server.on("connection", (socket) => {
+    sockets.add(socket);
+    socket.once("close", () => sockets.delete(socket));
+  });
+  const close3 = server.close;
+  server.close = (callback) => {
+    for (const socket of sockets)
+      socket.destroy();
+    sockets.clear();
+    return close3.call(server, callback);
+  };
+}
+var import_http2, import_http22, import_https2, HttpsProxyAgent, SocksProxyAgent, getProxyForUrl, NET_DEFAULT_TIMEOUT;
+var init_network = __esm({
+  "packages/utils/network.ts"() {
+    "use strict";
+    import_http2 = __toESM(require("http"));
+    import_http22 = __toESM(require("http2"));
+    import_https2 = __toESM(require("https"));
+    init_manualPromise();
+    init_happyEyeballs();
+    ({ HttpsProxyAgent } = require("./utilsBundle"));
+    ({ SocksProxyAgent } = require("./utilsBundle"));
+    ({ getProxyForUrl } = require("./utilsBundle"));
+    NET_DEFAULT_TIMEOUT = 3e4;
+  }
+});
+
+// packages/utils/httpServer.ts
+function computeAllowedHosts(requested, bound) {
+  const loopback = /* @__PURE__ */ new Set(["127.0.0.1", "::1", "localhost"]);
+  const isLoopback = (h) => h !== void 0 && loopback.has(h.toLowerCase());
+  if (!isLoopback(requested) && requested !== void 0)
+    return null;
+  if (!isLoopback(bound) && requested === void 0)
+    return null;
+  return /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
+}
+function urlHostFromAddress(address) {
+  return address.family === "IPv6" ? `[${address.address}]` : address.address;
+}
+function hostnameFromHostHeader(host) {
+  if (host.startsWith("[")) {
+    const end = host.indexOf("]");
+    return end < 0 ? host : host.substring(0, end + 1);
+  }
+  const colon = host.indexOf(":");
+  return colon < 0 ? host : host.substring(0, colon);
+}
+function serveFolder(folder) {
+  const server = new HttpServer(folder);
+  server.routePrefix("/", (request2, response2) => {
+    let relativePath = new URL("http://localhost" + request2.url).pathname;
+    if (relativePath.startsWith("/trace/file")) {
+      const url2 = new URL("http://localhost" + request2.url);
+      const requested = url2.searchParams.get("path");
+      if (!requested)
+        return false;
+      const resolved = import_path3.default.resolve(requested);
+      try {
+        return server.serveFile(request2, response2, resolved);
+      } catch (e) {
+        return false;
+      }
+    }
+    if (relativePath === "/")
+      relativePath = "/index.html";
+    const absolutePath = import_path3.default.join(folder, ...relativePath.split("/"));
+    return server.serveFile(request2, response2, absolutePath);
+  });
+  return server;
+}
+var import_fs4, import_path3, mime, wsServer, HttpServer;
+var init_httpServer = __esm({
+  "packages/utils/httpServer.ts"() {
+    "use strict";
+    import_fs4 = __toESM(require("fs"));
+    import_path3 = __toESM(require("path"));
+    init_assert();
+    init_crypto();
+    init_fileUtils();
+    init_network();
+    mime = require("./utilsBundle").mime;
+    ({ wsServer } = require("./utilsBundle"));
+    HttpServer = class {
+      constructor(staticRoot) {
+        this._urlPrefixPrecise = "";
+        this._urlPrefixHumanReadable = "";
+        this._port = 0;
+        this._started = false;
+        this._routes = [];
+        // Allowed Host headers; null disables the check (host bound to a public address).
+        this._allowedHosts = null;
+        this._server = createHttpServer(this._onRequest.bind(this));
+        this._staticRoot = staticRoot ? import_path3.default.resolve(staticRoot) : void 0;
+      }
+      server() {
+        return this._server;
+      }
+      routePrefix(prefix, handler) {
+        this._routes.push({ prefix, handler });
+      }
+      routePath(path59, handler) {
+        this._routes.push({ exact: path59, handler });
+      }
+      port() {
+        return this._port;
+      }
+      createWebSocket(transportFactory, guid) {
+        assert(!this._wsGuid, "can only create one main websocket transport per server");
+        this._wsGuid = guid || createGuid();
+        const wsPath = "/" + this._wsGuid;
+        const wss = new wsServer({ noServer: true });
+        this._server.on("upgrade", (request2, socket, head) => {
+          const pathname = new URL(request2.url ?? "/", "http://localhost").pathname;
+          if (pathname !== wsPath)
+            return;
+          wss.handleUpgrade(request2, socket, head, (ws4) => wss.emit("connection", ws4, request2));
+        });
+        wss.on("connection", (ws4, request2) => {
+          const url2 = new URL(request2.url ?? "/", "http://localhost");
+          const transport = transportFactory(url2);
+          transport.sendEvent = (method, params2) => ws4.send(JSON.stringify({ method, params: params2 }));
+          transport.close = () => ws4.close();
+          transport.onconnect();
+          ws4.on("message", async (message) => {
+            const { id, method, params: params2 } = JSON.parse(String(message));
+            try {
+              const result2 = await transport.dispatch(method, params2);
+              ws4.send(JSON.stringify({ id, result: result2 }));
+            } catch (e) {
+              ws4.send(JSON.stringify({ id, error: String(e) }));
+            }
+          });
+          ws4.on("close", () => transport.onclose());
+          ws4.on("error", () => transport.onclose());
+        });
+      }
+      wsGuid() {
+        return this._wsGuid;
+      }
+      async createViteDevServer(options) {
+        const loadVite = new Function('return import("vite")');
+        const vite = await loadVite();
+        return await vite.createServer({
+          root: options.root,
+          base: options.base,
+          server: {
+            middlewareMode: true,
+            // Dedicated path so Vite's HMR websocket does not collide with any
+            // websocket HttpServer owns via createWebSocket().
+            hmr: { path: "/__vite_hmr", server: this._server }
+          },
+          appType: "spa",
+          clearScreen: false
+        });
+      }
+      // HMR end
+      // Vite's middleware `next` callback for the "no middleware matched" case;
+      // emits a 404 only if nothing downstream already responded.
+      static notFoundFallback(response2) {
+        return () => {
+          if (!response2.headersSent) {
+            response2.statusCode = 404;
+            response2.end();
+          }
+        };
+      }
+      async start(options = {}) {
+        assert(!this._started, "server already started");
+        this._started = true;
+        const host = options.host;
+        if (options.preferredPort) {
+          try {
+            await startHttpServer(this._server, { port: options.preferredPort, host });
+          } catch (e) {
+            if (!e || !e.message || !e.message.includes("EADDRINUSE"))
+              throw e;
+            await startHttpServer(this._server, { host });
+          }
+        } else {
+          await startHttpServer(this._server, { port: options.port, host });
+        }
+        const address = this._server.address();
+        assert(address, "Could not bind server socket");
+        if (typeof address === "string") {
+          this._urlPrefixPrecise = address;
+          this._urlPrefixHumanReadable = address;
+        } else {
+          this._port = address.port;
+          this._urlPrefixPrecise = `http://${urlHostFromAddress(address)}:${address.port}`;
+          this._urlPrefixHumanReadable = `http://${host ?? "localhost"}:${address.port}`;
+          this._allowedHosts = computeAllowedHosts(host, address.address);
+        }
+      }
+      async stop() {
+        await new Promise((cb) => this._server.close(cb));
+      }
+      urlPrefix(purpose) {
+        return purpose === "human-readable" ? this._urlPrefixHumanReadable : this._urlPrefixPrecise;
+      }
+      serveFile(request2, response2, absoluteFilePath, headers, options) {
+        if (this._staticRoot && !options?.skipRootCheck && !isPathInside(this._staticRoot, absoluteFilePath)) {
+          response2.statusCode = 403;
+          response2.end();
+          return true;
+        }
+        try {
+          for (const [name, value2] of Object.entries(headers || {}))
+            response2.setHeader(name, value2);
+          if (request2.headers.range)
+            this._serveRangeFile(request2, response2, absoluteFilePath);
+          else
+            this._serveFile(response2, absoluteFilePath);
+          return true;
+        } catch (e) {
+          return false;
+        }
+      }
+      _serveFile(response2, absoluteFilePath) {
+        const content = import_fs4.default.readFileSync(absoluteFilePath);
+        response2.statusCode = 200;
+        const contentType = mime.getType(import_path3.default.extname(absoluteFilePath)) || "application/octet-stream";
+        response2.setHeader("Content-Type", contentType);
+        response2.setHeader("Content-Length", content.byteLength);
+        response2.end(content);
+      }
+      _serveRangeFile(request2, response2, absoluteFilePath) {
+        const range = request2.headers.range;
+        if (!range || !range.startsWith("bytes=") || range.includes(", ") || [...range].filter((char) => char === "-").length !== 1) {
+          response2.statusCode = 400;
+          return response2.end("Bad request");
+        }
+        const [startStr, endStr] = range.replace(/bytes=/, "").split("-");
+        let start3;
+        let end;
+        const size = import_fs4.default.statSync(absoluteFilePath).size;
+        if (startStr !== "" && endStr === "") {
+          start3 = +startStr;
+          end = size - 1;
+        } else if (startStr === "" && endStr !== "") {
+          start3 = size - +endStr;
+          end = size - 1;
+        } else {
+          start3 = +startStr;
+          end = +endStr;
+        }
+        if (Number.isNaN(start3) || Number.isNaN(end) || start3 >= size || end >= size || start3 > end) {
+          response2.writeHead(416, {
+            "Content-Range": `bytes */${size}`
+          });
+          return response2.end();
+        }
+        response2.writeHead(206, {
+          "Content-Range": `bytes ${start3}-${end}/${size}`,
+          "Accept-Ranges": "bytes",
+          "Content-Length": end - start3 + 1,
+          "Content-Type": mime.getType(import_path3.default.extname(absoluteFilePath))
+        });
+        const readable = import_fs4.default.createReadStream(absoluteFilePath, { start: start3, end });
+        readable.pipe(response2);
+      }
+      _onRequest(request2, response2) {
+        if (request2.method === "OPTIONS") {
+          response2.writeHead(200);
+          response2.end();
+          return;
+        }
+        if (this._allowedHosts) {
+          const host = request2.headers.host?.toLowerCase();
+          const hostname = host ? hostnameFromHostHeader(host) : void 0;
+          if (!hostname || !this._allowedHosts.has(hostname)) {
+            response2.statusCode = 403;
+            response2.end();
+            return;
+          }
+        }
+        request2.on("error", () => response2.end());
+        try {
+          if (!request2.url) {
+            response2.end();
+            return;
+          }
+          const url2 = new URL("http://localhost" + request2.url);
+          for (const route2 of this._routes) {
+            if (route2.exact && url2.pathname === route2.exact && route2.handler(request2, response2))
+              return;
+            if (route2.prefix && url2.pathname.startsWith(route2.prefix) && route2.handler(request2, response2))
+              return;
+          }
+          response2.statusCode = 404;
+          response2.end();
+        } catch (e) {
+          response2.end();
+        }
+      }
+    };
+  }
+});
+
+// packages/utils/zones.ts
+function currentZone() {
+  return asyncLocalStorage.getStore() ?? emptyZone;
+}
+var import_async_hooks, asyncLocalStorage, Zone, emptyZone;
+var init_zones = __esm({
+  "packages/utils/zones.ts"() {
+    "use strict";
+    import_async_hooks = require("async_hooks");
+    asyncLocalStorage = new import_async_hooks.AsyncLocalStorage();
+    Zone = class _Zone {
+      constructor(asyncLocalStorage2, store) {
+        this._asyncLocalStorage = asyncLocalStorage2;
+        this._data = store;
+      }
+      with(type3, data) {
+        return new _Zone(this._asyncLocalStorage, new Map(this._data).set(type3, data));
+      }
+      without(type3) {
+        const data = type3 ? new Map(this._data) : /* @__PURE__ */ new Map();
+        data.delete(type3);
+        return new _Zone(this._asyncLocalStorage, data);
+      }
+      run(func) {
+        return this._asyncLocalStorage.run(this, func);
+      }
+      data(type3) {
+        return this._data.get(type3);
+      }
+    };
+    emptyZone = new Zone(asyncLocalStorage, /* @__PURE__ */ new Map());
+  }
+});
+
+// packages/utils/nodePlatform.ts
+function setBoxedStackPrefixes(prefixes) {
+  boxedStackPrefixes = prefixes;
+}
+var import_crypto4, import_fs5, import_path4, util, import_stream, import_events, colors2, pipelineAsync, NodeZone, boxedStackPrefixes, nodePlatform, ReadableStreamImpl, WritableStreamImpl;
+var init_nodePlatform = __esm({
+  "packages/utils/nodePlatform.ts"() {
+    "use strict";
+    import_crypto4 = __toESM(require("crypto"));
+    import_fs5 = __toESM(require("fs"));
+    import_path4 = __toESM(require("path"));
+    util = __toESM(require("util"));
+    import_stream = require("stream");
+    import_events = require("events");
+    init_debugLogger();
+    init_zones();
+    init_debug();
+    colors2 = require("./utilsBundle").colors;
+    pipelineAsync = util.promisify(import_stream.pipeline);
+    NodeZone = class _NodeZone {
+      constructor(zone) {
+        this._zone = zone;
+      }
+      push(data) {
+        return new _NodeZone(this._zone.with("apiZone", data));
+      }
+      pop() {
+        return new _NodeZone(this._zone.without("apiZone"));
+      }
+      run(func) {
+        return this._zone.run(func);
+      }
+      data() {
+        return this._zone.data("apiZone");
+      }
+    };
+    boxedStackPrefixes = [];
+    nodePlatform = (coreDir) => ({
+      name: "node",
+      boxedStackPrefixes: () => {
+        if (process.env.PWDEBUGIMPL)
+          return [];
+        return [coreDir, ...boxedStackPrefixes];
+      },
+      calculateSha1: (text2) => {
+        const sha1 = import_crypto4.default.createHash("sha1");
+        sha1.update(text2);
+        return Promise.resolve(sha1.digest("hex"));
+      },
+      colors: colors2,
+      coreDir,
+      createGuid: () => import_crypto4.default.randomBytes(16).toString("hex"),
+      defaultMaxListeners: () => import_events.EventEmitter.defaultMaxListeners,
+      fs: () => import_fs5.default,
+      env: process.env,
+      inspectCustom: util.inspect.custom,
+      isDebugMode: () => debugMode() === "inspector",
+      isJSDebuggerAttached: () => !!require("inspector").url(),
+      isLogEnabled(name) {
+        return debugLogger.isEnabled(name);
+      },
+      isUnderTest: () => isUnderTest(),
+      log(name, message) {
+        debugLogger.log(name, message);
+      },
+      path: () => import_path4.default,
+      pathSeparator: import_path4.default.sep,
+      showInternalStackFrames: () => !!process.env.PWDEBUGIMPL,
+      async streamFile(path59, stream3) {
+        await pipelineAsync(import_fs5.default.createReadStream(path59), stream3);
+      },
+      streamReadable: (channel) => {
+        return new ReadableStreamImpl(channel);
+      },
+      streamWritable: (channel) => {
+        return new WritableStreamImpl(channel);
+      },
+      zones: {
+        current: () => new NodeZone(currentZone()),
+        empty: new NodeZone(emptyZone)
+      }
+    });
+    ReadableStreamImpl = class extends import_stream.Readable {
+      constructor(channel) {
+        super();
+        this._channel = channel;
+      }
+      async _read() {
+        const result2 = await this._channel.read({ size: 1024 * 1024 });
+        if (result2.binary.byteLength)
+          this.push(result2.binary);
+        else
+          this.push(null);
+      }
+      _destroy(error, callback) {
+        this._channel.close().catch((e) => null);
+        super._destroy(error, callback);
+      }
+    };
+    WritableStreamImpl = class extends import_stream.Writable {
+      constructor(channel) {
+        super();
+        this._channel = channel;
+      }
+      async _write(chunk, encoding, callback) {
+        const error = await this._channel.write({ binary: typeof chunk === "string" ? Buffer.from(chunk) : chunk }).catch((e) => e);
+        callback(error || null);
+      }
+      async _final(callback) {
+        const error = await this._channel.close().catch((e) => e);
+        callback(error || null);
+      }
+    };
+  }
+});
+
+// packages/utils/processLauncher.ts
+async function gracefullyCloseAll() {
+  await Promise.all(Array.from(gracefullyCloseSet).map((gracefullyClose) => gracefullyClose().catch((e) => {
+  })));
+}
+function gracefullyProcessExitDoNotHang(code, onExit2) {
+  const beforeExit = onExit2 ? () => onExit2().catch(() => {
+  }) : () => Promise.resolve();
+  const callback = () => beforeExit().then(() => process.exit(code));
+  setTimeout(callback, 3e4);
+  gracefullyCloseAll().then(callback);
+}
+function exitHandler() {
+  for (const kill of killSet)
+    kill();
+}
+function sigintHandler() {
+  const exitWithCode130 = () => {
+    if (isUnderTest()) {
+      setTimeout(() => process.exit(130), 1e3);
+    } else {
+      process.exit(130);
+    }
+  };
+  if (sigintHandlerCalled) {
+    process.off("SIGINT", sigintHandler);
+    for (const kill of killSet)
+      kill();
+    exitWithCode130();
+  } else {
+    sigintHandlerCalled = true;
+    gracefullyCloseAll().then(() => exitWithCode130());
+  }
+}
+function sigtermHandler() {
+  gracefullyCloseAll();
+}
+function sighupHandler() {
+  gracefullyCloseAll();
+}
+function addProcessHandlerIfNeeded(name) {
+  if (!installedHandlers.has(name)) {
+    installedHandlers.add(name);
+    process.on(name, processHandlers[name]);
+  }
+}
+function removeProcessHandlersIfNeeded() {
+  if (killSet.size)
+    return;
+  for (const handler of installedHandlers)
+    process.off(handler, processHandlers[handler]);
+  installedHandlers.clear();
+}
+async function launchProcess(options) {
+  const stdio = options.stdio === "pipe" ? ["ignore", "pipe", "pipe", "pipe", "pipe"] : ["pipe", "pipe", "pipe"];
+  options.log(` ${options.command} ${options.args ? options.args.join(" ") : ""}`);
+  const spawnOptions = {
+    // On non-windows platforms, `detached: true` makes child process a leader of a new
+    // process group, making it possible to kill child process tree with `.kill(-pid)` command.
+    // @see https://nodejs.org/api/child_process.html#child_process_options_detached
+    detached: process.platform !== "win32",
+    env: options.env,
+    cwd: options.cwd,
+    shell: options.shell,
+    stdio
+  };
+  const spawnedProcess = childProcess.spawn(options.command, options.args || [], spawnOptions);
+  const cleanup = async () => {
+    options.log(`[pid=${spawnedProcess.pid || "N/A"}] starting temporary directories cleanup`);
+    const errors = await removeFolders(options.tempDirectories);
+    for (let i = 0; i < options.tempDirectories.length; ++i) {
+      if (errors[i])
+        options.log(`[pid=${spawnedProcess.pid || "N/A"}] exception while removing ${options.tempDirectories[i]}: ${errors[i]}`);
+    }
+    options.log(`[pid=${spawnedProcess.pid || "N/A"}] finished temporary directories cleanup`);
+  };
+  spawnedProcess.on("error", () => {
+  });
+  if (!spawnedProcess.pid) {
+    let failed;
+    const failedPromise = new Promise((f, r) => failed = f);
+    spawnedProcess.once("error", (error) => {
+      failed(new Error("Failed to launch: " + error));
+    });
+    return failedPromise.then(async (error) => {
+      await cleanup();
+      throw error;
+    });
+  }
+  options.log(` pid=${spawnedProcess.pid}`);
+  const stdout = readline.createInterface({ input: spawnedProcess.stdout });
+  stdout.on("line", (data) => {
+    options.log(`[pid=${spawnedProcess.pid}][out] ` + data);
+  });
+  const stderr = readline.createInterface({ input: spawnedProcess.stderr });
+  stderr.on("line", (data) => {
+    options.log(`[pid=${spawnedProcess.pid}][err] ` + data);
+  });
+  let processClosed = false;
+  let fulfillCleanup = () => {
+  };
+  const waitForCleanup = new Promise((f) => fulfillCleanup = f);
+  spawnedProcess.once("close", (exitCode, signal) => {
+    options.log(`[pid=${spawnedProcess.pid}] `);
+    processClosed = true;
+    gracefullyCloseSet.delete(gracefullyClose);
+    killSet.delete(killProcessAndCleanup);
+    removeProcessHandlersIfNeeded();
+    options.onExit(exitCode, signal);
+    cleanup().then(fulfillCleanup);
+  });
+  addProcessHandlerIfNeeded("exit");
+  if (options.handleSIGINT)
+    addProcessHandlerIfNeeded("SIGINT");
+  if (options.handleSIGTERM)
+    addProcessHandlerIfNeeded("SIGTERM");
+  if (options.handleSIGHUP)
+    addProcessHandlerIfNeeded("SIGHUP");
+  gracefullyCloseSet.add(gracefullyClose);
+  killSet.add(killProcessAndCleanup);
+  let gracefullyClosing = false;
+  async function gracefullyClose() {
+    if (gracefullyClosing) {
+      options.log(`[pid=${spawnedProcess.pid}] `);
+      killProcess();
+      await waitForCleanup;
+      return;
+    }
+    gracefullyClosing = true;
+    options.log(`[pid=${spawnedProcess.pid}] `);
+    await options.attemptToGracefullyClose().catch(() => killProcess());
+    await waitForCleanup;
+    options.log(`[pid=${spawnedProcess.pid}] `);
+  }
+  function killProcess() {
+    gracefullyCloseSet.delete(gracefullyClose);
+    killSet.delete(killProcessAndCleanup);
+    removeProcessHandlersIfNeeded();
+    options.log(`[pid=${spawnedProcess.pid}] `);
+    if (spawnedProcess.pid && !spawnedProcess.killed && !processClosed) {
+      options.log(`[pid=${spawnedProcess.pid}] `);
+      try {
+        if (process.platform === "win32") {
+          const taskkillProcess = childProcess.spawnSync(`taskkill /pid ${spawnedProcess.pid} /T /F`, { shell: true });
+          const [stdout2, stderr2] = [taskkillProcess.stdout.toString(), taskkillProcess.stderr.toString()];
+          if (stdout2)
+            options.log(`[pid=${spawnedProcess.pid}] taskkill stdout: ${stdout2}`);
+          if (stderr2)
+            options.log(`[pid=${spawnedProcess.pid}] taskkill stderr: ${stderr2}`);
+        } else {
+          process.kill(-spawnedProcess.pid, "SIGKILL");
+        }
+      } catch (e) {
+        options.log(`[pid=${spawnedProcess.pid}] exception while trying to kill process: ${e}`);
+      }
+    } else {
+      options.log(`[pid=${spawnedProcess.pid}] `);
+    }
+  }
+  function killProcessAndCleanup() {
+    killProcess();
+    options.log(`[pid=${spawnedProcess.pid || "N/A"}] starting temporary directories cleanup`);
+    for (const dir of options.tempDirectories) {
+      try {
+        import_fs6.default.rmSync(dir, { force: true, recursive: true, maxRetries: 5 });
+      } catch (e) {
+        options.log(`[pid=${spawnedProcess.pid || "N/A"}] exception while removing ${dir}: ${e}`);
+      }
+    }
+    options.log(`[pid=${spawnedProcess.pid || "N/A"}] finished temporary directories cleanup`);
+  }
+  function killAndWait() {
+    killProcess();
+    return waitForCleanup;
+  }
+  return { launchedProcess: spawnedProcess, gracefullyClose, kill: killAndWait };
+}
+function envArrayToObject(env) {
+  const result2 = {};
+  for (const { name, value: value2 } of env)
+    result2[name] = value2;
+  return result2;
+}
+var childProcess, import_fs6, readline, gracefullyCloseSet, killSet, sigintHandlerCalled, installedHandlers, processHandlers;
+var init_processLauncher = __esm({
+  "packages/utils/processLauncher.ts"() {
+    "use strict";
+    childProcess = __toESM(require("child_process"));
+    import_fs6 = __toESM(require("fs"));
+    readline = __toESM(require("readline"));
+    init_fileUtils();
+    init_debug();
+    gracefullyCloseSet = /* @__PURE__ */ new Set();
+    killSet = /* @__PURE__ */ new Set();
+    sigintHandlerCalled = false;
+    installedHandlers = /* @__PURE__ */ new Set();
+    processHandlers = {
+      exit: exitHandler,
+      SIGINT: sigintHandler,
+      SIGTERM: sigtermHandler,
+      SIGHUP: sighupHandler
+    };
+  }
+});
+
+// packages/utils/profiler.ts
+async function startProfiling() {
+  if (!profileDir)
+    return;
+  session = new (require("inspector")).Session();
+  session.connect();
+  await new Promise((f) => {
+    session.post("Profiler.enable", () => {
+      session.post("Profiler.start", f);
+    });
+  });
+}
+async function stopProfiling(profileName) {
+  if (!profileDir)
+    return;
+  await new Promise((f) => session.post("Profiler.stop", (err, { profile }) => {
+    if (!err) {
+      import_fs7.default.mkdirSync(profileDir, { recursive: true });
+      import_fs7.default.writeFileSync(import_path5.default.join(profileDir, profileName + ".json"), JSON.stringify(profile));
+    }
+    f();
+  }));
+}
+var import_fs7, import_path5, profileDir, session;
+var init_profiler = __esm({
+  "packages/utils/profiler.ts"() {
+    "use strict";
+    import_fs7 = __toESM(require("fs"));
+    import_path5 = __toESM(require("path"));
+    profileDir = process.env.PWTEST_PROFILE_DIR || "";
+  }
+});
+
+// packages/utils/serializedFS.ts
+var import_fs8, yazl, APPEND_CHUNK_SIZE, SerializedFS;
+var init_serializedFS = __esm({
+  "packages/utils/serializedFS.ts"() {
+    "use strict";
+    import_fs8 = __toESM(require("fs"));
+    init_manualPromise();
+    yazl = require("./utilsBundle").yazl;
+    APPEND_CHUNK_SIZE = 64 * 1024;
+    SerializedFS = class {
+      constructor() {
+        this._buffers = /* @__PURE__ */ new Map();
+        this._operations = [];
+        this._operationsDone = new ManualPromise();
+        this._operationsDone.resolve();
+      }
+      mkdir(dir) {
+        this._appendOperation({ op: "mkdir", dir });
+      }
+      writeFile(file, content, skipIfExists) {
+        this._buffers.delete(file);
+        this._appendOperation({ op: "writeFile", file, content, skipIfExists });
+      }
+      appendFile(file, text2, flush) {
+        if (!this._buffers.has(file))
+          this._buffers.set(file, []);
+        const buffer = this._buffers.get(file);
+        buffer.push(text2);
+        let size = 0;
+        for (const chunk of buffer)
+          size += chunk.length;
+        if (flush || size >= APPEND_CHUNK_SIZE)
+          this._flushFile(file);
+      }
+      _flushFile(file) {
+        const buffer = this._buffers.get(file);
+        if (buffer === void 0)
+          return;
+        const content = buffer.join("");
+        this._buffers.delete(file);
+        this._appendOperation({ op: "appendFile", file, content });
+      }
+      copyFile(from, to) {
+        this._flushFile(from);
+        this._buffers.delete(to);
+        this._appendOperation({ op: "copyFile", from, to });
+      }
+      async syncAndGetError() {
+        for (const file of this._buffers.keys())
+          this._flushFile(file);
+        await this._operationsDone;
+        return this._error;
+      }
+      zip(entries, zipFileName) {
+        for (const file of this._buffers.keys())
+          this._flushFile(file);
+        this._appendOperation({ op: "zip", entries, zipFileName });
+      }
+      // This method serializes all writes to the trace.
+      _appendOperation(op) {
+        const last = this._operations[this._operations.length - 1];
+        if (last?.op === "appendFile" && op.op === "appendFile" && last.file === op.file && last.content.length < APPEND_CHUNK_SIZE) {
+          last.content += op.content;
+          return;
+        }
+        this._operations.push(op);
+        if (this._operationsDone.isDone())
+          this._performOperations();
+      }
+      async _performOperations() {
+        this._operationsDone = new ManualPromise();
+        while (this._operations.length) {
+          const op = this._operations.shift();
+          if (this._error)
+            continue;
+          try {
+            await this._performOperation(op);
+          } catch (e) {
+            this._error = e;
+          }
+        }
+        this._operationsDone.resolve();
+      }
+      async _performOperation(op) {
+        switch (op.op) {
+          case "mkdir": {
+            await import_fs8.default.promises.mkdir(op.dir, { recursive: true });
+            return;
+          }
+          case "writeFile": {
+            if (op.skipIfExists)
+              await import_fs8.default.promises.writeFile(op.file, op.content, { flag: "wx" }).catch(() => {
+              });
+            else
+              await import_fs8.default.promises.writeFile(op.file, op.content);
+            return;
+          }
+          case "copyFile": {
+            await import_fs8.default.promises.copyFile(op.from, op.to);
+            return;
+          }
+          case "appendFile": {
+            await import_fs8.default.promises.appendFile(op.file, op.content);
+            return;
+          }
+          case "zip": {
+            const zipFile = new yazl.ZipFile();
+            const result2 = new ManualPromise();
+            zipFile.on("error", (error) => result2.reject(error));
+            for (const entry of op.entries)
+              zipFile.addFile(entry.value, entry.name);
+            zipFile.end();
+            zipFile.outputStream.pipe(import_fs8.default.createWriteStream(op.zipFileName)).on("close", () => result2.resolve()).on("error", (error) => result2.reject(error));
+            await result2;
+            return;
+          }
+        }
+      }
+    };
+  }
+});
+
+// packages/utils/socksProxy.ts
+function hexToNumber(hex) {
+  return [...hex].reduce((value2, digit2) => {
+    const code = digit2.charCodeAt(0);
+    if (code >= 48 && code <= 57)
+      return value2 + code;
+    if (code >= 97 && code <= 102)
+      return value2 + (code - 97) + 10;
+    if (code >= 65 && code <= 70)
+      return value2 + (code - 65) + 10;
+    throw new Error("Invalid IPv6 token " + hex);
+  }, 0);
+}
+function ipToSocksAddress(address) {
+  const ipv4Mapped = /^::ffff:(\d+\.\d+\.\d+\.\d+)$/i.exec(address);
+  if (ipv4Mapped)
+    address = ipv4Mapped[1];
+  if (import_net2.default.isIPv4(address)) {
+    return [
+      1,
+      // IPv4
+      ...address.split(".", 4).map((t) => +t & 255)
+      // Address
+    ];
+  }
+  if (import_net2.default.isIPv6(address)) {
+    const result2 = [4];
+    const tokens = address.split(":", 8);
+    while (tokens.length < 8)
+      tokens.unshift("");
+    for (const token of tokens) {
+      const value2 = hexToNumber(token);
+      result2.push(value2 >> 8 & 255, value2 & 255);
+    }
+    return result2;
+  }
+  throw new Error("Only IPv4 and IPv6 addresses are supported");
+}
+function starMatchToRegex(pattern) {
+  const source11 = pattern.split("*").map((s) => {
+    return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+  }).join(".*");
+  return new RegExp("^" + source11 + "$");
+}
+function parsePattern(pattern) {
+  if (!pattern)
+    return () => false;
+  const matchers = pattern.split(",").map((token) => {
+    const match = token.match(/^(.*?)(?::(\d+))?$/);
+    if (!match)
+      throw new Error(`Unsupported token "${token}" in pattern "${pattern}"`);
+    const tokenPort = match[2] ? +match[2] : void 0;
+    const portMatches = (port) => tokenPort === void 0 || tokenPort === port;
+    let tokenHost = match[1];
+    if (tokenHost === "") {
+      return (host, port) => {
+        if (!portMatches(port))
+          return false;
+        return host === "localhost" || host.endsWith(".localhost") || host === "127.0.0.1" || host === "[::1]";
+      };
+    }
+    if (tokenHost === "*")
+      return (host, port) => portMatches(port);
+    if (import_net2.default.isIPv4(tokenHost) || import_net2.default.isIPv6(tokenHost))
+      return (host, port) => host === tokenHost && portMatches(port);
+    if (tokenHost[0] === ".")
+      tokenHost = "*" + tokenHost;
+    const tokenRegex = starMatchToRegex(tokenHost);
+    return (host, port) => {
+      if (!portMatches(port))
+        return false;
+      if (import_net2.default.isIPv4(host) || import_net2.default.isIPv6(host))
+        return false;
+      return !!host.match(tokenRegex);
+    };
+  });
+  return (host, port) => matchers.some((matcher) => matcher(host, port));
+}
+var import_events2, import_net2, SocksConnection, SocksProxy, SocksProxyHandler;
+var init_socksProxy = __esm({
+  "packages/utils/socksProxy.ts"() {
+    "use strict";
+    import_events2 = __toESM(require("events"));
+    import_net2 = __toESM(require("net"));
+    init_assert();
+    init_crypto();
+    init_debugLogger();
+    init_happyEyeballs();
+    SocksConnection = class {
+      constructor(uid, socket, client) {
+        this._buffer = Buffer.from([]);
+        this._offset = 0;
+        this._fence = 0;
+        this._uid = uid;
+        this._socket = socket;
+        this._client = client;
+        this._boundOnData = this._onData.bind(this);
+        socket.on("data", this._boundOnData);
+        socket.on("close", () => this._onClose());
+        socket.on("end", () => this._onClose());
+        socket.on("error", () => this._onClose());
+        this._run().catch(() => this._socket.end());
+      }
+      async _run() {
+        assert(await this._authenticate());
+        const { command, host, port } = await this._parseRequest();
+        if (command !== 1 /* CONNECT */) {
+          this._writeBytes(Buffer.from([
+            5,
+            7 /* CommandNotSupported */,
+            0,
+            // RSV
+            1,
+            // IPv4
+            0,
+            0,
+            0,
+            0,
+            // Address
+            0,
+            0
+            // Port
+          ]));
+          return;
+        }
+        this._socket.off("data", this._boundOnData);
+        this._client.onSocketRequested({ uid: this._uid, host, port });
+      }
+      async _authenticate() {
+        const version3 = await this._readByte();
+        assert(version3 === 5, "The VER field must be set to x05 for this version of the protocol, was " + version3);
+        const nMethods = await this._readByte();
+        assert(nMethods, "No authentication methods specified");
+        const methods = await this._readBytes(nMethods);
+        for (const method of methods) {
+          if (method === 0) {
+            this._writeBytes(Buffer.from([version3, method]));
+            return true;
+          }
+        }
+        this._writeBytes(Buffer.from([version3, 255 /* NO_ACCEPTABLE_METHODS */]));
+        return false;
+      }
+      async _parseRequest() {
+        const version3 = await this._readByte();
+        assert(version3 === 5, "The VER field must be set to x05 for this version of the protocol, was " + version3);
+        const command = await this._readByte();
+        await this._readByte();
+        const addressType = await this._readByte();
+        let host = "";
+        switch (addressType) {
+          case 1 /* IPv4 */:
+            host = (await this._readBytes(4)).join(".");
+            break;
+          case 3 /* FqName */:
+            const length = await this._readByte();
+            host = (await this._readBytes(length)).toString();
+            break;
+          case 4 /* IPv6 */:
+            const bytes = await this._readBytes(16);
+            const tokens = [];
+            for (let i = 0; i < 8; ++i)
+              tokens.push(bytes.readUInt16BE(i * 2).toString(16));
+            host = tokens.join(":");
+            break;
+        }
+        const port = (await this._readBytes(2)).readUInt16BE(0);
+        this._buffer = Buffer.from([]);
+        this._offset = 0;
+        this._fence = 0;
+        return {
+          command,
+          host,
+          port
+        };
+      }
+      async _readByte() {
+        const buffer = await this._readBytes(1);
+        return buffer[0];
+      }
+      async _readBytes(length) {
+        this._fence = this._offset + length;
+        if (!this._buffer || this._buffer.length < this._fence)
+          await new Promise((f) => this._fenceCallback = f);
+        this._offset += length;
+        return this._buffer.slice(this._offset - length, this._offset);
+      }
+      _writeBytes(buffer) {
+        if (this._socket.writable)
+          this._socket.write(buffer);
+      }
+      _onClose() {
+        this._client.onSocketClosed({ uid: this._uid });
+      }
+      _onData(buffer) {
+        this._buffer = Buffer.concat([this._buffer, buffer]);
+        if (this._fenceCallback && this._buffer.length >= this._fence) {
+          const callback = this._fenceCallback;
+          this._fenceCallback = void 0;
+          callback();
+        }
+      }
+      socketConnected(host, port) {
+        this._writeBytes(Buffer.from([
+          5,
+          0 /* Succeeded */,
+          0,
+          // RSV
+          ...ipToSocksAddress(host),
+          // ATYP, Address
+          port >> 8,
+          port & 255
+          // Port
+        ]));
+        this._socket.on("data", (data) => this._client.onSocketData({ uid: this._uid, data }));
+      }
+      socketFailed(errorCode) {
+        const buffer = Buffer.from([
+          5,
+          0,
+          0,
+          // RSV
+          ...ipToSocksAddress("0.0.0.0"),
+          // ATYP, Address
+          0,
+          0
+          // Port
+        ]);
+        switch (errorCode) {
+          case "ENOENT":
+          case "ENOTFOUND":
+          case "ETIMEDOUT":
+          case "EHOSTUNREACH":
+            buffer[1] = 4 /* HostUnreachable */;
+            break;
+          case "ENETUNREACH":
+            buffer[1] = 3 /* NetworkUnreachable */;
+            break;
+          case "ECONNREFUSED":
+            buffer[1] = 5 /* ConnectionRefused */;
+            break;
+          case "ERULESET":
+            buffer[1] = 2 /* NotAllowedByRuleSet */;
+            break;
+        }
+        this._writeBytes(buffer);
+        this._socket.end();
+      }
+      sendData(data) {
+        this._socket.write(data);
+      }
+      end() {
+        this._socket.end();
+      }
+      error(error) {
+        this._socket.destroy(new Error(error));
+      }
+    };
+    SocksProxy = class _SocksProxy extends import_events2.default {
+      constructor() {
+        super();
+        this._connections = /* @__PURE__ */ new Map();
+        this._sockets = /* @__PURE__ */ new Set();
+        this._closed = false;
+        this._patternMatcher = () => false;
+        this._directSockets = /* @__PURE__ */ new Map();
+        this._server = new import_net2.default.Server((socket) => {
+          const uid = createGuid();
+          const connection = new SocksConnection(uid, socket, this);
+          this._connections.set(uid, connection);
+        });
+        this._server.on("connection", (socket) => {
+          if (this._closed) {
+            socket.destroy();
+            return;
+          }
+          this._sockets.add(socket);
+          socket.once("close", () => this._sockets.delete(socket));
+        });
+      }
+      static {
+        this.Events = {
+          SocksRequested: "socksRequested",
+          SocksData: "socksData",
+          SocksClosed: "socksClosed"
+        };
+      }
+      setPattern(pattern) {
+        try {
+          this._patternMatcher = parsePattern(pattern);
+        } catch (e) {
+          this._patternMatcher = () => false;
+        }
+      }
+      async _handleDirect(request2) {
+        try {
+          const socket = await createSocket(request2.host, request2.port);
+          socket.on("data", (data) => this._connections.get(request2.uid)?.sendData(data));
+          socket.on("error", (error) => {
+            this._connections.get(request2.uid)?.error(error.message);
+            this._directSockets.delete(request2.uid);
+          });
+          socket.on("end", () => {
+            this._connections.get(request2.uid)?.end();
+            this._directSockets.delete(request2.uid);
+          });
+          const localAddress = socket.localAddress;
+          const localPort = socket.localPort;
+          this._directSockets.set(request2.uid, socket);
+          this._connections.get(request2.uid)?.socketConnected(localAddress, localPort);
+        } catch (error) {
+          this._connections.get(request2.uid)?.socketFailed(error.code);
+        }
+      }
+      port() {
+        return this._port;
+      }
+      async listen(port, hostname) {
+        return new Promise((f) => {
+          this._server.listen(port, hostname, () => {
+            const port2 = this._server.address().port;
+            this._port = port2;
+            f(port2);
+          });
+        });
+      }
+      async close() {
+        if (this._closed)
+          return;
+        this._closed = true;
+        for (const socket of this._sockets)
+          socket.destroy();
+        this._sockets.clear();
+        await new Promise((f) => this._server.close(f));
+      }
+      onSocketRequested(payload) {
+        if (!this._patternMatcher(payload.host, payload.port)) {
+          this._handleDirect(payload);
+          return;
+        }
+        this.emit(_SocksProxy.Events.SocksRequested, payload);
+      }
+      onSocketData(payload) {
+        const direct = this._directSockets.get(payload.uid);
+        if (direct) {
+          direct.write(payload.data);
+          return;
+        }
+        this.emit(_SocksProxy.Events.SocksData, payload);
+      }
+      onSocketClosed(payload) {
+        const direct = this._directSockets.get(payload.uid);
+        if (direct) {
+          direct.destroy();
+          this._directSockets.delete(payload.uid);
+          return;
+        }
+        this.emit(_SocksProxy.Events.SocksClosed, payload);
+      }
+      socketConnected({ uid, host, port }) {
+        this._connections.get(uid)?.socketConnected(host, port);
+      }
+      socketFailed({ uid, errorCode }) {
+        this._connections.get(uid)?.socketFailed(errorCode);
+      }
+      sendSocketData({ uid, data }) {
+        this._connections.get(uid)?.sendData(data);
+      }
+      sendSocketEnd({ uid }) {
+        this._connections.get(uid)?.end();
+      }
+      sendSocketError({ uid, error }) {
+        this._connections.get(uid)?.error(error);
+      }
+    };
+    SocksProxyHandler = class _SocksProxyHandler extends import_events2.default {
+      constructor(pattern, redirectPortForTest) {
+        super();
+        this._sockets = /* @__PURE__ */ new Map();
+        this._patternMatcher = () => false;
+        this._patternMatcher = parsePattern(pattern);
+        this._redirectPortForTest = redirectPortForTest;
+      }
+      static {
+        this.Events = {
+          SocksConnected: "socksConnected",
+          SocksData: "socksData",
+          SocksError: "socksError",
+          SocksFailed: "socksFailed",
+          SocksEnd: "socksEnd"
+        };
+      }
+      cleanup() {
+        for (const uid of this._sockets.keys())
+          this.socketClosed({ uid });
+      }
+      async socketRequested({ uid, host, port }) {
+        debugLogger.log("socks", `[${uid}] => request ${host}:${port}`);
+        if (!this._patternMatcher(host, port)) {
+          const payload = { uid, errorCode: "ERULESET" };
+          debugLogger.log("socks", `[${uid}] <= pattern error ${payload.errorCode}`);
+          this.emit(_SocksProxyHandler.Events.SocksFailed, payload);
+          return;
+        }
+        if (host === "local.playwright")
+          host = "localhost";
+        try {
+          if (this._redirectPortForTest)
+            port = this._redirectPortForTest;
+          const socket = await createSocket(host, port);
+          socket.on("data", (data) => {
+            const payload2 = { uid, data };
+            this.emit(_SocksProxyHandler.Events.SocksData, payload2);
+          });
+          socket.on("error", (error) => {
+            const payload2 = { uid, error: error.message };
+            debugLogger.log("socks", `[${uid}] <= network socket error ${payload2.error}`);
+            this.emit(_SocksProxyHandler.Events.SocksError, payload2);
+            this._sockets.delete(uid);
+          });
+          socket.on("end", () => {
+            const payload2 = { uid };
+            debugLogger.log("socks", `[${uid}] <= network socket closed`);
+            this.emit(_SocksProxyHandler.Events.SocksEnd, payload2);
+            this._sockets.delete(uid);
+          });
+          const localAddress = socket.localAddress;
+          const localPort = socket.localPort;
+          this._sockets.set(uid, socket);
+          const payload = { uid, host: localAddress, port: localPort };
+          debugLogger.log("socks", `[${uid}] <= connected to network ${payload.host}:${payload.port}`);
+          this.emit(_SocksProxyHandler.Events.SocksConnected, payload);
+        } catch (error) {
+          const payload = { uid, errorCode: error.code };
+          debugLogger.log("socks", `[${uid}] <= connect error ${payload.errorCode}`);
+          this.emit(_SocksProxyHandler.Events.SocksFailed, payload);
+        }
+      }
+      sendSocketData({ uid, data }) {
+        this._sockets.get(uid)?.write(data);
+      }
+      socketClosed({ uid }) {
+        debugLogger.log("socks", `[${uid}] <= browser socket closed`);
+        this._sockets.get(uid)?.destroy();
+        this._sockets.delete(uid);
+      }
+    };
+  }
+});
+
+// packages/utils/spawnAsync.ts
+function spawnAsync(cmd, args, options = {}) {
+  const process2 = (0, import_child_process.spawn)(cmd, args, Object.assign({ windowsHide: true }, options));
+  return new Promise((resolve) => {
+    let stdout = "";
+    let stderr = "";
+    if (process2.stdout)
+      process2.stdout.on("data", (data) => stdout += data.toString());
+    if (process2.stderr)
+      process2.stderr.on("data", (data) => stderr += data.toString());
+    process2.on("close", (code) => resolve({ stdout, stderr, code }));
+    process2.on("error", (error) => resolve({ stdout, stderr, code: 0, error }));
+  });
+}
+var import_child_process;
+var init_spawnAsync = __esm({
+  "packages/utils/spawnAsync.ts"() {
+    "use strict";
+    import_child_process = require("child_process");
+  }
+});
+
+// packages/utils/stringWidth.ts
+function characterWidth(c) {
+  return getEastAsianWidth.eastAsianWidth(c.codePointAt(0));
+}
+function stringWidth(v) {
+  let width = 0;
+  for (const { segment } of new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(v))
+    width += characterWidth(segment);
+  return width;
+}
+function suffixOfWidth(v, width) {
+  const segments = [...new Intl.Segmenter(void 0, { granularity: "grapheme" }).segment(v)];
+  let suffixBegin = v.length;
+  for (const { segment, index } of segments.reverse()) {
+    const segmentWidth = stringWidth(segment);
+    if (segmentWidth > width)
+      break;
+    width -= segmentWidth;
+    suffixBegin = index;
+  }
+  return v.substring(suffixBegin);
+}
+function fitToWidth(line, width, prefix) {
+  const prefixLength = prefix ? stripAnsiEscapes(prefix).length : 0;
+  width -= prefixLength;
+  if (stringWidth(line) <= width)
+    return line;
+  const parts = line.split(ansiRegex);
+  const taken = [];
+  for (let i = parts.length - 1; i >= 0; i--) {
+    if (i % 2) {
+      taken.push(parts[i]);
+    } else {
+      let part = suffixOfWidth(parts[i], width);
+      const wasTruncated = part.length < parts[i].length;
+      if (wasTruncated && parts[i].length > 0) {
+        part = "\u2026" + suffixOfWidth(parts[i], width - 1);
+      }
+      taken.push(part);
+      width -= stringWidth(part);
+    }
+  }
+  return taken.reverse().join("");
+}
+var getEastAsianWidth;
+var init_stringWidth = __esm({
+  "packages/utils/stringWidth.ts"() {
+    "use strict";
+    init_stringUtils();
+    getEastAsianWidth = require("./utilsBundle").getEastAsianWidth;
+  }
+});
+
+// packages/utils/task.ts
+function makeWaitForNextTask() {
+  if (process.versions.electron)
+    return (callback) => setTimeout(callback, 0);
+  if (parseInt(process.versions.node, 10) >= 11)
+    return setImmediate;
+  let spinning = false;
+  const callbacks = [];
+  const loop = () => {
+    const callback = callbacks.shift();
+    if (!callback) {
+      spinning = false;
+      return;
+    }
+    setImmediate(loop);
+    callback();
+  };
+  return (callback) => {
+    callbacks.push(callback);
+    if (!spinning) {
+      spinning = true;
+      setImmediate(loop);
+    }
+  };
+}
+var init_task = __esm({
+  "packages/utils/task.ts"() {
+    "use strict";
+  }
+});
+
+// packages/utils/wsServer.ts
+var wsServer2, lastConnectionId, kConnectionSymbol, perMessageDeflate, WSServer;
+var init_wsServer = __esm({
+  "packages/utils/wsServer.ts"() {
+    "use strict";
+    init_httpServer();
+    init_network();
+    init_debugLogger();
+    ({ wsServer: wsServer2 } = require("./utilsBundle"));
+    lastConnectionId = 0;
+    kConnectionSymbol = Symbol("kConnection");
+    perMessageDeflate = {
+      serverNoContextTakeover: true,
+      zlibDeflateOptions: {
+        level: 3
+      },
+      zlibInflateOptions: {
+        chunkSize: 10 * 1024
+      },
+      threshold: 10 * 1024
+    };
+    WSServer = class {
+      constructor(delegate) {
+        // Allowed Host headers for HTTP requests. null disables the check (server bound to a public address).
+        this._allowedHosts = null;
+        this._delegate = delegate;
+      }
+      async listen(port = 0, hostname, path59) {
+        debugLogger.log("server", `Server started at ${/* @__PURE__ */ new Date()}`);
+        hostname ??= "localhost";
+        const server = createHttpServer((request2, response2) => this._onRequest(request2, response2));
+        server.on("error", (error) => debugLogger.log("server", String(error)));
+        this.server = server;
+        const wsEndpoint = await new Promise((resolve, reject) => {
+          server.listen(port, hostname, () => {
+            const address = server.address();
+            if (!address) {
+              reject(new Error("Could not bind server socket"));
+              return;
+            }
+            if (typeof address === "string") {
+              resolve(`${address}${path59}`);
+              return;
+            }
+            this._allowedHosts = computeAllowedHosts(hostname, address.address);
+            resolve(`ws://${urlHostFromAddress(address)}:${address.port}${path59}`);
+          }).on("error", reject);
+        });
+        debugLogger.log("server", "Listening at " + wsEndpoint);
+        this._wsServer = new wsServer2({
+          noServer: true,
+          perMessageDeflate
+        });
+        this._wsServer.on("headers", (headers) => this._delegate.onHeaders(headers));
+        server.on("upgrade", (request2, socket, head) => {
+          const pathname = new URL("http://localhost" + request2.url).pathname;
+          if (pathname !== path59) {
+            socket.write(`HTTP/${request2.httpVersion} 400 Bad Request\r
+\r
+`);
+            socket.destroy();
+            return;
+          }
+          if (this._allowedHosts && !this._isAllowedOrigin(request2.headers.origin)) {
+            socket.write(`HTTP/${request2.httpVersion} 403 Forbidden\r
+\r
+`);
+            socket.destroy();
+            return;
+          }
+          const upgradeResult = this._delegate.onUpgrade(request2, socket);
+          if (upgradeResult) {
+            socket.write(upgradeResult.error);
+            socket.destroy();
+            return;
+          }
+          this._wsServer.handleUpgrade(request2, socket, head, (ws4) => this._wsServer.emit("connection", ws4, request2));
+        });
+        this._wsServer.on("connection", (ws4, request2) => {
+          debugLogger.log("server", "Connected client ws.extension=" + ws4.extensions);
+          const url2 = new URL("http://localhost" + (request2.url || ""));
+          const id = String(++lastConnectionId);
+          debugLogger.log("server", `[${id}] serving connection: ${request2.url}`);
+          const connection = this._delegate.onConnection(request2, url2, ws4, id);
+          ws4[kConnectionSymbol] = connection;
+        });
+        return wsEndpoint;
+      }
+      _onRequest(request2, response2) {
+        if (this._allowedHosts) {
+          const host = request2.headers.host?.toLowerCase();
+          const hostname = host ? hostnameFromHostHeader(host) : void 0;
+          if (!hostname || !this._allowedHosts.has(hostname)) {
+            response2.statusCode = 403;
+            response2.end();
+            return;
+          }
+        }
+        this._delegate.onRequest(request2, response2);
+      }
+      _isAllowedOrigin(origin) {
+        if (!origin)
+          return true;
+        try {
+          const hostname = new URL(origin).hostname.toLowerCase();
+          const bracketed = hostname.includes(":") ? `[${hostname}]` : hostname;
+          return this._allowedHosts.has(hostname) || this._allowedHosts.has(bracketed);
+        } catch {
+          return false;
+        }
+      }
+      async close() {
+        const server = this._wsServer;
+        if (!server)
+          return;
+        debugLogger.log("server", "closing websocket server");
+        const waitForClose = new Promise((f) => server.close(f));
+        await Promise.all(Array.from(server.clients).map(async (ws4) => {
+          const connection = ws4[kConnectionSymbol];
+          if (connection)
+            await connection.close();
+          try {
+            ws4.terminate();
+          } catch (e) {
+          }
+        }));
+        await waitForClose;
+        debugLogger.log("server", "closing http server");
+        if (this.server)
+          await new Promise((f) => this.server.close(f));
+        this._wsServer = void 0;
+        this.server = void 0;
+        debugLogger.log("server", "closed server");
+      }
+    };
+  }
+});
+
+// packages/utils/zipFile.ts
+var yauzl, ZipFile;
+var init_zipFile = __esm({
+  "packages/utils/zipFile.ts"() {
+    "use strict";
+    yauzl = require("./utilsBundle").yauzl;
+    ZipFile = class {
+      constructor(fileName) {
+        this._entries = /* @__PURE__ */ new Map();
+        this._fileName = fileName;
+        this._openedPromise = this._open();
+      }
+      async _open() {
+        await new Promise((fulfill, reject) => {
+          yauzl.open(this._fileName, { autoClose: false }, (e, z31) => {
+            if (e) {
+              reject(e);
+              return;
+            }
+            this._zipFile = z31;
+            this._zipFile.on("entry", (entry) => {
+              this._entries.set(entry.fileName, entry);
+            });
+            this._zipFile.on("end", fulfill);
+          });
+        });
+      }
+      async entries() {
+        await this._openedPromise;
+        return [...this._entries.keys()];
+      }
+      async read(entryPath) {
+        await this._openedPromise;
+        const entry = this._entries.get(entryPath);
+        if (!entry)
+          throw new Error(`${entryPath} not found in file ${this._fileName}`);
+        return new Promise((resolve, reject) => {
+          this._zipFile.openReadStream(entry, (error, readStream) => {
+            if (error || !readStream) {
+              reject(error || "Entry not found");
+              return;
+            }
+            const buffers = [];
+            readStream.on("data", (data) => buffers.push(data));
+            readStream.on("end", () => resolve(Buffer.concat(buffers)));
+          });
+        });
+      }
+      close() {
+        this._zipFile?.close();
+      }
+    };
+  }
+});
+
+// packages/utils/third_party/extractZip.ts
+async function extractZip(zipPath, opts) {
+  debug2("creating target directory", opts.dir);
+  if (!import_path6.default.isAbsolute(opts.dir))
+    throw new Error("Target directory is expected to be absolute");
+  await import_fs9.promises.mkdir(opts.dir, { recursive: true });
+  opts.dir = await import_fs9.promises.realpath(opts.dir);
+  return new Extractor(zipPath, opts).extract();
+}
+var import_fs9, import_path6, import_stream2, import_util, debugPkg, getStream, yauzl2, debug2, openZip, pipeline2, Extractor;
+var init_extractZip = __esm({
+  "packages/utils/third_party/extractZip.ts"() {
+    "use strict";
+    import_fs9 = require("fs");
+    import_path6 = __toESM(require("path"));
+    import_stream2 = __toESM(require("stream"));
+    import_util = require("util");
+    debugPkg = require("./utilsBundle").debug;
+    getStream = require("./utilsBundle").getStream;
+    yauzl2 = require("./utilsBundle").yauzl;
+    debug2 = debugPkg("extract-zip");
+    openZip = (0, import_util.promisify)(yauzl2.open);
+    pipeline2 = (0, import_util.promisify)(import_stream2.default.pipeline);
+    Extractor = class {
+      constructor(zipPath, opts) {
+        this.canceled = false;
+        this.zipPath = zipPath;
+        this.opts = opts;
+      }
+      async extract() {
+        debug2("opening", this.zipPath, "with opts", this.opts);
+        this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
+        this.canceled = false;
+        return new Promise((resolve, reject) => {
+          this.zipfile.on("error", (err) => {
+            this.canceled = true;
+            reject(err);
+          });
+          this.zipfile.readEntry();
+          this.zipfile.on("close", () => {
+            if (!this.canceled) {
+              debug2("zip extraction complete");
+              resolve();
+            }
+          });
+          this.zipfile.on("entry", async (entry) => {
+            if (this.canceled) {
+              debug2("skipping entry", entry.fileName, { cancelled: this.canceled });
+              return;
+            }
+            debug2("zipfile entry", entry.fileName);
+            if (entry.fileName.startsWith("__MACOSX/")) {
+              this.zipfile.readEntry();
+              return;
+            }
+            const destDir = import_path6.default.dirname(import_path6.default.join(this.opts.dir, entry.fileName));
+            try {
+              await import_fs9.promises.mkdir(destDir, { recursive: true });
+              const canonicalDestDir = await import_fs9.promises.realpath(destDir);
+              const relativeDestDir = import_path6.default.relative(this.opts.dir, canonicalDestDir);
+              if (relativeDestDir.split(import_path6.default.sep).includes(".."))
+                throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
+              await this.extractEntry(entry);
+              debug2("finished processing", entry.fileName);
+              this.zipfile.readEntry();
+            } catch (err) {
+              this.canceled = true;
+              this.zipfile.close();
+              reject(err);
+            }
+          });
+        });
+      }
+      async extractEntry(entry) {
+        if (this.canceled) {
+          debug2("skipping entry extraction", entry.fileName, { cancelled: this.canceled });
+          return;
+        }
+        if (this.opts.onEntry)
+          this.opts.onEntry(entry, this.zipfile);
+        const dest = import_path6.default.join(this.opts.dir, entry.fileName);
+        const mode = entry.externalFileAttributes >> 16 & 65535;
+        const IFMT = 61440;
+        const IFDIR = 16384;
+        const IFLNK = 40960;
+        const symlink = (mode & IFMT) === IFLNK;
+        let isDir = (mode & IFMT) === IFDIR;
+        if (!isDir && entry.fileName.endsWith("/"))
+          isDir = true;
+        const madeBy = entry.versionMadeBy >> 8;
+        if (!isDir)
+          isDir = madeBy === 0 && entry.externalFileAttributes === 16;
+        debug2("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink });
+        const procMode = this.getExtractedMode(mode, isDir) & 511;
+        const destDir = isDir ? dest : import_path6.default.dirname(dest);
+        const mkdirOptions = { recursive: true };
+        if (isDir)
+          mkdirOptions.mode = procMode;
+        debug2("mkdir", { dir: destDir, ...mkdirOptions });
+        await import_fs9.promises.mkdir(destDir, mkdirOptions);
+        if (isDir)
+          return;
+        debug2("opening read stream", dest);
+        const readStream = await (0, import_util.promisify)(this.zipfile.openReadStream.bind(this.zipfile))(entry);
+        if (symlink) {
+          const link = await getStream(readStream);
+          debug2("creating symlink", link, dest);
+          await import_fs9.promises.symlink(link, dest);
+        } else {
+          await pipeline2(readStream, (0, import_fs9.createWriteStream)(dest, { mode: procMode }));
+        }
+      }
+      getExtractedMode(entryMode, isDir) {
+        let mode = entryMode;
+        if (mode === 0) {
+          if (isDir) {
+            if (this.opts.defaultDirMode)
+              mode = Number(this.opts.defaultDirMode);
+            if (!mode)
+              mode = 493;
+          } else {
+            if (this.opts.defaultFileMode)
+              mode = Number(this.opts.defaultFileMode);
+            if (!mode)
+              mode = 420;
+          }
+        }
+        return mode;
+      }
+    };
+  }
+});
+
+// packages/utils/third_party/lockfile.ts
+function probe(file, fs61, callback) {
+  const cachedPrecision = fs61[cacheSymbol];
+  if (cachedPrecision) {
+    return fs61.stat(file, (err, stat) => {
+      if (err)
+        return callback(err);
+      callback(null, stat.mtime, cachedPrecision);
+    });
+  }
+  const mtime = new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
+  fs61.utimes(file, mtime, mtime, (err) => {
+    if (err)
+      return callback(err);
+    fs61.stat(file, (err2, stat) => {
+      if (err2)
+        return callback(err2);
+      const precision = stat.mtime.getTime() % 1e3 === 0 ? "s" : "ms";
+      Object.defineProperty(fs61, cacheSymbol, { value: precision });
+      callback(null, stat.mtime, precision);
+    });
+  });
+}
+function getMtime(precision) {
+  let now = Date.now();
+  if (precision === "s")
+    now = Math.ceil(now / 1e3) * 1e3;
+  return new Date(now);
+}
+function getLockFile(file, options) {
+  return options.lockfilePath || `${file}.lock`;
+}
+function resolveCanonicalPath(file, options, callback) {
+  if (!options.realpath)
+    return callback(null, import_path7.default.resolve(file));
+  options.fs.realpath(file, callback);
+}
+function acquireLock(file, options, callback) {
+  const lockfilePath = getLockFile(file, options);
+  options.fs.mkdir(lockfilePath, (err) => {
+    if (!err) {
+      return probe(lockfilePath, options.fs, (err2, mtime, mtimePrecision) => {
+        if (err2) {
+          options.fs.rmdir(lockfilePath, () => {
+          });
+          return callback(err2);
+        }
+        callback(null, mtime, mtimePrecision);
+      });
+    }
+    if (err.code !== "EEXIST")
+      return callback(err);
+    if (options.stale <= 0)
+      return callback(Object.assign(new Error("Lock file is already being held"), { code: "ELOCKED", file }));
+    options.fs.stat(lockfilePath, (err2, stat) => {
+      if (err2) {
+        if (err2.code === "ENOENT")
+          return acquireLock(file, { ...options, stale: 0 }, callback);
+        return callback(err2);
+      }
+      if (!isLockStale(stat, options))
+        return callback(Object.assign(new Error("Lock file is already being held"), { code: "ELOCKED", file }));
+      removeLock(file, options, (err3) => {
+        if (err3)
+          return callback(err3);
+        acquireLock(file, { ...options, stale: 0 }, callback);
+      });
+    });
+  });
+}
+function isLockStale(stat, options) {
+  return stat.mtime.getTime() < Date.now() - options.stale;
+}
+function removeLock(file, options, callback) {
+  options.fs.rmdir(getLockFile(file, options), (err) => {
+    if (err && err.code !== "ENOENT")
+      return callback(err);
+    callback(null);
+  });
+}
+function updateLock(file, options) {
+  const lock2 = locks[file];
+  if (lock2.updateTimeout)
+    return;
+  lock2.updateDelay = lock2.updateDelay || options.update;
+  lock2.updateTimeout = setTimeout(() => {
+    lock2.updateTimeout = null;
+    options.fs.stat(lock2.lockfilePath, (err, stat) => {
+      const isOverThreshold = lock2.lastUpdate + options.stale < Date.now();
+      if (err) {
+        if (err.code === "ENOENT" || isOverThreshold)
+          return setLockAsCompromised(file, lock2, Object.assign(err, { code: "ECOMPROMISED" }));
+        lock2.updateDelay = 1e3;
+        return updateLock(file, options);
+      }
+      const isMtimeOurs = lock2.mtime.getTime() === stat.mtime.getTime();
+      if (!isMtimeOurs) {
+        return setLockAsCompromised(
+          file,
+          lock2,
+          Object.assign(
+            new Error("Unable to update lock within the stale threshold"),
+            { code: "ECOMPROMISED" }
+          )
+        );
+      }
+      const mtime = getMtime(lock2.mtimePrecision);
+      options.fs.utimes(lock2.lockfilePath, mtime, mtime, (err2) => {
+        const isOverThreshold2 = lock2.lastUpdate + options.stale < Date.now();
+        if (lock2.released)
+          return;
+        if (err2) {
+          if (err2.code === "ENOENT" || isOverThreshold2)
+            return setLockAsCompromised(file, lock2, Object.assign(err2, { code: "ECOMPROMISED" }));
+          lock2.updateDelay = 1e3;
+          return updateLock(file, options);
+        }
+        lock2.mtime = mtime;
+        lock2.lastUpdate = Date.now();
+        lock2.updateDelay = null;
+        updateLock(file, options);
+      });
+    });
+  }, lock2.updateDelay);
+  if (lock2.updateTimeout && lock2.updateTimeout.unref)
+    lock2.updateTimeout.unref();
+}
+function setLockAsCompromised(file, lock2, err) {
+  lock2.released = true;
+  if (lock2.updateTimeout)
+    clearTimeout(lock2.updateTimeout);
+  if (locks[file] === lock2)
+    delete locks[file];
+  lock2.options.onCompromised(err);
+}
+function lockImpl(file, options, callback) {
+  const resolvedOptions = {
+    stale: 1e4,
+    update: null,
+    realpath: true,
+    retries: 0,
+    fs: gracefulFs,
+    onCompromised: (err) => {
+      throw err;
+    },
+    ...options
+  };
+  resolvedOptions.retries = resolvedOptions.retries || 0;
+  resolvedOptions.retries = typeof resolvedOptions.retries === "number" ? { retries: resolvedOptions.retries } : resolvedOptions.retries;
+  resolvedOptions.stale = Math.max(resolvedOptions.stale || 0, 2e3);
+  resolvedOptions.update = resolvedOptions.update === null || resolvedOptions.update === void 0 ? resolvedOptions.stale / 2 : resolvedOptions.update || 0;
+  resolvedOptions.update = Math.max(Math.min(resolvedOptions.update, resolvedOptions.stale / 2), 1e3);
+  resolveCanonicalPath(file, resolvedOptions, (err, resolvedFile) => {
+    if (err)
+      return callback(err);
+    const canonicalFile = resolvedFile;
+    const operation = retry.operation(resolvedOptions.retries);
+    operation.attempt(() => {
+      acquireLock(canonicalFile, resolvedOptions, (err2, mtime, mtimePrecision) => {
+        if (operation.retry(err2 || void 0))
+          return;
+        if (err2)
+          return callback(operation.mainError());
+        const lock2 = locks[canonicalFile] = {
+          lockfilePath: getLockFile(canonicalFile, resolvedOptions),
+          mtime,
+          mtimePrecision,
+          options: resolvedOptions,
+          lastUpdate: Date.now()
+        };
+        updateLock(canonicalFile, resolvedOptions);
+        callback(null, (releasedCallback) => {
+          if (lock2.released) {
+            return releasedCallback && releasedCallback(Object.assign(new Error("Lock is already released"), { code: "ERELEASED" }));
+          }
+          unlock(canonicalFile, { ...resolvedOptions, realpath: false }, releasedCallback || (() => {
+          }));
+        });
+      });
+    });
+  });
+}
+function unlock(file, options, callback) {
+  const resolvedOptions = {
+    stale: 1e4,
+    update: null,
+    realpath: true,
+    retries: 0,
+    fs: gracefulFs,
+    onCompromised: (err) => {
+      throw err;
+    },
+    ...options
+  };
+  resolveCanonicalPath(file, resolvedOptions, (err, resolvedFile) => {
+    if (err)
+      return callback(err);
+    const canonicalFile = resolvedFile;
+    const lock2 = locks[canonicalFile];
+    if (!lock2)
+      return callback(Object.assign(new Error("Lock is not acquired/owned by you"), { code: "ENOTACQUIRED" }));
+    if (lock2.updateTimeout)
+      clearTimeout(lock2.updateTimeout);
+    lock2.released = true;
+    delete locks[canonicalFile];
+    removeLock(canonicalFile, resolvedOptions, callback);
+  });
+}
+function toPromise(method) {
+  return (...args) => new Promise((resolve, reject) => {
+    args.push((err, result2) => {
+      if (err)
+        reject(err);
+      else
+        resolve(result2);
+    });
+    method(...args);
+  });
+}
+function ensureCleanup() {
+  if (cleanupInitialized)
+    return;
+  cleanupInitialized = true;
+  onExit(() => {
+    for (const file in locks) {
+      const options = locks[file].options;
+      try {
+        options.fs.rmdirSync(getLockFile(file, options));
+      } catch (e) {
+      }
+    }
+  });
+}
+async function lock(file, options) {
+  ensureCleanup();
+  const release = await toPromise(lockImpl)(file, options || {});
+  return toPromise(release);
+}
+var import_path7, gracefulFs, retry, onExit, locks, cacheSymbol, cleanupInitialized;
+var init_lockfile = __esm({
+  "packages/utils/third_party/lockfile.ts"() {
+    "use strict";
+    import_path7 = __toESM(require("path"));
+    gracefulFs = require("./utilsBundle").gracefulFs;
+    retry = require("./utilsBundle").retry;
+    onExit = require("./utilsBundle").onExit;
+    locks = {};
+    cacheSymbol = Symbol();
+    cleanupInitialized = false;
+  }
+});
+
+// packages/utils/index.ts
+var utils_exports = {};
+__export(utils_exports, {
+  FastStats: () => FastStats,
+  HttpServer: () => HttpServer,
+  ImageChannel: () => ImageChannel,
+  NET_DEFAULT_TIMEOUT: () => NET_DEFAULT_TIMEOUT,
+  RecentLogsCollector: () => RecentLogsCollector,
+  SerializedFS: () => SerializedFS,
+  SocksProxy: () => SocksProxy,
+  SocksProxyHandler: () => SocksProxyHandler,
+  WSServer: () => WSServer,
+  ZipFile: () => ZipFile,
+  Zone: () => Zone,
+  addSuffixToFilePath: () => addSuffixToFilePath,
+  blendWithWhite: () => blendWithWhite,
+  calculateSha1: () => calculateSha1,
+  canAccessFile: () => canAccessFile,
+  colorDeltaE94: () => colorDeltaE94,
+  compare: () => compare,
+  compareBuffersOrStrings: () => compareBuffersOrStrings,
+  computeAllowedHosts: () => computeAllowedHosts,
+  copyFileAndMakeWritable: () => copyFileAndMakeWritable,
+  createGuid: () => createGuid,
+  createHttp2Server: () => createHttp2Server,
+  createHttpServer: () => createHttpServer,
+  createHttpsServer: () => createHttpsServer,
+  createProxyAgent: () => createProxyAgent,
+  currentZone: () => currentZone,
+  debugLogger: () => debugLogger,
+  debugMode: () => debugMode,
+  decorateServer: () => decorateServer,
+  defaultUserDataDirForChannel: () => defaultUserDataDirForChannel,
+  emptyZone: () => emptyZone,
+  envArrayToObject: () => envArrayToObject,
+  eventsHelper: () => eventsHelper,
+  existsAsync: () => existsAsync,
+  extractZip: () => extractZip,
+  fitToWidth: () => fitToWidth,
+  generateSelfSignedCertificate: () => generateSelfSignedCertificate,
+  getAsBooleanFromENV: () => getAsBooleanFromENV,
+  getComparator: () => getComparator,
+  getFromENV: () => getFromENV,
+  getPackageManager: () => getPackageManager,
+  getPackageManagerExecCommand: () => getPackageManagerExecCommand,
+  gracefullyCloseAll: () => gracefullyCloseAll,
+  gracefullyCloseSet: () => gracefullyCloseSet,
+  gracefullyProcessExitDoNotHang: () => gracefullyProcessExitDoNotHang,
+  guessClientName: () => guessClientName,
+  hostPlatform: () => hostPlatform,
+  hostnameFromHostHeader: () => hostnameFromHostHeader,
+  httpRequest: () => httpRequest,
+  isChromiumChannelName: () => isChromiumChannelName,
+  isCodingAgent: () => isCodingAgent,
+  isLikelyNpxGlobal: () => isLikelyNpxGlobal,
+  isOfficiallySupportedPlatform: () => isOfficiallySupportedPlatform,
+  isPathInside: () => isPathInside,
+  isSystemDirectory: () => isSystemDirectory,
+  isURLAvailable: () => isURLAvailable,
+  isUnderTest: () => isUnderTest,
+  isWritable: () => isWritable,
+  jsonStringifyForceASCII: () => jsonStringifyForceASCII,
+  launchProcess: () => launchProcess,
+  lock: () => lock,
+  makeSocketPath: () => makeSocketPath,
+  makeWaitForNextTask: () => makeWaitForNextTask,
+  mkdirIfNeeded: () => mkdirIfNeeded,
+  nodePlatform: () => nodePlatform,
+  parsePattern: () => parsePattern,
+  perMessageDeflate: () => perMessageDeflate,
+  removeFolders: () => removeFolders,
+  resolveWithinRoot: () => resolveWithinRoot,
+  rgb2gray: () => rgb2gray,
+  sanitizeForFilePath: () => sanitizeForFilePath,
+  serveFolder: () => serveFolder,
+  setBoxedStackPrefixes: () => setBoxedStackPrefixes,
+  setPlaywrightTestProcessEnv: () => setPlaywrightTestProcessEnv,
+  shortPlatform: () => shortPlatform,
+  spawnAsync: () => spawnAsync,
+  srgb2xyz: () => srgb2xyz,
+  ssim: () => ssim,
+  startHttpServer: () => startHttpServer,
+  startProfiling: () => startProfiling,
+  stopProfiling: () => stopProfiling,
+  stringWidth: () => stringWidth,
+  throwingResolveWithinRoot: () => throwingResolveWithinRoot,
+  toPosixPath: () => toPosixPath,
+  trimLongString: () => trimLongString,
+  urlHostFromAddress: () => urlHostFromAddress,
+  wrapInASCIIBox: () => wrapInASCIIBox,
+  xyz2lab: () => xyz2lab
+});
+var init_utils = __esm({
+  "packages/utils/index.ts"() {
+    "use strict";
+    init_ascii();
+    init_chromiumChannels();
+    init_comparators();
+    init_crypto();
+    init_debug();
+    init_debugLogger();
+    init_env();
+    init_eventsHelper();
+    init_fileUtils();
+    init_hostPlatform();
+    init_httpServer();
+    init_network();
+    init_nodePlatform();
+    init_processLauncher();
+    init_profiler();
+    init_serializedFS();
+    init_socksProxy();
+    init_spawnAsync();
+    init_stringWidth();
+    init_task();
+    init_wsServer();
+    init_zipFile();
+    init_zones();
+    init_extractZip();
+    init_lockfile();
+    init_colorUtils();
+    init_compare();
+    init_imageChannel();
+    init_stats();
+  }
+});
+
+// packages/playwright-core/src/client/eventEmitter.ts
+function checkListener(listener) {
+  if (typeof listener !== "function")
+    throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
+}
+function unwrapListener(l) {
+  return wrappedListener(l) ?? l;
+}
+function unwrapListeners(arr) {
+  return arr.map((l) => wrappedListener(l) ?? l);
+}
+function wrappedListener(l) {
+  return l.listener;
+}
+var EventEmitter3, OnceWrapper;
+var init_eventEmitter = __esm({
+  "packages/playwright-core/src/client/eventEmitter.ts"() {
+    "use strict";
+    EventEmitter3 = class {
+      constructor(platform) {
+        this._events = void 0;
+        this._eventsCount = 0;
+        this._maxListeners = void 0;
+        this._pendingHandlers = /* @__PURE__ */ new Map();
+        this._platform = platform;
+        if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
+          this._events = /* @__PURE__ */ Object.create(null);
+          this._eventsCount = 0;
+        }
+        this._maxListeners = this._maxListeners || void 0;
+        this.on = this.addListener;
+        this.off = this.removeListener;
+      }
+      setMaxListeners(n) {
+        if (typeof n !== "number" || n < 0 || Number.isNaN(n))
+          throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
+        this._maxListeners = n;
+        return this;
+      }
+      getMaxListeners() {
+        return this._maxListeners === void 0 ? this._platform.defaultMaxListeners() : this._maxListeners;
+      }
+      emit(type3, ...args) {
+        const events = this._events;
+        if (events === void 0)
+          return false;
+        const handler = events?.[type3];
+        if (handler === void 0)
+          return false;
+        if (typeof handler === "function") {
+          this._callHandler(type3, handler, args);
+        } else {
+          const len = handler.length;
+          const listeners = handler.slice();
+          for (let i = 0; i < len; ++i)
+            this._callHandler(type3, listeners[i], args);
+        }
+        return true;
+      }
+      _callHandler(type3, handler, args) {
+        const promise = Reflect.apply(handler, this, args);
+        if (!(promise instanceof Promise))
+          return;
+        let set = this._pendingHandlers.get(type3);
+        if (!set) {
+          set = /* @__PURE__ */ new Set();
+          this._pendingHandlers.set(type3, set);
+        }
+        set.add(promise);
+        promise.catch((e) => {
+          if (this._rejectionHandler)
+            this._rejectionHandler(e);
+          else
+            throw e;
+        }).finally(() => set.delete(promise));
+      }
+      addListener(type3, listener) {
+        return this._addListener(type3, listener, false);
+      }
+      on(type3, listener) {
+        return this._addListener(type3, listener, false);
+      }
+      _addListener(type3, listener, prepend) {
+        checkListener(listener);
+        let events = this._events;
+        let existing;
+        if (events === void 0) {
+          events = this._events = /* @__PURE__ */ Object.create(null);
+          this._eventsCount = 0;
+        } else {
+          if (events.newListener !== void 0) {
+            this.emit("newListener", type3, unwrapListener(listener));
+            events = this._events;
+          }
+          existing = events[type3];
+        }
+        if (existing === void 0) {
+          existing = events[type3] = listener;
+          ++this._eventsCount;
+        } else {
+          if (typeof existing === "function") {
+            existing = events[type3] = prepend ? [listener, existing] : [existing, listener];
+          } else if (prepend) {
+            existing.unshift(listener);
+          } else {
+            existing.push(listener);
+          }
+          const m = this.getMaxListeners();
+          if (m > 0 && existing.length > m && !existing.warned) {
+            existing.warned = true;
+            const w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type3) + " listeners added. Use emitter.setMaxListeners() to increase limit");
+            w.name = "MaxListenersExceededWarning";
+            w.emitter = this;
+            w.type = type3;
+            w.count = existing.length;
+            if (!this._platform.isUnderTest()) {
+              console.warn(w);
+            }
+          }
+        }
+        return this;
+      }
+      prependListener(type3, listener) {
+        return this._addListener(type3, listener, true);
+      }
+      once(type3, listener) {
+        checkListener(listener);
+        this.on(type3, new OnceWrapper(this, type3, listener).wrapperFunction);
+        return this;
+      }
+      prependOnceListener(type3, listener) {
+        checkListener(listener);
+        this.prependListener(type3, new OnceWrapper(this, type3, listener).wrapperFunction);
+        return this;
+      }
+      removeListener(type3, listener) {
+        checkListener(listener);
+        const events = this._events;
+        if (events === void 0)
+          return this;
+        const list = events[type3];
+        if (list === void 0)
+          return this;
+        if (list === listener || list.listener === listener) {
+          if (--this._eventsCount === 0) {
+            this._events = /* @__PURE__ */ Object.create(null);
+          } else {
+            delete events[type3];
+            if (events.removeListener)
+              this.emit("removeListener", type3, list.listener ?? listener);
+          }
+        } else if (typeof list !== "function") {
+          let position = -1;
+          let originalListener;
+          for (let i = list.length - 1; i >= 0; i--) {
+            if (list[i] === listener || wrappedListener(list[i]) === listener) {
+              originalListener = wrappedListener(list[i]);
+              position = i;
+              break;
+            }
+          }
+          if (position < 0)
+            return this;
+          if (position === 0)
+            list.shift();
+          else
+            list.splice(position, 1);
+          if (list.length === 1)
+            events[type3] = list[0];
+          if (events.removeListener !== void 0)
+            this.emit("removeListener", type3, originalListener || listener);
+        }
+        return this;
+      }
+      off(type3, listener) {
+        return this.removeListener(type3, listener);
+      }
+      removeAllListeners(type3, options) {
+        this._removeAllListeners(type3);
+        if (!options)
+          return this;
+        if (options.behavior === "wait") {
+          const errors = [];
+          this._rejectionHandler = (error) => errors.push(error);
+          return this._waitFor(type3).then(() => {
+            if (errors.length)
+              throw errors[0];
+          });
+        }
+        if (options.behavior === "ignoreErrors")
+          this._rejectionHandler = () => {
+          };
+        return Promise.resolve();
+      }
+      _removeAllListeners(type3) {
+        const events = this._events;
+        if (!events)
+          return;
+        if (!events.removeListener) {
+          if (type3 === void 0) {
+            this._events = /* @__PURE__ */ Object.create(null);
+            this._eventsCount = 0;
+          } else if (events[type3] !== void 0) {
+            if (--this._eventsCount === 0)
+              this._events = /* @__PURE__ */ Object.create(null);
+            else
+              delete events[type3];
+          }
+          return;
+        }
+        if (type3 === void 0) {
+          const keys = Object.keys(events);
+          let key;
+          for (let i = 0; i < keys.length; ++i) {
+            key = keys[i];
+            if (key === "removeListener")
+              continue;
+            this._removeAllListeners(key);
+          }
+          this._removeAllListeners("removeListener");
+          this._events = /* @__PURE__ */ Object.create(null);
+          this._eventsCount = 0;
+          return;
+        }
+        const listeners = events[type3];
+        if (typeof listeners === "function") {
+          this.removeListener(type3, listeners);
+        } else if (listeners !== void 0) {
+          for (let i = listeners.length - 1; i >= 0; i--)
+            this.removeListener(type3, listeners[i]);
+        }
+      }
+      listeners(type3) {
+        return this._listeners(this, type3, true);
+      }
+      rawListeners(type3) {
+        return this._listeners(this, type3, false);
+      }
+      listenerCount(type3) {
+        const events = this._events;
+        if (events !== void 0) {
+          const listener = events[type3];
+          if (typeof listener === "function")
+            return 1;
+          if (listener !== void 0)
+            return listener.length;
+        }
+        return 0;
+      }
+      eventNames() {
+        return this._eventsCount > 0 && this._events ? Reflect.ownKeys(this._events) : [];
+      }
+      async _waitFor(type3) {
+        let promises = [];
+        if (type3) {
+          promises = [...this._pendingHandlers.get(type3) || []];
+        } else {
+          promises = [];
+          for (const [, pending] of this._pendingHandlers)
+            promises.push(...pending);
+        }
+        await Promise.all(promises);
+      }
+      _listeners(target, type3, unwrap) {
+        const events = target._events;
+        if (events === void 0)
+          return [];
+        const listener = events[type3];
+        if (listener === void 0)
+          return [];
+        if (typeof listener === "function")
+          return unwrap ? [unwrapListener(listener)] : [listener];
+        return unwrap ? unwrapListeners(listener) : listener.slice();
+      }
+    };
+    OnceWrapper = class {
+      constructor(eventEmitter, eventType, listener) {
+        this._fired = false;
+        this._eventEmitter = eventEmitter;
+        this._eventType = eventType;
+        this._listener = listener;
+        this.wrapperFunction = this._handle.bind(this);
+        this.wrapperFunction.listener = listener;
+      }
+      _handle(...args) {
+        if (this._fired)
+          return;
+        this._fired = true;
+        this._eventEmitter.removeListener(this._eventType, this.wrapperFunction);
+        return this._listener.apply(this._eventEmitter, args);
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/bootstrap.ts
+var minimumMajorNodeVersion, currentNodeVersion, major;
+var init_bootstrap = __esm({
+  "packages/playwright-core/src/bootstrap.ts"() {
+    "use strict";
+    minimumMajorNodeVersion = 18;
+    currentNodeVersion = process.versions.node;
+    major = +currentNodeVersion.split(".")[0];
+    if (major < minimumMajorNodeVersion) {
+      console.error(
+        "You are running Node.js " + currentNodeVersion + `.
+Playwright requires Node.js ${minimumMajorNodeVersion} or higher. 
+Please update your version of Node.js.`
+      );
+      process.exit(1);
+    }
+    if (process.env.PW_INSTRUMENT_MODULES) {
+      const Module = require("module");
+      const originalLoad = Module._load;
+      const root = { name: "", selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
+      let current = root;
+      const stack = [];
+      Module._load = function(request2, _parent, _isMain) {
+        const node = { name: request2, selfMs: 0, totalMs: 0, childrenMs: 0, children: [] };
+        current.children.push(node);
+        stack.push(current);
+        current = node;
+        const start3 = performance.now();
+        let result2;
+        try {
+          result2 = originalLoad.apply(this, arguments);
+        } catch (e) {
+          current = stack.pop();
+          current.children.pop();
+          throw e;
+        }
+        const duration = performance.now() - start3;
+        node.totalMs = duration;
+        node.selfMs = Math.max(0, duration - node.childrenMs);
+        current = stack.pop();
+        current.childrenMs += duration;
+        return result2;
+      };
+      process.on("exit", () => {
+        function printTree(node, prefix, isLast, lines2, depth) {
+          if (node.totalMs < 1 && depth > 0)
+            return;
+          const connector = depth === 0 ? "" : isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
+          const time = `${node.totalMs.toFixed(1).padStart(8)}ms`;
+          const self2 = node.children.length ? ` (self: ${node.selfMs.toFixed(1)}ms)` : "";
+          lines2.push(`${time}  ${prefix}${connector}${node.name}${self2}`);
+          const childPrefix = prefix + (depth === 0 ? "" : isLast ? "    " : "\u2502   ");
+          const sorted2 = node.children.slice().sort((a, b) => b.totalMs - a.totalMs);
+          for (let i = 0; i < sorted2.length; i++)
+            printTree(sorted2[i], childPrefix, i === sorted2.length - 1, lines2, depth + 1);
+        }
+        let totalModules = 0;
+        function count(n) {
+          totalModules++;
+          n.children.forEach(count);
+        }
+        root.children.forEach(count);
+        const lines = [];
+        const sorted = root.children.slice().sort((a, b) => b.totalMs - a.totalMs);
+        for (let i = 0; i < sorted.length; i++)
+          printTree(sorted[i], "", i === sorted.length - 1, lines, 0);
+        const totalMs = root.children.reduce((s, c) => s + c.totalMs, 0);
+        process.stderr.write(`
+--- Module load tree: ${totalModules} modules, ${totalMs.toFixed(0)}ms total ---
+` + lines.join("\n") + "\n");
+        const flat = /* @__PURE__ */ new Map();
+        function gather(n) {
+          const existing = flat.get(n.name);
+          if (existing) {
+            existing.selfMs += n.selfMs;
+            existing.totalMs += n.totalMs;
+            existing.count++;
+          } else {
+            flat.set(n.name, { selfMs: n.selfMs, totalMs: n.totalMs, count: 1 });
+          }
+          n.children.forEach(gather);
+        }
+        root.children.forEach(gather);
+        const top50 = [...flat.entries()].sort((a, b) => b[1].selfMs - a[1].selfMs).slice(0, 50);
+        const flatLines = top50.map(
+          ([mod, { selfMs, totalMs: totalMs2, count: count2 }]) => `${selfMs.toFixed(1).padStart(8)}ms self ${totalMs2.toFixed(1).padStart(8)}ms total  (x${String(count2).padStart(3)})  ${mod}`
+        );
+        process.stderr.write(`
+--- Top 50 modules by self time ---
+` + flatLines.join("\n") + "\n");
+      });
+    }
+  }
+});
+
+// packages/playwright-core/src/package.ts
+function libPath(...parts) {
+  return import_path8.default.join(packageRoot, "lib", ...parts);
+}
+var import_path8, packageRoot, packageJSON, binPath;
+var init_package = __esm({
+  "packages/playwright-core/src/package.ts"() {
+    "use strict";
+    import_path8 = __toESM(require("path"));
+    packageRoot = import_path8.default.join(__dirname, "..");
+    packageJSON = require(import_path8.default.join(packageRoot, "package.json"));
+    binPath = import_path8.default.join(packageRoot, "bin");
+  }
+});
+
+// packages/playwright-core/src/tools/trace/traceParser.ts
+async function extractTrace(traceFile, outDir) {
+  const zipFile = new ZipFile(traceFile);
+  try {
+    const entries = await zipFile.entries();
+    for (const entry of entries) {
+      const outPath = resolveWithinRoot(outDir, entry);
+      if (!outPath)
+        throw new Error(`Trace entry '${entry}' escapes output directory`);
+      await import_fs10.default.promises.mkdir(import_path9.default.dirname(outPath), { recursive: true });
+      const buffer = await zipFile.read(entry);
+      await import_fs10.default.promises.writeFile(outPath, buffer);
+    }
+  } finally {
+    zipFile.close();
+  }
+}
+var import_fs10, import_path9, DirTraceLoaderBackend;
+var init_traceParser = __esm({
+  "packages/playwright-core/src/tools/trace/traceParser.ts"() {
+    "use strict";
+    import_fs10 = __toESM(require("fs"));
+    import_path9 = __toESM(require("path"));
+    init_fileUtils();
+    init_zipFile();
+    DirTraceLoaderBackend = class {
+      constructor(dir) {
+        this._dir = dir;
+      }
+      isLive() {
+        return false;
+      }
+      async entryNames() {
+        const entries = [];
+        const walk = async (dir, prefix) => {
+          const items = await import_fs10.default.promises.readdir(dir, { withFileTypes: true });
+          for (const item of items) {
+            if (item.isDirectory())
+              await walk(import_path9.default.join(dir, item.name), prefix ? `${prefix}/${item.name}` : item.name);
+            else
+              entries.push(prefix ? `${prefix}/${item.name}` : item.name);
+          }
+        };
+        await walk(this._dir, "");
+        return entries;
+      }
+      async hasEntry(entryName) {
+        const resolved = resolveWithinRoot(this._dir, entryName);
+        if (!resolved)
+          return false;
+        try {
+          await import_fs10.default.promises.access(resolved);
+          return true;
+        } catch {
+          return false;
+        }
+      }
+      async readText(entryName) {
+        const resolved = resolveWithinRoot(this._dir, entryName);
+        if (!resolved)
+          return;
+        try {
+          return await import_fs10.default.promises.readFile(resolved, "utf-8");
+        } catch {
+        }
+      }
+      async readBlob(entryName) {
+        const resolved = resolveWithinRoot(this._dir, entryName);
+        if (!resolved)
+          return;
+        try {
+          const buffer = await import_fs10.default.promises.readFile(resolved);
+          return new Blob([new Uint8Array(buffer)]);
+        } catch {
+        }
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/tools/trace/traceUtils.ts
+function ensureTraceOpen() {
+  if (!import_fs11.default.existsSync(traceDir))
+    throw new Error(`No trace opened. Run 'npx playwright trace open ' first.`);
+  return traceDir;
+}
+async function closeTrace() {
+  if (import_fs11.default.existsSync(traceDir))
+    await import_fs11.default.promises.rm(traceDir, { recursive: true });
+}
+async function openTrace(traceFile) {
+  const filePath = import_path10.default.resolve(traceFile);
+  if (!import_fs11.default.existsSync(filePath))
+    throw new Error(`Trace file not found: ${filePath}`);
+  await closeTrace();
+  await import_fs11.default.promises.mkdir(traceDir, { recursive: true });
+  if (filePath.endsWith(".zip"))
+    await extractTrace(filePath, traceDir);
+  else
+    await import_fs11.default.promises.writeFile(import_path10.default.join(traceDir, ".link"), filePath, "utf-8");
+}
+async function loadTrace() {
+  const dir = ensureTraceOpen();
+  const linkFile = import_path10.default.join(dir, ".link");
+  let traceDir2;
+  let traceFile;
+  if (import_fs11.default.existsSync(linkFile)) {
+    const tracePath = await import_fs11.default.promises.readFile(linkFile, "utf-8");
+    traceDir2 = import_path10.default.dirname(tracePath);
+    traceFile = import_path10.default.basename(tracePath);
+  } else {
+    traceDir2 = dir;
+  }
+  const backend = new DirTraceLoaderBackend(traceDir2);
+  const loader = new TraceLoader();
+  await loader.load(backend, traceFile);
+  const model = new TraceModel(traceDir2, loader.contextEntries);
+  return new LoadedTrace(model, loader, buildOrdinalMap(model));
+}
+function formatTimestamp(ms, base) {
+  const relative = ms - base;
+  if (relative < 0)
+    return "0:00.000";
+  const totalMs = Math.floor(relative);
+  const minutes = Math.floor(totalMs / 6e4);
+  const seconds = Math.floor(totalMs % 6e4 / 1e3);
+  const millis = totalMs % 1e3;
+  return `${minutes}:${seconds.toString().padStart(2, "0")}.${millis.toString().padStart(3, "0")}`;
+}
+function actionTitle(action) {
+  return renderTitleForCall({ ...action, type: action.class }) || `${action.class}.${action.method}`;
+}
+async function saveOutputFile(fileName, content, explicitOutput) {
+  let outFile;
+  if (explicitOutput) {
+    outFile = explicitOutput;
+  } else {
+    const resolved = resolveWithinRoot(cliOutputDir, fileName);
+    if (!resolved)
+      throw new Error(`Attachment name '${fileName}' escapes output directory`);
+    await import_fs11.default.promises.mkdir(import_path10.default.dirname(resolved), { recursive: true });
+    outFile = resolved;
+  }
+  await import_fs11.default.promises.writeFile(outFile, content);
+  return outFile;
+}
+function buildOrdinalMap(model) {
+  const actions = model.actions.filter((a) => a.group !== "configuration");
+  const { rootItem } = buildActionTree(actions);
+  const ordinalToCallId = /* @__PURE__ */ new Map();
+  const callIdToOrdinal = /* @__PURE__ */ new Map();
+  let ordinal = 1;
+  const visit = (item) => {
+    ordinalToCallId.set(ordinal, item.action.callId);
+    callIdToOrdinal.set(item.action.callId, ordinal);
+    ordinal++;
+    for (const child of item.children)
+      visit(child);
+  };
+  for (const child of rootItem.children)
+    visit(child);
+  return { ordinalToCallId, callIdToOrdinal };
+}
+var import_fs11, import_path10, traceDir, cliOutputDir, LoadedTrace;
+var init_traceUtils2 = __esm({
+  "packages/playwright-core/src/tools/trace/traceUtils.ts"() {
+    "use strict";
+    import_fs11 = __toESM(require("fs"));
+    import_path10 = __toESM(require("path"));
+    init_traceModel();
+    init_traceLoader();
+    init_protocolFormatter();
+    init_fileUtils();
+    init_traceParser();
+    traceDir = import_path10.default.join(".playwright-cli", "trace");
+    cliOutputDir = ".playwright-cli";
+    LoadedTrace = class {
+      constructor(model, loader, ordinals) {
+        this.model = model;
+        this.loader = loader;
+        this.ordinalToCallId = ordinals.ordinalToCallId;
+        this.callIdToOrdinal = ordinals.callIdToOrdinal;
+      }
+      resolveActionId(actionId) {
+        const ordinal = parseInt(actionId, 10);
+        if (!isNaN(ordinal)) {
+          const callId = this.ordinalToCallId.get(ordinal);
+          if (callId)
+            return this.model.actions.find((a) => a.callId === callId);
+        }
+        return this.model.actions.find((a) => a.callId === actionId);
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/tools/trace/traceOpen.ts
+async function traceOpen(traceFile) {
+  await openTrace(traceFile);
+  await traceInfo();
+}
+async function traceInfo() {
+  const trace = await loadTrace();
+  const model = trace.model;
+  const info = {
+    browser: model.browserName || "unknown",
+    platform: model.platform || "unknown",
+    playwrightVersion: model.playwrightVersion || "unknown",
+    title: model.title || "",
+    duration: msToString(model.endTime - model.startTime),
+    durationMs: model.endTime - model.startTime,
+    startTime: model.wallTime ? new Date(model.wallTime).toISOString() : "unknown",
+    viewport: model.options.viewport ? `${model.options.viewport.width}x${model.options.viewport.height}` : "default",
+    actions: model.actions.length,
+    pages: model.pages.length,
+    network: model.resources.length,
+    errors: model.errorDescriptors.length,
+    attachments: model.attachments.length,
+    consoleMessages: model.events.filter((e) => e.type === "console").length
+  };
+  console.log("");
+  console.log(`  Browser:      ${info.browser}`);
+  console.log(`  Platform:     ${info.platform}`);
+  console.log(`  Playwright:   ${info.playwrightVersion}`);
+  if (info.title)
+    console.log(`  Title:        ${info.title}`);
+  console.log(`  Duration:     ${info.duration}`);
+  console.log(`  Start time:   ${info.startTime}`);
+  console.log(`  Viewport:     ${info.viewport}`);
+  console.log(`  Actions:      ${info.actions}`);
+  console.log(`  Pages:        ${info.pages}`);
+  console.log(`  Network:      ${info.network} requests`);
+  console.log(`  Errors:       ${info.errors}`);
+  console.log(`  Attachments:  ${info.attachments}`);
+  console.log(`  Console:      ${info.consoleMessages} messages`);
+  console.log("");
+}
+var init_traceOpen = __esm({
+  "packages/playwright-core/src/tools/trace/traceOpen.ts"() {
+    "use strict";
+    init_formatUtils();
+    init_traceUtils2();
+  }
+});
+
+// packages/playwright-core/src/tools/trace/traceActions.ts
+async function traceActions(options) {
+  const trace = await loadTrace();
+  const actions = filterActions(trace.model.actions, options);
+  const { rootItem } = buildActionTree(actions);
+  console.log(`  ${"#".padStart(4)} ${"Time".padEnd(9)}  ${"Action".padEnd(55)} ${"Duration".padStart(8)}`);
+  console.log(`  ${"\u2500".repeat(4)} ${"\u2500".repeat(9)}  ${"\u2500".repeat(55)} ${"\u2500".repeat(8)}`);
+  const visit = (item, indent) => {
+    const action = item.action;
+    const ordinal = trace.callIdToOrdinal.get(action.callId) ?? "?";
+    const ts = formatTimestamp(action.startTime, trace.model.startTime);
+    const duration = action.endTime ? msToString(action.endTime - action.startTime) : "running";
+    const title = actionTitle(action);
+    const locator2 = actionLocator(action);
+    const error = action.error ? "  \u2717" : "";
+    const prefix = `  ${(ordinal + ".").padStart(4)} ${ts}  ${indent}`;
+    console.log(`${prefix}${title.padEnd(Math.max(1, 55 - indent.length))} ${duration.padStart(8)}${error}`);
+    if (locator2)
+      console.log(`${" ".repeat(prefix.length)}${locator2}`);
+    for (const child of item.children)
+      visit(child, indent + "  ");
+  };
+  for (const child of rootItem.children)
+    visit(child, "");
+}
+function filterActions(actions, options) {
+  let result2 = actions.filter((a) => a.group !== "configuration");
+  if (options.grep) {
+    const pattern = new RegExp(options.grep, "i");
+    result2 = result2.filter((a) => pattern.test(actionTitle(a)) || pattern.test(actionLocator(a) || ""));
+  }
+  if (options.errorsOnly)
+    result2 = result2.filter((a) => !!a.error);
+  return result2;
+}
+function actionLocator(action, sdkLanguage) {
+  return action.params.selector ? asLocatorDescription(sdkLanguage || "javascript", action.params.selector) : void 0;
+}
+async function traceAction(actionId) {
+  const trace = await loadTrace();
+  const action = trace.resolveActionId(actionId);
+  if (!action) {
+    console.error(`Action '${actionId}' not found. Use 'trace actions' to see available action IDs.`);
+    process.exitCode = 1;
+    return;
+  }
+  const title = actionTitle(action);
+  console.log(`
+  ${title}
+`);
+  console.log("  Time");
+  console.log(`    start:     ${formatTimestamp(action.startTime, trace.model.startTime)}`);
+  const duration = action.endTime ? msToString(action.endTime - action.startTime) : action.error ? "Timed Out" : "Running";
+  console.log(`    duration:  ${duration}`);
+  const paramKeys = Object.keys(action.params).filter((name) => name !== "info");
+  if (paramKeys.length) {
+    console.log("\n  Parameters");
+    for (const key of paramKeys) {
+      const value2 = formatParamValue(action.params[key]);
+      console.log(`    ${key}: ${value2}`);
+    }
+  }
+  if (action.result) {
+    console.log("\n  Return value");
+    for (const [key, value2] of Object.entries(action.result))
+      console.log(`    ${key}: ${formatParamValue(value2)}`);
+  }
+  if (action.error) {
+    console.log("\n  Error");
+    console.log(`    ${action.error.message}`);
+  }
+  if (action.log.length) {
+    console.log("\n  Log");
+    for (const entry of action.log) {
+      const time = entry.time !== -1 ? formatTimestamp(entry.time, trace.model.startTime) : "";
+      console.log(`    ${time.padEnd(12)} ${entry.message}`);
+    }
+  }
+  if (action.stack?.length) {
+    console.log("\n  Source");
+    for (const frame of action.stack.slice(0, 5)) {
+      const file = frame.file.replace(/.*[/\\](.*)/, "$1");
+      console.log(`    ${file}:${frame.line}:${frame.column}`);
+    }
+  }
+  const snapshots = [];
+  if (action.beforeSnapshot)
+    snapshots.push("before");
+  if (action.inputSnapshot)
+    snapshots.push("input");
+  if (action.afterSnapshot)
+    snapshots.push("after");
+  if (snapshots.length) {
+    console.log("\n  Snapshots");
+    console.log(`    available: ${snapshots.join(", ")}`);
+    console.log(`    usage:     npx playwright trace snapshot ${actionId} --name <${snapshots.join("|")}>`);
+  }
+  console.log("");
+}
+function formatParamValue(value2) {
+  if (value2 === void 0 || value2 === null)
+    return String(value2);
+  if (typeof value2 === "string")
+    return `"${value2}"`;
+  if (typeof value2 !== "object")
+    return String(value2);
+  if (value2.guid)
+    return "";
+  return JSON.stringify(value2).slice(0, 1e3);
+}
+var init_traceActions = __esm({
+  "packages/playwright-core/src/tools/trace/traceActions.ts"() {
+    "use strict";
+    init_traceModel();
+    init_locatorGenerators();
+    init_formatUtils();
+    init_traceUtils2();
+  }
+});
+
+// packages/playwright-core/src/tools/trace/traceRequests.ts
+async function traceRequests(options) {
+  const trace = await loadTrace();
+  const model = trace.model;
+  let indexed = model.resources.map((r, i) => ({ resource: r, ordinal: i + 1 }));
+  if (options.grep) {
+    const pattern = new RegExp(options.grep, "i");
+    indexed = indexed.filter(({ resource: r }) => pattern.test(r.request.url));
+  }
+  if (options.method)
+    indexed = indexed.filter(({ resource: r }) => r.request.method.toLowerCase() === options.method.toLowerCase());
+  if (options.status) {
+    const code = parseInt(options.status, 10);
+    indexed = indexed.filter(({ resource: r }) => r.response.status === code);
+  }
+  if (options.failed)
+    indexed = indexed.filter(({ resource: r }) => r.response.status >= 400 || r.response.status === -1);
+  if (!indexed.length) {
+    console.log("  No network requests");
+    return;
+  }
+  console.log(`  ${"#".padStart(4)} ${"Method".padEnd(8)} ${"Status".padEnd(8)} ${"Name".padEnd(45)} ${"Duration".padStart(10)} ${"Size".padStart(8)} ${"Route".padEnd(10)}`);
+  console.log(`  ${"\u2500".repeat(4)} ${"\u2500".repeat(8)} ${"\u2500".repeat(8)} ${"\u2500".repeat(45)} ${"\u2500".repeat(10)} ${"\u2500".repeat(8)} ${"\u2500".repeat(10)}`);
+  for (const { resource: r, ordinal } of indexed) {
+    let name;
+    try {
+      const url2 = new URL(r.request.url);
+      name = url2.pathname.substring(url2.pathname.lastIndexOf("/") + 1);
+      if (!name)
+        name = url2.host;
+      if (url2.search)
+        name += url2.search;
+    } catch {
+      name = r.request.url;
+    }
+    if (name.length > 45)
+      name = name.substring(0, 42) + "...";
+    const status = r.response.status > 0 ? String(r.response.status) : "ERR";
+    const size = r.response._transferSize > 0 ? r.response._transferSize : r.response.bodySize;
+    const route2 = formatRouteStatus(r);
+    console.log(`  ${(ordinal + ".").padStart(4)} ${r.request.method.padEnd(8)} ${status.padEnd(8)} ${name.padEnd(45)} ${msToString(r.time).padStart(10)} ${bytesToString2(size).padStart(8)} ${route2.padEnd(10)}`);
+  }
+}
+async function traceRequest(requestId) {
+  const trace = await loadTrace();
+  const model = trace.model;
+  const ordinal = parseInt(requestId, 10);
+  const resource = !isNaN(ordinal) && ordinal >= 1 && ordinal <= model.resources.length ? model.resources[ordinal - 1] : void 0;
+  if (!resource) {
+    console.error(`Request '${requestId}' not found. Use 'trace requests' to see available request IDs.`);
+    process.exitCode = 1;
+    return;
+  }
+  const r = resource;
+  const status = r.response.status > 0 ? `${r.response.status} ${r.response.statusText}` : "ERR";
+  const size = r.response._transferSize > 0 ? r.response._transferSize : r.response.bodySize;
+  console.log(`
+  ${r.request.method} ${r.request.url}
+`);
+  console.log("  General");
+  console.log(`    status:    ${status}`);
+  console.log(`    duration:  ${msToString(r.time)}`);
+  console.log(`    size:      ${bytesToString2(size)}`);
+  if (r.response.content.mimeType)
+    console.log(`    type:      ${r.response.content.mimeType}`);
+  const route2 = formatRouteStatus(r);
+  if (route2)
+    console.log(`    route:     ${route2}`);
+  if (r.serverIPAddress)
+    console.log(`    server:    ${r.serverIPAddress}${r._serverPort ? ":" + r._serverPort : ""}`);
+  if (r.response._failureText)
+    console.log(`    error:     ${r.response._failureText}`);
+  if (r.request.headers.length) {
+    console.log("\n  Request headers");
+    for (const h of r.request.headers)
+      console.log(`    ${h.name}: ${h.value}`);
+  }
+  if (r.request.postData) {
+    console.log("\n  Request body");
+    const resource2 = r.request.postData._sha1 ?? r.request.postData._file;
+    if (resource2) {
+      console.log(`    ${import_path11.default.relative(process.cwd(), import_path11.default.join(trace.model.traceUri, "resources", resource2))}`);
+    } else {
+      const text2 = r.request.postData.text.length > 2e3 ? r.request.postData.text.substring(0, 2e3) + "..." : r.request.postData.text;
+      console.log(`    ${text2}`);
+    }
+  }
+  if (r.response.headers.length) {
+    console.log("\n  Response headers");
+    for (const h of r.response.headers)
+      console.log(`    ${h.name}: ${h.value}`);
+  }
+  if (r.response.bodySize > 0) {
+    const resource2 = r.response.content._sha1 ?? r.response.content._file;
+    if (resource2) {
+      console.log("\n  Response body");
+      console.log(`    ${import_path11.default.relative(process.cwd(), import_path11.default.join(trace.model.traceUri, "resources", resource2))}`);
+    } else if (r.response.content.text) {
+      const text2 = r.response.content.text.length > 2e3 ? r.response.content.text.substring(0, 2e3) + "..." : r.response.content.text;
+      console.log("\n  Response body");
+      console.log(`    ${text2}`);
+    }
+  }
+  if (r._securityDetails) {
+    console.log("\n  Security");
+    if (r._securityDetails.protocol)
+      console.log(`    protocol:  ${r._securityDetails.protocol}`);
+    if (r._securityDetails.subjectName)
+      console.log(`    subject:   ${r._securityDetails.subjectName}`);
+    if (r._securityDetails.issuer)
+      console.log(`    issuer:    ${r._securityDetails.issuer}`);
+  }
+  console.log("");
+}
+function bytesToString2(bytes) {
+  if (bytes < 0 || !isFinite(bytes))
+    return "-";
+  if (bytes === 0)
+    return "0";
+  if (bytes < 1e3)
+    return bytes.toFixed(0);
+  const kb = bytes / 1024;
+  if (kb < 1e3)
+    return kb.toFixed(1) + "K";
+  const mb = kb / 1024;
+  if (mb < 1e3)
+    return mb.toFixed(1) + "M";
+  const gb = mb / 1024;
+  return gb.toFixed(1) + "G";
+}
+function formatRouteStatus(r) {
+  if (r._wasAborted)
+    return "aborted";
+  if (r._wasContinued)
+    return "continued";
+  if (r._wasFulfilled)
+    return "fulfilled";
+  if (r._apiRequest)
+    return "api";
+  return "";
+}
+var import_path11;
+var init_traceRequests = __esm({
+  "packages/playwright-core/src/tools/trace/traceRequests.ts"() {
+    "use strict";
+    import_path11 = __toESM(require("path"));
+    init_formatUtils();
+    init_traceUtils2();
+  }
+});
+
+// packages/playwright-core/src/tools/trace/traceConsole.ts
+async function traceConsole(options) {
+  const trace = await loadTrace();
+  const model = trace.model;
+  const items = [];
+  for (const event of model.events) {
+    if (event.type === "console") {
+      if (options.stdio)
+        continue;
+      const level = event.messageType;
+      if (options.errorsOnly && level !== "error")
+        continue;
+      if (options.warnings && level !== "error" && level !== "warning")
+        continue;
+      const url2 = event.location.url;
+      const filename = url2 ? url2.substring(url2.lastIndexOf("/") + 1) : "";
+      items.push({
+        type: "browser",
+        level,
+        text: event.text,
+        location: `${filename}:${event.location.lineNumber}`,
+        timestamp: event.time
+      });
+    }
+    if (event.type === "event" && event.method === "pageError") {
+      if (options.stdio)
+        continue;
+      const error = event.params.error;
+      items.push({
+        type: "browser",
+        level: "error",
+        text: error?.error?.message || String(error?.value || ""),
+        timestamp: event.time
+      });
+    }
+  }
+  for (const event of model.stdio) {
+    if (options.browser)
+      continue;
+    if (options.errorsOnly && event.type !== "stderr")
+      continue;
+    if (options.warnings && event.type !== "stderr")
+      continue;
+    let text2 = "";
+    if (event.text)
+      text2 = event.text.trim();
+    if (event.base64)
+      text2 = Buffer.from(event.base64, "base64").toString("utf-8").trim();
+    if (!text2)
+      continue;
+    items.push({
+      type: event.type,
+      level: event.type === "stderr" ? "error" : "info",
+      text: text2,
+      timestamp: event.timestamp
+    });
+  }
+  items.sort((a, b) => a.timestamp - b.timestamp);
+  if (!items.length) {
+    console.log("  No console entries");
+    return;
+  }
+  for (const item of items) {
+    const ts = formatTimestamp(item.timestamp, model.startTime);
+    const source11 = item.type === "browser" ? "[browser]" : `[${item.type}]`;
+    const level = item.level.padEnd(8);
+    const location2 = item.location ? `  ${item.location}` : "";
+    console.log(`  ${ts}  ${source11.padEnd(10)} ${level} ${item.text}${location2}`);
+  }
+}
+var init_traceConsole = __esm({
+  "packages/playwright-core/src/tools/trace/traceConsole.ts"() {
+    "use strict";
+    init_traceUtils2();
+  }
+});
+
+// packages/playwright-core/src/tools/trace/traceErrors.ts
+async function traceErrors() {
+  const trace = await loadTrace();
+  const model = trace.model;
+  if (!model.errorDescriptors.length) {
+    console.log("  No errors");
+    return;
+  }
+  for (const error of model.errorDescriptors) {
+    if (error.action) {
+      const title = actionTitle(error.action);
+      console.log(`
+  \u2717 ${title}`);
+    } else {
+      console.log(`
+  \u2717 Error`);
+    }
+    if (error.stack?.length) {
+      const frame = error.stack[0];
+      const file = frame.file.replace(/.*[/\\](.*)/, "$1");
+      console.log(`    at ${file}:${frame.line}:${frame.column}`);
+    }
+    console.log("");
+    const indented = error.message.split("\n").map((l) => `    ${l}`).join("\n");
+    console.log(indented);
+  }
+  console.log("");
+}
+var init_traceErrors = __esm({
+  "packages/playwright-core/src/tools/trace/traceErrors.ts"() {
+    "use strict";
+    init_traceUtils2();
+  }
+});
+
+// packages/isomorphic/disposable.ts
+async function disposeAll(disposables) {
+  const copy = [...disposables];
+  disposables.length = 0;
+  await Promise.all(copy.map((d) => d.dispose()));
+}
+var init_disposable = __esm({
+  "packages/isomorphic/disposable.ts"() {
+    "use strict";
+  }
+});
+
+// packages/playwright-core/src/server/userAgent.ts
+function getUserAgent() {
+  if (cachedUserAgent)
+    return cachedUserAgent;
+  try {
+    cachedUserAgent = determineUserAgent();
+  } catch (e) {
+    cachedUserAgent = "Playwright/unknown";
+  }
+  return cachedUserAgent;
+}
+function determineUserAgent() {
+  let osIdentifier = "unknown";
+  let osVersion = "unknown";
+  if (process.platform === "win32") {
+    const version3 = import_os4.default.release().split(".");
+    osIdentifier = "windows";
+    osVersion = `${version3[0]}.${version3[1]}`;
+  } else if (process.platform === "darwin") {
+    const version3 = (0, import_child_process2.execSync)("sw_vers -productVersion", { stdio: ["ignore", "pipe", "ignore"] }).toString().trim().split(".");
+    osIdentifier = "macOS";
+    osVersion = `${version3[0]}.${version3[1]}`;
+  } else if (process.platform === "linux") {
+    const distroInfo = getLinuxDistributionInfoSync();
+    if (distroInfo) {
+      osIdentifier = distroInfo.id || "linux";
+      osVersion = distroInfo.version || "unknown";
+    } else {
+      osIdentifier = "linux";
+    }
+  }
+  const additionalTokens = [];
+  if (process.env.CI)
+    additionalTokens.push("CI/1");
+  const serializedTokens = additionalTokens.length ? " " + additionalTokens.join(" ") : "";
+  const { embedderName, embedderVersion } = getEmbedderName();
+  return `Playwright/${getPlaywrightVersion()} (${import_os4.default.arch()}; ${osIdentifier} ${osVersion}) ${embedderName}/${embedderVersion}${serializedTokens}`;
+}
+function getEmbedderName() {
+  let embedderName = "unknown";
+  let embedderVersion = "unknown";
+  if (!process.env.PW_LANG_NAME) {
+    embedderName = "node";
+    embedderVersion = process.version.substring(1).split(".").slice(0, 2).join(".");
+  } else if (["node", "python", "java", "csharp"].includes(process.env.PW_LANG_NAME)) {
+    embedderName = process.env.PW_LANG_NAME;
+    embedderVersion = process.env.PW_LANG_NAME_VERSION ?? "unknown";
+  }
+  return { embedderName, embedderVersion };
+}
+function getPlaywrightVersion(majorMinorOnly = false) {
+  const version3 = process.env.PW_VERSION_OVERRIDE || packageJSON.version;
+  return majorMinorOnly ? version3.split(".").slice(0, 2).join(".") : version3;
+}
+var import_child_process2, import_os4, cachedUserAgent;
+var init_userAgent = __esm({
+  "packages/playwright-core/src/server/userAgent.ts"() {
+    "use strict";
+    import_child_process2 = require("child_process");
+    import_os4 = __toESM(require("os"));
+    init_linuxUtils();
+    init_package();
+  }
+});
+
+// packages/playwright-core/src/generated/clockSource.ts
+var source;
+var init_clockSource = __esm({
+  "packages/playwright-core/src/generated/clockSource.ts"() {
+    "use strict";
+    source = '\nvar __commonJS = obj => {\n  let required = false;\n  let result;\n  return function __require() {\n    if (!required) {\n      required = true;\n      let fn;\n      for (const name in obj) { fn = obj[name]; break; }\n      const module = { exports: {} };\n      fn(module.exports, module);\n      result = module.exports;\n    }\n    return result;\n  }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/clock.ts\nvar clock_exports = {};\n__export(clock_exports, {\n  ClockController: () => ClockController,\n  createClock: () => createClock,\n  inject: () => inject,\n  install: () => install\n});\nmodule.exports = __toCommonJS(clock_exports);\nvar ClockController = class {\n  constructor(embedder) {\n    this._duringTick = false;\n    this._uniqueTimerId = idCounterStart;\n    this.disposables = [];\n    this._log = [];\n    this._timers = /* @__PURE__ */ new Map();\n    this._now = { time: asWallTime(0), isFixedTime: false, ticks: 0, origin: asWallTime(-1) };\n    this._embedder = embedder;\n  }\n  uninstall() {\n    this.disposables.forEach((dispose) => dispose());\n    this.disposables.length = 0;\n  }\n  now() {\n    this._replayLogOnce();\n    this._syncRealTime();\n    return this._now.time;\n  }\n  install(time) {\n    this._replayLogOnce();\n    this._innerInstall(asWallTime(time));\n  }\n  setSystemTime(time) {\n    this._replayLogOnce();\n    this._innerSetTime(asWallTime(time));\n  }\n  setFixedTime(time) {\n    this._replayLogOnce();\n    this._innerSetFixedTime(asWallTime(time));\n  }\n  performanceNow() {\n    this._replayLogOnce();\n    this._syncRealTime();\n    return this._now.ticks;\n  }\n  _syncRealTime() {\n    if (!this._realTime)\n      return;\n    const now = this._embedder.performanceNow();\n    const sinceLastSync = now - this._realTime.lastSyncTicks;\n    if (sinceLastSync > 0) {\n      this._advanceNow(shiftTicks(this._now.ticks, sinceLastSync));\n      this._realTime.lastSyncTicks = now;\n    }\n  }\n  _innerSetTime(time) {\n    this._now.time = time;\n    this._now.isFixedTime = false;\n    if (this._now.origin < 0)\n      this._now.origin = this._now.time;\n  }\n  _innerInstall(time) {\n    if (this._now.origin < 0)\n      this._now.ticks = 0;\n    this._innerSetTime(time);\n  }\n  _innerSetFixedTime(time) {\n    this._innerSetTime(time);\n    this._now.isFixedTime = true;\n  }\n  _advanceNow(to) {\n    if (this._now.ticks > to) {\n      return;\n    }\n    if (!this._now.isFixedTime)\n      this._now.time = asWallTime(this._now.time + to - this._now.ticks);\n    this._now.ticks = to;\n  }\n  async log(type, time, param) {\n    this._log.push({ type, time, param });\n  }\n  async runFor(ticks) {\n    this._replayLogOnce();\n    if (ticks < 0)\n      throw new TypeError("Negative ticks are not supported");\n    await this._runWithDisabledRealTimeSync(async () => {\n      await this._runTo(shiftTicks(this._now.ticks, ticks));\n    });\n  }\n  async _runTo(to) {\n    to = Math.ceil(to);\n    if (this._now.ticks > to)\n      return;\n    let firstException;\n    while (true) {\n      const result = await this._callFirstTimer(to);\n      if (!result.timerFound)\n        break;\n      firstException = firstException || result.error;\n    }\n    this._advanceNow(to);\n    if (firstException)\n      throw firstException;\n  }\n  async pauseAt(time) {\n    this._replayLogOnce();\n    await this._innerPause();\n    const toConsume = time - this._now.time;\n    await this._innerFastForwardTo(shiftTicks(this._now.ticks, toConsume));\n    return toConsume;\n  }\n  async _innerPause() {\n    var _a;\n    this._realTime = void 0;\n    await ((_a = this._currentRealTimeTimer) == null ? void 0 : _a.dispose());\n    this._currentRealTimeTimer = void 0;\n  }\n  resume() {\n    this._replayLogOnce();\n    this._innerResume();\n  }\n  _innerResume() {\n    const now = this._embedder.performanceNow();\n    this._realTime = { startTicks: now, lastSyncTicks: now };\n    this._updateRealTimeTimer();\n  }\n  _updateRealTimeTimer() {\n    var _a;\n    if ((_a = this._currentRealTimeTimer) == null ? void 0 : _a.promise) {\n      return;\n    }\n    const firstTimer = this._firstTimer();\n    const nextTick = Math.min(firstTimer ? firstTimer.callAt : this._now.ticks + maxTimeout, this._now.ticks + 100);\n    const callAt = this._currentRealTimeTimer ? Math.min(this._currentRealTimeTimer.callAt, nextTick) : nextTick;\n    if (this._currentRealTimeTimer) {\n      this._currentRealTimeTimer.cancel();\n      this._currentRealTimeTimer = void 0;\n    }\n    const realTimeTimer = {\n      callAt,\n      promise: void 0,\n      cancel: this._embedder.setTimeout(() => {\n        this._syncRealTime();\n        realTimeTimer.promise = this._runTo(this._now.ticks).catch((e) => console.error(e));\n        void realTimeTimer.promise.then(() => {\n          this._currentRealTimeTimer = void 0;\n          if (this._realTime)\n            this._updateRealTimeTimer();\n        });\n      }, callAt - this._now.ticks),\n      dispose: async () => {\n        realTimeTimer.cancel();\n        await realTimeTimer.promise;\n      }\n    };\n    this._currentRealTimeTimer = realTimeTimer;\n  }\n  async _runWithDisabledRealTimeSync(fn) {\n    if (!this._realTime) {\n      await fn();\n      return;\n    }\n    await this._innerPause();\n    try {\n      await fn();\n    } finally {\n      this._innerResume();\n    }\n  }\n  async fastForward(ticks) {\n    this._replayLogOnce();\n    await this._runWithDisabledRealTimeSync(async () => {\n      await this._innerFastForwardTo(shiftTicks(this._now.ticks, ticks | 0));\n    });\n  }\n  async _innerFastForwardTo(to) {\n    if (to < this._now.ticks)\n      throw new Error("Cannot fast-forward to the past");\n    for (const timer of this._timers.values()) {\n      if (to > timer.callAt)\n        timer.callAt = to;\n    }\n    await this._runTo(to);\n  }\n  addTimer(options) {\n    this._replayLogOnce();\n    if (options.type === "AnimationFrame" /* AnimationFrame */ && !options.func)\n      throw new Error("Callback must be provided to requestAnimationFrame calls");\n    if (options.type === "IdleCallback" /* IdleCallback */ && !options.func)\n      throw new Error("Callback must be provided to requestIdleCallback calls");\n    if (["Timeout" /* Timeout */, "Interval" /* Interval */].includes(options.type) && !options.func && options.delay === void 0)\n      throw new Error("Callback must be provided to timer calls");\n    let delay = options.delay ? +options.delay : 0;\n    if (!Number.isFinite(delay))\n      delay = 0;\n    delay = delay > maxTimeout ? 1 : delay;\n    delay = Math.max(0, delay);\n    const timer = {\n      type: options.type,\n      func: options.func,\n      args: options.args || [],\n      delay,\n      callAt: shiftTicks(this._now.ticks, delay || (this._duringTick ? 1 : 0)),\n      createdAt: this._now.ticks,\n      id: this._uniqueTimerId++,\n      error: new Error()\n    };\n    this._timers.set(timer.id, timer);\n    if (this._realTime)\n      this._updateRealTimeTimer();\n    return timer.id;\n  }\n  countTimers() {\n    return this._timers.size;\n  }\n  _firstTimer(beforeTick) {\n    let firstTimer = null;\n    for (const timer of this._timers.values()) {\n      const isInRange = beforeTick === void 0 || timer.callAt <= beforeTick;\n      if (isInRange && (!firstTimer || compareTimers(firstTimer, timer) === 1))\n        firstTimer = timer;\n    }\n    return firstTimer;\n  }\n  _takeFirstTimer(beforeTick) {\n    const timer = this._firstTimer(beforeTick);\n    if (!timer)\n      return null;\n    this._advanceNow(timer.callAt);\n    if (timer.type === "Interval" /* Interval */)\n      timer.callAt = shiftTicks(timer.callAt, timer.delay);\n    else\n      this._timers.delete(timer.id);\n    return timer;\n  }\n  async _callFirstTimer(beforeTick) {\n    const timer = this._takeFirstTimer(beforeTick);\n    if (!timer)\n      return { timerFound: false };\n    this._duringTick = true;\n    try {\n      if (typeof timer.func !== "function") {\n        let error2;\n        try {\n          (() => {\n            globalThis.eval(timer.func);\n          })();\n        } catch (e) {\n          error2 = e;\n        }\n        await new Promise((f) => this._embedder.setTimeout(f));\n        return { timerFound: true, error: error2 };\n      }\n      let args = timer.args;\n      if (timer.type === "AnimationFrame" /* AnimationFrame */)\n        args = [this._now.ticks];\n      else if (timer.type === "IdleCallback" /* IdleCallback */)\n        args = [{ didTimeout: false, timeRemaining: () => 0 }];\n      let error;\n      try {\n        timer.func.apply(null, args);\n      } catch (e) {\n        error = e;\n      }\n      await new Promise((f) => this._embedder.setTimeout(f));\n      return { timerFound: true, error };\n    } finally {\n      this._duringTick = false;\n    }\n  }\n  getTimeToNextFrame() {\n    this._replayLogOnce();\n    return 16 - this._now.ticks % 16;\n  }\n  clearTimer(timerId, type) {\n    this._replayLogOnce();\n    if (!timerId) {\n      return;\n    }\n    const id = Number(timerId);\n    if (Number.isNaN(id) || id < idCounterStart) {\n      const handlerName = getClearHandler(type);\n      new Error(`Clock: ${handlerName} was invoked to clear a native timer instead of one created by the clock library.`);\n    }\n    const timer = this._timers.get(id);\n    if (timer) {\n      if (timer.type === type || timer.type === "Timeout" && type === "Interval" || timer.type === "Interval" && type === "Timeout") {\n        this._timers.delete(id);\n      } else {\n        const clear = getClearHandler(type);\n        const schedule = getScheduleHandler(timer.type);\n        throw new Error(\n          `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`\n        );\n      }\n    }\n  }\n  _replayLogOnce() {\n    if (!this._log.length)\n      return;\n    let lastLogTime = -1;\n    let isPaused = false;\n    for (const { type, time, param } of this._log) {\n      if (!isPaused && lastLogTime !== -1)\n        this._advanceNow(shiftTicks(this._now.ticks, time - lastLogTime));\n      lastLogTime = time;\n      if (type === "install") {\n        this._innerInstall(asWallTime(param));\n      } else if (type === "fastForward" || type === "runFor") {\n        this._advanceNow(shiftTicks(this._now.ticks, param));\n      } else if (type === "pauseAt") {\n        isPaused = true;\n        this._innerSetTime(asWallTime(param));\n      } else if (type === "resume") {\n        isPaused = false;\n      } else if (type === "setFixedTime") {\n        this._innerSetFixedTime(asWallTime(param));\n      } else if (type === "setSystemTime") {\n        this._innerSetTime(asWallTime(param));\n      }\n    }\n    if (!isPaused) {\n      if (lastLogTime > 0)\n        this._advanceNow(shiftTicks(this._now.ticks, this._embedder.dateNow() - lastLogTime));\n      this._innerResume();\n    } else {\n      this._realTime = void 0;\n    }\n    this._log.length = 0;\n  }\n};\nfunction mirrorDateProperties(target, source) {\n  for (const prop in source) {\n    if (source.hasOwnProperty(prop))\n      target[prop] = source[prop];\n  }\n  target.toString = () => source.toString();\n  target.prototype = source.prototype;\n  target.parse = source.parse;\n  target.UTC = source.UTC;\n  target.prototype.toUTCString = source.prototype.toUTCString;\n  target.isFake = true;\n  return target;\n}\nfunction createDate(clock, NativeDate) {\n  function ClockDate(year, month, date, hour, minute, second, ms) {\n    if (!(this instanceof ClockDate))\n      return new NativeDate(clock.now()).toString();\n    switch (arguments.length) {\n      case 0:\n        return new NativeDate(clock.now());\n      case 1:\n        return new NativeDate(year);\n      case 2:\n        return new NativeDate(year, month);\n      case 3:\n        return new NativeDate(year, month, date);\n      case 4:\n        return new NativeDate(year, month, date, hour);\n      case 5:\n        return new NativeDate(year, month, date, hour, minute);\n      case 6:\n        return new NativeDate(\n          year,\n          month,\n          date,\n          hour,\n          minute,\n          second\n        );\n      default:\n        return new NativeDate(\n          year,\n          month,\n          date,\n          hour,\n          minute,\n          second,\n          ms\n        );\n    }\n  }\n  ClockDate.now = () => clock.now();\n  return mirrorDateProperties(ClockDate, NativeDate);\n}\nfunction createIntl(clock, NativeIntl) {\n  const ClockIntl = {};\n  for (const key of Object.getOwnPropertyNames(NativeIntl))\n    ClockIntl[key] = NativeIntl[key];\n  ClockIntl.DateTimeFormat = function(...args) {\n    const realFormatter = new NativeIntl.DateTimeFormat(...args);\n    const formatter = {\n      formatRange: realFormatter.formatRange.bind(realFormatter),\n      formatRangeToParts: realFormatter.formatRangeToParts.bind(realFormatter),\n      resolvedOptions: realFormatter.resolvedOptions.bind(realFormatter),\n      format: (date) => realFormatter.format(date || clock.now()),\n      formatToParts: (date) => realFormatter.formatToParts(date || clock.now())\n    };\n    return formatter;\n  };\n  ClockIntl.DateTimeFormat.prototype = Object.create(\n    NativeIntl.DateTimeFormat.prototype\n  );\n  ClockIntl.DateTimeFormat.supportedLocalesOf = NativeIntl.DateTimeFormat.supportedLocalesOf;\n  return ClockIntl;\n}\nfunction compareTimers(a, b) {\n  if (a.callAt < b.callAt)\n    return -1;\n  if (a.callAt > b.callAt)\n    return 1;\n  if (a.type === "Immediate" /* Immediate */ && b.type !== "Immediate" /* Immediate */)\n    return -1;\n  if (a.type !== "Immediate" /* Immediate */ && b.type === "Immediate" /* Immediate */)\n    return 1;\n  if (a.createdAt < b.createdAt)\n    return -1;\n  if (a.createdAt > b.createdAt)\n    return 1;\n  if (a.id < b.id)\n    return -1;\n  if (a.id > b.id)\n    return 1;\n}\nvar maxTimeout = Math.pow(2, 31) - 1;\nvar idCounterStart = 1e12;\nfunction platformOriginals(globalObject) {\n  const raw = {\n    setTimeout: globalObject.setTimeout,\n    clearTimeout: globalObject.clearTimeout,\n    setInterval: globalObject.setInterval,\n    clearInterval: globalObject.clearInterval,\n    requestAnimationFrame: globalObject.requestAnimationFrame ? globalObject.requestAnimationFrame : void 0,\n    cancelAnimationFrame: globalObject.cancelAnimationFrame ? globalObject.cancelAnimationFrame : void 0,\n    requestIdleCallback: globalObject.requestIdleCallback ? globalObject.requestIdleCallback : void 0,\n    cancelIdleCallback: globalObject.cancelIdleCallback ? globalObject.cancelIdleCallback : void 0,\n    Date: globalObject.Date,\n    performance: globalObject.performance,\n    Intl: globalObject.Intl,\n    AbortSignal: globalObject.AbortSignal\n  };\n  const bound = { ...raw };\n  for (const key of Object.keys(bound)) {\n    if (key !== "Date" && key !== "AbortSignal" && typeof bound[key] === "function")\n      bound[key] = bound[key].bind(globalObject);\n  }\n  return { raw, bound };\n}\nfunction getScheduleHandler(type) {\n  if (type === "IdleCallback" || type === "AnimationFrame")\n    return `request${type}`;\n  return `set${type}`;\n}\nfunction createApi(clock, originals, browserName) {\n  return {\n    setTimeout: (func, timeout, ...args) => {\n      const delay = timeout ? +timeout : timeout;\n      return clock.addTimer({\n        type: "Timeout" /* Timeout */,\n        func,\n        args,\n        delay\n      });\n    },\n    clearTimeout: (timerId) => {\n      if (timerId)\n        clock.clearTimer(timerId, "Timeout" /* Timeout */);\n    },\n    setInterval: (func, timeout, ...args) => {\n      const delay = timeout ? +timeout : timeout;\n      return clock.addTimer({\n        type: "Interval" /* Interval */,\n        func,\n        args,\n        delay\n      });\n    },\n    clearInterval: (timerId) => {\n      if (timerId)\n        return clock.clearTimer(timerId, "Interval" /* Interval */);\n    },\n    requestAnimationFrame: (callback) => {\n      return clock.addTimer({\n        type: "AnimationFrame" /* AnimationFrame */,\n        func: callback,\n        delay: clock.getTimeToNextFrame()\n      });\n    },\n    cancelAnimationFrame: (timerId) => {\n      if (timerId)\n        return clock.clearTimer(timerId, "AnimationFrame" /* AnimationFrame */);\n    },\n    requestIdleCallback: (callback, options) => {\n      let timeToNextIdlePeriod = 0;\n      if (clock.countTimers() > 0)\n        timeToNextIdlePeriod = 50;\n      return clock.addTimer({\n        type: "IdleCallback" /* IdleCallback */,\n        func: callback,\n        delay: (options == null ? void 0 : options.timeout) ? Math.min(options == null ? void 0 : options.timeout, timeToNextIdlePeriod) : timeToNextIdlePeriod\n      });\n    },\n    cancelIdleCallback: (timerId) => {\n      if (timerId)\n        return clock.clearTimer(timerId, "IdleCallback" /* IdleCallback */);\n    },\n    Intl: originals.Intl ? createIntl(clock, originals.Intl) : void 0,\n    Date: createDate(clock, originals.Date),\n    performance: originals.performance ? fakePerformance(clock, originals.performance) : void 0,\n    AbortSignal: originals.AbortSignal ? fakeAbortSignal(clock, originals.AbortSignal, browserName) : void 0\n  };\n}\nfunction getClearHandler(type) {\n  if (type === "IdleCallback" || type === "AnimationFrame")\n    return `cancel${type}`;\n  return `clear${type}`;\n}\nvar FakePerformanceEntry = class {\n  constructor(name, entryType, startTime, duration) {\n    this.name = name;\n    this.entryType = entryType;\n    this.startTime = startTime;\n    this.duration = duration;\n  }\n  toJSON() {\n    return JSON.stringify({ ...this });\n  }\n};\nfunction fakePerformance(clock, performance) {\n  const result = {\n    now: () => clock.performanceNow()\n  };\n  result.__defineGetter__("timeOrigin", () => clock._now.origin || 0);\n  for (const key of Object.keys(performance.__proto__)) {\n    if (key === "now" || key === "timeOrigin")\n      continue;\n    if (key === "getEntries" || key === "getEntriesByName" || key === "getEntriesByType")\n      result[key] = () => [];\n    else if (key === "mark")\n      result[key] = (name) => new FakePerformanceEntry(name, "mark", 0, 0);\n    else if (key === "measure")\n      result[key] = (name) => new FakePerformanceEntry(name, "measure", 0, 50);\n    else\n      result[key] = () => {\n      };\n  }\n  return result;\n}\nfunction fakeAbortSignal(clock, abortSignal, browserName) {\n  Object.defineProperty(abortSignal, "timeout", {\n    value(ms) {\n      const controller = new AbortController();\n      clock.addTimer({\n        delay: ms,\n        type: "Timeout" /* Timeout */,\n        func: () => controller.abort(\n          new DOMException(\n            browserName === "chromium" ? "signal timed out" : "The operation timed out.",\n            "TimeoutError"\n          )\n        )\n      });\n      return controller.signal;\n    }\n  });\n  return abortSignal;\n}\nfunction createClock(globalObject, config = {}) {\n  const originals = platformOriginals(globalObject);\n  const embedder = {\n    dateNow: () => originals.raw.Date.now(),\n    performanceNow: () => Math.ceil(originals.raw.performance.now()),\n    setTimeout: (task, timeout) => {\n      const timerId = originals.bound.setTimeout(task, timeout);\n      return () => originals.bound.clearTimeout(timerId);\n    },\n    setInterval: (task, delay) => {\n      const intervalId = originals.bound.setInterval(task, delay);\n      return () => originals.bound.clearInterval(intervalId);\n    }\n  };\n  const clock = new ClockController(embedder);\n  const api = createApi(clock, originals.bound, config.browserName);\n  return { clock, api, originals: originals.raw };\n}\nfunction install(globalObject, config = {}) {\n  var _a, _b;\n  if ((_a = globalObject.Date) == null ? void 0 : _a.isFake) {\n    throw new TypeError(`Can\'t install fake timers twice on the same global object.`);\n  }\n  const { clock, api, originals } = createClock(globalObject, config);\n  const toFake = ((_b = config.toFake) == null ? void 0 : _b.length) ? config.toFake : Object.keys(originals);\n  for (const method of toFake) {\n    if (method === "Date") {\n      globalObject.Date = mirrorDateProperties(api.Date, globalObject.Date);\n    } else if (method === "Intl") {\n      globalObject.Intl = api[method];\n    } else if (method === "AbortSignal") {\n      globalObject.AbortSignal = api[method];\n    } else if (method === "performance") {\n      globalObject.performance = api[method];\n      const kEventTimeStamp = Symbol("playwrightEventTimeStamp");\n      Object.defineProperty(Event.prototype, "timeStamp", {\n        get() {\n          var _a2;\n          if (!this[kEventTimeStamp])\n            this[kEventTimeStamp] = (_a2 = api.performance) == null ? void 0 : _a2.now();\n          return this[kEventTimeStamp];\n        }\n      });\n    } else {\n      globalObject[method] = (...args) => {\n        return api[method].apply(api, args);\n      };\n    }\n    clock.disposables.push(() => {\n      globalObject[method] = originals[method];\n    });\n  }\n  return { clock, api, originals };\n}\nfunction inject(globalObject, browserName) {\n  const builtins = platformOriginals(globalObject).bound;\n  const { clock: controller } = install(globalObject, { browserName });\n  controller.resume();\n  return {\n    controller,\n    builtins\n  };\n}\nfunction asWallTime(n) {\n  return n;\n}\nfunction shiftTicks(ticks, ms) {\n  return ticks + ms;\n}\n';
+  }
+});
+
+// packages/playwright-core/src/protocol/serializers.ts
+function parseSerializedValue(value2, handles) {
+  return innerParseSerializedValue(value2, handles, /* @__PURE__ */ new Map(), []);
+}
+function innerParseSerializedValue(value2, handles, refs, accessChain) {
+  if (value2.ref !== void 0)
+    return refs.get(value2.ref);
+  if (value2.n !== void 0)
+    return value2.n;
+  if (value2.s !== void 0)
+    return value2.s;
+  if (value2.b !== void 0)
+    return value2.b;
+  if (value2.v !== void 0) {
+    if (value2.v === "undefined")
+      return void 0;
+    if (value2.v === "null")
+      return null;
+    if (value2.v === "NaN")
+      return NaN;
+    if (value2.v === "Infinity")
+      return Infinity;
+    if (value2.v === "-Infinity")
+      return -Infinity;
+    if (value2.v === "-0")
+      return -0;
+  }
+  if (value2.d !== void 0)
+    return new Date(value2.d);
+  if (value2.u !== void 0)
+    return new URL(value2.u);
+  if (value2.bi !== void 0)
+    return BigInt(value2.bi);
+  if (value2.e !== void 0) {
+    const error = new Error(value2.e.m);
+    error.name = value2.e.n;
+    error.stack = value2.e.s;
+    return error;
+  }
+  if (value2.r !== void 0)
+    return new RegExp(value2.r.p, value2.r.f);
+  if (value2.ta !== void 0) {
+    const ctor = typedArrayKindToConstructor[value2.ta.k];
+    return new ctor(value2.ta.b.buffer, value2.ta.b.byteOffset, value2.ta.b.length / ctor.BYTES_PER_ELEMENT);
+  }
+  if (value2.a !== void 0) {
+    const result2 = [];
+    refs.set(value2.id, result2);
+    for (let i = 0; i < value2.a.length; i++)
+      result2.push(innerParseSerializedValue(value2.a[i], handles, refs, [...accessChain, i]));
+    return result2;
+  }
+  if (value2.o !== void 0) {
+    const result2 = {};
+    refs.set(value2.id, result2);
+    for (const { k, v } of value2.o)
+      result2[k] = innerParseSerializedValue(v, handles, refs, [...accessChain, k]);
+    return result2;
+  }
+  if (value2.h !== void 0) {
+    if (handles === void 0)
+      throw new Error("Unexpected handle");
+    return handles[value2.h];
+  }
+  throw new Error(`Attempting to deserialize unexpected value${accessChainToDisplayString(accessChain)}: ${value2}`);
+}
+function serializeValue(value2, handleSerializer) {
+  return innerSerializeValue(value2, handleSerializer, { lastId: 0, visited: /* @__PURE__ */ new Map() }, []);
+}
+function innerSerializeValue(value2, handleSerializer, visitorInfo, accessChain) {
+  const handle = handleSerializer(value2);
+  if ("fallThrough" in handle)
+    value2 = handle.fallThrough;
+  else
+    return handle;
+  if (typeof value2 === "symbol")
+    return { v: "undefined" };
+  if (Object.is(value2, void 0))
+    return { v: "undefined" };
+  if (Object.is(value2, null))
+    return { v: "null" };
+  if (Object.is(value2, NaN))
+    return { v: "NaN" };
+  if (Object.is(value2, Infinity))
+    return { v: "Infinity" };
+  if (Object.is(value2, -Infinity))
+    return { v: "-Infinity" };
+  if (Object.is(value2, -0))
+    return { v: "-0" };
+  if (typeof value2 === "boolean")
+    return { b: value2 };
+  if (typeof value2 === "number")
+    return { n: value2 };
+  if (typeof value2 === "string")
+    return { s: value2 };
+  if (typeof value2 === "bigint")
+    return { bi: value2.toString() };
+  if (isError2(value2))
+    return { e: { n: value2.name, m: value2.message, s: value2.stack || "" } };
+  if (isDate(value2))
+    return { d: value2.toJSON() };
+  if (isURL(value2))
+    return { u: value2.toJSON() };
+  if (isRegExp4(value2))
+    return { r: { p: value2.source, f: value2.flags } };
+  const typedArrayKind = constructorToTypedArrayKind.get(value2.constructor);
+  if (typedArrayKind)
+    return { ta: { b: Buffer.from(value2.buffer, value2.byteOffset, value2.byteLength), k: typedArrayKind } };
+  const id = visitorInfo.visited.get(value2);
+  if (id)
+    return { ref: id };
+  if (Array.isArray(value2)) {
+    const a = [];
+    const id2 = ++visitorInfo.lastId;
+    visitorInfo.visited.set(value2, id2);
+    for (let i = 0; i < value2.length; ++i)
+      a.push(innerSerializeValue(value2[i], handleSerializer, visitorInfo, [...accessChain, i]));
+    return { a, id: id2 };
+  }
+  if (typeof value2 === "object") {
+    const o = [];
+    const id2 = ++visitorInfo.lastId;
+    visitorInfo.visited.set(value2, id2);
+    for (const name of Object.keys(value2))
+      o.push({ k: name, v: innerSerializeValue(value2[name], handleSerializer, visitorInfo, [...accessChain, name]) });
+    return { o, id: id2 };
+  }
+  throw new Error(`Attempting to serialize unexpected value${accessChainToDisplayString(accessChain)}: ${value2}`);
+}
+function accessChainToDisplayString(accessChain) {
+  const chainString = accessChain.map((accessor, i) => {
+    if (typeof accessor === "string")
+      return i ? `.${accessor}` : accessor;
+    return `[${accessor}]`;
+  }).join("");
+  return chainString.length > 0 ? ` at position "${chainString}"` : "";
+}
+function isRegExp4(obj) {
+  return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";
+}
+function isDate(obj) {
+  return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";
+}
+function isURL(obj) {
+  return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";
+}
+function isError2(obj) {
+  const proto = obj ? Object.getPrototypeOf(obj) : null;
+  return obj instanceof Error || proto?.name === "Error" || proto && isError2(proto);
+}
+var typedArrayKindToConstructor, constructorToTypedArrayKind;
+var init_serializers = __esm({
+  "packages/playwright-core/src/protocol/serializers.ts"() {
+    "use strict";
+    typedArrayKindToConstructor = {
+      i8: Int8Array,
+      ui8: Uint8Array,
+      ui8c: Uint8ClampedArray,
+      i16: Int16Array,
+      ui16: Uint16Array,
+      i32: Int32Array,
+      ui32: Uint32Array,
+      f32: Float32Array,
+      f64: Float64Array,
+      bi64: BigInt64Array,
+      bui64: BigUint64Array
+    };
+    constructorToTypedArrayKind = new Map(Object.entries(typedArrayKindToConstructor).map(([k, v]) => [v, k]));
+  }
+});
+
+// packages/playwright-core/src/server/errors.ts
+function isTargetClosedError(error) {
+  return error instanceof TargetClosedError || error.name === "TargetClosedError";
+}
+function serializeError(e) {
+  if (isError(e))
+    return { error: { message: e.message, stack: e.stack, name: e.name } };
+  return { value: serializeValue(e, (value2) => ({ fallThrough: value2 })) };
+}
+function parseError(error) {
+  if (!error.error) {
+    if (error.value === void 0)
+      throw new Error("Serialized error must have either an error or a value");
+    return parseSerializedValue(error.value, void 0);
+  }
+  const e = new Error(error.error.message);
+  e.stack = error.error.stack || "";
+  e.name = error.error.name;
+  return e;
+}
+var CustomError, TimeoutError, TargetClosedError;
+var init_errors = __esm({
+  "packages/playwright-core/src/server/errors.ts"() {
+    "use strict";
+    init_rtti();
+    init_serializers();
+    CustomError = class extends Error {
+      constructor(message) {
+        super(message);
+        this.name = this.constructor.name;
+      }
+    };
+    TimeoutError = class extends CustomError {
+    };
+    TargetClosedError = class extends CustomError {
+      constructor(cause, logs) {
+        super((cause || "Target page, context or browser has been closed") + (logs || ""));
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/server/progress.ts
+function isAbortError(error) {
+  return error instanceof TimeoutError || !!error[kAbortErrorSymbol];
+}
+async function raceUncancellableOperationWithCleanup(progress2, run, cleanup) {
+  let aborted = false;
+  try {
+    return await progress2.race(run().then(async (t) => {
+      if (aborted)
+        await cleanup(t);
+      return t;
+    }));
+  } catch (error) {
+    aborted = true;
+    throw error;
+  }
+}
+var ProgressController, kAbortErrorSymbol, nullProgress;
+var init_progress = __esm({
+  "packages/playwright-core/src/server/progress.ts"() {
+    "use strict";
+    init_manualPromise();
+    init_assert();
+    init_time();
+    init_debugLogger();
+    init_errors();
+    ProgressController = class _ProgressController {
+      constructor(metadata, onCallLog) {
+        this._forceAbortPromise = new ManualPromise();
+        this._donePromise = new ManualPromise();
+        this._state = "before";
+        this.metadata = metadata || { id: "", startTime: 0, endTime: 0, type: "Internal", method: "", params: {}, log: [], internal: true };
+        this._onCallLog = onCallLog;
+        this._forceAbortPromise.catch((e) => null);
+        this._controller = new AbortController();
+      }
+      static createForSdkObject(sdkObject, callMetadata) {
+        const logName = sdkObject.logName || "api";
+        return new _ProgressController(callMetadata, (message) => {
+          if (logName === "api" && sdkObject.attribution.playwright?.options.isInternalPlaywright)
+            return;
+          debugLogger.log(logName, message);
+          sdkObject.instrumentation.onCallLog(sdkObject, callMetadata, logName, message);
+        });
+      }
+      async abort(error) {
+        if (this._state === "running") {
+          error[kAbortErrorSymbol] = true;
+          this._state = { error };
+          this._forceAbortPromise.reject(error);
+          this._controller.abort(error);
+        }
+        await this._donePromise;
+      }
+      async run(task, timeout) {
+        const deadline = timeout ? monotonicTime() + timeout : 0;
+        assert(this._state === "before");
+        this._state = "running";
+        let timer;
+        let outerProgress;
+        let allowConcurrent = false;
+        const progress2 = {
+          timeout: timeout ?? 0,
+          deadline,
+          disableTimeout: () => {
+            clearTimeout(timer);
+          },
+          log: (message) => {
+            if (this._state === "running")
+              this.metadata.log.push(message);
+            this._onCallLog?.(message);
+          },
+          metadata: this.metadata,
+          setAllowConcurrentOrNestedRaces: (allow) => {
+            allowConcurrent = allow;
+          },
+          race: (promise) => {
+            if (process.env.PW_DETECT_NESTED_PROGRESS) {
+              const innerProgress = new Error().stack;
+              if (outerProgress && !allowConcurrent && outerProgress !== innerProgress) {
+                console.error("Cannot call race() inside another race()");
+                console.error("<<<<>>>>:", outerProgress);
+                console.error("<<<<>>>>:", innerProgress);
+              }
+              outerProgress = innerProgress;
+            }
+            const promises = Array.isArray(promise) ? promise : [promise];
+            if (!promises.length)
+              return Promise.resolve();
+            return Promise.race([...promises, this._forceAbortPromise]).finally(() => outerProgress = void 0);
+          },
+          wait: async (timeout2) => {
+            let timer2;
+            const promise = new Promise((f) => timer2 = setTimeout(f, timeout2));
+            return progress2.race(promise).finally(() => clearTimeout(timer2));
+          },
+          signal: this._controller.signal
+        };
+        if (deadline) {
+          const timeoutError = new TimeoutError(`Timeout ${timeout}ms exceeded.`);
+          timer = setTimeout(() => {
+            if (this.metadata.pauseStartTime && !this.metadata.pauseEndTime)
+              return;
+            if (this._state === "running") {
+              this._state = { error: timeoutError };
+              this._forceAbortPromise.reject(timeoutError);
+              this._controller.abort(timeoutError);
+            }
+          }, deadline - monotonicTime());
+        }
+        try {
+          const result2 = await task(progress2);
+          this._state = "finished";
+          return result2;
+        } catch (error) {
+          this._state = { error };
+          throw error;
+        } finally {
+          clearTimeout(timer);
+          this._donePromise.resolve();
+        }
+      }
+    };
+    kAbortErrorSymbol = Symbol("kAbortError");
+    nullProgress = {
+      timeout: 0,
+      deadline: 0,
+      disableTimeout() {
+      },
+      log() {
+      },
+      race(promise) {
+        const promises = Array.isArray(promise) ? promise : [promise];
+        return Promise.race(promises);
+      },
+      wait: async (timeout) => await new Promise((f) => setTimeout(f, timeout)),
+      signal: new AbortController().signal,
+      metadata: {
+        id: "",
+        startTime: 0,
+        endTime: 0,
+        type: "",
+        method: "",
+        params: {},
+        log: [],
+        internal: true
+      },
+      setAllowConcurrentOrNestedRaces() {
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/server/clock.ts
+function parseTicks(value2) {
+  if (typeof value2 === "number")
+    return value2;
+  if (!value2)
+    return 0;
+  const str = value2;
+  const strings = str.split(":");
+  const l = strings.length;
+  let i = l;
+  let ms = 0;
+  let parsed;
+  if (l > 3 || !/^(\d\d:){0,2}\d\d?$/.test(str)) {
+    throw new Error(
+      `Clock only understands numbers, 'mm:ss' and 'hh:mm:ss'`
+    );
+  }
+  while (i--) {
+    parsed = parseInt(strings[i], 10);
+    if (parsed >= 60)
+      throw new Error(`Invalid time ${str}`);
+    ms += parsed * Math.pow(60, l - i - 1);
+  }
+  return ms * 1e3;
+}
+function parseTime(epoch) {
+  if (!epoch)
+    return 0;
+  if (typeof epoch === "number")
+    return epoch;
+  const parsed = new Date(epoch);
+  if (!isFinite(parsed.getTime()))
+    throw new Error(`Invalid date: ${epoch}`);
+  return parsed.getTime();
+}
+var Clock;
+var init_clock = __esm({
+  "packages/playwright-core/src/server/clock.ts"() {
+    "use strict";
+    init_clockSource();
+    init_progress();
+    Clock = class {
+      constructor(browserContext) {
+        this._initScripts = [];
+        this._browserContext = browserContext;
+      }
+      async uninstall(progress2) {
+        await progress2.race(Promise.all(this._initScripts.map((script) => script.dispose())));
+        this._initScripts = [];
+      }
+      async fastForward(ticks) {
+        await this._installIfNeeded();
+        const ticksMillis = parseTicks(ticks);
+        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('fastForward', ${Date.now()}, ${ticksMillis})`));
+        await this._evaluateInFrames(`globalThis.__pwClock.controller.fastForward(${ticksMillis})`);
+      }
+      async install(time) {
+        await this._installIfNeeded();
+        const timeMillis = time !== void 0 ? parseTime(time) : Date.now();
+        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('install', ${Date.now()}, ${timeMillis})`));
+        await this._evaluateInFrames(`globalThis.__pwClock.controller.install(${timeMillis})`);
+      }
+      async pauseAt(ticks) {
+        await this._installIfNeeded();
+        const timeMillis = parseTime(ticks);
+        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('pauseAt', ${Date.now()}, ${timeMillis})`));
+        await this._evaluateInFrames(`globalThis.__pwClock.controller.pauseAt(${timeMillis})`);
+      }
+      resumeNoReply() {
+        if (!this._initScripts.length)
+          return;
+        const doResume = async () => {
+          this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('resume', ${Date.now()})`));
+          await this._evaluateInFrames(`globalThis.__pwClock.controller.resume()`);
+        };
+        doResume().catch(() => {
+        });
+      }
+      async resume(progress2) {
+        await progress2.race(this._installIfNeeded());
+        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('resume', ${Date.now()})`));
+        await progress2.race(this._evaluateInFrames(`globalThis.__pwClock.controller.resume()`));
+      }
+      async setFixedTime(time) {
+        await this._installIfNeeded();
+        const timeMillis = parseTime(time);
+        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('setFixedTime', ${Date.now()}, ${timeMillis})`));
+        await this._evaluateInFrames(`globalThis.__pwClock.controller.setFixedTime(${timeMillis})`);
+      }
+      async setSystemTime(time) {
+        await this._installIfNeeded();
+        const timeMillis = parseTime(time);
+        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('setSystemTime', ${Date.now()}, ${timeMillis})`));
+        await this._evaluateInFrames(`globalThis.__pwClock.controller.setSystemTime(${timeMillis})`);
+      }
+      async runFor(ticks) {
+        await this._installIfNeeded();
+        const ticksMillis = parseTicks(ticks);
+        this._initScripts.push(await this._browserContext.addInitScript(nullProgress, `globalThis.__pwClock.controller.log('runFor', ${Date.now()}, ${ticksMillis})`));
+        await this._evaluateInFrames(`globalThis.__pwClock.controller.runFor(${ticksMillis})`);
+      }
+      async _installIfNeeded() {
+        if (this._initScripts.length)
+          return;
+        const script = `(() => {
+      const module = {};
+      ${source}
+      if (!globalThis.__pwClock)
+        globalThis.__pwClock = (module.exports.inject())(globalThis, ${JSON.stringify(this._browserContext._browser.options.name)});
+    })();`;
+        const initScript = await this._browserContext.addInitScript(nullProgress, script);
+        await this._evaluateInFrames(script);
+        this._initScripts.push(initScript);
+      }
+      async _evaluateInFrames(script) {
+        await this._browserContext.safeNonStallingEvaluateInAllFrames(script, "main", { throwOnJSErrors: true });
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/generated/webAuthnSource.ts
+var source2;
+var init_webAuthnSource = __esm({
+  "packages/playwright-core/src/generated/webAuthnSource.ts"() {
+    "use strict";
+    source2 = `
+var __commonJS = obj => {
+  let required = false;
+  let result;
+  return function __require() {
+    if (!required) {
+      required = true;
+      let fn;
+      for (const name in obj) { fn = obj[name]; break; }
+      const module = { exports: {} };
+      fn(module.exports, module);
+      result = module.exports;
+    }
+    return result;
+  }
+};
+var __export = (target, all) => {for (var name in all) target[name] = all[name];};
+var __toESM = mod => ({ ...mod, 'default': mod });
+var __toCommonJS = mod => ({ ...mod, __esModule: true });
+
+
+// packages/injected/src/webAuthn.ts
+var webAuthn_exports = {};
+__export(webAuthn_exports, {
+  inject: () => inject
+});
+module.exports = __toCommonJS(webAuthn_exports);
+function inject(globalThis) {
+  if (globalThis.__pwWebAuthnInstalled)
+    return;
+  globalThis.__pwWebAuthnInstalled = true;
+  const binding = globalThis.__pwWebAuthnBinding;
+  if (!binding || !globalThis.navigator)
+    return;
+  if (!globalThis.navigator.credentials) {
+    Object.defineProperty(globalThis.navigator, "credentials", {
+      value: { create: async () => null, get: async () => null },
+      writable: true,
+      configurable: true
+    });
+  }
+  function toBase64Url(buf) {
+    const bytes = buf instanceof ArrayBuffer ? new Uint8Array(buf) : new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
+    let s = "";
+    for (let i = 0; i < bytes.length; i++)
+      s += String.fromCharCode(bytes[i]);
+    return globalThis.btoa(s).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
+  }
+  function fromBase64Url(s) {
+    let str = s.replaceAll("-", "+").replaceAll("_", "/");
+    while (str.length % 4)
+      str += "=";
+    const bin = globalThis.atob(str);
+    const out = new Uint8Array(bin.length);
+    for (let i = 0; i < bin.length; i++)
+      out[i] = bin.charCodeAt(i);
+    return out.buffer;
+  }
+  const PublicKeyCredentialCtor = globalThis.PublicKeyCredential;
+  const AuthAttestationResponseCtor = globalThis.AuthenticatorAttestationResponse;
+  const AuthAssertionResponseCtor = globalThis.AuthenticatorAssertionResponse;
+  function defineReadonly(target, props) {
+    for (const k of Object.keys(props))
+      Object.defineProperty(target, k, { value: props[k], enumerable: true, configurable: true });
+  }
+  function makeAttestationResponse(clientDataJSON, attestationObject) {
+    const proto = (AuthAttestationResponseCtor == null ? void 0 : AuthAttestationResponseCtor.prototype) || Object.prototype;
+    const r = Object.create(proto);
+    defineReadonly(r, { clientDataJSON, attestationObject });
+    r.getTransports = () => ["internal"];
+    r.getAuthenticatorData = () => {
+      return attestationObject;
+    };
+    r.getPublicKey = () => null;
+    r.getPublicKeyAlgorithm = () => -7;
+    return r;
+  }
+  function makeAssertionResponse(clientDataJSON, authenticatorData, signature, userHandle) {
+    const proto = (AuthAssertionResponseCtor == null ? void 0 : AuthAssertionResponseCtor.prototype) || Object.prototype;
+    const r = Object.create(proto);
+    defineReadonly(r, { clientDataJSON, authenticatorData, signature, userHandle });
+    return r;
+  }
+  function makePublicKeyCredential(id, response) {
+    const proto = (PublicKeyCredentialCtor == null ? void 0 : PublicKeyCredentialCtor.prototype) || Object.prototype;
+    const cred = Object.create(proto);
+    defineReadonly(cred, {
+      id,
+      rawId: fromBase64Url(id),
+      type: "public-key",
+      authenticatorAttachment: "platform",
+      response
+    });
+    cred.getClientExtensionResults = () => ({});
+    cred.toJSON = () => ({ id, rawId: id, type: "public-key", response: {} });
+    return cred;
+  }
+  function toBuf(x) {
+    if (!x)
+      return new ArrayBuffer(0);
+    if (x instanceof ArrayBuffer)
+      return x;
+    const v = x;
+    const out = new Uint8Array(v.byteLength);
+    out.set(new Uint8Array(v.buffer, v.byteOffset, v.byteLength));
+    return out.buffer;
+  }
+  function failure(name, message) {
+    const Ctor = globalThis.DOMException || Error;
+    throw new Ctor(message, name);
+  }
+  const origCreate = globalThis.navigator.credentials.create.bind(globalThis.navigator.credentials);
+  const origGet = globalThis.navigator.credentials.get.bind(globalThis.navigator.credentials);
+  globalThis.navigator.credentials.create = async function(options) {
+    var _a, _b, _c, _d, _e, _f, _g;
+    if (!options || !options.publicKey)
+      return origCreate(options);
+    const pk = options.publicKey;
+    const req = {
+      type: "create",
+      origin: globalThis.location.origin,
+      challenge: toBase64Url(toBuf(pk.challenge)),
+      rp: { id: (_a = pk.rp) == null ? void 0 : _a.id, name: ((_b = pk.rp) == null ? void 0 : _b.name) || "" },
+      user: {
+        id: toBase64Url(toBuf((_c = pk.user) == null ? void 0 : _c.id)),
+        name: ((_d = pk.user) == null ? void 0 : _d.name) || "",
+        displayName: ((_e = pk.user) == null ? void 0 : _e.displayName) || ""
+      },
+      pubKeyCredParams: (pk.pubKeyCredParams || []).map((p) => ({ type: p.type, alg: p.alg })),
+      excludeCredentials: (pk.excludeCredentials || []).map((c) => ({ type: c.type, id: toBase64Url(toBuf(c.id)) })),
+      userVerification: (_f = pk.authenticatorSelection) == null ? void 0 : _f.userVerification,
+      residentKey: (_g = pk.authenticatorSelection) == null ? void 0 : _g.residentKey
+    };
+    const result = await binding(req);
+    if (!result.ok)
+      failure(result.name, result.message);
+    const resp = makeAttestationResponse(fromBase64Url(result.clientDataJSON), fromBase64Url(result.attestationObject));
+    return makePublicKeyCredential(result.id, resp);
+  };
+  globalThis.navigator.credentials.get = async function(options) {
+    if (!options || !options.publicKey)
+      return origGet(options);
+    const pk = options.publicKey;
+    const req = {
+      type: "get",
+      origin: globalThis.location.origin,
+      challenge: toBase64Url(toBuf(pk.challenge)),
+      rpId: pk.rpId || new URL(globalThis.location.origin).hostname,
+      allowCredentials: (pk.allowCredentials || []).map((c) => ({ type: c.type, id: toBase64Url(toBuf(c.id)) })),
+      userVerification: pk.userVerification
+    };
+    const result = await binding(req);
+    if (!result.ok)
+      failure(result.name, result.message);
+    const resp = makeAssertionResponse(
+      fromBase64Url(result.clientDataJSON),
+      fromBase64Url(result.authenticatorData),
+      fromBase64Url(result.signature),
+      result.userHandle ? fromBase64Url(result.userHandle) : null
+    );
+    return makePublicKeyCredential(result.id, resp);
+  };
+  if (PublicKeyCredentialCtor) {
+    PublicKeyCredentialCtor.isUserVerifyingPlatformAuthenticatorAvailable = async () => true;
+    PublicKeyCredentialCtor.isConditionalMediationAvailable = async () => true;
+  }
+}
+`;
+  }
+});
+
+// packages/playwright-core/src/server/credentials.ts
+function toPublic(r) {
+  return { id: r.id, rpId: r.rpId, userHandle: r.userHandle, privateKey: r.privateKey, publicKey: r.publicKey };
+}
+function randomBase64Url(bytes) {
+  return bufToB64Url(import_crypto6.default.randomBytes(bytes));
+}
+function bufToB64Url(b) {
+  return b.toString("base64").replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
+}
+function b64UrlToBuf(s) {
+  return Buffer.from(s, "base64url");
+}
+function u32ToBytes(n) {
+  const b = Buffer.alloc(4);
+  b.writeUInt32BE(n >>> 0, 0);
+  return b;
+}
+function cborHead(major2, value2) {
+  const m = major2 << 5;
+  if (value2 < 24)
+    return Buffer.from([m | value2]);
+  if (value2 < 256)
+    return Buffer.from([m | 24, value2]);
+  if (value2 < 65536)
+    return Buffer.from([m | 25, value2 >> 8 & 255, value2 & 255]);
+  return Buffer.from([m | 26, value2 >>> 24 & 255, value2 >> 16 & 255, value2 >> 8 & 255, value2 & 255]);
+}
+function cborUint(v) {
+  return cborHead(0, v);
+}
+function cborNint(v) {
+  return cborHead(1, -1 - v);
+}
+function cborBytes(b) {
+  return Buffer.concat([cborHead(2, b.length), b]);
+}
+function cborText(s) {
+  const b = Buffer.from(s, "utf8");
+  return Buffer.concat([cborHead(3, b.length), b]);
+}
+function cborMap(entries) {
+  return Buffer.concat([cborHead(5, entries.length), ...entries.flatMap(([k, v]) => [k, v])]);
+}
+function encodeCoseEs256PublicKey(publicKey) {
+  const jwk = publicKey.export({ format: "jwk" });
+  const x = Buffer.from(jwk.x, "base64url");
+  const y = Buffer.from(jwk.y, "base64url");
+  return cborMap([
+    [cborUint(1), cborUint(2)],
+    // kty = EC2
+    [cborUint(3), cborNint(-7)],
+    // alg = ES256
+    [cborNint(-1), cborUint(1)],
+    // crv = P-256
+    [cborNint(-2), cborBytes(x)],
+    [cborNint(-3), cborBytes(y)]
+  ]);
+}
+function encodeAttestationObjectNone(authData) {
+  return cborMap([
+    [cborText("fmt"), cborText("none")],
+    [cborText("attStmt"), cborMap([])],
+    [cborText("authData"), cborBytes(authData)]
+  ]);
+}
+var import_crypto6, kBindingName, kAuthenticatorAAGUID, Credentials;
+var init_credentials = __esm({
+  "packages/playwright-core/src/server/credentials.ts"() {
+    "use strict";
+    import_crypto6 = __toESM(require("crypto"));
+    init_webAuthnSource();
+    init_progress();
+    kBindingName = "__pwWebAuthnBinding";
+    kAuthenticatorAAGUID = Buffer.alloc(16);
+    Credentials = class {
+      constructor(browserContext) {
+        this._initScripts = [];
+        this._installed = false;
+        this._registry = /* @__PURE__ */ new Map();
+        this._browserContext = browserContext;
+      }
+      async create(options) {
+        let privateKey = options.privateKey;
+        let publicKey = options.publicKey;
+        if (!privateKey || !publicKey) {
+          const pair = import_crypto6.default.generateKeyPairSync("ec", { namedCurve: "P-256" });
+          privateKey = bufToB64Url(pair.privateKey.export({ format: "der", type: "pkcs8" }));
+          publicKey = bufToB64Url(pair.publicKey.export({ format: "der", type: "spki" }));
+        }
+        const record = {
+          id: options.id || randomBase64Url(16),
+          rpId: options.rpId,
+          userHandle: options.userHandle || randomBase64Url(16),
+          privateKey,
+          publicKey,
+          signCount: 0,
+          isResident: true
+        };
+        this._registry.set(record.id, record);
+        return toPublic(record);
+      }
+      async get(filter) {
+        return [...this._registry.values()].filter((c) => {
+          if (filter?.rpId && c.rpId !== filter.rpId)
+            return false;
+          if (filter?.id && c.id !== filter.id)
+            return false;
+          return true;
+        }).map(toPublic);
+      }
+      async delete(id) {
+        this._registry.delete(id);
+      }
+      async dispose(progress2) {
+        await progress2.race(Promise.all(this._initScripts.map((s) => s.dispose())));
+        this._initScripts = [];
+        this._installed = false;
+        this._registry.clear();
+      }
+      async install(progress2) {
+        if (this._installed)
+          return;
+        this._installed = true;
+        await this._browserContext.exposeBinding(progress2, kBindingName, async (_source, payload) => {
+          try {
+            if (payload?.type === "create")
+              return await this._handleCreate(payload);
+            if (payload?.type === "get")
+              return this._handleGet(payload);
+          } catch (e) {
+            return { ok: false, name: "NotAllowedError", message: e.message };
+          }
+          return { ok: false, name: "NotAllowedError", message: "Unknown WebAuthn request" };
+        });
+        const script = `(() => {
+      const module = {};
+      ${source2}
+      module.exports.inject()(globalThis);
+    })();`;
+        const initScript = await this._browserContext.addInitScript(nullProgress, script);
+        this._initScripts.push(initScript);
+        await progress2.race(this._browserContext.safeNonStallingEvaluateInAllFrames(script, "main", { throwOnJSErrors: false }));
+      }
+      async _handleCreate(req) {
+        const rpId = req.rp?.id || new URL(req.origin).hostname;
+        const userHandle = req.user.id;
+        if (req.excludeCredentials?.length) {
+          for (const desc of req.excludeCredentials) {
+            if (this._registry.has(desc.id))
+              return { ok: false, name: "InvalidStateError", message: "Credential excluded" };
+          }
+        }
+        const pair = import_crypto6.default.generateKeyPairSync("ec", { namedCurve: "P-256" });
+        const privateKey = bufToB64Url(pair.privateKey.export({ format: "der", type: "pkcs8" }));
+        const publicKey = bufToB64Url(pair.publicKey.export({ format: "der", type: "spki" }));
+        const credentialId = import_crypto6.default.randomBytes(16);
+        const credentialIdB64 = bufToB64Url(credentialId);
+        const record = {
+          id: credentialIdB64,
+          rpId,
+          userHandle,
+          privateKey,
+          publicKey,
+          signCount: 0,
+          isResident: req.residentKey === "required" || req.residentKey === "preferred"
+        };
+        this._registry.set(credentialIdB64, record);
+        const clientDataJSON = Buffer.from(JSON.stringify({
+          type: "webauthn.create",
+          challenge: req.challenge,
+          origin: req.origin,
+          crossOrigin: false
+        }));
+        const rpIdHash = import_crypto6.default.createHash("sha256").update(rpId).digest();
+        const flags = 1 | 4 | 64;
+        const signCountBuf = u32ToBytes(record.signCount);
+        const cosePublicKey = encodeCoseEs256PublicKey(pair.publicKey);
+        const credIdLenBuf = Buffer.from([credentialId.length >> 8 & 255, credentialId.length & 255]);
+        const attestedCredentialData = Buffer.concat([kAuthenticatorAAGUID, credIdLenBuf, credentialId, cosePublicKey]);
+        const authData = Buffer.concat([rpIdHash, Buffer.from([flags]), signCountBuf, attestedCredentialData]);
+        const attestationObject = encodeAttestationObjectNone(authData);
+        return {
+          ok: true,
+          id: credentialIdB64,
+          clientDataJSON: bufToB64Url(clientDataJSON),
+          attestationObject: bufToB64Url(attestationObject)
+        };
+      }
+      _handleGet(req) {
+        const rpId = req.rpId || new URL(req.origin).hostname;
+        let candidate;
+        if (req.allowCredentials?.length) {
+          for (const desc of req.allowCredentials) {
+            const c = this._registry.get(desc.id);
+            if (c && c.rpId === rpId) {
+              candidate = c;
+              break;
+            }
+          }
+        } else {
+          for (const c of this._registry.values()) {
+            if (c.rpId === rpId && c.isResident) {
+              candidate = c;
+              break;
+            }
+          }
+        }
+        if (!candidate)
+          return { ok: false, name: "NotAllowedError", message: "No matching credential" };
+        const clientDataJSON = Buffer.from(JSON.stringify({
+          type: "webauthn.get",
+          challenge: req.challenge,
+          origin: req.origin,
+          crossOrigin: false
+        }));
+        const rpIdHash = import_crypto6.default.createHash("sha256").update(rpId).digest();
+        const flags = 1 | 4;
+        candidate.signCount += 1;
+        const signCountBuf = u32ToBytes(candidate.signCount);
+        const authData = Buffer.concat([rpIdHash, Buffer.from([flags]), signCountBuf]);
+        const clientDataHash = import_crypto6.default.createHash("sha256").update(clientDataJSON).digest();
+        const toSign = Buffer.concat([authData, clientDataHash]);
+        const privateKey = import_crypto6.default.createPrivateKey({ key: b64UrlToBuf(candidate.privateKey), format: "der", type: "pkcs8" });
+        const signature = import_crypto6.default.sign("sha256", toSign, privateKey);
+        return {
+          ok: true,
+          id: candidate.id,
+          clientDataJSON: bufToB64Url(clientDataJSON),
+          authenticatorData: bufToB64Url(authData),
+          signature: bufToB64Url(signature),
+          userHandle: candidate.userHandle || null
+        };
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/server/instrumentation.ts
+function createRootSdkObject() {
+  const fakeParent = { attribution: {}, instrumentation: createInstrumentation() };
+  const root = new SdkObject(fakeParent);
+  root.guid = "";
+  return root;
+}
+function createInstrumentation() {
+  const listeners = /* @__PURE__ */ new Map();
+  const lastListeners = /* @__PURE__ */ new Map();
+  return new Proxy({}, {
+    get: (obj, prop) => {
+      if (typeof prop !== "string")
+        return obj[prop];
+      if (prop === "addListener") {
+        return (listener, context2, options) => {
+          if (options?.order === "last")
+            lastListeners.set(listener, context2);
+          else
+            listeners.set(listener, context2);
+        };
+      }
+      if (prop === "removeListener") {
+        return (listener) => {
+          listeners.delete(listener);
+          lastListeners.delete(listener);
+        };
+      }
+      if (!prop.startsWith("on"))
+        return obj[prop];
+      return async (sdkObject, ...params2) => {
+        for (const [listener, context2] of listeners) {
+          if (!context2 || sdkObject.attribution.context === context2)
+            await listener[prop]?.(sdkObject, ...params2);
+        }
+        for (const [listener, context2] of lastListeners) {
+          if (!context2 || sdkObject.attribution.context === context2)
+            await listener[prop]?.(sdkObject, ...params2);
+        }
+      };
+    }
+  });
+}
+var import_events3, SdkObject;
+var init_instrumentation = __esm({
+  "packages/playwright-core/src/server/instrumentation.ts"() {
+    "use strict";
+    import_events3 = require("events");
+    init_crypto();
+    init_debugLogger();
+    SdkObject = class extends import_events3.EventEmitter {
+      constructor(parent, guidPrefix, guid) {
+        super();
+        this.guid = guid || `${guidPrefix || ""}@${createGuid()}`;
+        this.setMaxListeners(0);
+        this.attribution = { ...parent.attribution };
+        this.instrumentation = parent.instrumentation;
+      }
+      apiLog(message) {
+        if (!this.attribution.playwright.options.isInternalPlaywright)
+          debugLogger.log("api", message);
+      }
+      closeReason() {
+        return this.attribution.worker?._closeReason || this.attribution.page?._closeReason || this.attribution.context?._closeReason || this.attribution.browser?._closeReason;
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/server/debugger.ts
+function matchesLocation(metadata, location2) {
+  return !!metadata.location?.file.includes(location2.file) && (location2.line === void 0 || metadata.location.line === location2.line) && (location2.column === void 0 || metadata.location.column === location2.column);
+}
+var symbol, Debugger;
+var init_debugger = __esm({
+  "packages/playwright-core/src/server/debugger.ts"() {
+    "use strict";
+    init_protocolMetainfo();
+    init_time();
+    init_instrumentation();
+    init_browserContext();
+    symbol = Symbol("Debugger");
+    Debugger = class _Debugger extends SdkObject {
+      constructor(context2) {
+        super(context2, "debugger");
+        this._pauseAt = {};
+        this._enabled = false;
+        this._pauseBeforeWaitingActions = false;
+        this._muted = false;
+        this._context = context2;
+        this._context[symbol] = this;
+        context2.instrumentation.addListener(this, context2, { order: "last" });
+        this._context.once(BrowserContext.Events.Close, () => {
+          this._context.instrumentation.removeListener(this);
+        });
+      }
+      static {
+        this.Events = {
+          PausedStateChanged: "pausedstatechanged"
+        };
+      }
+      requestPause(progress2) {
+        if (this.isPaused())
+          throw new Error("Debugger is already paused");
+        this.setPauseBeforeWaitingActions();
+        this.setPauseAt({ next: true });
+      }
+      doResume(progress2) {
+        if (!this.isPaused())
+          throw new Error("Debugger is not paused");
+        this.resume();
+      }
+      next(progress2) {
+        if (!this.isPaused())
+          throw new Error("Debugger is not paused");
+        this.setPauseBeforeWaitingActions();
+        this.setPauseAt({ next: true });
+        this.resume();
+      }
+      runTo(progress2, location2) {
+        if (!this.isPaused())
+          throw new Error("Debugger is not paused");
+        this.setPauseBeforeWaitingActions();
+        this.setPauseAt({ location: location2 });
+        this.resume();
+      }
+      async setMuted(muted) {
+        this._muted = muted;
+      }
+      async onBeforeCall(sdkObject, metadata) {
+        if (this._muted || metadata.internal)
+          return;
+        const metainfo = getMetainfo(metadata);
+        const pauseOnPauseCall = this._enabled && metadata.type === "BrowserContext" && metadata.method === "pause";
+        const pauseBeforeAction = !!this._pauseAt.next && !!metainfo?.pause && (this._pauseBeforeWaitingActions || !metainfo?.isAutoWaiting);
+        const pauseOnLocation = !!this._pauseAt.location && matchesLocation(metadata, this._pauseAt.location);
+        if (pauseOnPauseCall || pauseBeforeAction || pauseOnLocation)
+          await this._pause(sdkObject, metadata);
+      }
+      async onBeforeInputAction(sdkObject, metadata) {
+        if (this._muted || metadata.internal)
+          return;
+        const metainfo = getMetainfo(metadata);
+        const pauseBeforeInput = !!this._pauseAt.next && !!metainfo?.pause && !!metainfo?.isAutoWaiting && !this._pauseBeforeWaitingActions;
+        if (pauseBeforeInput)
+          await this._pause(sdkObject, metadata);
+      }
+      async _pause(sdkObject, metadata) {
+        if (this._muted || metadata.internal)
+          return;
+        if (this._pausedCall)
+          return;
+        this._pauseAt = {};
+        metadata.pauseStartTime = monotonicTime();
+        const result2 = new Promise((resolve) => {
+          this._pausedCall = { metadata, sdkObject, resolve };
+        });
+        this.emit(_Debugger.Events.PausedStateChanged);
+        return result2;
+      }
+      resume() {
+        if (!this._pausedCall)
+          return;
+        this._pausedCall.metadata.pauseEndTime = monotonicTime();
+        this._pausedCall.resolve();
+        this._pausedCall = void 0;
+        this.emit(_Debugger.Events.PausedStateChanged);
+      }
+      setPauseBeforeWaitingActions() {
+        this._pauseBeforeWaitingActions = true;
+      }
+      setPauseAt(at = {}) {
+        this._enabled = true;
+        this._pauseAt = at;
+      }
+      isPaused(metadata) {
+        if (metadata)
+          return this._pausedCall?.metadata === metadata;
+        return !!this._pausedCall;
+      }
+      pausedDetails() {
+        return this._pausedCall;
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/server/dialog.ts
+var Dialog, DialogManager;
+var init_dialog = __esm({
+  "packages/playwright-core/src/server/dialog.ts"() {
+    "use strict";
+    init_assert();
+    init_instrumentation();
+    Dialog = class extends SdkObject {
+      constructor(page, type3, message, onHandle, defaultValue) {
+        super(page, "dialog");
+        this._handled = false;
+        this._page = page;
+        this._type = type3;
+        this._message = message;
+        this._onHandle = onHandle;
+        this._defaultValue = defaultValue || "";
+      }
+      async accept(progress2, promptText) {
+        await progress2.race(this._accept(promptText));
+      }
+      async dismiss(progress2) {
+        await progress2.race(this._dismiss());
+      }
+      page() {
+        return this._page;
+      }
+      type() {
+        return this._type;
+      }
+      message() {
+        return this._message;
+      }
+      defaultValue() {
+        return this._defaultValue;
+      }
+      async _accept(promptText) {
+        assert(!this._handled, "Cannot accept dialog which is already handled!");
+        this._handled = true;
+        this._page.browserContext.dialogManager._dialogWillClose(this);
+        await this._onHandle(true, promptText);
+      }
+      async _dismiss() {
+        assert(!this._handled, "Cannot dismiss dialog which is already handled!");
+        this._handled = true;
+        this._page.browserContext.dialogManager._dialogWillClose(this);
+        await this._onHandle(false);
+      }
+      async _close() {
+        if (this._type === "beforeunload")
+          await this._accept();
+        else
+          await this._dismiss();
+      }
+    };
+    DialogManager = class {
+      constructor(instrumentation) {
+        this._dialogHandlers = /* @__PURE__ */ new Set();
+        this._openedDialogs = /* @__PURE__ */ new Set();
+        this._instrumentation = instrumentation;
+      }
+      dialogDidOpen(dialog) {
+        for (const frame of dialog.page().frameManager.frames())
+          frame.invalidateNonStallingEvaluations("JavaScript dialog interrupted evaluation");
+        this._openedDialogs.add(dialog);
+        this._instrumentation.onDialog(dialog);
+        let hasHandlers = false;
+        for (const handler of this._dialogHandlers) {
+          if (handler(dialog))
+            hasHandlers = true;
+        }
+        if (!hasHandlers)
+          dialog._close().then(() => {
+          });
+      }
+      _dialogWillClose(dialog) {
+        this._openedDialogs.delete(dialog);
+      }
+      addDialogHandler(handler) {
+        this._dialogHandlers.add(handler);
+      }
+      removeDialogHandler(handler) {
+        this._dialogHandlers.delete(handler);
+        if (!this._dialogHandlers.size) {
+          for (const dialog of this._openedDialogs)
+            dialog._close().catch(() => {
+            });
+        }
+      }
+      hasOpenDialogsForPage(page) {
+        return [...this._openedDialogs].some((dialog) => dialog.page() === page);
+      }
+      async closeBeforeUnloadDialogs() {
+        await Promise.all([...this._openedDialogs].map(async (dialog) => {
+          if (dialog.type() === "beforeunload")
+            await dialog._dismiss();
+        }));
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/server/network.ts
+function filterCookies(cookies, urls) {
+  const parsedURLs = urls.map((s) => new URL(s));
+  return cookies.filter((c) => {
+    if (!parsedURLs.length)
+      return true;
+    for (const parsedURL of parsedURLs) {
+      let domain = c.domain;
+      if (!domain.startsWith("."))
+        domain = "." + domain;
+      if (!("." + parsedURL.hostname).endsWith(domain))
+        continue;
+      if (!parsedURL.pathname.startsWith(c.path))
+        continue;
+      if (parsedURL.protocol !== "https:" && !isLocalHostname(parsedURL.hostname) && c.secure)
+        continue;
+      return true;
+    }
+    return false;
+  });
+}
+function isLocalHostname(hostname) {
+  return hostname === "localhost" || hostname.endsWith(".localhost");
+}
+function isForbiddenHeader(name, value2) {
+  const lowerName = name.toLowerCase();
+  if (FORBIDDEN_HEADER_NAMES.has(lowerName))
+    return true;
+  if (lowerName.startsWith("proxy-"))
+    return true;
+  if (lowerName.startsWith("sec-"))
+    return true;
+  if (lowerName === "x-http-method" || lowerName === "x-http-method-override" || lowerName === "x-method-override") {
+    if (value2 && FORBIDDEN_METHODS.has(value2.toUpperCase()))
+      return true;
+  }
+  return false;
+}
+function applyHeadersOverrides(original, overrides) {
+  const forbiddenHeaders = original.filter((header) => isForbiddenHeader(header.name, header.value));
+  const allowedHeaders = overrides.filter((header) => !isForbiddenHeader(header.name, header.value));
+  return mergeHeaders([allowedHeaders, forbiddenHeaders]);
+}
+function rewriteCookies(cookies) {
+  return cookies.map((c) => {
+    assert(c.url || c.domain && c.path, "Cookie should have a url or a domain/path pair");
+    assert(!(c.url && c.domain), "Cookie should have either url or domain");
+    assert(!(c.url && c.path), "Cookie should have either url or path");
+    assert(!(c.expires && c.expires < 0 && c.expires !== -1), "Cookie should have a valid expires, only -1 or a positive number for the unix timestamp in seconds is allowed");
+    assert(!(c.expires && c.expires > 0 && c.expires > kMaxCookieExpiresDateInSeconds), "Cookie should have a valid expires, only -1 or a positive number for the unix timestamp in seconds is allowed");
+    const copy = { ...c };
+    if (copy.url) {
+      assert(copy.url !== "about:blank", `Blank page can not have cookie "${c.name}"`);
+      assert(!copy.url.startsWith("data:"), `Data URL page can not have cookie "${c.name}"`);
+      const url2 = new URL(copy.url);
+      copy.domain = url2.hostname;
+      copy.path = url2.pathname.substring(0, url2.pathname.lastIndexOf("/") + 1);
+      copy.secure = url2.protocol === "https:";
+    }
+    return copy;
+  });
+}
+function parseURL2(url2) {
+  try {
+    return new URL(url2);
+  } catch (e) {
+    return null;
+  }
+}
+function stripFragmentFromUrl(url2) {
+  if (!url2.includes("#"))
+    return url2;
+  return url2.substring(0, url2.indexOf("#"));
+}
+function statusText(status) {
+  return STATUS_TEXTS[String(status)] || "Unknown";
+}
+function singleHeader(name, value2) {
+  return [{ name, value: value2 }];
+}
+function mergeHeaders(headers) {
+  const lowerCaseToValue = /* @__PURE__ */ new Map();
+  const lowerCaseToOriginalCase = /* @__PURE__ */ new Map();
+  for (const h of headers) {
+    if (!h)
+      continue;
+    for (const { name, value: value2 } of h) {
+      const lower = name.toLowerCase();
+      lowerCaseToOriginalCase.set(lower, name);
+      lowerCaseToValue.set(lower, value2);
+    }
+  }
+  const result2 = [];
+  for (const [lower, value2] of lowerCaseToValue)
+    result2.push({ name: lowerCaseToOriginalCase.get(lower), value: value2 });
+  return result2;
+}
+function headersSize(headers) {
+  let result2 = 0;
+  for (const header of headers)
+    result2 += header.name.length + header.value.length + 4;
+  return result2;
+}
+function requestHeadersSize(headers, url2, method) {
+  let result2 = 4;
+  result2 += method.length;
+  result2 += new URL(url2).pathname.length;
+  result2 += 8;
+  result2 += headersSize(headers);
+  return result2;
+}
+function responseHeadersSize(headers, statusText2) {
+  let result2 = 4;
+  result2 += 8;
+  result2 += 3;
+  result2 += statusText2.length;
+  result2 += headersSize(headers);
+  result2 += 2;
+  return result2;
+}
+var FORBIDDEN_HEADER_NAMES, FORBIDDEN_METHODS, kMaxCookieExpiresDateInSeconds, Request, Route, Response2, WebSocket, STATUS_TEXTS;
+var init_network2 = __esm({
+  "packages/playwright-core/src/server/network.ts"() {
+    "use strict";
+    init_manualPromise();
+    init_assert();
+    init_browserContext();
+    init_fetch();
+    init_instrumentation();
+    FORBIDDEN_HEADER_NAMES = /* @__PURE__ */ new Set([
+      "accept-charset",
+      "accept-encoding",
+      "access-control-request-headers",
+      "access-control-request-method",
+      "connection",
+      "content-length",
+      "cookie",
+      "date",
+      "dnt",
+      "expect",
+      "host",
+      "keep-alive",
+      "origin",
+      "referer",
+      "set-cookie",
+      "te",
+      "trailer",
+      "transfer-encoding",
+      "upgrade",
+      "via"
+    ]);
+    FORBIDDEN_METHODS = /* @__PURE__ */ new Set(["CONNECT", "TRACE", "TRACK"]);
+    kMaxCookieExpiresDateInSeconds = 253402300799;
+    Request = class _Request extends SdkObject {
+      constructor(context2, frame, serviceWorker, redirectedFrom, documentId, url2, resourceType, method, postData, headers, wallTimeMs) {
+        super(frame || context2, "request");
+        this._response = null;
+        this._redirectedTo = null;
+        this._failureText = null;
+        this._frame = null;
+        this._serviceWorker = null;
+        this._rawRequestHeadersPromise = new ManualPromise();
+        this._waitForResponsePromise = new ManualPromise();
+        this._responseEndTiming = -1;
+        assert(!url2.startsWith("data:"), "Data urls should not fire requests");
+        this._context = context2;
+        this._frame = frame;
+        this._serviceWorker = serviceWorker;
+        this._redirectedFrom = redirectedFrom;
+        if (redirectedFrom)
+          redirectedFrom._redirectedTo = this;
+        this._documentId = documentId;
+        this._url = stripFragmentFromUrl(url2);
+        this._resourceType = resourceType;
+        this._method = method;
+        this._postData = postData;
+        this._headers = headers;
+        this._wallTimeMs = wallTimeMs;
+        this._isFavicon = url2.endsWith("/favicon.ico") || !!redirectedFrom?._isFavicon;
+      }
+      static {
+        this.Events = {
+          Response: "response"
+        };
+      }
+      wallTimeMs() {
+        return this._wallTimeMs;
+      }
+      async raceWithPageClosure(progress2, promise) {
+        const scope = this._serviceWorker?.openScope ?? this._frame?._page.openScope;
+        if (scope)
+          return await progress2.race(scope.race(promise));
+        return await progress2.race(promise);
+      }
+      async rawRequestHeaders(progress2) {
+        return await this.raceWithPageClosure(progress2, this.internalRawRequestHeaders());
+      }
+      async response(progress2) {
+        return await this.raceWithPageClosure(progress2, this._waitForResponse());
+      }
+      _setFailureText(failureText) {
+        this._failureText = failureText;
+        this._waitForResponsePromise.resolve(null);
+      }
+      _applyOverrides(overrides) {
+        this._overrides = { ...this._overrides, ...overrides };
+        return this._overrides;
+      }
+      overrides() {
+        return this._overrides;
+      }
+      url() {
+        return this._overrides?.url || this._url;
+      }
+      resourceType() {
+        return this._resourceType;
+      }
+      method() {
+        return this._overrides?.method || this._method;
+      }
+      postDataBuffer() {
+        return this._overrides?.postData || this._postData;
+      }
+      headers() {
+        return this._overrides?.headers || this._headers;
+      }
+      headerValue(name) {
+        const lowerCaseName = name.toLowerCase();
+        return this.headers().find((h) => h.name.toLowerCase() === lowerCaseName)?.value;
+      }
+      // "null" means no raw headers available - we'll use provisional headers as raw headers.
+      setRawRequestHeaders(headers) {
+        if (!this._rawRequestHeadersPromise.isDone())
+          this._rawRequestHeadersPromise.resolve(headers || this._headers);
+      }
+      async internalRawRequestHeaders() {
+        return this._overrides?.headers || this._rawRequestHeadersPromise;
+      }
+      _waitForResponse() {
+        return this._waitForResponsePromise;
+      }
+      _existingResponse() {
+        return this._response;
+      }
+      _setResponse(response2) {
+        this._response = response2;
+        this._waitForResponsePromise.resolve(response2);
+        this.emit(_Request.Events.Response, response2);
+      }
+      _finalRequest() {
+        return this._redirectedTo ? this._redirectedTo._finalRequest() : this;
+      }
+      frame() {
+        return this._frame;
+      }
+      serviceWorker() {
+        return this._serviceWorker;
+      }
+      isNavigationRequest() {
+        return !!this._documentId;
+      }
+      redirectedFrom() {
+        return this._redirectedFrom;
+      }
+      failure() {
+        if (this._failureText === null)
+          return null;
+        return {
+          errorText: this._failureText
+        };
+      }
+      // TODO(bidi): remove once post body is available.
+      _setBodySize(size) {
+        this._bodySize = size;
+      }
+      bodySize() {
+        return this._bodySize || this.postDataBuffer()?.length || 0;
+      }
+      async _requestHeadersSize() {
+        return requestHeadersSize(await this.internalRawRequestHeaders(), this.url(), this.method());
+      }
+    };
+    Route = class extends SdkObject {
+      constructor(request2, delegate) {
+        super(request2._frame || request2._context, "route");
+        this._handled = false;
+        this._futureHandlers = [];
+        this._request = request2;
+        this._delegate = delegate;
+        this._request._context.addRouteInFlight(this);
+      }
+      handle(handlers) {
+        this._futureHandlers = [...handlers];
+        this.continue({ isFallback: true }).catch(() => {
+        });
+      }
+      async removeHandler(handler) {
+        this._futureHandlers = this._futureHandlers.filter((h) => h !== handler);
+        if (handler === this._currentHandler) {
+          await this.continue({ isFallback: true }).catch(() => {
+          });
+          return;
+        }
+      }
+      request() {
+        return this._request;
+      }
+      async abort(errorCode = "failed") {
+        this._startHandling();
+        this._request._context.emit(BrowserContext.Events.RequestAborted, this._request);
+        await this._delegate.abort(errorCode);
+        this._endHandling();
+      }
+      redirectNavigationRequest(url2) {
+        this._startHandling();
+        assert(this._request.isNavigationRequest());
+        this._request.frame().redirectNavigation(url2, this._request._documentId, this._request.headerValue("referer"));
+        this._endHandling();
+      }
+      async fulfill(overrides) {
+        this._startHandling();
+        let body = overrides.body;
+        let isBase64 = overrides.isBase64 || false;
+        if (body === void 0) {
+          if (overrides.fetchResponseUid) {
+            const buffer = this._request._context.fetchRequest.fetchResponses.get(overrides.fetchResponseUid) || APIRequestContext.findResponseBody(overrides.fetchResponseUid);
+            assert(buffer, "Fetch response has been disposed");
+            body = buffer.toString("base64");
+            isBase64 = true;
+          } else {
+            body = "";
+            isBase64 = false;
+          }
+        } else if (!overrides.status || overrides.status < 200 || overrides.status >= 400) {
+          this._request._responseBodyOverride = { body, isBase64 };
+        }
+        const headers = [...overrides.headers || []];
+        this._maybeAddCorsHeaders(headers);
+        this._request._context.emit(BrowserContext.Events.RequestFulfilled, this._request);
+        await this._delegate.fulfill({
+          status: overrides.status || 200,
+          headers,
+          body,
+          isBase64
+        });
+        this._endHandling();
+      }
+      // See https://github.com/microsoft/playwright/issues/12929
+      _maybeAddCorsHeaders(headers) {
+        const origin = this._request.headerValue("origin");
+        if (!origin)
+          return;
+        const requestUrl = new URL(this._request.url());
+        if (!requestUrl.protocol.startsWith("http"))
+          return;
+        if (requestUrl.origin === origin.trim())
+          return;
+        const corsHeader = headers.find(({ name }) => name === "access-control-allow-origin");
+        if (corsHeader)
+          return;
+        headers.push({ name: "access-control-allow-origin", value: origin });
+        headers.push({ name: "access-control-allow-credentials", value: "true" });
+        headers.push({ name: "vary", value: "Origin" });
+      }
+      async continue(overrides) {
+        if (overrides.url) {
+          const newUrl = new URL(overrides.url);
+          const oldUrl = new URL(this._request.url());
+          if (oldUrl.protocol !== newUrl.protocol)
+            throw new Error("New URL must have same protocol as overridden URL");
+        }
+        if (overrides.headers) {
+          overrides.headers = applyHeadersOverrides(this._request._headers, overrides.headers);
+        }
+        overrides = this._request._applyOverrides(overrides);
+        const nextHandler = this._futureHandlers.shift();
+        if (nextHandler) {
+          this._currentHandler = nextHandler;
+          nextHandler(this, this._request);
+          return;
+        }
+        if (!overrides.isFallback)
+          this._request._context.emit(BrowserContext.Events.RequestContinued, this._request);
+        this._startHandling();
+        await this._delegate.continue(overrides);
+        this._endHandling();
+      }
+      _startHandling() {
+        assert(!this._handled, "Route is already handled!");
+        this._handled = true;
+        this._currentHandler = void 0;
+      }
+      _endHandling() {
+        this._futureHandlers = [];
+        this._currentHandler = void 0;
+        this._request._context.removeRouteInFlight(this);
+      }
+    };
+    Response2 = class extends SdkObject {
+      constructor(request2, status, statusText2, headers, timing, getResponseBodyCallback, fromServiceWorker) {
+        super(request2.frame() || request2._context, "response");
+        this._contentPromise = null;
+        this._finishedPromise = new ManualPromise();
+        this._headersMap = /* @__PURE__ */ new Map();
+        this._serverAddrPromise = new ManualPromise();
+        this._securityDetailsPromise = new ManualPromise();
+        this._rawResponseHeadersPromise = new ManualPromise();
+        this._httpVersionPromise = new ManualPromise();
+        this._encodedBodySizePromise = new ManualPromise();
+        this._transferSizePromise = new ManualPromise();
+        this._responseHeadersSizePromise = new ManualPromise();
+        this._request = request2;
+        this._timing = timing;
+        this._status = status;
+        this._statusText = statusText2;
+        this._url = request2.url();
+        this._headers = headers;
+        for (const { name, value: value2 } of this._headers)
+          this._headersMap.set(name.toLowerCase(), value2);
+        this._getResponseBodyCallback = getResponseBodyCallback;
+        this._request._setResponse(this);
+        this._fromServiceWorker = fromServiceWorker;
+      }
+      async body(progress2) {
+        return await this._request.raceWithPageClosure(progress2, this.internalBody());
+      }
+      async securityDetails(progress2) {
+        return await this._request.raceWithPageClosure(progress2, this.internalSecurityDetails());
+      }
+      async serverAddr(progress2) {
+        return await this._request.raceWithPageClosure(progress2, this.internalServerAddr());
+      }
+      async rawResponseHeaders(progress2) {
+        return await this._request.raceWithPageClosure(progress2, this.internalRawResponseHeaders());
+      }
+      async httpVersion(progress2) {
+        return await this._request.raceWithPageClosure(progress2, this.internalHttpVersion());
+      }
+      async sizes(progress2) {
+        return await this._request.raceWithPageClosure(progress2, this.internalSizes());
+      }
+      _serverAddrFinished(addr) {
+        this._serverAddrPromise.resolve(addr);
+      }
+      _securityDetailsFinished(securityDetails) {
+        this._securityDetailsPromise.resolve(securityDetails);
+      }
+      _requestFinished(responseEndTiming) {
+        this._request._responseEndTiming = Math.max(responseEndTiming, this._timing.responseStart);
+        if (this._timing.requestStart === -1)
+          this._timing.requestStart = this._request._responseEndTiming;
+        this._finishedPromise.resolve();
+      }
+      _setHttpVersion(httpVersion) {
+        this._httpVersionPromise.resolve(httpVersion);
+      }
+      url() {
+        return this._url;
+      }
+      status() {
+        return this._status;
+      }
+      statusText() {
+        return this._statusText;
+      }
+      headers() {
+        return this._headers;
+      }
+      headerValue(name) {
+        return this._headersMap.get(name);
+      }
+      // "null" means no raw headers available - we'll use provisional headers as raw headers.
+      setRawResponseHeaders(headers) {
+        if (!this._rawResponseHeadersPromise.isDone())
+          this._rawResponseHeadersPromise.resolve(headers || this._headers);
+      }
+      setTransferSize(size) {
+        this._transferSizePromise.resolve(size);
+      }
+      setEncodedBodySize(size) {
+        this._encodedBodySizePromise.resolve(size);
+      }
+      setResponseHeadersSize(size) {
+        this._responseHeadersSizePromise.resolve(size);
+      }
+      timing() {
+        return this._timing;
+      }
+      async internalSecurityDetails() {
+        return await this._securityDetailsPromise || null;
+      }
+      async internalServerAddr() {
+        return await this._serverAddrPromise || null;
+      }
+      async internalRawResponseHeaders() {
+        return await this._rawResponseHeadersPromise;
+      }
+      internalBody() {
+        if (!this._contentPromise) {
+          this._contentPromise = this._finishedPromise.then(async () => {
+            if (this._status >= 300 && this._status <= 399)
+              throw new Error("Response body is unavailable for redirect responses");
+            if (this._request._responseBodyOverride) {
+              const { body, isBase64 } = this._request._responseBodyOverride;
+              return Buffer.from(body, isBase64 ? "base64" : "utf-8");
+            }
+            return this._getResponseBodyCallback();
+          });
+        }
+        return this._contentPromise;
+      }
+      request() {
+        return this._request;
+      }
+      finished() {
+        return this._finishedPromise;
+      }
+      frame() {
+        return this._request.frame();
+      }
+      async internalHttpVersion() {
+        const httpVersion = await this._httpVersionPromise || null;
+        if (!httpVersion)
+          return "HTTP/1.1";
+        if (httpVersion === "http/1.1")
+          return "HTTP/1.1";
+        if (httpVersion === "h2")
+          return "HTTP/2.0";
+        return httpVersion;
+      }
+      fromServiceWorker() {
+        return this._fromServiceWorker;
+      }
+      async responseHeadersSize() {
+        const availableSize = await this._responseHeadersSizePromise;
+        if (availableSize !== null)
+          return availableSize;
+        return responseHeadersSize(await this._rawResponseHeadersPromise, this.statusText());
+      }
+      async internalSizes() {
+        const requestHeadersSize2 = await this._request._requestHeadersSize();
+        const responseHeadersSize2 = await this.responseHeadersSize();
+        let encodedBodySize = await this._encodedBodySizePromise;
+        if (encodedBodySize === null) {
+          const headers = await this._rawResponseHeadersPromise;
+          const contentLength = headers.find((h) => h.name.toLowerCase() === "content-length")?.value;
+          encodedBodySize = contentLength ? +contentLength : 0;
+        }
+        let transferSize = await this._transferSizePromise;
+        if (transferSize === null) {
+          transferSize = responseHeadersSize2 + encodedBodySize;
+        }
+        return {
+          requestBodySize: this._request.bodySize(),
+          requestHeadersSize: requestHeadersSize2,
+          responseBodySize: encodedBodySize,
+          responseHeadersSize: responseHeadersSize2,
+          transferSize
+        };
+      }
+    };
+    WebSocket = class _WebSocket extends SdkObject {
+      constructor(parent, url2) {
+        super(parent, "ws");
+        this._notified = false;
+        this._url = stripFragmentFromUrl(url2);
+      }
+      static {
+        this.Events = {
+          Close: "close",
+          SocketError: "socketerror",
+          FrameReceived: "framereceived",
+          FrameSent: "framesent",
+          Request: "request",
+          Response: "response"
+        };
+      }
+      markAsNotified() {
+        if (this._notified)
+          return false;
+        this._notified = true;
+        return true;
+      }
+      url() {
+        return this._url;
+      }
+      wallTimeMs() {
+        return this._wallTimeMs;
+      }
+      setWallTimeMs(wallTimeMs) {
+        this._wallTimeMs = wallTimeMs;
+      }
+      requestSent(headers) {
+        this.emit(_WebSocket.Events.Request, { headers });
+      }
+      responseReceived(status, statusText2, headers) {
+        this.emit(_WebSocket.Events.Response, { status, statusText: statusText2, headers });
+      }
+      frameSent(opcode, data, wallTimeMs) {
+        this.emit(_WebSocket.Events.FrameSent, { opcode, data, wallTimeMs });
+      }
+      frameReceived(opcode, data, wallTimeMs) {
+        this.emit(_WebSocket.Events.FrameReceived, { opcode, data, wallTimeMs });
+      }
+      error(errorMessage) {
+        this.emit(_WebSocket.Events.SocketError, errorMessage);
+      }
+      closed() {
+        this.emit(_WebSocket.Events.Close);
+      }
+    };
+    STATUS_TEXTS = {
+      "100": "Continue",
+      "101": "Switching Protocols",
+      "102": "Processing",
+      "103": "Early Hints",
+      "200": "OK",
+      "201": "Created",
+      "202": "Accepted",
+      "203": "Non-Authoritative Information",
+      "204": "No Content",
+      "205": "Reset Content",
+      "206": "Partial Content",
+      "207": "Multi-Status",
+      "208": "Already Reported",
+      "226": "IM Used",
+      "300": "Multiple Choices",
+      "301": "Moved Permanently",
+      "302": "Found",
+      "303": "See Other",
+      "304": "Not Modified",
+      "305": "Use Proxy",
+      "306": "Switch Proxy",
+      "307": "Temporary Redirect",
+      "308": "Permanent Redirect",
+      "400": "Bad Request",
+      "401": "Unauthorized",
+      "402": "Payment Required",
+      "403": "Forbidden",
+      "404": "Not Found",
+      "405": "Method Not Allowed",
+      "406": "Not Acceptable",
+      "407": "Proxy Authentication Required",
+      "408": "Request Timeout",
+      "409": "Conflict",
+      "410": "Gone",
+      "411": "Length Required",
+      "412": "Precondition Failed",
+      "413": "Payload Too Large",
+      "414": "URI Too Long",
+      "415": "Unsupported Media Type",
+      "416": "Range Not Satisfiable",
+      "417": "Expectation Failed",
+      "418": "I'm a teapot",
+      "421": "Misdirected Request",
+      "422": "Unprocessable Entity",
+      "423": "Locked",
+      "424": "Failed Dependency",
+      "425": "Too Early",
+      "426": "Upgrade Required",
+      "428": "Precondition Required",
+      "429": "Too Many Requests",
+      "431": "Request Header Fields Too Large",
+      "451": "Unavailable For Legal Reasons",
+      "500": "Internal Server Error",
+      "501": "Not Implemented",
+      "502": "Bad Gateway",
+      "503": "Service Unavailable",
+      "504": "Gateway Timeout",
+      "505": "HTTP Version Not Supported",
+      "506": "Variant Also Negotiates",
+      "507": "Insufficient Storage",
+      "508": "Loop Detected",
+      "510": "Not Extended",
+      "511": "Network Authentication Required"
+    };
+  }
+});
+
+// packages/playwright-core/src/server/cookieStore.ts
+function parseRawCookie(header) {
+  const pairs = header.split(";").filter((s) => s.trim().length > 0).map((p) => {
+    let key = "";
+    let value3 = "";
+    const separatorPos = p.indexOf("=");
+    if (separatorPos === -1) {
+      key = p.trim();
+    } else {
+      key = p.slice(0, separatorPos).trim();
+      value3 = p.slice(separatorPos + 1).trim();
+    }
+    return [key, value3];
+  });
+  if (!pairs.length)
+    return null;
+  const [name, value2] = pairs[0];
+  const cookie = {
+    name,
+    value: value2
+  };
+  for (let i = 1; i < pairs.length; i++) {
+    const [name2, value3] = pairs[i];
+    switch (name2.toLowerCase()) {
+      case "expires":
+        const expiresMs = +new Date(value3);
+        if (isFinite(expiresMs)) {
+          if (expiresMs <= 0)
+            cookie.expires = 0;
+          else
+            cookie.expires = Math.min(expiresMs / 1e3, kMaxCookieExpiresDateInSeconds);
+        }
+        break;
+      case "max-age":
+        const maxAgeSec = parseInt(value3, 10);
+        if (isFinite(maxAgeSec)) {
+          if (maxAgeSec <= 0)
+            cookie.expires = 0;
+          else
+            cookie.expires = Math.min(Date.now() / 1e3 + maxAgeSec, kMaxCookieExpiresDateInSeconds);
+        }
+        break;
+      case "domain":
+        cookie.domain = value3.toLocaleLowerCase() || "";
+        if (cookie.domain && !cookie.domain.startsWith(".") && cookie.domain.includes("."))
+          cookie.domain = "." + cookie.domain;
+        break;
+      case "path":
+        cookie.path = value3 || "";
+        break;
+      case "secure":
+        cookie.secure = true;
+        break;
+      case "httponly":
+        cookie.httpOnly = true;
+        break;
+      case "samesite":
+        switch (value3.toLowerCase()) {
+          case "none":
+            cookie.sameSite = "None";
+            break;
+          case "lax":
+            cookie.sameSite = "Lax";
+            break;
+          case "strict":
+            cookie.sameSite = "Strict";
+            break;
+        }
+        break;
+    }
+  }
+  return cookie;
+}
+function domainMatches(value2, domain) {
+  if (value2 === domain)
+    return true;
+  if (!domain.startsWith("."))
+    return false;
+  value2 = "." + value2;
+  return value2.endsWith(domain);
+}
+function pathMatches(value2, path59) {
+  if (value2 === path59)
+    return true;
+  if (!value2.endsWith("/"))
+    value2 = value2 + "/";
+  if (!path59.endsWith("/"))
+    path59 = path59 + "/";
+  return value2.startsWith(path59);
+}
+var Cookie, CookieStore;
+var init_cookieStore = __esm({
+  "packages/playwright-core/src/server/cookieStore.ts"() {
+    "use strict";
+    init_network2();
+    Cookie = class {
+      constructor(data) {
+        this._raw = data;
+      }
+      _name() {
+        return this._raw.name;
+      }
+      // https://datatracker.ietf.org/doc/html/rfc6265#section-5.4
+      matches(url2) {
+        if (this._raw.secure && (url2.protocol !== "https:" && !isLocalHostname(url2.hostname)))
+          return false;
+        if (!domainMatches(url2.hostname, this._raw.domain))
+          return false;
+        if (!pathMatches(url2.pathname, this._raw.path))
+          return false;
+        return true;
+      }
+      _equals(other) {
+        return this._raw.name === other._raw.name && this._raw.domain === other._raw.domain && this._raw.path === other._raw.path;
+      }
+      _networkCookie() {
+        return this._raw;
+      }
+      _updateExpiresFrom(other) {
+        this._raw.expires = other._raw.expires;
+      }
+      _expired() {
+        if (this._raw.expires === -1)
+          return false;
+        return this._raw.expires * 1e3 < Date.now();
+      }
+    };
+    CookieStore = class _CookieStore {
+      constructor() {
+        this._nameToCookies = /* @__PURE__ */ new Map();
+      }
+      addCookies(cookies) {
+        for (const cookie of cookies)
+          this._addCookie(new Cookie(cookie));
+      }
+      cookies(url2) {
+        const result2 = [];
+        for (const cookie of this._cookiesIterator()) {
+          if (cookie.matches(url2))
+            result2.push(cookie._networkCookie());
+        }
+        return result2;
+      }
+      allCookies() {
+        const result2 = [];
+        for (const cookie of this._cookiesIterator())
+          result2.push(cookie._networkCookie());
+        return result2;
+      }
+      _addCookie(cookie) {
+        let set = this._nameToCookies.get(cookie._name());
+        if (!set) {
+          set = /* @__PURE__ */ new Set();
+          this._nameToCookies.set(cookie._name(), set);
+        }
+        for (const other of set) {
+          if (other._equals(cookie))
+            set.delete(other);
+        }
+        set.add(cookie);
+        _CookieStore.pruneExpired(set);
+      }
+      *_cookiesIterator() {
+        for (const [name, cookies] of this._nameToCookies) {
+          _CookieStore.pruneExpired(cookies);
+          for (const cookie of cookies)
+            yield cookie;
+          if (cookies.size === 0)
+            this._nameToCookies.delete(name);
+        }
+      }
+      static pruneExpired(cookies) {
+        for (const cookie of cookies) {
+          if (cookie._expired())
+            cookies.delete(cookie);
+        }
+      }
+    };
+  }
+});
+
+// packages/playwright-core/src/server/formData.ts
+function generateUniqueBoundaryString() {
+  const charCodes = [];
+  for (let i = 0; i < 16; i++)
+    charCodes.push(alphaNumericEncodingMap[Math.floor(Math.random() * alphaNumericEncodingMap.length)]);
+  return "----WebKitFormBoundary" + String.fromCharCode(...charCodes);
+}
+var mime2, MultipartFormData, alphaNumericEncodingMap;
+var init_formData = __esm({
+  "packages/playwright-core/src/server/formData.ts"() {
+    "use strict";
+    mime2 = require("./utilsBundle").mime;
+    MultipartFormData = class {
+      constructor() {
+        this._chunks = [];
+        this._boundary = generateUniqueBoundaryString();
+      }
+      contentTypeHeader() {
+        return `multipart/form-data; boundary=${this._boundary}`;
+      }
+      addField(name, value2) {
+        this._beginMultiPartHeader(name);
+        this._finishMultiPartHeader();
+        this._chunks.push(Buffer.from(value2));
+        this._finishMultiPartField();
+      }
+      addFileField(name, value2) {
+        this._beginMultiPartHeader(name);
+        this._chunks.push(Buffer.from(`; filename="${value2.name}"`));
+        this._chunks.push(Buffer.from(`\r
+content-type: ${value2.mimeType || mime2.getType(value2.name) || "application/octet-stream"}`));
+        this._finishMultiPartHeader();
+        this._chunks.push(value2.buffer);
+        this._finishMultiPartField();
+      }
+      finish() {
+        this._addBoundary(true);
+        return Buffer.concat(this._chunks);
+      }
+      _beginMultiPartHeader(name) {
+        this._addBoundary();
+        this._chunks.push(Buffer.from(`content-disposition: form-data; name="${name}"`));
+      }
+      _finishMultiPartHeader() {
+        this._chunks.push(Buffer.from(`\r
+\r
+`));
+      }
+      _finishMultiPartField() {
+        this._chunks.push(Buffer.from(`\r
+`));
+      }
+      _addBoundary(isLastBoundary) {
+        this._chunks.push(Buffer.from("--" + this._boundary));
+        if (isLastBoundary)
+          this._chunks.push(Buffer.from("--"));
+        this._chunks.push(Buffer.from("\r\n"));
+      }
+    };
+    alphaNumericEncodingMap = [
+      65,
+      66,
+      67,
+      68,
+      69,
+      70,
+      71,
+      72,
+      73,
+      74,
+      75,
+      76,
+      77,
+      78,
+      79,
+      80,
+      81,
+      82,
+      83,
+      84,
+      85,
+      86,
+      87,
+      88,
+      89,
+      90,
+      97,
+      98,
+      99,
+      100,
+      101,
+      102,
+      103,
+      104,
+      105,
+      106,
+      107,
+      108,
+      109,
+      110,
+      111,
+      112,
+      113,
+      114,
+      115,
+      116,
+      117,
+      118,
+      119,
+      120,
+      121,
+      122,
+      48,
+      49,
+      50,
+      51,
+      52,
+      53,
+      54,
+      55,
+      56,
+      57,
+      65,
+      66
+    ];
+  }
+});
+
+// packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts
+function loadDummyServerCertsIfNeeded() {
+  if (dummyServerTlsOptions)
+    return;
+  const { cert, key } = generateSelfSignedCertificate();
+  dummyServerTlsOptions = { key, cert };
+}
+function normalizeOrigin(origin) {
+  try {
+    return new URL(origin).origin;
+  } catch (error) {
+    return origin;
+  }
+}
+function convertClientCertificatesToTLSOptions(clientCertificates) {
+  if (!clientCertificates || !clientCertificates.length)
+    return;
+  const tlsOptions = {
+    pfx: [],
+    key: [],
+    cert: []
+  };
+  for (const cert of clientCertificates) {
+    if (cert.cert)
+      tlsOptions.cert.push(cert.cert);
+    if (cert.key)
+      tlsOptions.key.push({ pem: cert.key, passphrase: cert.passphrase });
+    if (cert.pfx)
+      tlsOptions.pfx.push({ buf: cert.pfx, passphrase: cert.passphrase });
+  }
+  return tlsOptions;
+}
+function getMatchingTLSOptionsForOrigin(clientCertificates, origin) {
+  const matchingCerts = clientCertificates?.filter(
+    (c) => normalizeOrigin(c.origin) === origin
+  );
+  return convertClientCertificatesToTLSOptions(matchingCerts);
+}
+function rewriteToLocalhostIfNeeded(host) {
+  return host === "local.playwright" ? "localhost" : host;
+}
+function rewriteOpenSSLErrorIfNeeded(error) {
+  if (error.message !== "unsupported" && error.code !== "ERR_CRYPTO_UNSUPPORTED_OPERATION")
+    return error;
+  return rewriteErrorMessage(error, [
+    "Unsupported TLS certificate.",
+    "Most likely, the security algorithm of the given certificate was deprecated by OpenSSL.",
+    "For more details, see https://github.com/openssl/openssl/blob/master/README-PROVIDERS.md#the-legacy-provider",
+    "You could probably modernize the certificate by following the steps at https://github.com/nodejs/node/issues/40672#issuecomment-1243648223"
+  ].join("\n"));
+}
+function parseALPNFromClientHello(buffer) {
+  if (buffer.length < 6)
+    return null;
+  if (buffer[0] !== 22)
+    return null;
+  let offset = 5;
+  if (buffer[offset] !== 1)
+    return null;
+  offset += 4;
+  offset += 2;
+  offset += 32;
+  if (offset >= buffer.length)
+    return null;
+  const sessionIdLength = buffer[offset];
+  offset += 1 + sessionIdLength;
+  if (offset + 2 > buffer.length)
+    return null;
+  const cipherSuitesLength = buffer.readUInt16BE(offset);
+  offset += 2 + cipherSuitesLength;
+  if (offset >= buffer.length)
+    return null;
+  const compressionMethodsLength = buffer[offset];
+  offset += 1 + compressionMethodsLength;
+  if (offset + 2 > buffer.length)
+    return null;
+  const extensionsLength = buffer.readUInt16BE(offset);
+  offset += 2;
+  const extensionsEnd = offset + extensionsLength;
+  if (extensionsEnd > buffer.length)
+    return null;
+  while (offset + 4 <= extensionsEnd) {
+    const extensionType = buffer.readUInt16BE(offset);
+    offset += 2;
+    const extensionLength = buffer.readUInt16BE(offset);
+    offset += 2;
+    if (offset + extensionLength > extensionsEnd)
+      return null;
+    if (extensionType === 16)
+      return parseALPNExtension(buffer.subarray(offset, offset + extensionLength));
+    offset += extensionLength;
+  }
+  return null;
+}
+function parseALPNExtension(buffer) {
+  if (buffer.length < 2)
+    return null;
+  const listLength = buffer.readUInt16BE(0);
+  if (listLength !== buffer.length - 2)
+    return null;
+  const protocols = [];
+  let offset = 2;
+  while (offset < buffer.length) {
+    const protocolLength = buffer[offset];
+    offset += 1;
+    if (offset + protocolLength > buffer.length)
+      break;
+    const protocol = buffer.subarray(offset, offset + protocolLength).toString("utf8");
+    protocols.push(protocol);
+    offset += protocolLength;
+  }
+  return protocols.length > 0 ? protocols : null;
+}
+var import_events4, import_http23, import_net3, import_stream3, import_tls2, getProxyForUrl2, dummyServerTlsOptions, SocksProxyConnection, ClientCertificatesProxy;
+var init_socksClientCertificatesInterceptor = __esm({
+  "packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts"() {
+    "use strict";
+    import_events4 = require("events");
+    import_http23 = __toESM(require("http2"));
+    import_net3 = __toESM(require("net"));
+    import_stream3 = __toESM(require("stream"));
+    import_tls2 = __toESM(require("tls"));
+    init_socksProxy();
+    init_debugLogger();
+    init_happyEyeballs();
+    init_stringUtils();
+    init_crypto();
+    init_stackTrace();
+    init_network();
+    init_browserContext();
+    ({ getProxyForUrl: getProxyForUrl2 } = require("./utilsBundle"));
+    dummyServerTlsOptions = void 0;
+    SocksProxyConnection = class {
+      constructor(socksProxy, uid, host, port) {
+        this._firstPackageReceived = false;
+        this._closed = false;
+        this.socksProxy = socksProxy;
+        this.uid = uid;
+        this.host = host;
+        this.port = port;
+        this._serverCloseEventListener = () => {
+          this._browserEncrypted.destroy();
+        };
+        this._browserEncrypted = new import_stream3.default.Duplex({
+          read: () => {
+          },
+          write: (data, encoding, callback) => {
+            this.socksProxy._socksProxy.sendSocketData({ uid: this.uid, data });
+            callback();
+          },
+          destroy: (error, callback) => {
+            if (error)
+              socksProxy._socksProxy.sendSocketError({ uid: this.uid, error: error.message });
+            else
+              socksProxy._socksProxy.sendSocketEnd({ uid: this.uid });
+            callback();
+          }
+        });
+      }
+      async connect() {
+        const proxyAgent = this.socksProxy._getProxyAgent(this.host, this.port);
+        if (proxyAgent)
+          this._serverEncrypted = await proxyAgent.connect(new import_events4.EventEmitter(), { host: rewriteToLocalhostIfNeeded(this.host), port: this.port, secureEndpoint: false });
+        else
+          this._serverEncrypted = await createSocket(rewriteToLocalhostIfNeeded(this.host), this.port);
+        this._serverEncrypted.once("close", this._serverCloseEventListener);
+        this._serverEncrypted.once("error", (error) => this._browserEncrypted.destroy(error));
+        if (this._closed) {
+          this._serverEncrypted.destroy();
+          return;
+        }
+        this.socksProxy._socksProxy.socketConnected({
+          uid: this.uid,
+          host: this._serverEncrypted.localAddress,
+          port: this._serverEncrypted.localPort
+        });
+      }
+      onClose() {
+        this._serverEncrypted.destroy();
+        this._browserEncrypted.destroy();
+        this._closed = true;
+      }
+      onData(data) {
+        if (!this._firstPackageReceived) {
+          this._firstPackageReceived = true;
+          const secureContext = data[0] === 22 ? this.socksProxy.secureContextMap.get(normalizeOrigin(`https://${this.host}:${this.port}`)) : void 0;
+          if (secureContext)
+            this._establishTlsTunnel(this._browserEncrypted, data, secureContext);
+          else
+            this._establishPlaintextTunnel(this._browserEncrypted);
+        }
+        this._browserEncrypted.push(data);
+      }
+      _establishPlaintextTunnel(browserEncrypted) {
+        browserEncrypted.pipe(this._serverEncrypted);
+        this._serverEncrypted.pipe(browserEncrypted);
+      }
+      _establishTlsTunnel(browserEncrypted, clientHello, secureContext) {
+        const browserALPNProtocols = parseALPNFromClientHello(clientHello) || ["http/1.1"];
+        debugLogger.log("client-certificates", `Browser->Proxy ${this.host}:${this.port} offers ALPN ${browserALPNProtocols}`);
+        const rejectUnauthorized = !this.socksProxy.ignoreHTTPSErrors;
+        const serverDecrypted = import_tls2.default.connect({
+          socket: this._serverEncrypted,
+          host: this.host,
+          port: this.port,
+          rejectUnauthorized,
+          ALPNProtocols: browserALPNProtocols,
+          servername: !import_net3.default.isIP(this.host) ? this.host : void 0,
+          secureContext
+        }, async () => {
+          const browserDecrypted = await this._upgradeToTLSIfNeeded(browserEncrypted, serverDecrypted.alpnProtocol);
+          debugLogger.log("client-certificates", `Proxy->Server ${this.host}:${this.port} chooses ALPN ${browserDecrypted.alpnProtocol}`);
+          browserDecrypted.pipe(serverDecrypted);
+          serverDecrypted.pipe(browserDecrypted);
+          const cleanup = (error) => this._serverEncrypted.destroy(error);
+          browserDecrypted.once("error", cleanup);
+          serverDecrypted.once("error", cleanup);
+          browserDecrypted.once("close", cleanup);
+          serverDecrypted.once("close", cleanup);
+          if (this._closed)
+            serverDecrypted.destroy();
+        });
+        serverDecrypted.once("error", async (error) => {
+          debugLogger.log("client-certificates", `error when connecting to server: ${error.message.replaceAll("\n", " ")}`);
+          this._serverEncrypted.removeListener("close", this._serverCloseEventListener);
+          this._serverEncrypted.destroy();
+          const browserDecrypted = await this._upgradeToTLSIfNeeded(this._browserEncrypted, serverDecrypted.alpnProtocol);
+          const responseBody = escapeHTML("Playwright client-certificate error: " + error.message).replaceAll("\n", " 
"); + if (browserDecrypted.alpnProtocol === "h2") { + if ("performServerHandshake" in import_http23.default) { + const session2 = import_http23.default.performServerHandshake(browserDecrypted); + session2.on("error", (error2) => { + this._browserEncrypted.destroy(error2); + }); + session2.once("stream", (stream3) => { + const cleanup = (error2) => { + session2.close(); + this._browserEncrypted.destroy(error2); + }; + stream3.once("end", cleanup); + stream3.once("error", cleanup); + stream3.respond({ + [import_http23.default.constants.HTTP2_HEADER_CONTENT_TYPE]: "text/html", + [import_http23.default.constants.HTTP2_HEADER_STATUS]: 503 + }); + stream3.end(responseBody); + }); + } else { + this._browserEncrypted.destroy(error); + } + } else { + browserDecrypted.end([ + "HTTP/1.1 503 Internal Server Error", + "Content-Type: text/html; charset=utf-8", + "Content-Length: " + Buffer.byteLength(responseBody), + "", + responseBody + ].join("\r\n")); + } + }); + } + async _upgradeToTLSIfNeeded(socket, alpnProtocol) { + this._brorwserDecrypted ??= new Promise((resolve, reject) => { + const dummyServer = import_tls2.default.createServer({ + ...dummyServerTlsOptions, + ALPNProtocols: [alpnProtocol || "http/1.1"] + }); + dummyServer.emit("connection", socket); + dummyServer.once("secureConnection", (tlsSocket) => { + dummyServer.close(); + resolve(tlsSocket); + }); + dummyServer.once("error", (error) => { + dummyServer.close(); + reject(error); + }); + }); + return this._brorwserDecrypted; + } + }; + ClientCertificatesProxy = class _ClientCertificatesProxy { + constructor(contextOptions) { + this._connections = /* @__PURE__ */ new Map(); + this.secureContextMap = /* @__PURE__ */ new Map(); + verifyClientCertificates(contextOptions.clientCertificates); + this.ignoreHTTPSErrors = contextOptions.ignoreHTTPSErrors; + this._proxy = contextOptions.proxy; + this._initSecureContexts(contextOptions.clientCertificates); + this._socksProxy = new SocksProxy(); + this._socksProxy.setPattern("*"); + this._socksProxy.addListener(SocksProxy.Events.SocksRequested, async (payload) => { + try { + const connection = new SocksProxyConnection(this, payload.uid, payload.host, payload.port); + await connection.connect(); + this._connections.set(payload.uid, connection); + } catch (error) { + debugLogger.log("client-certificates", `Failed to connect to ${payload.host}:${payload.port}: ${error.message}`); + this._socksProxy.socketFailed({ uid: payload.uid, errorCode: error.code }); + } + }); + this._socksProxy.addListener(SocksProxy.Events.SocksData, (payload) => { + this._connections.get(payload.uid)?.onData(payload.data); + }); + this._socksProxy.addListener(SocksProxy.Events.SocksClosed, (payload) => { + this._connections.get(payload.uid)?.onClose(); + this._connections.delete(payload.uid); + }); + loadDummyServerCertsIfNeeded(); + } + _getProxyAgent(host, port) { + const proxyFromOptions = createProxyAgent(this._proxy); + if (proxyFromOptions) + return proxyFromOptions; + const proxyFromEnv = getProxyForUrl2(`https://${host}:${port}`); + if (proxyFromEnv) + return createProxyAgent({ server: proxyFromEnv }); + } + _initSecureContexts(clientCertificates) { + const origin2certs = /* @__PURE__ */ new Map(); + for (const cert of clientCertificates || []) { + const origin = normalizeOrigin(cert.origin); + const certs = origin2certs.get(origin) || []; + certs.push(cert); + origin2certs.set(origin, certs); + } + for (const [origin, certs] of origin2certs) { + try { + this.secureContextMap.set(origin, import_tls2.default.createSecureContext(convertClientCertificatesToTLSOptions(certs))); + } catch (error) { + error = rewriteOpenSSLErrorIfNeeded(error); + throw rewriteErrorMessage(error, `Failed to load client certificate: ${error.message}`); + } + } + } + static async create(progress2, contextOptions) { + const proxy = new _ClientCertificatesProxy(contextOptions); + try { + await progress2.race(proxy._socksProxy.listen(0, "127.0.0.1")); + return proxy; + } catch (error) { + await progress2.race(proxy.close()); + throw error; + } + } + proxySettings() { + return { server: `socks5://127.0.0.1:${this._socksProxy.port()}` }; + } + async close() { + await this._socksProxy.close(); + } + }; + } +}); + +// packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts +function frameSnapshotStreamer(snapshotStreamer, removeNoScript) { + if (window[snapshotStreamer]) + return; + const kShadowAttribute = "__playwright_shadow_root_"; + const kValueAttribute = "__playwright_value_"; + const kCheckedAttribute = "__playwright_checked_"; + const kSelectedAttribute = "__playwright_selected_"; + const kScrollTopAttribute = "__playwright_scroll_top_"; + const kScrollLeftAttribute = "__playwright_scroll_left_"; + const kStyleSheetAttribute = "__playwright_style_sheet_"; + const kTargetAttribute = "__playwright_target__"; + const kCustomElementsAttribute = "__playwright_custom_elements__"; + const kCurrentSrcAttribute = "__playwright_current_src__"; + const kBoundingRectAttribute = "__playwright_bounding_rect__"; + const kPopoverOpenAttribute = "__playwright_popover_open_"; + const kDialogOpenAttribute = "__playwright_dialog_open_"; + const kSnapshotFrameId = Symbol("__playwright_snapshot_frameid_"); + const kCachedData = Symbol("__playwright_snapshot_cache_"); + const kEndOfList = Symbol("__playwright_end_of_list_"); + function resetCachedData(obj) { + delete obj[kCachedData]; + } + function ensureCachedData(obj) { + if (!obj[kCachedData]) + obj[kCachedData] = {}; + return obj[kCachedData]; + } + const kObserverConfig = { attributes: true, subtree: true }; + function removeHash2(url2) { + try { + const u = new URL(url2); + u.hash = ""; + return u.toString(); + } catch (e) { + return url2; + } + } + class Streamer { + constructor() { + this._lastSnapshotNumber = 0; + this._staleStyleSheets = /* @__PURE__ */ new Set(); + this._modifiedStyleSheets = /* @__PURE__ */ new Set(); + this._readingStyleSheet = false; + this._targetGeneration = 0; + const invalidateCSSGroupingRule = (rule) => { + if (rule.parentStyleSheet) + this._invalidateStyleSheet(rule.parentStyleSheet); + }; + this._interceptNativeMethod(window.CSSStyleSheet.prototype, "insertRule", (sheet) => this._invalidateStyleSheet(sheet)); + this._interceptNativeMethod(window.CSSStyleSheet.prototype, "deleteRule", (sheet) => this._invalidateStyleSheet(sheet)); + this._interceptNativeMethod(window.CSSStyleSheet.prototype, "addRule", (sheet) => this._invalidateStyleSheet(sheet)); + this._interceptNativeMethod(window.CSSStyleSheet.prototype, "removeRule", (sheet) => this._invalidateStyleSheet(sheet)); + this._interceptNativeGetter(window.CSSStyleSheet.prototype, "rules", (sheet) => this._invalidateStyleSheet(sheet)); + this._interceptNativeGetter(window.CSSStyleSheet.prototype, "cssRules", (sheet) => this._invalidateStyleSheet(sheet)); + this._interceptNativeMethod(window.CSSStyleSheet.prototype, "replaceSync", (sheet) => this._invalidateStyleSheet(sheet)); + this._interceptNativeMethod(window.CSSGroupingRule.prototype, "insertRule", invalidateCSSGroupingRule); + this._interceptNativeMethod(window.CSSGroupingRule.prototype, "deleteRule", invalidateCSSGroupingRule); + this._interceptNativeGetter(window.CSSGroupingRule.prototype, "cssRules", invalidateCSSGroupingRule); + this._interceptNativeSetter(window.StyleSheet.prototype, "disabled", (sheet) => { + if (sheet instanceof CSSStyleSheet) + this._invalidateStyleSheet(sheet); + }); + this._interceptNativeAsyncMethod(window.CSSStyleSheet.prototype, "replace", (sheet) => this._invalidateStyleSheet(sheet)); + this._fakeBase = document.createElement("base"); + this._observer = new MutationObserver((list) => this._handleMutations(list)); + this._ensureObservingCurrentDocument(); + } + _refreshListenersWhenNeeded() { + this._refreshListeners(); + const customEventName = "__playwright_snapshotter_global_listeners_check__"; + let seenEvent = false; + const handleCustomEvent = () => seenEvent = true; + window.addEventListener(customEventName, handleCustomEvent); + const observer = new MutationObserver((entries) => { + const newDocumentElement = entries.some((entry) => Array.from(entry.addedNodes).includes(document.documentElement)); + if (newDocumentElement) { + seenEvent = false; + window.dispatchEvent(new CustomEvent(customEventName)); + if (!seenEvent) { + window.addEventListener(customEventName, handleCustomEvent); + this._refreshListeners(); + } + } + }); + observer.observe(document, { childList: true }); + } + _refreshListeners() { + document.addEventListener("__playwright_mark_target__", (event) => { + const target = event.composedPath()[0]; + if (target?.nodeType !== Node.ELEMENT_NODE) + return; + target.__playwright_target__ = this._targetGeneration; + }); + document.addEventListener("__playwright_reset_targets__", () => { + ++this._targetGeneration; + }); + } + _interceptNativeMethod(obj, method, cb) { + const native = obj[method]; + if (!native) + return; + obj[method] = function(...args) { + const result2 = native.call(this, ...args); + cb(this, result2); + return result2; + }; + } + _interceptNativeAsyncMethod(obj, method, cb) { + const native = obj[method]; + if (!native) + return; + obj[method] = async function(...args) { + const result2 = await native.call(this, ...args); + cb(this, result2); + return result2; + }; + } + _interceptNativeGetter(obj, prop, cb) { + const descriptor = Object.getOwnPropertyDescriptor(obj, prop); + Object.defineProperty(obj, prop, { + ...descriptor, + get: function() { + const result2 = descriptor.get.call(this); + cb(this, result2); + return result2; + } + }); + } + _interceptNativeSetter(obj, prop, cb) { + const descriptor = Object.getOwnPropertyDescriptor(obj, prop); + Object.defineProperty(obj, prop, { + ...descriptor, + set: function(value2) { + const result2 = descriptor.set.call(this, value2); + cb(this, value2); + return result2; + } + }); + } + _handleMutations(list) { + for (const mutation of list) + ensureCachedData(mutation.target).attributesCached = void 0; + } + _ensureObservingCurrentDocument() { + if (this._observedDocument === document) + return; + this._observedDocument = document; + this._observer.disconnect(); + this._observer.observe(document, kObserverConfig); + this._refreshListenersWhenNeeded(); + } + _invalidateStyleSheet(sheet) { + if (this._readingStyleSheet) + return; + this._staleStyleSheets.add(sheet); + if (sheet.href !== null) + this._modifiedStyleSheets.add(sheet); + } + _updateStyleElementStyleSheetTextIfNeeded(sheet, forceText) { + const data = ensureCachedData(sheet); + if (this._staleStyleSheets.has(sheet) || forceText && data.cssText === void 0) { + this._staleStyleSheets.delete(sheet); + try { + data.cssText = this._getSheetText(sheet); + } catch (e) { + data.cssText = ""; + } + } + return data.cssText; + } + // Returns either content, ref, or no override. + _updateLinkStyleSheetTextIfNeeded(sheet, snapshotNumber) { + const data = ensureCachedData(sheet); + if (this._staleStyleSheets.has(sheet)) { + this._staleStyleSheets.delete(sheet); + try { + data.cssText = this._getSheetText(sheet); + data.cssRef = snapshotNumber; + return data.cssText; + } catch (e) { + } + } + return data.cssRef === void 0 ? void 0 : snapshotNumber - data.cssRef; + } + markIframe(iframeElement, frameId) { + iframeElement[kSnapshotFrameId] = frameId; + } + resetHistory() { + this._staleStyleSheets.clear(); + const visitNode = (node) => { + resetCachedData(node); + if (node.nodeType === Node.ELEMENT_NODE) { + const element2 = node; + if (element2.shadowRoot) + visitNode(element2.shadowRoot); + } + for (let child = node.firstChild; child; child = child.nextSibling) + visitNode(child); + }; + visitNode(document.documentElement); + visitNode(this._fakeBase); + } + __sanitizeMetaAttribute(name, value2, httpEquiv) { + if (name === "charset") + return "utf-8"; + if (httpEquiv.toLowerCase() !== "content-type" || name !== "content") + return value2; + const [type3, ...params2] = value2.split(";"); + if (type3 !== "text/html" || params2.length <= 0) + return value2; + const charsetParamIdx = params2.findIndex((param) => param.trim().startsWith("charset=")); + if (charsetParamIdx > -1) + params2[charsetParamIdx] = "charset=utf-8"; + return `${type3}; ${params2.join("; ")}`; + } + _sanitizeUrl(url2) { + if (url2.startsWith("javascript:") || url2.startsWith("vbscript:")) + return ""; + return url2; + } + _sanitizeSrcSet(srcset) { + return srcset.split(",").map((src) => { + src = src.trim(); + const spaceIndex = src.lastIndexOf(" "); + if (spaceIndex === -1) + return this._sanitizeUrl(src); + return this._sanitizeUrl(src.substring(0, spaceIndex).trim()) + src.substring(spaceIndex); + }).join(", "); + } + _resolveUrl(base, url2) { + if (url2 === "") + return ""; + try { + return new URL(url2, base).href; + } catch (e) { + return url2; + } + } + _getSheetBase(sheet) { + let rootSheet = sheet; + while (rootSheet.parentStyleSheet) + rootSheet = rootSheet.parentStyleSheet; + if (rootSheet.ownerNode) + return rootSheet.ownerNode.baseURI; + return document.baseURI; + } + _getSheetText(sheet) { + this._readingStyleSheet = true; + try { + if (sheet.disabled) + return ""; + const rules = []; + for (const rule of sheet.cssRules) + rules.push(rule.cssText); + return rules.join("\n"); + } finally { + this._readingStyleSheet = false; + } + } + captureSnapshot(reset) { + const timestamp = performance.now(); + const snapshotNumber = ++this._lastSnapshotNumber; + if (reset === "history") + this.resetHistory(); + if (reset) + ++this._targetGeneration; + let nodeCounter = 0; + let shadowDomNesting = 0; + let headNesting = 0; + this._ensureObservingCurrentDocument(); + this._handleMutations(this._observer.takeRecords()); + const definedCustomElements = /* @__PURE__ */ new Set(); + const visitNode = (node) => { + const nodeType = node.nodeType; + const nodeName = nodeType === Node.DOCUMENT_FRAGMENT_NODE ? "template" : node.nodeName; + if (nodeType !== Node.ELEMENT_NODE && nodeType !== Node.DOCUMENT_FRAGMENT_NODE && nodeType !== Node.TEXT_NODE) + return; + if (nodeName === "SCRIPT") + return; + if (nodeName === "LINK" && nodeType === Node.ELEMENT_NODE) { + const rel = node.getAttribute("rel")?.toLowerCase(); + if (rel === "preload" || rel === "prefetch") + return; + } + if (removeNoScript && nodeName === "NOSCRIPT") + return; + if (nodeName === "META") { + const httpEquiv = node.httpEquiv.toLowerCase(); + if (httpEquiv === "content-security-policy" || httpEquiv === "refresh" || httpEquiv === "set-cookie") + return; + } + if ((nodeName === "IFRAME" || nodeName === "FRAME") && headNesting) + return; + const data = ensureCachedData(node); + const values = []; + let equals = !!data.cached; + let extraNodes = 0; + const expectValue = (value2) => { + equals = equals && data.cached[values.length] === value2; + values.push(value2); + }; + const checkAndReturn = (n) => { + data.attributesCached = true; + if (equals) + return { equals: true, n: [[snapshotNumber - data.ref[0], data.ref[1]]] }; + nodeCounter += extraNodes; + data.ref = [snapshotNumber, nodeCounter++]; + data.cached = values; + return { equals: false, n }; + }; + if (nodeType === Node.TEXT_NODE) { + const value2 = node.nodeValue || ""; + expectValue(value2); + return checkAndReturn(value2); + } + if (nodeName === "STYLE") { + const sheet = node.sheet; + let cssText; + if (sheet) + cssText = this._updateStyleElementStyleSheetTextIfNeeded(sheet); + cssText = cssText || node.textContent || ""; + expectValue(cssText); + extraNodes++; + return checkAndReturn([nodeName, {}, cssText]); + } + const attrs = {}; + const result3 = [nodeName, attrs]; + const visitChild = (child) => { + const snapshot3 = visitNode(child); + if (snapshot3) { + result3.push(snapshot3.n); + expectValue(child); + equals = equals && snapshot3.equals; + } + }; + const visitChildStyleSheet = (child) => { + const snapshot3 = visitStyleSheet(child); + if (snapshot3) { + result3.push(snapshot3.n); + expectValue(child); + equals = equals && snapshot3.equals; + } + }; + if (nodeType === Node.DOCUMENT_FRAGMENT_NODE) + attrs[kShadowAttribute] = "open"; + if (nodeType === Node.ELEMENT_NODE) { + const element2 = node; + if (element2.localName.includes("-") && window.customElements?.get(element2.localName)) + definedCustomElements.add(element2.localName); + if (nodeName === "INPUT" || nodeName === "TEXTAREA") { + const value2 = element2.value; + expectValue(kValueAttribute); + expectValue(value2); + attrs[kValueAttribute] = value2; + } + if (nodeName === "INPUT" && ["checkbox", "radio"].includes(element2.type)) { + const value2 = element2.checked ? "true" : "false"; + expectValue(kCheckedAttribute); + expectValue(value2); + attrs[kCheckedAttribute] = value2; + } + if (nodeName === "OPTION") { + const value2 = element2.selected ? "true" : "false"; + expectValue(kSelectedAttribute); + expectValue(value2); + attrs[kSelectedAttribute] = value2; + } + if (nodeName === "CANVAS" || nodeName === "IFRAME" || nodeName === "FRAME") { + const boundingRect = element2.getBoundingClientRect(); + const value2 = JSON.stringify({ + left: boundingRect.left, + top: boundingRect.top, + right: boundingRect.right, + bottom: boundingRect.bottom + }); + expectValue(kBoundingRectAttribute); + expectValue(value2); + attrs[kBoundingRectAttribute] = value2; + } + if (element2.popover && element2.matches && element2.matches(":popover-open")) { + const value2 = "true"; + expectValue(kPopoverOpenAttribute); + expectValue(value2); + attrs[kPopoverOpenAttribute] = value2; + } + if (nodeName === "DIALOG" && element2.open) { + const value2 = element2.matches(":modal") ? "modal" : "true"; + expectValue(kDialogOpenAttribute); + expectValue(value2); + attrs[kDialogOpenAttribute] = value2; + } + if (element2.scrollTop) { + expectValue(kScrollTopAttribute); + expectValue(element2.scrollTop); + attrs[kScrollTopAttribute] = "" + element2.scrollTop; + } + if (element2.scrollLeft) { + expectValue(kScrollLeftAttribute); + expectValue(element2.scrollLeft); + attrs[kScrollLeftAttribute] = "" + element2.scrollLeft; + } + if (element2.shadowRoot) { + ++shadowDomNesting; + visitChild(element2.shadowRoot); + --shadowDomNesting; + } + if (element2.__playwright_target__ === this._targetGeneration) { + expectValue(kTargetAttribute); + attrs[kTargetAttribute] = ""; + } + } + if (nodeName === "HEAD") { + ++headNesting; + this._fakeBase.setAttribute("href", document.baseURI); + visitChild(this._fakeBase); + } + for (let child = node.firstChild; child; child = child.nextSibling) + visitChild(child); + if (nodeName === "HEAD") + --headNesting; + expectValue(kEndOfList); + let documentOrShadowRoot = null; + if (node.ownerDocument.documentElement === node) + documentOrShadowRoot = node.ownerDocument; + else if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) + documentOrShadowRoot = node; + if (documentOrShadowRoot) { + for (const sheet of documentOrShadowRoot.adoptedStyleSheets || []) + visitChildStyleSheet(sheet); + expectValue(kEndOfList); + } + if (nodeName === "IFRAME" || nodeName === "FRAME") { + const element2 = node; + const frameId = element2[kSnapshotFrameId]; + const name = "src"; + const value2 = frameId ? `/snapshot/${frameId}` : ""; + expectValue(name); + expectValue(value2); + attrs[name] = value2; + } + if (nodeName === "BODY" && definedCustomElements.size) { + const value2 = [...definedCustomElements].join(","); + expectValue(kCustomElementsAttribute); + expectValue(value2); + attrs[kCustomElementsAttribute] = value2; + } + if (nodeName === "IMG" || nodeName === "PICTURE") { + const value2 = nodeName === "PICTURE" ? "" : this._sanitizeUrl(node.currentSrc); + expectValue(kCurrentSrcAttribute); + expectValue(value2); + attrs[kCurrentSrcAttribute] = value2; + } + if (equals && data.attributesCached && !shadowDomNesting) + return checkAndReturn(result3); + if (nodeType === Node.ELEMENT_NODE) { + const element2 = node; + for (let i = 0; i < element2.attributes.length; i++) { + const name = element2.attributes[i].name; + if (nodeName === "LINK" && name === "integrity") + continue; + if (nodeName === "IFRAME" && (name === "src" || name === "srcdoc" || name === "sandbox")) + continue; + if (nodeName === "FRAME" && name === "src") + continue; + if (nodeName === "DIALOG" && name === "open") + continue; + let value2 = element2.attributes[i].value; + if (nodeName === "META") + value2 = this.__sanitizeMetaAttribute(name, value2, node.httpEquiv); + else if (name === "src" && nodeName === "IMG") + value2 = this._sanitizeUrl(value2); + else if (name === "srcset" && nodeName === "IMG") + value2 = this._sanitizeSrcSet(value2); + else if (name === "srcset" && nodeName === "SOURCE") + value2 = this._sanitizeSrcSet(value2); + else if (name === "href" && nodeName === "LINK") + value2 = this._sanitizeUrl(value2); + else if (name.startsWith("on")) + value2 = ""; + expectValue(name); + expectValue(value2); + attrs[name] = value2; + } + expectValue(kEndOfList); + } + if (result3.length === 2 && !Object.keys(attrs).length) + result3.pop(); + return checkAndReturn(result3); + }; + const visitStyleSheet = (sheet) => { + const data = ensureCachedData(sheet); + const oldCSSText = data.cssText; + const cssText = this._updateStyleElementStyleSheetTextIfNeeded( + sheet, + true + /* forceText */ + ); + if (cssText === oldCSSText) + return { equals: true, n: [[snapshotNumber - data.ref[0], data.ref[1]]] }; + data.ref = [snapshotNumber, nodeCounter++]; + return { + equals: false, + n: ["template", { + [kStyleSheetAttribute]: cssText + }] + }; + }; + let html; + if (document.documentElement) { + const { n } = visitNode(document.documentElement); + html = n; + } else { + html = ["html"]; + } + const result2 = { + html, + doctype: document.doctype ? document.doctype.name : void 0, + resourceOverrides: [], + viewport: { + width: window.innerWidth, + height: window.innerHeight + }, + url: location.href, + wallTime: Date.now(), + collectionTime: 0 + }; + for (const sheet of this._modifiedStyleSheets) { + if (sheet.href === null) + continue; + const content = this._updateLinkStyleSheetTextIfNeeded(sheet, snapshotNumber); + if (content === void 0) { + continue; + } + const base = this._getSheetBase(sheet); + const url2 = removeHash2(this._resolveUrl(base, sheet.href)); + result2.resourceOverrides.push({ url: url2, content, contentType: "text/css" }); + } + result2.collectionTime = performance.now() - timestamp; + return result2; + } + } + window[snapshotStreamer] = new Streamer(); +} +var init_snapshotterInjected = __esm({ + "packages/playwright-core/src/server/trace/recorder/snapshotterInjected.ts"() { + "use strict"; + } +}); + +// packages/playwright-core/src/server/trace/recorder/snapshotter.ts +var mime3, Snapshotter, kNeedsResetSymbol; +var init_snapshotter = __esm({ + "packages/playwright-core/src/server/trace/recorder/snapshotter.ts"() { + "use strict"; + init_time(); + init_crypto(); + init_debugLogger(); + init_eventsHelper(); + init_snapshotterInjected(); + init_browserContext(); + init_progress(); + mime3 = require("./utilsBundle").mime; + Snapshotter = class { + constructor(context2, delegate) { + this._eventListeners = []; + this._started = false; + this._context = context2; + this._delegate = delegate; + const guid = createGuid(); + this._snapshotStreamer = "__playwright_snapshot_streamer_" + guid; + } + started() { + return this._started; + } + async start(progress2) { + this._started = true; + if (!this._initScript) + await this._initialize(progress2); + await progress2.race(this.reset()); + } + async reset() { + if (this._started) + await this._context.safeNonStallingEvaluateInAllFrames(`window["${this._snapshotStreamer}"].resetHistory()`, "main"); + } + stop() { + this._started = false; + } + async resetForReuse() { + if (this._initScript) { + eventsHelper.removeEventListeners(this._eventListeners); + await this._initScript.dispose(); + this._initScript = void 0; + } + } + async _initialize(progress2) { + for (const page of this._context.pages()) + this._onPage(page); + this._eventListeners = [ + eventsHelper.addEventListener(this._context, BrowserContext.Events.Page, this._onPage.bind(this)), + eventsHelper.addEventListener(this._context, BrowserContext.Events.FrameAttached, (frame) => this._annotateFrameHierarchy(frame)) + ]; + const { javaScriptEnabled } = this._context._options; + const initScriptSource = `(${frameSnapshotStreamer})("${this._snapshotStreamer}", ${javaScriptEnabled || javaScriptEnabled === void 0})`; + this._initScript = await this._context.addInitScript(progress2, initScriptSource); + await progress2.race(this._context.safeNonStallingEvaluateInAllFrames(initScriptSource, "main")); + } + dispose() { + eventsHelper.removeEventListeners(this._eventListeners); + } + async _captureFrameSnapshot(frame, resetTargets) { + const needsHistoryReset = !!frame[kNeedsResetSymbol]; + frame[kNeedsResetSymbol] = false; + const reset = needsHistoryReset ? "history" : resetTargets ? "targets" : void 0; + const expression2 = `window["${this._snapshotStreamer}"].captureSnapshot(${JSON.stringify(reset)})`; + try { + return await frame.nonStallingRawEvaluateInExistingMainContext(expression2); + } catch (e) { + frame[kNeedsResetSymbol] = true; + debugLogger.log("error", e); + } + } + async captureSnapshot(page, callId, snapshotName, resetTargets) { + const snapshots = page.frames().map(async (frame) => { + const data = await this._captureFrameSnapshot(frame, resetTargets); + if (!data || !this._started) + return; + const snapshot3 = { + callId, + snapshotName, + pageId: page.guid, + frameId: frame.guid, + frameUrl: data.url, + doctype: data.doctype, + html: data.html, + viewport: data.viewport, + timestamp: monotonicTime(), + wallTime: data.wallTime, + collectionTime: data.collectionTime, + resourceOverrides: [], + isMainFrame: page.mainFrame() === frame + }; + for (const { url: url2, content, contentType } of data.resourceOverrides) { + if (typeof content === "string") { + const buffer = Buffer.from(content); + const sha1 = calculateSha1(buffer) + "." + (mime3.getExtension(contentType) || "dat"); + this._delegate.onSnapshotterBlob({ sha1, buffer }); + snapshot3.resourceOverrides.push({ url: url2, sha1 }); + } else { + snapshot3.resourceOverrides.push({ url: url2, ref: content }); + } + } + this._delegate.onFrameSnapshot(snapshot3); + }); + await Promise.all(snapshots); + } + _onPage(page) { + for (const frame of page.frames()) + this._annotateFrameHierarchy(frame); + } + _annotateFrameHierarchy(frame) { + (async () => { + const frameElement = await frame.frameElement(nullProgress); + const parent = frame.parentFrame(); + if (!parent) + return; + const context2 = await parent.mainContext(); + await context2?.evaluate(({ snapshotStreamer, frameElement: frameElement2, frameId }) => { + window[snapshotStreamer].markIframe(frameElement2, frameId); + }, { snapshotStreamer: this._snapshotStreamer, frameElement, frameId: frame.guid }); + frameElement.dispose(); + })().catch(() => { + }); + } + }; + kNeedsResetSymbol = Symbol("kNeedsReset"); + } +}); + +// packages/playwright-core/src/server/artifact.ts +var import_fs12, Artifact; +var init_artifact = __esm({ + "packages/playwright-core/src/server/artifact.ts"() { + "use strict"; + import_fs12 = __toESM(require("fs")); + init_manualPromise(); + init_assert(); + init_errors(); + init_instrumentation(); + Artifact = class extends SdkObject { + constructor(parent, localPath, unaccessibleErrorMessage, cancelCallback) { + super(parent, "artifact"); + this._finishedPromise = new ManualPromise(); + this._saveCallbacks = []; + this._finished = false; + this._deleted = false; + this._localPath = localPath; + this._unaccessibleErrorMessage = unaccessibleErrorMessage; + this._cancelCallback = cancelCallback; + } + async localPathAfterFinished(progress2) { + return await progress2.race(this._localPathAfterFinished()); + } + async failureError(progress2) { + return await progress2.race(this._failureError()); + } + async cancel(progress2) { + return await progress2.race(this._cancel()); + } + async delete(progress2) { + return await progress2.race(this._delete()); + } + localPath() { + return this._localPath; + } + async _localPathAfterFinished() { + if (this._unaccessibleErrorMessage) + throw new Error(this._unaccessibleErrorMessage); + await this._finishedPromise; + if (this._failureErrorValue) + throw this._failureErrorValue; + return this._localPath; + } + saveAs(progress2, saveCallback) { + if (this._unaccessibleErrorMessage) + throw new Error(this._unaccessibleErrorMessage); + if (this._deleted) + throw new Error(`File already deleted. Save before deleting.`); + if (this._failureErrorValue) + throw this._failureErrorValue; + if (this._finished) { + saveCallback(this._localPath).catch(() => { + }); + return; + } + this._saveCallbacks.push(saveCallback); + } + async _failureError() { + if (this._unaccessibleErrorMessage) + return this._unaccessibleErrorMessage; + await this._finishedPromise; + return this._failureErrorValue?.message || null; + } + async _cancel() { + assert(this._cancelCallback !== void 0); + return this._cancelCallback(); + } + async _delete() { + if (this._unaccessibleErrorMessage) + return; + const fileName = await this._localPathAfterFinished(); + if (this._deleted) + return; + this._deleted = true; + if (fileName) + await import_fs12.default.promises.unlink(fileName).catch((e) => { + }); + } + async deleteOnContextClose() { + if (this._deleted) + return; + this._deleted = true; + if (!this._unaccessibleErrorMessage) + await import_fs12.default.promises.unlink(this._localPath).catch((e) => { + }); + await this.reportFinished(new TargetClosedError(this.closeReason())); + } + async reportFinished(error) { + if (this._finished) + return; + this._finished = true; + this._failureErrorValue = error; + if (error) { + for (const callback of this._saveCallbacks) + await callback("", error); + } else { + for (const callback of this._saveCallbacks) + await callback(this._localPath); + } + this._saveCallbacks = []; + this._finishedPromise.resolve(); + } + }; + } +}); + +// packages/playwright-core/src/protocol/validatorPrimitives.ts +function findValidator(type3, method, kind) { + const validator = maybeFindValidator(type3, method, kind); + if (!validator) + throw new ValidationError(`Unknown scheme for ${kind}: ${type3}.${method}`); + return validator; +} +function maybeFindValidator(type3, method, kind) { + const schemeName = type3 + (kind === "Initializer" ? "" : method[0].toUpperCase() + method.substring(1)) + kind; + return scheme[schemeName]; +} +function createMetadataValidator() { + return tOptional(scheme["Metadata"]); +} +function createWaitInfoValidator() { + return scheme["WaitInfo"]; +} +var ValidationError, scheme, tFloat, tInt, tBoolean, tString, tBinary, tAny, tOptional, tArray, tObject, tEnum, tChannel, tType; +var init_validatorPrimitives = __esm({ + "packages/playwright-core/src/protocol/validatorPrimitives.ts"() { + "use strict"; + ValidationError = class extends Error { + }; + scheme = {}; + tFloat = (arg, path59, context2) => { + if (arg instanceof Number) + return arg.valueOf(); + if (typeof arg === "number") + return arg; + throw new ValidationError(`${path59}: expected float, got ${typeof arg}`); + }; + tInt = (arg, path59, context2) => { + let value2; + if (arg instanceof Number) + value2 = arg.valueOf(); + else if (typeof arg === "number") + value2 = arg; + else + throw new ValidationError(`${path59}: expected integer, got ${typeof arg}`); + if (!Number.isInteger(value2)) + throw new ValidationError(`${path59}: expected integer, got float ${value2}`); + return value2; + }; + tBoolean = (arg, path59, context2) => { + if (arg instanceof Boolean) + return arg.valueOf(); + if (typeof arg === "boolean") + return arg; + throw new ValidationError(`${path59}: expected boolean, got ${typeof arg}`); + }; + tString = (arg, path59, context2) => { + if (arg instanceof String) + return arg.valueOf(); + if (typeof arg === "string") + return arg; + throw new ValidationError(`${path59}: expected string, got ${typeof arg}`); + }; + tBinary = (arg, path59, context2) => { + if (context2.binary === "fromBase64") { + if (arg instanceof String) + return Buffer.from(arg.valueOf(), "base64"); + if (typeof arg === "string") + return Buffer.from(arg, "base64"); + throw new ValidationError(`${path59}: expected base64-encoded buffer, got ${typeof arg}`); + } + if (context2.binary === "toBase64") { + if (!(arg instanceof Buffer)) + throw new ValidationError(`${path59}: expected Buffer, got ${typeof arg}`); + return arg.toString("base64"); + } + if (context2.binary === "buffer") { + if (!(arg instanceof Buffer) && !(arg instanceof Object)) + throw new ValidationError(`${path59}: expected Buffer, got ${typeof arg}`); + return arg; + } + throw new ValidationError(`Unsupported binary behavior "${context2.binary}"`); + }; + tAny = (arg, path59, context2) => { + return arg; + }; + tOptional = (v) => { + return (arg, path59, context2) => { + if (Object.is(arg, void 0)) + return arg; + return v(arg, path59, context2); + }; + }; + tArray = (v) => { + return (arg, path59, context2) => { + if (!Array.isArray(arg)) + throw new ValidationError(`${path59}: expected array, got ${typeof arg}`); + return arg.map((x, index) => v(x, path59 + "[" + index + "]", context2)); + }; + }; + tObject = (s) => { + return (arg, path59, context2) => { + if (Object.is(arg, null)) + throw new ValidationError(`${path59}: expected object, got null`); + if (typeof arg !== "object") + throw new ValidationError(`${path59}: expected object, got ${typeof arg}`); + const result2 = {}; + for (const [key, v] of Object.entries(s)) { + const value2 = v(arg[key], path59 ? path59 + "." + key : key, context2); + if (!Object.is(value2, void 0)) + result2[key] = value2; + } + if (context2.isUnderTest()) { + for (const [key, value2] of Object.entries(arg)) { + if (key.startsWith("__testHook")) + result2[key] = value2; + } + } + return result2; + }; + }; + tEnum = (e) => { + return (arg, path59, context2) => { + if (!e.includes(arg)) + throw new ValidationError(`${path59}: expected one of (${e.join("|")})`); + return arg; + }; + }; + tChannel = (names) => { + return (arg, path59, context2) => { + return context2.tChannelImpl(names, arg, path59, context2); + }; + }; + tType = (name) => { + return (arg, path59, context2) => { + const v = scheme[name]; + if (!v) + throw new ValidationError(path59 + ': unknown type "' + name + '"'); + return v(arg, path59, context2); + }; + }; + } +}); + +// packages/playwright-core/src/protocol/validator.ts +var init_validator = __esm({ + "packages/playwright-core/src/protocol/validator.ts"() { + "use strict"; + init_validatorPrimitives(); + init_validatorPrimitives(); + scheme.AndroidInitializer = tOptional(tObject({})); + scheme.AndroidDevicesParams = tObject({ + host: tOptional(tString), + port: tOptional(tInt), + omitDriverInstall: tOptional(tBoolean) + }); + scheme.AndroidDevicesResult = tObject({ + devices: tArray(tChannel(["AndroidDevice"])) + }); + scheme.AndroidSocketInitializer = tOptional(tObject({})); + scheme.AndroidSocketDataEvent = tObject({ + data: tBinary + }); + scheme.AndroidSocketCloseEvent = tOptional(tObject({})); + scheme.AndroidSocketWriteParams = tObject({ + data: tBinary + }); + scheme.AndroidSocketWriteResult = tOptional(tObject({})); + scheme.AndroidSocketCloseParams = tOptional(tObject({})); + scheme.AndroidSocketCloseResult = tOptional(tObject({})); + scheme.AndroidDeviceInitializer = tObject({ + model: tString, + serial: tString + }); + scheme.AndroidDeviceCloseEvent = tOptional(tObject({})); + scheme.AndroidDeviceWebViewAddedEvent = tObject({ + webView: tType("AndroidWebView") + }); + scheme.AndroidDeviceWebViewRemovedEvent = tObject({ + socketName: tString + }); + scheme.AndroidDeviceWaitParams = tObject({ + androidSelector: tType("AndroidSelector"), + state: tOptional(tEnum(["gone"])), + timeout: tFloat + }); + scheme.AndroidDeviceWaitResult = tOptional(tObject({})); + scheme.AndroidDeviceFillParams = tObject({ + androidSelector: tType("AndroidSelector"), + text: tString, + timeout: tFloat + }); + scheme.AndroidDeviceFillResult = tOptional(tObject({})); + scheme.AndroidDeviceTapParams = tObject({ + androidSelector: tType("AndroidSelector"), + duration: tOptional(tFloat), + timeout: tFloat + }); + scheme.AndroidDeviceTapResult = tOptional(tObject({})); + scheme.AndroidDeviceDragParams = tObject({ + androidSelector: tType("AndroidSelector"), + dest: tType("Point"), + speed: tOptional(tFloat), + timeout: tFloat + }); + scheme.AndroidDeviceDragResult = tOptional(tObject({})); + scheme.AndroidDeviceFlingParams = tObject({ + androidSelector: tType("AndroidSelector"), + direction: tEnum(["up", "down", "left", "right"]), + speed: tOptional(tFloat), + timeout: tFloat + }); + scheme.AndroidDeviceFlingResult = tOptional(tObject({})); + scheme.AndroidDeviceLongTapParams = tObject({ + androidSelector: tType("AndroidSelector"), + timeout: tFloat + }); + scheme.AndroidDeviceLongTapResult = tOptional(tObject({})); + scheme.AndroidDevicePinchCloseParams = tObject({ + androidSelector: tType("AndroidSelector"), + percent: tFloat, + speed: tOptional(tFloat), + timeout: tFloat + }); + scheme.AndroidDevicePinchCloseResult = tOptional(tObject({})); + scheme.AndroidDevicePinchOpenParams = tObject({ + androidSelector: tType("AndroidSelector"), + percent: tFloat, + speed: tOptional(tFloat), + timeout: tFloat + }); + scheme.AndroidDevicePinchOpenResult = tOptional(tObject({})); + scheme.AndroidDeviceScrollParams = tObject({ + androidSelector: tType("AndroidSelector"), + direction: tEnum(["up", "down", "left", "right"]), + percent: tFloat, + speed: tOptional(tFloat), + timeout: tFloat + }); + scheme.AndroidDeviceScrollResult = tOptional(tObject({})); + scheme.AndroidDeviceSwipeParams = tObject({ + androidSelector: tType("AndroidSelector"), + direction: tEnum(["up", "down", "left", "right"]), + percent: tFloat, + speed: tOptional(tFloat), + timeout: tFloat + }); + scheme.AndroidDeviceSwipeResult = tOptional(tObject({})); + scheme.AndroidDeviceInfoParams = tObject({ + androidSelector: tType("AndroidSelector") + }); + scheme.AndroidDeviceInfoResult = tObject({ + info: tType("AndroidElementInfo") + }); + scheme.AndroidDeviceScreenshotParams = tOptional(tObject({})); + scheme.AndroidDeviceScreenshotResult = tObject({ + binary: tBinary + }); + scheme.AndroidDeviceInputTypeParams = tObject({ + text: tString + }); + scheme.AndroidDeviceInputTypeResult = tOptional(tObject({})); + scheme.AndroidDeviceInputPressParams = tObject({ + key: tString + }); + scheme.AndroidDeviceInputPressResult = tOptional(tObject({})); + scheme.AndroidDeviceInputTapParams = tObject({ + point: tType("Point") + }); + scheme.AndroidDeviceInputTapResult = tOptional(tObject({})); + scheme.AndroidDeviceInputSwipeParams = tObject({ + segments: tArray(tType("Point")), + steps: tInt + }); + scheme.AndroidDeviceInputSwipeResult = tOptional(tObject({})); + scheme.AndroidDeviceInputDragParams = tObject({ + from: tType("Point"), + to: tType("Point"), + steps: tInt + }); + scheme.AndroidDeviceInputDragResult = tOptional(tObject({})); + scheme.AndroidDeviceLaunchBrowserParams = tObject({ + noDefaultViewport: tOptional(tBoolean), + viewport: tOptional(tObject({ + width: tInt, + height: tInt + })), + screen: tOptional(tObject({ + width: tInt, + height: tInt + })), + ignoreHTTPSErrors: tOptional(tBoolean), + clientCertificates: tOptional(tArray(tObject({ + origin: tString, + cert: tOptional(tBinary), + key: tOptional(tBinary), + passphrase: tOptional(tString), + pfx: tOptional(tBinary) + }))), + javaScriptEnabled: tOptional(tBoolean), + bypassCSP: tOptional(tBoolean), + userAgent: tOptional(tString), + locale: tOptional(tString), + timezoneId: tOptional(tString), + geolocation: tOptional(tObject({ + longitude: tFloat, + latitude: tFloat, + accuracy: tOptional(tFloat) + })), + permissions: tOptional(tArray(tString)), + extraHTTPHeaders: tOptional(tArray(tType("NameValue"))), + offline: tOptional(tBoolean), + httpCredentials: tOptional(tObject({ + username: tString, + password: tString, + origin: tOptional(tString), + send: tOptional(tEnum(["always", "unauthorized"])) + })), + deviceScaleFactor: tOptional(tFloat), + isMobile: tOptional(tBoolean), + hasTouch: tOptional(tBoolean), + colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])), + reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])), + forcedColors: tOptional(tEnum(["active", "none", "no-override"])), + acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])), + contrast: tOptional(tEnum(["no-preference", "more", "no-override"])), + baseURL: tOptional(tString), + recordVideo: tOptional(tObject({ + dir: tOptional(tString), + size: tOptional(tObject({ + width: tInt, + height: tInt + })), + showActions: tOptional(tObject({ + duration: tOptional(tFloat), + position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])), + fontSize: tOptional(tInt), + cursor: tOptional(tEnum(["none", "pointer"])) + })) + })), + strictSelectors: tOptional(tBoolean), + serviceWorkers: tOptional(tEnum(["allow", "block"])), + selectorEngines: tOptional(tArray(tType("SelectorEngine"))), + testIdAttributeName: tOptional(tString), + pkg: tOptional(tString), + args: tOptional(tArray(tString)), + proxy: tOptional(tObject({ + server: tString, + bypass: tOptional(tString), + username: tOptional(tString), + password: tOptional(tString) + })) + }); + scheme.AndroidDeviceLaunchBrowserResult = tObject({ + context: tChannel(["BrowserContext"]) + }); + scheme.AndroidDeviceOpenParams = tObject({ + command: tString + }); + scheme.AndroidDeviceOpenResult = tObject({ + socket: tChannel(["AndroidSocket"]) + }); + scheme.AndroidDeviceShellParams = tObject({ + command: tString + }); + scheme.AndroidDeviceShellResult = tObject({ + result: tBinary + }); + scheme.AndroidDeviceInstallApkParams = tObject({ + file: tBinary, + args: tOptional(tArray(tString)) + }); + scheme.AndroidDeviceInstallApkResult = tOptional(tObject({})); + scheme.AndroidDevicePushParams = tObject({ + file: tBinary, + path: tString, + mode: tOptional(tInt) + }); + scheme.AndroidDevicePushResult = tOptional(tObject({})); + scheme.AndroidDeviceConnectToWebViewParams = tObject({ + socketName: tString + }); + scheme.AndroidDeviceConnectToWebViewResult = tObject({ + context: tChannel(["BrowserContext"]) + }); + scheme.AndroidDeviceCloseParams = tOptional(tObject({})); + scheme.AndroidDeviceCloseResult = tOptional(tObject({})); + scheme.AndroidWebView = tObject({ + pid: tInt, + pkg: tString, + socketName: tString + }); + scheme.AndroidSelector = tObject({ + checkable: tOptional(tBoolean), + checked: tOptional(tBoolean), + clazz: tOptional(tString), + clickable: tOptional(tBoolean), + depth: tOptional(tInt), + desc: tOptional(tString), + enabled: tOptional(tBoolean), + focusable: tOptional(tBoolean), + focused: tOptional(tBoolean), + hasChild: tOptional(tObject({ + androidSelector: tType("AndroidSelector") + })), + hasDescendant: tOptional(tObject({ + androidSelector: tType("AndroidSelector"), + maxDepth: tOptional(tInt) + })), + longClickable: tOptional(tBoolean), + pkg: tOptional(tString), + res: tOptional(tString), + scrollable: tOptional(tBoolean), + selected: tOptional(tBoolean), + text: tOptional(tString) + }); + scheme.AndroidElementInfo = tObject({ + children: tOptional(tArray(tType("AndroidElementInfo"))), + clazz: tString, + desc: tString, + res: tString, + pkg: tString, + text: tString, + bounds: tType("Rect"), + checkable: tBoolean, + checked: tBoolean, + clickable: tBoolean, + enabled: tBoolean, + focusable: tBoolean, + focused: tBoolean, + longClickable: tBoolean, + scrollable: tBoolean, + selected: tBoolean + }); + scheme.APIRequestContextInitializer = tObject({ + tracing: tChannel(["Tracing"]) + }); + scheme.APIRequestContextFetchParams = tObject({ + url: tString, + encodedParams: tOptional(tString), + params: tOptional(tArray(tType("NameValue"))), + method: tOptional(tString), + headers: tOptional(tArray(tType("NameValue"))), + postData: tOptional(tBinary), + jsonData: tOptional(tString), + formData: tOptional(tArray(tType("NameValue"))), + multipartData: tOptional(tArray(tType("FormField"))), + timeout: tFloat, + failOnStatusCode: tOptional(tBoolean), + ignoreHTTPSErrors: tOptional(tBoolean), + maxRedirects: tOptional(tInt), + maxRetries: tOptional(tInt) + }); + scheme.APIRequestContextFetchResult = tObject({ + response: tType("APIResponse") + }); + scheme.APIRequestContextFetchResponseBodyParams = tObject({ + fetchUid: tString + }); + scheme.APIRequestContextFetchResponseBodyResult = tObject({ + binary: tOptional(tBinary) + }); + scheme.APIRequestContextFetchLogParams = tObject({ + fetchUid: tString + }); + scheme.APIRequestContextFetchLogResult = tObject({ + log: tArray(tString) + }); + scheme.APIRequestContextStorageStateParams = tObject({ + indexedDB: tOptional(tBoolean) + }); + scheme.APIRequestContextStorageStateResult = tObject({ + cookies: tArray(tType("NetworkCookie")), + origins: tArray(tType("OriginStorage")) + }); + scheme.APIRequestContextDisposeAPIResponseParams = tObject({ + fetchUid: tString + }); + scheme.APIRequestContextDisposeAPIResponseResult = tOptional(tObject({})); + scheme.APIRequestContextDisposeParams = tObject({ + reason: tOptional(tString) + }); + scheme.APIRequestContextDisposeResult = tOptional(tObject({})); + scheme.APIResponse = tObject({ + fetchUid: tString, + url: tString, + status: tInt, + statusText: tString, + headers: tArray(tType("NameValue")), + securityDetails: tOptional(tType("SecurityDetails")), + serverAddr: tOptional(tType("RemoteAddr")) + }); + scheme.ArtifactInitializer = tObject({ + absolutePath: tString + }); + scheme.ArtifactPathAfterFinishedParams = tOptional(tObject({})); + scheme.ArtifactPathAfterFinishedResult = tObject({ + value: tString + }); + scheme.ArtifactSaveAsParams = tObject({ + path: tString + }); + scheme.ArtifactSaveAsResult = tOptional(tObject({})); + scheme.ArtifactSaveAsStreamParams = tOptional(tObject({})); + scheme.ArtifactSaveAsStreamResult = tObject({ + stream: tChannel(["Stream"]) + }); + scheme.ArtifactFailureParams = tOptional(tObject({})); + scheme.ArtifactFailureResult = tObject({ + error: tOptional(tString) + }); + scheme.ArtifactStreamParams = tOptional(tObject({})); + scheme.ArtifactStreamResult = tObject({ + stream: tChannel(["Stream"]) + }); + scheme.ArtifactCancelParams = tOptional(tObject({})); + scheme.ArtifactCancelResult = tOptional(tObject({})); + scheme.ArtifactDeleteParams = tOptional(tObject({})); + scheme.ArtifactDeleteResult = tOptional(tObject({})); + scheme.StreamInitializer = tOptional(tObject({})); + scheme.StreamReadParams = tObject({ + size: tOptional(tInt) + }); + scheme.StreamReadResult = tObject({ + binary: tBinary + }); + scheme.StreamCloseParams = tOptional(tObject({})); + scheme.StreamCloseResult = tOptional(tObject({})); + scheme.WritableStreamInitializer = tOptional(tObject({})); + scheme.WritableStreamWriteParams = tObject({ + binary: tBinary + }); + scheme.WritableStreamWriteResult = tOptional(tObject({})); + scheme.WritableStreamCloseParams = tOptional(tObject({})); + scheme.WritableStreamCloseResult = tOptional(tObject({})); + scheme.BrowserInitializer = tObject({ + version: tString, + name: tString, + browserName: tEnum(["chromium", "firefox", "webkit"]) + }); + scheme.BrowserContextEvent = tObject({ + context: tChannel(["BrowserContext"]) + }); + scheme.BrowserCloseEvent = tOptional(tObject({})); + scheme.BrowserStartServerParams = tObject({ + title: tString, + workspaceDir: tOptional(tString), + metadata: tOptional(tAny), + host: tOptional(tString), + port: tOptional(tInt) + }); + scheme.BrowserStartServerResult = tObject({ + endpoint: tString + }); + scheme.BrowserStopServerParams = tOptional(tObject({})); + scheme.BrowserStopServerResult = tOptional(tObject({})); + scheme.BrowserCloseParams = tObject({ + reason: tOptional(tString) + }); + scheme.BrowserCloseResult = tOptional(tObject({})); + scheme.BrowserKillForTestsParams = tOptional(tObject({})); + scheme.BrowserKillForTestsResult = tOptional(tObject({})); + scheme.BrowserDefaultUserAgentForTestParams = tOptional(tObject({})); + scheme.BrowserDefaultUserAgentForTestResult = tObject({ + userAgent: tString + }); + scheme.BrowserNewContextParams = tObject({ + noDefaultViewport: tOptional(tBoolean), + viewport: tOptional(tObject({ + width: tInt, + height: tInt + })), + screen: tOptional(tObject({ + width: tInt, + height: tInt + })), + ignoreHTTPSErrors: tOptional(tBoolean), + clientCertificates: tOptional(tArray(tObject({ + origin: tString, + cert: tOptional(tBinary), + key: tOptional(tBinary), + passphrase: tOptional(tString), + pfx: tOptional(tBinary) + }))), + javaScriptEnabled: tOptional(tBoolean), + bypassCSP: tOptional(tBoolean), + userAgent: tOptional(tString), + locale: tOptional(tString), + timezoneId: tOptional(tString), + geolocation: tOptional(tObject({ + longitude: tFloat, + latitude: tFloat, + accuracy: tOptional(tFloat) + })), + permissions: tOptional(tArray(tString)), + extraHTTPHeaders: tOptional(tArray(tType("NameValue"))), + offline: tOptional(tBoolean), + httpCredentials: tOptional(tObject({ + username: tString, + password: tString, + origin: tOptional(tString), + send: tOptional(tEnum(["always", "unauthorized"])) + })), + deviceScaleFactor: tOptional(tFloat), + isMobile: tOptional(tBoolean), + hasTouch: tOptional(tBoolean), + colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])), + reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])), + forcedColors: tOptional(tEnum(["active", "none", "no-override"])), + acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])), + contrast: tOptional(tEnum(["no-preference", "more", "no-override"])), + baseURL: tOptional(tString), + recordVideo: tOptional(tObject({ + dir: tOptional(tString), + size: tOptional(tObject({ + width: tInt, + height: tInt + })), + showActions: tOptional(tObject({ + duration: tOptional(tFloat), + position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])), + fontSize: tOptional(tInt), + cursor: tOptional(tEnum(["none", "pointer"])) + })) + })), + strictSelectors: tOptional(tBoolean), + serviceWorkers: tOptional(tEnum(["allow", "block"])), + selectorEngines: tOptional(tArray(tType("SelectorEngine"))), + testIdAttributeName: tOptional(tString), + proxy: tOptional(tObject({ + server: tString, + bypass: tOptional(tString), + username: tOptional(tString), + password: tOptional(tString) + })), + storageState: tOptional(tObject({ + cookies: tOptional(tArray(tType("SetNetworkCookie"))), + origins: tOptional(tArray(tType("SetOriginStorage"))) + })) + }); + scheme.BrowserNewContextResult = tObject({ + context: tChannel(["BrowserContext"]) + }); + scheme.BrowserNewContextForReuseParams = tObject({ + noDefaultViewport: tOptional(tBoolean), + viewport: tOptional(tObject({ + width: tInt, + height: tInt + })), + screen: tOptional(tObject({ + width: tInt, + height: tInt + })), + ignoreHTTPSErrors: tOptional(tBoolean), + clientCertificates: tOptional(tArray(tObject({ + origin: tString, + cert: tOptional(tBinary), + key: tOptional(tBinary), + passphrase: tOptional(tString), + pfx: tOptional(tBinary) + }))), + javaScriptEnabled: tOptional(tBoolean), + bypassCSP: tOptional(tBoolean), + userAgent: tOptional(tString), + locale: tOptional(tString), + timezoneId: tOptional(tString), + geolocation: tOptional(tObject({ + longitude: tFloat, + latitude: tFloat, + accuracy: tOptional(tFloat) + })), + permissions: tOptional(tArray(tString)), + extraHTTPHeaders: tOptional(tArray(tType("NameValue"))), + offline: tOptional(tBoolean), + httpCredentials: tOptional(tObject({ + username: tString, + password: tString, + origin: tOptional(tString), + send: tOptional(tEnum(["always", "unauthorized"])) + })), + deviceScaleFactor: tOptional(tFloat), + isMobile: tOptional(tBoolean), + hasTouch: tOptional(tBoolean), + colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])), + reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])), + forcedColors: tOptional(tEnum(["active", "none", "no-override"])), + acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])), + contrast: tOptional(tEnum(["no-preference", "more", "no-override"])), + baseURL: tOptional(tString), + recordVideo: tOptional(tObject({ + dir: tOptional(tString), + size: tOptional(tObject({ + width: tInt, + height: tInt + })), + showActions: tOptional(tObject({ + duration: tOptional(tFloat), + position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])), + fontSize: tOptional(tInt), + cursor: tOptional(tEnum(["none", "pointer"])) + })) + })), + strictSelectors: tOptional(tBoolean), + serviceWorkers: tOptional(tEnum(["allow", "block"])), + selectorEngines: tOptional(tArray(tType("SelectorEngine"))), + testIdAttributeName: tOptional(tString), + proxy: tOptional(tObject({ + server: tString, + bypass: tOptional(tString), + username: tOptional(tString), + password: tOptional(tString) + })), + storageState: tOptional(tObject({ + cookies: tOptional(tArray(tType("SetNetworkCookie"))), + origins: tOptional(tArray(tType("SetOriginStorage"))) + })) + }); + scheme.BrowserNewContextForReuseResult = tObject({ + context: tChannel(["BrowserContext"]) + }); + scheme.BrowserDisconnectFromReusedContextParams = tObject({ + reason: tString + }); + scheme.BrowserDisconnectFromReusedContextResult = tOptional(tObject({})); + scheme.BrowserNewBrowserCDPSessionParams = tOptional(tObject({})); + scheme.BrowserNewBrowserCDPSessionResult = tObject({ + session: tChannel(["CDPSession"]) + }); + scheme.BrowserStartTracingParams = tObject({ + page: tOptional(tChannel(["Page"])), + screenshots: tOptional(tBoolean), + categories: tOptional(tArray(tString)) + }); + scheme.BrowserStartTracingResult = tOptional(tObject({})); + scheme.BrowserStopTracingParams = tOptional(tObject({})); + scheme.BrowserStopTracingResult = tObject({ + artifact: tChannel(["Artifact"]) + }); + scheme.BrowserContextInitializer = tObject({ + debugger: tChannel(["Debugger"]), + requestContext: tChannel(["APIRequestContext"]), + tracing: tChannel(["Tracing"]), + options: tObject({ + noDefaultViewport: tOptional(tBoolean), + viewport: tOptional(tObject({ + width: tInt, + height: tInt + })), + screen: tOptional(tObject({ + width: tInt, + height: tInt + })), + ignoreHTTPSErrors: tOptional(tBoolean), + clientCertificates: tOptional(tArray(tObject({ + origin: tString, + cert: tOptional(tBinary), + key: tOptional(tBinary), + passphrase: tOptional(tString), + pfx: tOptional(tBinary) + }))), + javaScriptEnabled: tOptional(tBoolean), + bypassCSP: tOptional(tBoolean), + userAgent: tOptional(tString), + locale: tOptional(tString), + timezoneId: tOptional(tString), + geolocation: tOptional(tObject({ + longitude: tFloat, + latitude: tFloat, + accuracy: tOptional(tFloat) + })), + permissions: tOptional(tArray(tString)), + extraHTTPHeaders: tOptional(tArray(tType("NameValue"))), + offline: tOptional(tBoolean), + httpCredentials: tOptional(tObject({ + username: tString, + password: tString, + origin: tOptional(tString), + send: tOptional(tEnum(["always", "unauthorized"])) + })), + deviceScaleFactor: tOptional(tFloat), + isMobile: tOptional(tBoolean), + hasTouch: tOptional(tBoolean), + colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])), + reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])), + forcedColors: tOptional(tEnum(["active", "none", "no-override"])), + acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])), + contrast: tOptional(tEnum(["no-preference", "more", "no-override"])), + baseURL: tOptional(tString), + recordVideo: tOptional(tObject({ + dir: tOptional(tString), + size: tOptional(tObject({ + width: tInt, + height: tInt + })), + showActions: tOptional(tObject({ + duration: tOptional(tFloat), + position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])), + fontSize: tOptional(tInt), + cursor: tOptional(tEnum(["none", "pointer"])) + })) + })), + strictSelectors: tOptional(tBoolean), + serviceWorkers: tOptional(tEnum(["allow", "block"])), + selectorEngines: tOptional(tArray(tType("SelectorEngine"))), + testIdAttributeName: tOptional(tString) + }) + }); + scheme.BrowserContextBindingCallEvent = tObject({ + binding: tChannel(["BindingCall"]) + }); + scheme.BrowserContextConsoleEvent = tObject({ + type: tString, + text: tString, + args: tArray(tChannel(["ElementHandle", "JSHandle"])), + location: tObject({ + url: tString, + lineNumber: tInt, + columnNumber: tInt + }), + timestamp: tFloat, + page: tOptional(tChannel(["Page"])), + worker: tOptional(tChannel(["Worker"])) + }); + scheme.BrowserContextCloseEvent = tOptional(tObject({})); + scheme.BrowserContextDialogEvent = tObject({ + dialog: tChannel(["Dialog"]) + }); + scheme.BrowserContextPageEvent = tObject({ + page: tChannel(["Page"]) + }); + scheme.BrowserContextPageErrorEvent = tObject({ + error: tType("SerializedError"), + page: tChannel(["Page"]), + location: tObject({ + url: tString, + line: tInt, + column: tInt + }) + }); + scheme.BrowserContextRouteEvent = tObject({ + route: tChannel(["Route"]) + }); + scheme.BrowserContextWebSocketRouteEvent = tObject({ + webSocketRoute: tChannel(["WebSocketRoute"]) + }); + scheme.BrowserContextServiceWorkerEvent = tObject({ + worker: tChannel(["Worker"]) + }); + scheme.BrowserContextRequestEvent = tObject({ + request: tChannel(["Request"]), + page: tOptional(tChannel(["Page"])) + }); + scheme.BrowserContextRequestFailedEvent = tObject({ + request: tChannel(["Request"]), + failureText: tOptional(tString), + responseEndTiming: tFloat, + page: tOptional(tChannel(["Page"])) + }); + scheme.BrowserContextRequestFinishedEvent = tObject({ + request: tChannel(["Request"]), + response: tOptional(tChannel(["Response"])), + responseEndTiming: tFloat, + page: tOptional(tChannel(["Page"])) + }); + scheme.BrowserContextResponseEvent = tObject({ + response: tChannel(["Response"]), + page: tOptional(tChannel(["Page"])) + }); + scheme.BrowserContextRecorderEventEvent = tObject({ + event: tEnum(["actionAdded", "actionUpdated", "signalAdded"]), + data: tAny, + page: tChannel(["Page"]), + code: tString + }); + scheme.BrowserContextAddCookiesParams = tObject({ + cookies: tArray(tType("SetNetworkCookie")) + }); + scheme.BrowserContextAddCookiesResult = tOptional(tObject({})); + scheme.BrowserContextAddInitScriptParams = tObject({ + source: tString + }); + scheme.BrowserContextAddInitScriptResult = tObject({ + disposable: tChannel(["Disposable"]) + }); + scheme.BrowserContextClearCookiesParams = tObject({ + name: tOptional(tString), + nameRegexSource: tOptional(tString), + nameRegexFlags: tOptional(tString), + domain: tOptional(tString), + domainRegexSource: tOptional(tString), + domainRegexFlags: tOptional(tString), + path: tOptional(tString), + pathRegexSource: tOptional(tString), + pathRegexFlags: tOptional(tString) + }); + scheme.BrowserContextClearCookiesResult = tOptional(tObject({})); + scheme.BrowserContextClearPermissionsParams = tOptional(tObject({})); + scheme.BrowserContextClearPermissionsResult = tOptional(tObject({})); + scheme.BrowserContextCloseParams = tObject({ + reason: tOptional(tString) + }); + scheme.BrowserContextCloseResult = tOptional(tObject({})); + scheme.BrowserContextCookiesParams = tObject({ + urls: tArray(tString) + }); + scheme.BrowserContextCookiesResult = tObject({ + cookies: tArray(tType("NetworkCookie")) + }); + scheme.BrowserContextExposeBindingParams = tObject({ + name: tString + }); + scheme.BrowserContextExposeBindingResult = tObject({ + disposable: tChannel(["Disposable"]) + }); + scheme.BrowserContextGrantPermissionsParams = tObject({ + permissions: tArray(tString), + origin: tOptional(tString) + }); + scheme.BrowserContextGrantPermissionsResult = tOptional(tObject({})); + scheme.BrowserContextNewPageParams = tOptional(tObject({})); + scheme.BrowserContextNewPageResult = tObject({ + page: tChannel(["Page"]) + }); + scheme.BrowserContextRegisterSelectorEngineParams = tObject({ + selectorEngine: tType("SelectorEngine") + }); + scheme.BrowserContextRegisterSelectorEngineResult = tOptional(tObject({})); + scheme.BrowserContextSetTestIdAttributeNameParams = tObject({ + testIdAttributeName: tString + }); + scheme.BrowserContextSetTestIdAttributeNameResult = tOptional(tObject({})); + scheme.BrowserContextSetExtraHTTPHeadersParams = tObject({ + headers: tArray(tType("NameValue")) + }); + scheme.BrowserContextSetExtraHTTPHeadersResult = tOptional(tObject({})); + scheme.BrowserContextSetGeolocationParams = tObject({ + geolocation: tOptional(tObject({ + longitude: tFloat, + latitude: tFloat, + accuracy: tOptional(tFloat) + })) + }); + scheme.BrowserContextSetGeolocationResult = tOptional(tObject({})); + scheme.BrowserContextSetHTTPCredentialsParams = tObject({ + httpCredentials: tOptional(tObject({ + username: tString, + password: tString, + origin: tOptional(tString) + })) + }); + scheme.BrowserContextSetHTTPCredentialsResult = tOptional(tObject({})); + scheme.BrowserContextSetNetworkInterceptionPatternsParams = tObject({ + patterns: tArray(tObject({ + glob: tOptional(tString), + regexSource: tOptional(tString), + regexFlags: tOptional(tString), + urlPattern: tOptional(tType("URLPattern")) + })) + }); + scheme.BrowserContextSetNetworkInterceptionPatternsResult = tOptional(tObject({})); + scheme.BrowserContextSetWebSocketInterceptionPatternsParams = tObject({ + patterns: tArray(tObject({ + glob: tOptional(tString), + regexSource: tOptional(tString), + regexFlags: tOptional(tString), + urlPattern: tOptional(tType("URLPattern")) + })) + }); + scheme.BrowserContextSetWebSocketInterceptionPatternsResult = tOptional(tObject({})); + scheme.BrowserContextSetOfflineParams = tObject({ + offline: tBoolean + }); + scheme.BrowserContextSetOfflineResult = tOptional(tObject({})); + scheme.BrowserContextStorageStateParams = tObject({ + indexedDB: tOptional(tBoolean) + }); + scheme.BrowserContextStorageStateResult = tObject({ + cookies: tArray(tType("NetworkCookie")), + origins: tArray(tType("OriginStorage")) + }); + scheme.BrowserContextSetStorageStateParams = tObject({ + storageState: tOptional(tObject({ + cookies: tOptional(tArray(tType("SetNetworkCookie"))), + origins: tOptional(tArray(tType("SetOriginStorage"))) + })) + }); + scheme.BrowserContextSetStorageStateResult = tOptional(tObject({})); + scheme.BrowserContextPauseParams = tOptional(tObject({})); + scheme.BrowserContextPauseResult = tOptional(tObject({})); + scheme.BrowserContextEnableRecorderParams = tObject({ + language: tOptional(tString), + mode: tOptional(tEnum(["inspecting", "recording"])), + recorderMode: tOptional(tEnum(["default", "api"])), + pauseOnNextStatement: tOptional(tBoolean), + testIdAttributeName: tOptional(tString), + launchOptions: tOptional(tAny), + contextOptions: tOptional(tAny), + device: tOptional(tString), + saveStorage: tOptional(tString), + outputFile: tOptional(tString), + handleSIGINT: tOptional(tBoolean), + omitCallTracking: tOptional(tBoolean) + }); + scheme.BrowserContextEnableRecorderResult = tOptional(tObject({})); + scheme.BrowserContextDisableRecorderParams = tOptional(tObject({})); + scheme.BrowserContextDisableRecorderResult = tOptional(tObject({})); + scheme.BrowserContextExposeConsoleApiParams = tOptional(tObject({})); + scheme.BrowserContextExposeConsoleApiResult = tOptional(tObject({})); + scheme.BrowserContextNewCDPSessionParams = tObject({ + page: tOptional(tChannel(["Page"])), + frame: tOptional(tChannel(["Frame"])) + }); + scheme.BrowserContextNewCDPSessionResult = tObject({ + session: tChannel(["CDPSession"]) + }); + scheme.BrowserContextCreateTempFilesParams = tObject({ + rootDirName: tOptional(tString), + items: tArray(tObject({ + name: tString, + lastModifiedMs: tOptional(tFloat) + })) + }); + scheme.BrowserContextCreateTempFilesResult = tObject({ + rootDir: tOptional(tChannel(["WritableStream"])), + writableStreams: tArray(tChannel(["WritableStream"])) + }); + scheme.BrowserContextUpdateSubscriptionParams = tObject({ + event: tEnum(["console", "dialog", "request", "response", "requestFinished", "requestFailed"]), + enabled: tBoolean + }); + scheme.BrowserContextUpdateSubscriptionResult = tOptional(tObject({})); + scheme.BrowserContextClockFastForwardParams = tObject({ + ticksNumber: tOptional(tFloat), + ticksString: tOptional(tString) + }); + scheme.BrowserContextClockFastForwardResult = tOptional(tObject({})); + scheme.BrowserContextClockInstallParams = tObject({ + timeNumber: tOptional(tFloat), + timeString: tOptional(tString) + }); + scheme.BrowserContextClockInstallResult = tOptional(tObject({})); + scheme.BrowserContextClockPauseAtParams = tObject({ + timeNumber: tOptional(tFloat), + timeString: tOptional(tString) + }); + scheme.BrowserContextClockPauseAtResult = tOptional(tObject({})); + scheme.BrowserContextClockResumeParams = tOptional(tObject({})); + scheme.BrowserContextClockResumeResult = tOptional(tObject({})); + scheme.BrowserContextClockRunForParams = tObject({ + ticksNumber: tOptional(tFloat), + ticksString: tOptional(tString) + }); + scheme.BrowserContextClockRunForResult = tOptional(tObject({})); + scheme.BrowserContextClockSetFixedTimeParams = tObject({ + timeNumber: tOptional(tFloat), + timeString: tOptional(tString) + }); + scheme.BrowserContextClockSetFixedTimeResult = tOptional(tObject({})); + scheme.BrowserContextClockSetSystemTimeParams = tObject({ + timeNumber: tOptional(tFloat), + timeString: tOptional(tString) + }); + scheme.BrowserContextClockSetSystemTimeResult = tOptional(tObject({})); + scheme.BrowserContextCredentialsInstallParams = tOptional(tObject({})); + scheme.BrowserContextCredentialsInstallResult = tOptional(tObject({})); + scheme.BrowserContextCredentialsCreateParams = tObject({ + rpId: tString, + id: tOptional(tString), + userHandle: tOptional(tString), + privateKey: tOptional(tString), + publicKey: tOptional(tString) + }); + scheme.BrowserContextCredentialsCreateResult = tObject({ + credential: tType("VirtualCredential") + }); + scheme.BrowserContextCredentialsGetParams = tObject({ + rpId: tOptional(tString), + id: tOptional(tString) + }); + scheme.BrowserContextCredentialsGetResult = tObject({ + credentials: tArray(tType("VirtualCredential")) + }); + scheme.BrowserContextCredentialsDeleteParams = tObject({ + id: tString + }); + scheme.BrowserContextCredentialsDeleteResult = tOptional(tObject({})); + scheme.BrowserTypeInitializer = tObject({ + executablePath: tString, + name: tString + }); + scheme.BrowserTypeLaunchParams = tObject({ + channel: tOptional(tString), + executablePath: tOptional(tString), + args: tOptional(tArray(tString)), + ignoreAllDefaultArgs: tOptional(tBoolean), + ignoreDefaultArgs: tOptional(tArray(tString)), + handleSIGINT: tOptional(tBoolean), + handleSIGTERM: tOptional(tBoolean), + handleSIGHUP: tOptional(tBoolean), + timeout: tFloat, + env: tOptional(tArray(tType("NameValue"))), + headless: tOptional(tBoolean), + proxy: tOptional(tObject({ + server: tString, + bypass: tOptional(tString), + username: tOptional(tString), + password: tOptional(tString) + })), + downloadsPath: tOptional(tString), + tracesDir: tOptional(tString), + artifactsDir: tOptional(tString), + chromiumSandbox: tOptional(tBoolean), + firefoxUserPrefs: tOptional(tAny), + cdpPort: tOptional(tInt), + slowMo: tOptional(tFloat) + }); + scheme.BrowserTypeLaunchResult = tObject({ + browser: tChannel(["Browser"]) + }); + scheme.BrowserTypeLaunchPersistentContextParams = tObject({ + channel: tOptional(tString), + executablePath: tOptional(tString), + args: tOptional(tArray(tString)), + ignoreAllDefaultArgs: tOptional(tBoolean), + ignoreDefaultArgs: tOptional(tArray(tString)), + handleSIGINT: tOptional(tBoolean), + handleSIGTERM: tOptional(tBoolean), + handleSIGHUP: tOptional(tBoolean), + timeout: tFloat, + env: tOptional(tArray(tType("NameValue"))), + headless: tOptional(tBoolean), + proxy: tOptional(tObject({ + server: tString, + bypass: tOptional(tString), + username: tOptional(tString), + password: tOptional(tString) + })), + downloadsPath: tOptional(tString), + tracesDir: tOptional(tString), + artifactsDir: tOptional(tString), + chromiumSandbox: tOptional(tBoolean), + firefoxUserPrefs: tOptional(tAny), + cdpPort: tOptional(tInt), + noDefaultViewport: tOptional(tBoolean), + viewport: tOptional(tObject({ + width: tInt, + height: tInt + })), + screen: tOptional(tObject({ + width: tInt, + height: tInt + })), + ignoreHTTPSErrors: tOptional(tBoolean), + clientCertificates: tOptional(tArray(tObject({ + origin: tString, + cert: tOptional(tBinary), + key: tOptional(tBinary), + passphrase: tOptional(tString), + pfx: tOptional(tBinary) + }))), + javaScriptEnabled: tOptional(tBoolean), + bypassCSP: tOptional(tBoolean), + userAgent: tOptional(tString), + locale: tOptional(tString), + timezoneId: tOptional(tString), + geolocation: tOptional(tObject({ + longitude: tFloat, + latitude: tFloat, + accuracy: tOptional(tFloat) + })), + permissions: tOptional(tArray(tString)), + extraHTTPHeaders: tOptional(tArray(tType("NameValue"))), + offline: tOptional(tBoolean), + httpCredentials: tOptional(tObject({ + username: tString, + password: tString, + origin: tOptional(tString), + send: tOptional(tEnum(["always", "unauthorized"])) + })), + deviceScaleFactor: tOptional(tFloat), + isMobile: tOptional(tBoolean), + hasTouch: tOptional(tBoolean), + colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])), + reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])), + forcedColors: tOptional(tEnum(["active", "none", "no-override"])), + acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])), + contrast: tOptional(tEnum(["no-preference", "more", "no-override"])), + baseURL: tOptional(tString), + recordVideo: tOptional(tObject({ + dir: tOptional(tString), + size: tOptional(tObject({ + width: tInt, + height: tInt + })), + showActions: tOptional(tObject({ + duration: tOptional(tFloat), + position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])), + fontSize: tOptional(tInt), + cursor: tOptional(tEnum(["none", "pointer"])) + })) + })), + strictSelectors: tOptional(tBoolean), + serviceWorkers: tOptional(tEnum(["allow", "block"])), + selectorEngines: tOptional(tArray(tType("SelectorEngine"))), + testIdAttributeName: tOptional(tString), + userDataDir: tString, + slowMo: tOptional(tFloat) + }); + scheme.BrowserTypeLaunchPersistentContextResult = tObject({ + browser: tChannel(["Browser"]), + context: tChannel(["BrowserContext"]) + }); + scheme.BrowserTypeConnectOverCDPParams = tObject({ + endpointURL: tOptional(tString), + headers: tOptional(tArray(tType("NameValue"))), + slowMo: tOptional(tFloat), + timeout: tFloat, + isLocal: tOptional(tBoolean), + noDefaults: tOptional(tBoolean), + artifactsDir: tOptional(tString), + transport: tOptional(tBinary) + }); + scheme.BrowserTypeConnectOverCDPResult = tObject({ + browser: tChannel(["Browser"]), + defaultContext: tOptional(tChannel(["BrowserContext"])) + }); + scheme.BrowserTypeConnectToWorkerParams = tObject({ + endpoint: tString, + timeout: tFloat + }); + scheme.BrowserTypeConnectToWorkerResult = tObject({ + worker: tChannel(["Worker"]) + }); + scheme.Metadata = tObject({ + location: tOptional(tObject({ + file: tString, + line: tOptional(tInt), + column: tOptional(tInt) + })), + title: tOptional(tString), + internal: tOptional(tBoolean), + stepId: tOptional(tString) + }); + scheme.ClientSideCallMetadata = tObject({ + id: tInt, + stack: tOptional(tArray(tType("StackFrame"))) + }); + scheme.SDKLanguage = tEnum(["javascript", "python", "java", "csharp"]); + scheme.DisposableInitializer = tOptional(tObject({})); + scheme.DisposableDisposeParams = tOptional(tObject({})); + scheme.DisposableDisposeResult = tOptional(tObject({})); + scheme.WaitInfo = tObject({ + waitId: tString, + phase: tEnum(["before", "after", "log"]), + event: tOptional(tString), + message: tOptional(tString), + error: tOptional(tString) + }); + scheme.ElectronInitializer = tOptional(tObject({})); + scheme.ElectronLaunchParams = tObject({ + executablePath: tOptional(tString), + args: tOptional(tArray(tString)), + chromiumSandbox: tOptional(tBoolean), + cwd: tOptional(tString), + env: tOptional(tArray(tType("NameValue"))), + timeout: tFloat, + acceptDownloads: tOptional(tEnum(["accept", "deny", "internal-browser-default"])), + bypassCSP: tOptional(tBoolean), + colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])), + extraHTTPHeaders: tOptional(tArray(tType("NameValue"))), + geolocation: tOptional(tObject({ + longitude: tFloat, + latitude: tFloat, + accuracy: tOptional(tFloat) + })), + httpCredentials: tOptional(tObject({ + username: tString, + password: tString, + origin: tOptional(tString) + })), + ignoreHTTPSErrors: tOptional(tBoolean), + locale: tOptional(tString), + offline: tOptional(tBoolean), + recordVideo: tOptional(tObject({ + dir: tOptional(tString), + size: tOptional(tObject({ + width: tInt, + height: tInt + })), + showActions: tOptional(tObject({ + duration: tOptional(tFloat), + position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])), + fontSize: tOptional(tInt), + cursor: tOptional(tEnum(["none", "pointer"])) + })) + })), + strictSelectors: tOptional(tBoolean), + timezoneId: tOptional(tString), + tracesDir: tOptional(tString), + artifactsDir: tOptional(tString), + selectorEngines: tOptional(tArray(tType("SelectorEngine"))), + testIdAttributeName: tOptional(tString) + }); + scheme.ElectronLaunchResult = tObject({ + electronApplication: tChannel(["ElectronApplication"]) + }); + scheme.ElectronApplicationInitializer = tObject({ + context: tChannel(["BrowserContext"]) + }); + scheme.ElectronApplicationCloseEvent = tOptional(tObject({})); + scheme.ElectronApplicationConsoleEvent = tObject({ + type: tString, + text: tString, + args: tArray(tChannel(["ElementHandle", "JSHandle"])), + location: tObject({ + url: tString, + lineNumber: tInt, + columnNumber: tInt + }), + timestamp: tFloat + }); + scheme.ElectronApplicationBrowserWindowParams = tObject({ + page: tChannel(["Page"]) + }); + scheme.ElectronApplicationBrowserWindowResult = tObject({ + handle: tChannel(["ElementHandle", "JSHandle"]) + }); + scheme.ElectronApplicationEvaluateExpressionParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.ElectronApplicationEvaluateExpressionResult = tObject({ + value: tType("SerializedValue") + }); + scheme.ElectronApplicationEvaluateExpressionHandleParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.ElectronApplicationEvaluateExpressionHandleResult = tObject({ + handle: tChannel(["ElementHandle", "JSHandle"]) + }); + scheme.ElectronApplicationUpdateSubscriptionParams = tObject({ + event: tEnum(["console"]), + enabled: tBoolean + }); + scheme.ElectronApplicationUpdateSubscriptionResult = tOptional(tObject({})); + scheme.FrameInitializer = tObject({ + url: tString, + name: tString, + parentFrame: tOptional(tChannel(["Frame"])), + loadStates: tArray(tType("LifecycleEvent")) + }); + scheme.FrameLoadstateEvent = tObject({ + add: tOptional(tType("LifecycleEvent")), + remove: tOptional(tType("LifecycleEvent")) + }); + scheme.FrameNavigatedEvent = tObject({ + url: tString, + name: tString, + newDocument: tOptional(tObject({ + request: tOptional(tChannel(["Request"])) + })), + error: tOptional(tString) + }); + scheme.FrameEvalOnSelectorParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.FrameEvalOnSelectorResult = tObject({ + value: tType("SerializedValue") + }); + scheme.FrameEvalOnSelectorAllParams = tObject({ + selector: tString, + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.FrameEvalOnSelectorAllResult = tObject({ + value: tType("SerializedValue") + }); + scheme.FrameAddScriptTagParams = tObject({ + url: tOptional(tString), + content: tOptional(tString), + type: tOptional(tString) + }); + scheme.FrameAddScriptTagResult = tObject({ + element: tChannel(["ElementHandle"]) + }); + scheme.FrameAddStyleTagParams = tObject({ + url: tOptional(tString), + content: tOptional(tString) + }); + scheme.FrameAddStyleTagResult = tObject({ + element: tChannel(["ElementHandle"]) + }); + scheme.FrameAriaSnapshotParams = tObject({ + mode: tOptional(tEnum(["ai", "default"])), + track: tOptional(tString), + selector: tOptional(tString), + depth: tOptional(tInt), + boxes: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameAriaSnapshotResult = tObject({ + snapshot: tString + }); + scheme.FrameBlurParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameBlurResult = tOptional(tObject({})); + scheme.FrameCheckParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + force: tOptional(tBoolean), + position: tOptional(tType("Point")), + timeout: tFloat, + trial: tOptional(tBoolean) + }); + scheme.FrameCheckResult = tOptional(tObject({})); + scheme.FrameClickParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + force: tOptional(tBoolean), + noWaitAfter: tOptional(tBoolean), + modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))), + position: tOptional(tType("Point")), + delay: tOptional(tFloat), + button: tOptional(tEnum(["left", "right", "middle"])), + clickCount: tOptional(tInt), + timeout: tFloat, + trial: tOptional(tBoolean), + steps: tOptional(tInt) + }); + scheme.FrameClickResult = tOptional(tObject({})); + scheme.FrameContentParams = tOptional(tObject({})); + scheme.FrameContentResult = tObject({ + value: tString + }); + scheme.FrameDragAndDropParams = tObject({ + source: tString, + target: tString, + force: tOptional(tBoolean), + timeout: tFloat, + trial: tOptional(tBoolean), + sourcePosition: tOptional(tType("Point")), + targetPosition: tOptional(tType("Point")), + strict: tOptional(tBoolean), + steps: tOptional(tInt) + }); + scheme.FrameDragAndDropResult = tOptional(tObject({})); + scheme.FrameDropParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + position: tOptional(tType("Point")), + payloads: tOptional(tArray(tObject({ + name: tString, + mimeType: tOptional(tString), + buffer: tBinary + }))), + localPaths: tOptional(tArray(tString)), + streams: tOptional(tArray(tChannel(["WritableStream"]))), + data: tOptional(tArray(tObject({ + mimeType: tString, + value: tString + }))), + timeout: tFloat + }); + scheme.FrameDropResult = tOptional(tObject({})); + scheme.FrameDblclickParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + force: tOptional(tBoolean), + modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))), + position: tOptional(tType("Point")), + delay: tOptional(tFloat), + button: tOptional(tEnum(["left", "right", "middle"])), + timeout: tFloat, + trial: tOptional(tBoolean), + steps: tOptional(tInt) + }); + scheme.FrameDblclickResult = tOptional(tObject({})); + scheme.FrameDispatchEventParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + type: tString, + eventInit: tType("SerializedArgument"), + timeout: tFloat + }); + scheme.FrameDispatchEventResult = tOptional(tObject({})); + scheme.FrameEvaluateExpressionParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.FrameEvaluateExpressionResult = tObject({ + value: tType("SerializedValue") + }); + scheme.FrameEvaluateExpressionHandleParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.FrameEvaluateExpressionHandleResult = tObject({ + handle: tChannel(["ElementHandle", "JSHandle"]) + }); + scheme.FrameFillParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + value: tString, + force: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameFillResult = tOptional(tObject({})); + scheme.FrameFocusParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameFocusResult = tOptional(tObject({})); + scheme.FrameFrameElementParams = tOptional(tObject({})); + scheme.FrameFrameElementResult = tObject({ + element: tChannel(["ElementHandle"]) + }); + scheme.FrameResolveSelectorParams = tObject({ + selector: tString + }); + scheme.FrameResolveSelectorResult = tObject({ + resolvedSelector: tString + }); + scheme.FrameHighlightParams = tObject({ + selector: tString, + style: tOptional(tString) + }); + scheme.FrameHighlightResult = tOptional(tObject({})); + scheme.FrameHideHighlightParams = tObject({ + selector: tString + }); + scheme.FrameHideHighlightResult = tOptional(tObject({})); + scheme.FrameGetAttributeParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + name: tString, + timeout: tFloat + }); + scheme.FrameGetAttributeResult = tObject({ + value: tOptional(tString) + }); + scheme.FrameGotoParams = tObject({ + url: tString, + timeout: tFloat, + waitUntil: tOptional(tType("LifecycleEvent")), + referer: tOptional(tString) + }); + scheme.FrameGotoResult = tObject({ + response: tOptional(tChannel(["Response"])) + }); + scheme.FrameHoverParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + force: tOptional(tBoolean), + modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))), + position: tOptional(tType("Point")), + timeout: tFloat, + trial: tOptional(tBoolean) + }); + scheme.FrameHoverResult = tOptional(tObject({})); + scheme.FrameInnerHTMLParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameInnerHTMLResult = tObject({ + value: tString + }); + scheme.FrameInnerTextParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameInnerTextResult = tObject({ + value: tString + }); + scheme.FrameInputValueParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameInputValueResult = tObject({ + value: tString + }); + scheme.FrameIsCheckedParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameIsCheckedResult = tObject({ + value: tBoolean + }); + scheme.FrameIsDisabledParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameIsDisabledResult = tObject({ + value: tBoolean + }); + scheme.FrameIsEnabledParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameIsEnabledResult = tObject({ + value: tBoolean + }); + scheme.FrameIsHiddenParams = tObject({ + selector: tString, + strict: tOptional(tBoolean) + }); + scheme.FrameIsHiddenResult = tObject({ + value: tBoolean + }); + scheme.FrameIsVisibleParams = tObject({ + selector: tString, + strict: tOptional(tBoolean) + }); + scheme.FrameIsVisibleResult = tObject({ + value: tBoolean + }); + scheme.FrameIsEditableParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameIsEditableResult = tObject({ + value: tBoolean + }); + scheme.FramePressParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + key: tString, + delay: tOptional(tFloat), + noWaitAfter: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FramePressResult = tOptional(tObject({})); + scheme.FrameQuerySelectorParams = tObject({ + selector: tString, + strict: tOptional(tBoolean) + }); + scheme.FrameQuerySelectorResult = tObject({ + element: tOptional(tChannel(["ElementHandle"])) + }); + scheme.FrameQuerySelectorAllParams = tObject({ + selector: tString + }); + scheme.FrameQuerySelectorAllResult = tObject({ + elements: tArray(tChannel(["ElementHandle"])) + }); + scheme.FrameQueryCountParams = tObject({ + selector: tString + }); + scheme.FrameQueryCountResult = tObject({ + value: tInt + }); + scheme.FrameSelectOptionParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + elements: tOptional(tArray(tChannel(["ElementHandle"]))), + options: tOptional(tArray(tObject({ + valueOrLabel: tOptional(tString), + value: tOptional(tString), + label: tOptional(tString), + index: tOptional(tInt) + }))), + force: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameSelectOptionResult = tObject({ + values: tArray(tString) + }); + scheme.FrameSetContentParams = tObject({ + html: tString, + timeout: tFloat, + waitUntil: tOptional(tType("LifecycleEvent")) + }); + scheme.FrameSetContentResult = tOptional(tObject({})); + scheme.FrameSetInputFilesParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + payloads: tOptional(tArray(tObject({ + name: tString, + mimeType: tOptional(tString), + buffer: tBinary + }))), + localDirectory: tOptional(tString), + directoryStream: tOptional(tChannel(["WritableStream"])), + localPaths: tOptional(tArray(tString)), + streams: tOptional(tArray(tChannel(["WritableStream"]))), + timeout: tFloat + }); + scheme.FrameSetInputFilesResult = tOptional(tObject({})); + scheme.FrameTapParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + force: tOptional(tBoolean), + modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))), + position: tOptional(tType("Point")), + timeout: tFloat, + trial: tOptional(tBoolean) + }); + scheme.FrameTapResult = tOptional(tObject({})); + scheme.FrameTextContentParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat + }); + scheme.FrameTextContentResult = tObject({ + value: tOptional(tString) + }); + scheme.FrameTitleParams = tOptional(tObject({})); + scheme.FrameTitleResult = tObject({ + value: tString + }); + scheme.FrameTypeParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + text: tString, + delay: tOptional(tFloat), + timeout: tFloat + }); + scheme.FrameTypeResult = tOptional(tObject({})); + scheme.FrameUncheckParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + force: tOptional(tBoolean), + position: tOptional(tType("Point")), + timeout: tFloat, + trial: tOptional(tBoolean) + }); + scheme.FrameUncheckResult = tOptional(tObject({})); + scheme.FrameWaitForTimeoutParams = tObject({ + waitTimeout: tFloat + }); + scheme.FrameWaitForTimeoutResult = tOptional(tObject({})); + scheme.FrameWaitForFunctionParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument"), + timeout: tFloat, + pollingInterval: tOptional(tFloat) + }); + scheme.FrameWaitForFunctionResult = tObject({ + handle: tChannel(["ElementHandle", "JSHandle"]) + }); + scheme.FrameWaitForSelectorParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat, + state: tOptional(tEnum(["attached", "detached", "visible", "hidden"])), + omitReturnValue: tOptional(tBoolean) + }); + scheme.FrameWaitForSelectorResult = tObject({ + element: tOptional(tChannel(["ElementHandle"])) + }); + scheme.FrameExpectParams = tObject({ + selector: tOptional(tString), + expression: tString, + expressionArg: tOptional(tAny), + pseudo: tOptional(tEnum(["before", "after"])), + expectedText: tOptional(tArray(tType("ExpectedTextValue"))), + expectedNumber: tOptional(tFloat), + expectedValue: tOptional(tType("SerializedArgument")), + useInnerText: tOptional(tBoolean), + isNot: tBoolean, + timeout: tFloat + }); + scheme.FrameExpectResult = tOptional(tObject({})); + scheme.FrameExpectErrorDetails = tObject({ + received: tOptional(tObject({ + value: tOptional(tType("SerializedValue")), + ariaSnapshot: tOptional(tString) + })), + timedOut: tOptional(tBoolean), + customErrorMessage: tOptional(tString) + }); + scheme.JSHandleInitializer = tObject({ + preview: tString + }); + scheme.JSHandlePreviewUpdatedEvent = tObject({ + preview: tString + }); + scheme.ElementHandlePreviewUpdatedEvent = tType("JSHandlePreviewUpdatedEvent"); + scheme.JSHandleDisposeParams = tOptional(tObject({})); + scheme.ElementHandleDisposeParams = tType("JSHandleDisposeParams"); + scheme.JSHandleDisposeResult = tOptional(tObject({})); + scheme.ElementHandleDisposeResult = tType("JSHandleDisposeResult"); + scheme.JSHandleEvaluateExpressionParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.ElementHandleEvaluateExpressionParams = tType("JSHandleEvaluateExpressionParams"); + scheme.JSHandleEvaluateExpressionResult = tObject({ + value: tType("SerializedValue") + }); + scheme.ElementHandleEvaluateExpressionResult = tType("JSHandleEvaluateExpressionResult"); + scheme.JSHandleEvaluateExpressionHandleParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.ElementHandleEvaluateExpressionHandleParams = tType("JSHandleEvaluateExpressionHandleParams"); + scheme.JSHandleEvaluateExpressionHandleResult = tObject({ + handle: tChannel(["ElementHandle", "JSHandle"]) + }); + scheme.ElementHandleEvaluateExpressionHandleResult = tType("JSHandleEvaluateExpressionHandleResult"); + scheme.JSHandleGetPropertyListParams = tOptional(tObject({})); + scheme.ElementHandleGetPropertyListParams = tType("JSHandleGetPropertyListParams"); + scheme.JSHandleGetPropertyListResult = tObject({ + properties: tArray(tObject({ + name: tString, + value: tChannel(["ElementHandle", "JSHandle"]) + })) + }); + scheme.ElementHandleGetPropertyListResult = tType("JSHandleGetPropertyListResult"); + scheme.JSHandleGetPropertyParams = tObject({ + name: tString + }); + scheme.ElementHandleGetPropertyParams = tType("JSHandleGetPropertyParams"); + scheme.JSHandleGetPropertyResult = tObject({ + handle: tChannel(["ElementHandle", "JSHandle"]) + }); + scheme.ElementHandleGetPropertyResult = tType("JSHandleGetPropertyResult"); + scheme.JSHandleJsonValueParams = tOptional(tObject({})); + scheme.ElementHandleJsonValueParams = tType("JSHandleJsonValueParams"); + scheme.JSHandleJsonValueResult = tObject({ + value: tType("SerializedValue") + }); + scheme.ElementHandleJsonValueResult = tType("JSHandleJsonValueResult"); + scheme.ElementHandleInitializer = tObject({ + preview: tString + }); + scheme.ElementHandleEvalOnSelectorParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.ElementHandleEvalOnSelectorResult = tObject({ + value: tType("SerializedValue") + }); + scheme.ElementHandleEvalOnSelectorAllParams = tObject({ + selector: tString, + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.ElementHandleEvalOnSelectorAllResult = tObject({ + value: tType("SerializedValue") + }); + scheme.ElementHandleBoundingBoxParams = tOptional(tObject({})); + scheme.ElementHandleBoundingBoxResult = tObject({ + value: tOptional(tType("Rect")) + }); + scheme.ElementHandleCheckParams = tObject({ + force: tOptional(tBoolean), + position: tOptional(tType("Point")), + timeout: tFloat, + trial: tOptional(tBoolean) + }); + scheme.ElementHandleCheckResult = tOptional(tObject({})); + scheme.ElementHandleClickParams = tObject({ + force: tOptional(tBoolean), + noWaitAfter: tOptional(tBoolean), + modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))), + position: tOptional(tType("Point")), + delay: tOptional(tFloat), + button: tOptional(tEnum(["left", "right", "middle"])), + clickCount: tOptional(tInt), + timeout: tFloat, + trial: tOptional(tBoolean), + steps: tOptional(tInt) + }); + scheme.ElementHandleClickResult = tOptional(tObject({})); + scheme.ElementHandleContentFrameParams = tOptional(tObject({})); + scheme.ElementHandleContentFrameResult = tObject({ + frame: tOptional(tChannel(["Frame"])) + }); + scheme.ElementHandleDblclickParams = tObject({ + force: tOptional(tBoolean), + modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))), + position: tOptional(tType("Point")), + delay: tOptional(tFloat), + button: tOptional(tEnum(["left", "right", "middle"])), + timeout: tFloat, + trial: tOptional(tBoolean), + steps: tOptional(tInt) + }); + scheme.ElementHandleDblclickResult = tOptional(tObject({})); + scheme.ElementHandleDispatchEventParams = tObject({ + type: tString, + eventInit: tType("SerializedArgument") + }); + scheme.ElementHandleDispatchEventResult = tOptional(tObject({})); + scheme.ElementHandleFillParams = tObject({ + value: tString, + force: tOptional(tBoolean), + timeout: tFloat + }); + scheme.ElementHandleFillResult = tOptional(tObject({})); + scheme.ElementHandleFocusParams = tOptional(tObject({})); + scheme.ElementHandleFocusResult = tOptional(tObject({})); + scheme.ElementHandleGetAttributeParams = tObject({ + name: tString + }); + scheme.ElementHandleGetAttributeResult = tObject({ + value: tOptional(tString) + }); + scheme.ElementHandleHoverParams = tObject({ + force: tOptional(tBoolean), + modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))), + position: tOptional(tType("Point")), + timeout: tFloat, + trial: tOptional(tBoolean) + }); + scheme.ElementHandleHoverResult = tOptional(tObject({})); + scheme.ElementHandleInnerHTMLParams = tOptional(tObject({})); + scheme.ElementHandleInnerHTMLResult = tObject({ + value: tString + }); + scheme.ElementHandleInnerTextParams = tOptional(tObject({})); + scheme.ElementHandleInnerTextResult = tObject({ + value: tString + }); + scheme.ElementHandleInputValueParams = tOptional(tObject({})); + scheme.ElementHandleInputValueResult = tObject({ + value: tString + }); + scheme.ElementHandleIsCheckedParams = tOptional(tObject({})); + scheme.ElementHandleIsCheckedResult = tObject({ + value: tBoolean + }); + scheme.ElementHandleIsDisabledParams = tOptional(tObject({})); + scheme.ElementHandleIsDisabledResult = tObject({ + value: tBoolean + }); + scheme.ElementHandleIsEditableParams = tOptional(tObject({})); + scheme.ElementHandleIsEditableResult = tObject({ + value: tBoolean + }); + scheme.ElementHandleIsEnabledParams = tOptional(tObject({})); + scheme.ElementHandleIsEnabledResult = tObject({ + value: tBoolean + }); + scheme.ElementHandleIsHiddenParams = tOptional(tObject({})); + scheme.ElementHandleIsHiddenResult = tObject({ + value: tBoolean + }); + scheme.ElementHandleIsVisibleParams = tOptional(tObject({})); + scheme.ElementHandleIsVisibleResult = tObject({ + value: tBoolean + }); + scheme.ElementHandleOwnerFrameParams = tOptional(tObject({})); + scheme.ElementHandleOwnerFrameResult = tObject({ + frame: tOptional(tChannel(["Frame"])) + }); + scheme.ElementHandlePressParams = tObject({ + key: tString, + delay: tOptional(tFloat), + timeout: tFloat, + noWaitAfter: tOptional(tBoolean) + }); + scheme.ElementHandlePressResult = tOptional(tObject({})); + scheme.ElementHandleQuerySelectorParams = tObject({ + selector: tString, + strict: tOptional(tBoolean) + }); + scheme.ElementHandleQuerySelectorResult = tObject({ + element: tOptional(tChannel(["ElementHandle"])) + }); + scheme.ElementHandleQuerySelectorAllParams = tObject({ + selector: tString + }); + scheme.ElementHandleQuerySelectorAllResult = tObject({ + elements: tArray(tChannel(["ElementHandle"])) + }); + scheme.ElementHandleScreenshotParams = tObject({ + timeout: tFloat, + type: tOptional(tEnum(["png", "jpeg"])), + quality: tOptional(tInt), + omitBackground: tOptional(tBoolean), + caret: tOptional(tEnum(["hide", "initial"])), + animations: tOptional(tEnum(["disabled", "allow"])), + scale: tOptional(tEnum(["css", "device"])), + mask: tOptional(tArray(tObject({ + frame: tChannel(["Frame"]), + selector: tString + }))), + maskColor: tOptional(tString), + style: tOptional(tString) + }); + scheme.ElementHandleScreenshotResult = tObject({ + binary: tBinary + }); + scheme.ElementHandleScrollIntoViewIfNeededParams = tObject({ + timeout: tFloat + }); + scheme.ElementHandleScrollIntoViewIfNeededResult = tOptional(tObject({})); + scheme.ElementHandleSelectOptionParams = tObject({ + elements: tOptional(tArray(tChannel(["ElementHandle"]))), + options: tOptional(tArray(tObject({ + valueOrLabel: tOptional(tString), + value: tOptional(tString), + label: tOptional(tString), + index: tOptional(tInt) + }))), + force: tOptional(tBoolean), + timeout: tFloat + }); + scheme.ElementHandleSelectOptionResult = tObject({ + values: tArray(tString) + }); + scheme.ElementHandleSelectTextParams = tObject({ + force: tOptional(tBoolean), + timeout: tFloat + }); + scheme.ElementHandleSelectTextResult = tOptional(tObject({})); + scheme.ElementHandleSetInputFilesParams = tObject({ + payloads: tOptional(tArray(tObject({ + name: tString, + mimeType: tOptional(tString), + buffer: tBinary + }))), + localDirectory: tOptional(tString), + directoryStream: tOptional(tChannel(["WritableStream"])), + localPaths: tOptional(tArray(tString)), + streams: tOptional(tArray(tChannel(["WritableStream"]))), + timeout: tFloat + }); + scheme.ElementHandleSetInputFilesResult = tOptional(tObject({})); + scheme.ElementHandleTapParams = tObject({ + force: tOptional(tBoolean), + modifiers: tOptional(tArray(tEnum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"]))), + position: tOptional(tType("Point")), + timeout: tFloat, + trial: tOptional(tBoolean) + }); + scheme.ElementHandleTapResult = tOptional(tObject({})); + scheme.ElementHandleTextContentParams = tOptional(tObject({})); + scheme.ElementHandleTextContentResult = tObject({ + value: tOptional(tString) + }); + scheme.ElementHandleTypeParams = tObject({ + text: tString, + delay: tOptional(tFloat), + timeout: tFloat + }); + scheme.ElementHandleTypeResult = tOptional(tObject({})); + scheme.ElementHandleUncheckParams = tObject({ + force: tOptional(tBoolean), + position: tOptional(tType("Point")), + timeout: tFloat, + trial: tOptional(tBoolean) + }); + scheme.ElementHandleUncheckResult = tOptional(tObject({})); + scheme.ElementHandleWaitForElementStateParams = tObject({ + state: tEnum(["visible", "hidden", "stable", "enabled", "disabled", "editable"]), + timeout: tFloat + }); + scheme.ElementHandleWaitForElementStateResult = tOptional(tObject({})); + scheme.ElementHandleWaitForSelectorParams = tObject({ + selector: tString, + strict: tOptional(tBoolean), + timeout: tFloat, + state: tOptional(tEnum(["attached", "detached", "visible", "hidden"])) + }); + scheme.ElementHandleWaitForSelectorResult = tObject({ + element: tOptional(tChannel(["ElementHandle"])) + }); + scheme.LocalUtilsInitializer = tObject({ + deviceDescriptors: tArray(tObject({ + name: tString, + descriptor: tObject({ + userAgent: tString, + viewport: tObject({ + width: tInt, + height: tInt + }), + screen: tOptional(tObject({ + width: tInt, + height: tInt + })), + deviceScaleFactor: tFloat, + isMobile: tBoolean, + hasTouch: tBoolean, + defaultBrowserType: tEnum(["chromium", "firefox", "webkit"]) + }) + })) + }); + scheme.LocalUtilsZipParams = tObject({ + zipFile: tString, + entries: tArray(tType("NameValue")), + stacksId: tOptional(tString), + mode: tEnum(["write", "append"]), + includeSources: tBoolean, + additionalSources: tOptional(tArray(tString)) + }); + scheme.LocalUtilsZipResult = tOptional(tObject({})); + scheme.LocalUtilsHarOpenParams = tObject({ + file: tString + }); + scheme.LocalUtilsHarOpenResult = tObject({ + harId: tOptional(tString), + error: tOptional(tString) + }); + scheme.LocalUtilsHarLookupParams = tObject({ + harId: tString, + url: tString, + method: tString, + headers: tArray(tType("NameValue")), + postData: tOptional(tBinary), + isNavigationRequest: tBoolean + }); + scheme.LocalUtilsHarLookupResult = tObject({ + action: tEnum(["error", "redirect", "fulfill", "noentry"]), + message: tOptional(tString), + redirectURL: tOptional(tString), + status: tOptional(tInt), + headers: tOptional(tArray(tType("NameValue"))), + body: tOptional(tBinary) + }); + scheme.LocalUtilsHarCloseParams = tObject({ + harId: tString + }); + scheme.LocalUtilsHarCloseResult = tOptional(tObject({})); + scheme.LocalUtilsHarUnzipParams = tObject({ + zipFile: tString, + harFile: tString, + resourcesDir: tOptional(tString) + }); + scheme.LocalUtilsHarUnzipResult = tOptional(tObject({})); + scheme.LocalUtilsConnectParams = tObject({ + endpoint: tString, + headers: tOptional(tAny), + exposeNetwork: tOptional(tString), + slowMo: tOptional(tFloat), + timeout: tFloat, + socksProxyRedirectPortForTest: tOptional(tInt) + }); + scheme.LocalUtilsConnectResult = tObject({ + pipe: tChannel(["JsonPipe"]), + headers: tArray(tType("NameValue")) + }); + scheme.LocalUtilsTracingStartedParams = tObject({ + tracesDir: tOptional(tString), + traceName: tString, + live: tOptional(tBoolean) + }); + scheme.LocalUtilsTracingStartedResult = tObject({ + stacksId: tString + }); + scheme.LocalUtilsAddStackToTracingNoReplyParams = tObject({ + callData: tType("ClientSideCallMetadata") + }); + scheme.LocalUtilsAddStackToTracingNoReplyResult = tOptional(tObject({})); + scheme.LocalUtilsTraceDiscardedParams = tObject({ + stacksId: tString + }); + scheme.LocalUtilsTraceDiscardedResult = tOptional(tObject({})); + scheme.LocalUtilsGlobToRegexParams = tObject({ + glob: tString, + baseURL: tOptional(tString), + webSocketUrl: tOptional(tBoolean) + }); + scheme.LocalUtilsGlobToRegexResult = tObject({ + regex: tString + }); + scheme.SetNetworkCookie = tObject({ + name: tString, + value: tString, + url: tOptional(tString), + domain: tOptional(tString), + path: tOptional(tString), + expires: tOptional(tFloat), + httpOnly: tOptional(tBoolean), + secure: tOptional(tBoolean), + sameSite: tOptional(tEnum(["Strict", "Lax", "None"])), + partitionKey: tOptional(tString), + _crHasCrossSiteAncestor: tOptional(tBoolean) + }); + scheme.NetworkCookie = tObject({ + name: tString, + value: tString, + domain: tString, + path: tString, + expires: tFloat, + httpOnly: tBoolean, + secure: tBoolean, + sameSite: tEnum(["Strict", "Lax", "None"]), + partitionKey: tOptional(tString), + _crHasCrossSiteAncestor: tOptional(tBoolean) + }); + scheme.RequestInitializer = tObject({ + frame: tOptional(tChannel(["Frame"])), + serviceWorker: tOptional(tChannel(["Worker"])), + url: tString, + resourceType: tString, + method: tString, + postData: tOptional(tBinary), + headers: tArray(tType("NameValue")), + isNavigationRequest: tBoolean, + redirectedFrom: tOptional(tChannel(["Request"])) + }); + scheme.RequestResponseParams = tOptional(tObject({})); + scheme.RequestResponseResult = tObject({ + response: tOptional(tChannel(["Response"])) + }); + scheme.RequestRawRequestHeadersParams = tOptional(tObject({})); + scheme.RequestRawRequestHeadersResult = tObject({ + headers: tArray(tType("NameValue")) + }); + scheme.RouteInitializer = tObject({ + request: tChannel(["Request"]) + }); + scheme.RouteRedirectNavigationRequestParams = tObject({ + url: tString + }); + scheme.RouteRedirectNavigationRequestResult = tOptional(tObject({})); + scheme.RouteAbortParams = tObject({ + errorCode: tOptional(tString) + }); + scheme.RouteAbortResult = tOptional(tObject({})); + scheme.RouteContinueParams = tObject({ + url: tOptional(tString), + method: tOptional(tString), + headers: tOptional(tArray(tType("NameValue"))), + postData: tOptional(tBinary), + isFallback: tBoolean + }); + scheme.RouteContinueResult = tOptional(tObject({})); + scheme.RouteFulfillParams = tObject({ + status: tOptional(tInt), + headers: tOptional(tArray(tType("NameValue"))), + body: tOptional(tString), + isBase64: tOptional(tBoolean), + fetchResponseUid: tOptional(tString) + }); + scheme.RouteFulfillResult = tOptional(tObject({})); + scheme.WebSocketRouteInitializer = tObject({ + url: tString, + protocols: tArray(tString) + }); + scheme.WebSocketRouteMessageFromPageEvent = tObject({ + message: tString, + isBase64: tBoolean + }); + scheme.WebSocketRouteMessageFromServerEvent = tObject({ + message: tString, + isBase64: tBoolean + }); + scheme.WebSocketRouteClosePageEvent = tObject({ + code: tOptional(tInt), + reason: tOptional(tString), + wasClean: tBoolean + }); + scheme.WebSocketRouteCloseServerEvent = tObject({ + code: tOptional(tInt), + reason: tOptional(tString), + wasClean: tBoolean + }); + scheme.WebSocketRouteConnectParams = tOptional(tObject({})); + scheme.WebSocketRouteConnectResult = tOptional(tObject({})); + scheme.WebSocketRouteEnsureOpenedParams = tOptional(tObject({})); + scheme.WebSocketRouteEnsureOpenedResult = tOptional(tObject({})); + scheme.WebSocketRouteSendToPageParams = tObject({ + message: tString, + isBase64: tBoolean + }); + scheme.WebSocketRouteSendToPageResult = tOptional(tObject({})); + scheme.WebSocketRouteSendToServerParams = tObject({ + message: tString, + isBase64: tBoolean + }); + scheme.WebSocketRouteSendToServerResult = tOptional(tObject({})); + scheme.WebSocketRouteClosePageParams = tObject({ + code: tOptional(tInt), + reason: tOptional(tString), + wasClean: tBoolean + }); + scheme.WebSocketRouteClosePageResult = tOptional(tObject({})); + scheme.WebSocketRouteCloseServerParams = tObject({ + code: tOptional(tInt), + reason: tOptional(tString), + wasClean: tBoolean + }); + scheme.WebSocketRouteCloseServerResult = tOptional(tObject({})); + scheme.ResourceTiming = tObject({ + startTime: tFloat, + domainLookupStart: tFloat, + domainLookupEnd: tFloat, + connectStart: tFloat, + secureConnectionStart: tFloat, + connectEnd: tFloat, + requestStart: tFloat, + responseStart: tFloat + }); + scheme.ResponseInitializer = tObject({ + request: tChannel(["Request"]), + url: tString, + status: tInt, + statusText: tString, + headers: tArray(tType("NameValue")), + timing: tType("ResourceTiming"), + fromServiceWorker: tBoolean + }); + scheme.ResponseBodyParams = tOptional(tObject({})); + scheme.ResponseBodyResult = tObject({ + binary: tBinary + }); + scheme.ResponseSecurityDetailsParams = tOptional(tObject({})); + scheme.ResponseSecurityDetailsResult = tObject({ + value: tOptional(tType("SecurityDetails")) + }); + scheme.ResponseServerAddrParams = tOptional(tObject({})); + scheme.ResponseServerAddrResult = tObject({ + value: tOptional(tType("RemoteAddr")) + }); + scheme.ResponseRawResponseHeadersParams = tOptional(tObject({})); + scheme.ResponseRawResponseHeadersResult = tObject({ + headers: tArray(tType("NameValue")) + }); + scheme.ResponseHttpVersionParams = tOptional(tObject({})); + scheme.ResponseHttpVersionResult = tObject({ + value: tString + }); + scheme.ResponseSizesParams = tOptional(tObject({})); + scheme.ResponseSizesResult = tObject({ + sizes: tType("RequestSizes") + }); + scheme.SecurityDetails = tObject({ + issuer: tOptional(tString), + protocol: tOptional(tString), + subjectName: tOptional(tString), + validFrom: tOptional(tFloat), + validTo: tOptional(tFloat) + }); + scheme.RequestSizes = tObject({ + requestBodySize: tInt, + requestHeadersSize: tInt, + responseBodySize: tInt, + responseHeadersSize: tInt + }); + scheme.RemoteAddr = tObject({ + ipAddress: tString, + port: tInt + }); + scheme.WebSocketInitializer = tObject({ + url: tString + }); + scheme.WebSocketOpenEvent = tOptional(tObject({})); + scheme.WebSocketFrameSentEvent = tObject({ + opcode: tInt, + data: tString + }); + scheme.WebSocketFrameReceivedEvent = tObject({ + opcode: tInt, + data: tString + }); + scheme.WebSocketSocketErrorEvent = tObject({ + error: tString + }); + scheme.WebSocketCloseEvent = tOptional(tObject({})); + scheme.PageInitializer = tObject({ + mainFrame: tChannel(["Frame"]), + viewportSize: tOptional(tObject({ + width: tInt, + height: tInt + })), + isClosed: tBoolean, + opener: tOptional(tChannel(["Page"])), + video: tOptional(tChannel(["Artifact"])) + }); + scheme.PageBindingCallEvent = tObject({ + binding: tChannel(["BindingCall"]) + }); + scheme.PageCloseEvent = tOptional(tObject({})); + scheme.PageCrashEvent = tOptional(tObject({})); + scheme.PageDownloadEvent = tObject({ + url: tString, + suggestedFilename: tString, + artifact: tChannel(["Artifact"]) + }); + scheme.PageViewportSizeChangedEvent = tObject({ + viewportSize: tOptional(tObject({ + width: tInt, + height: tInt + })) + }); + scheme.PageFileChooserEvent = tObject({ + element: tChannel(["ElementHandle"]), + isMultiple: tBoolean + }); + scheme.PageFrameAttachedEvent = tObject({ + frame: tChannel(["Frame"]) + }); + scheme.PageFrameDetachedEvent = tObject({ + frame: tChannel(["Frame"]) + }); + scheme.PageLocatorHandlerTriggeredEvent = tObject({ + uid: tInt + }); + scheme.PageRouteEvent = tObject({ + route: tChannel(["Route"]) + }); + scheme.PageScreencastFrameEvent = tObject({ + data: tBinary, + timestamp: tFloat, + viewportWidth: tInt, + viewportHeight: tInt + }); + scheme.PageWebSocketRouteEvent = tObject({ + webSocketRoute: tChannel(["WebSocketRoute"]) + }); + scheme.PageWebSocketEvent = tObject({ + webSocket: tChannel(["WebSocket"]) + }); + scheme.PageWorkerEvent = tObject({ + worker: tChannel(["Worker"]) + }); + scheme.PageAddInitScriptParams = tObject({ + source: tString + }); + scheme.PageAddInitScriptResult = tObject({ + disposable: tChannel(["Disposable"]) + }); + scheme.PageCloseParams = tObject({ + reason: tOptional(tString) + }); + scheme.PageCloseResult = tOptional(tObject({})); + scheme.PageRunBeforeUnloadParams = tOptional(tObject({})); + scheme.PageRunBeforeUnloadResult = tOptional(tObject({})); + scheme.PageClearConsoleMessagesParams = tOptional(tObject({})); + scheme.PageClearConsoleMessagesResult = tOptional(tObject({})); + scheme.PageConsoleMessagesParams = tObject({ + filter: tOptional(tType("ConsoleMessagesFilter")) + }); + scheme.PageConsoleMessagesResult = tObject({ + messages: tArray(tObject({ + type: tString, + text: tString, + args: tArray(tChannel(["ElementHandle", "JSHandle"])), + location: tObject({ + url: tString, + lineNumber: tInt, + columnNumber: tInt + }), + timestamp: tFloat + })) + }); + scheme.PageEmulateMediaParams = tObject({ + media: tOptional(tEnum(["screen", "print", "no-override"])), + colorScheme: tOptional(tEnum(["dark", "light", "no-preference", "no-override"])), + reducedMotion: tOptional(tEnum(["reduce", "no-preference", "no-override"])), + forcedColors: tOptional(tEnum(["active", "none", "no-override"])), + contrast: tOptional(tEnum(["no-preference", "more", "no-override"])) + }); + scheme.PageEmulateMediaResult = tOptional(tObject({})); + scheme.PageExposeBindingParams = tObject({ + name: tString + }); + scheme.PageExposeBindingResult = tObject({ + disposable: tChannel(["Disposable"]) + }); + scheme.PageGoBackParams = tObject({ + timeout: tFloat, + waitUntil: tOptional(tType("LifecycleEvent")) + }); + scheme.PageGoBackResult = tObject({ + response: tOptional(tChannel(["Response"])) + }); + scheme.PageGoForwardParams = tObject({ + timeout: tFloat, + waitUntil: tOptional(tType("LifecycleEvent")) + }); + scheme.PageGoForwardResult = tObject({ + response: tOptional(tChannel(["Response"])) + }); + scheme.PageRequestGCParams = tOptional(tObject({})); + scheme.PageRequestGCResult = tOptional(tObject({})); + scheme.PageRegisterLocatorHandlerParams = tObject({ + selector: tString, + noWaitAfter: tOptional(tBoolean) + }); + scheme.PageRegisterLocatorHandlerResult = tObject({ + uid: tInt + }); + scheme.PageResolveLocatorHandlerNoReplyParams = tObject({ + uid: tInt, + remove: tOptional(tBoolean) + }); + scheme.PageResolveLocatorHandlerNoReplyResult = tOptional(tObject({})); + scheme.PageUnregisterLocatorHandlerParams = tObject({ + uid: tInt + }); + scheme.PageUnregisterLocatorHandlerResult = tOptional(tObject({})); + scheme.PageReloadParams = tObject({ + timeout: tFloat, + waitUntil: tOptional(tType("LifecycleEvent")) + }); + scheme.PageReloadResult = tObject({ + response: tOptional(tChannel(["Response"])) + }); + scheme.PageExpectScreenshotParams = tObject({ + expected: tOptional(tBinary), + timeout: tFloat, + isNot: tBoolean, + locator: tOptional(tObject({ + frame: tChannel(["Frame"]), + selector: tString + })), + comparator: tOptional(tString), + maxDiffPixels: tOptional(tInt), + maxDiffPixelRatio: tOptional(tFloat), + threshold: tOptional(tFloat), + fullPage: tOptional(tBoolean), + clip: tOptional(tType("Rect")), + omitBackground: tOptional(tBoolean), + caret: tOptional(tEnum(["hide", "initial"])), + animations: tOptional(tEnum(["disabled", "allow"])), + scale: tOptional(tEnum(["css", "device"])), + mask: tOptional(tArray(tObject({ + frame: tChannel(["Frame"]), + selector: tString + }))), + maskColor: tOptional(tString), + style: tOptional(tString) + }); + scheme.PageExpectScreenshotResult = tObject({ + actual: tOptional(tBinary) + }); + scheme.PageExpectScreenshotErrorDetails = tObject({ + diff: tOptional(tBinary), + customErrorMessage: tOptional(tString), + actual: tOptional(tBinary), + previous: tOptional(tBinary), + timedOut: tOptional(tBoolean), + log: tOptional(tArray(tString)) + }); + scheme.PageScreenshotParams = tObject({ + timeout: tFloat, + type: tOptional(tEnum(["png", "jpeg"])), + quality: tOptional(tInt), + fullPage: tOptional(tBoolean), + clip: tOptional(tType("Rect")), + omitBackground: tOptional(tBoolean), + caret: tOptional(tEnum(["hide", "initial"])), + animations: tOptional(tEnum(["disabled", "allow"])), + scale: tOptional(tEnum(["css", "device"])), + mask: tOptional(tArray(tObject({ + frame: tChannel(["Frame"]), + selector: tString + }))), + maskColor: tOptional(tString), + style: tOptional(tString) + }); + scheme.PageScreenshotResult = tObject({ + binary: tBinary + }); + scheme.PageSetExtraHTTPHeadersParams = tObject({ + headers: tArray(tType("NameValue")) + }); + scheme.PageSetExtraHTTPHeadersResult = tOptional(tObject({})); + scheme.PageSetNetworkInterceptionPatternsParams = tObject({ + patterns: tArray(tObject({ + glob: tOptional(tString), + regexSource: tOptional(tString), + regexFlags: tOptional(tString), + urlPattern: tOptional(tType("URLPattern")) + })) + }); + scheme.PageSetNetworkInterceptionPatternsResult = tOptional(tObject({})); + scheme.PageSetWebSocketInterceptionPatternsParams = tObject({ + patterns: tArray(tObject({ + glob: tOptional(tString), + regexSource: tOptional(tString), + regexFlags: tOptional(tString), + urlPattern: tOptional(tType("URLPattern")) + })) + }); + scheme.PageSetWebSocketInterceptionPatternsResult = tOptional(tObject({})); + scheme.PageSetViewportSizeParams = tObject({ + viewportSize: tObject({ + width: tInt, + height: tInt + }) + }); + scheme.PageSetViewportSizeResult = tOptional(tObject({})); + scheme.PageKeyboardDownParams = tObject({ + key: tString + }); + scheme.PageKeyboardDownResult = tOptional(tObject({})); + scheme.PageKeyboardUpParams = tObject({ + key: tString + }); + scheme.PageKeyboardUpResult = tOptional(tObject({})); + scheme.PageKeyboardInsertTextParams = tObject({ + text: tString + }); + scheme.PageKeyboardInsertTextResult = tOptional(tObject({})); + scheme.PageKeyboardTypeParams = tObject({ + text: tString, + delay: tOptional(tFloat) + }); + scheme.PageKeyboardTypeResult = tOptional(tObject({})); + scheme.PageKeyboardPressParams = tObject({ + key: tString, + delay: tOptional(tFloat) + }); + scheme.PageKeyboardPressResult = tOptional(tObject({})); + scheme.PageMouseMoveParams = tObject({ + x: tFloat, + y: tFloat, + steps: tOptional(tInt) + }); + scheme.PageMouseMoveResult = tOptional(tObject({})); + scheme.PageMouseDownParams = tObject({ + button: tOptional(tEnum(["left", "right", "middle"])), + clickCount: tOptional(tInt) + }); + scheme.PageMouseDownResult = tOptional(tObject({})); + scheme.PageMouseUpParams = tObject({ + button: tOptional(tEnum(["left", "right", "middle"])), + clickCount: tOptional(tInt) + }); + scheme.PageMouseUpResult = tOptional(tObject({})); + scheme.PageMouseClickParams = tObject({ + x: tFloat, + y: tFloat, + delay: tOptional(tFloat), + button: tOptional(tEnum(["left", "right", "middle"])), + clickCount: tOptional(tInt) + }); + scheme.PageMouseClickResult = tOptional(tObject({})); + scheme.PageMouseWheelParams = tObject({ + deltaX: tFloat, + deltaY: tFloat + }); + scheme.PageMouseWheelResult = tOptional(tObject({})); + scheme.PageTouchscreenTapParams = tObject({ + x: tFloat, + y: tFloat + }); + scheme.PageTouchscreenTapResult = tOptional(tObject({})); + scheme.PageClearPageErrorsParams = tOptional(tObject({})); + scheme.PageClearPageErrorsResult = tOptional(tObject({})); + scheme.PagePageErrorsParams = tObject({ + filter: tOptional(tType("ConsoleMessagesFilter")) + }); + scheme.PagePageErrorsResult = tObject({ + errors: tArray(tType("SerializedError")) + }); + scheme.PagePdfParams = tObject({ + scale: tOptional(tFloat), + displayHeaderFooter: tOptional(tBoolean), + headerTemplate: tOptional(tString), + footerTemplate: tOptional(tString), + printBackground: tOptional(tBoolean), + landscape: tOptional(tBoolean), + pageRanges: tOptional(tString), + format: tOptional(tString), + width: tOptional(tString), + height: tOptional(tString), + preferCSSPageSize: tOptional(tBoolean), + margin: tOptional(tObject({ + top: tOptional(tString), + bottom: tOptional(tString), + left: tOptional(tString), + right: tOptional(tString) + })), + tagged: tOptional(tBoolean), + outline: tOptional(tBoolean) + }); + scheme.PagePdfResult = tObject({ + pdf: tBinary + }); + scheme.PageRequestsParams = tOptional(tObject({})); + scheme.PageRequestsResult = tObject({ + requests: tArray(tChannel(["Request"])) + }); + scheme.PageStartJSCoverageParams = tObject({ + resetOnNavigation: tOptional(tBoolean), + reportAnonymousScripts: tOptional(tBoolean) + }); + scheme.PageStartJSCoverageResult = tOptional(tObject({})); + scheme.PageStopJSCoverageParams = tOptional(tObject({})); + scheme.PageStopJSCoverageResult = tObject({ + entries: tArray(tObject({ + url: tString, + scriptId: tString, + source: tOptional(tString), + functions: tArray(tObject({ + functionName: tString, + isBlockCoverage: tBoolean, + ranges: tArray(tObject({ + startOffset: tInt, + endOffset: tInt, + count: tInt + })) + })) + })) + }); + scheme.PageStartCSSCoverageParams = tObject({ + resetOnNavigation: tOptional(tBoolean) + }); + scheme.PageStartCSSCoverageResult = tOptional(tObject({})); + scheme.PageStopCSSCoverageParams = tOptional(tObject({})); + scheme.PageStopCSSCoverageResult = tObject({ + entries: tArray(tObject({ + url: tString, + text: tOptional(tString), + ranges: tArray(tObject({ + start: tInt, + end: tInt + })) + })) + }); + scheme.PageBringToFrontParams = tOptional(tObject({})); + scheme.PageBringToFrontResult = tOptional(tObject({})); + scheme.PagePickLocatorParams = tOptional(tObject({})); + scheme.PagePickLocatorResult = tObject({ + selector: tString + }); + scheme.PageCancelPickLocatorParams = tOptional(tObject({})); + scheme.PageCancelPickLocatorResult = tOptional(tObject({})); + scheme.PageHideHighlightParams = tOptional(tObject({})); + scheme.PageHideHighlightResult = tOptional(tObject({})); + scheme.PageScreencastShowOverlayParams = tObject({ + html: tString, + duration: tOptional(tFloat) + }); + scheme.PageScreencastShowOverlayResult = tObject({ + id: tString + }); + scheme.PageScreencastRemoveOverlayParams = tObject({ + id: tString + }); + scheme.PageScreencastRemoveOverlayResult = tOptional(tObject({})); + scheme.PageScreencastChapterParams = tObject({ + title: tString, + description: tOptional(tString), + duration: tOptional(tFloat) + }); + scheme.PageScreencastChapterResult = tOptional(tObject({})); + scheme.PageScreencastSetOverlayVisibleParams = tObject({ + visible: tBoolean + }); + scheme.PageScreencastSetOverlayVisibleResult = tOptional(tObject({})); + scheme.PageScreencastShowActionsParams = tObject({ + duration: tOptional(tFloat), + position: tOptional(tEnum(["top-left", "top", "top-right", "bottom-left", "bottom", "bottom-right"])), + fontSize: tOptional(tInt), + cursor: tOptional(tEnum(["none", "pointer"])) + }); + scheme.PageScreencastShowActionsResult = tOptional(tObject({})); + scheme.PageScreencastHideActionsParams = tOptional(tObject({})); + scheme.PageScreencastHideActionsResult = tOptional(tObject({})); + scheme.PageScreencastStartParams = tObject({ + size: tOptional(tObject({ + width: tInt, + height: tInt + })), + quality: tOptional(tInt), + sendFrames: tOptional(tBoolean), + record: tOptional(tBoolean) + }); + scheme.PageScreencastStartResult = tObject({ + artifact: tOptional(tChannel(["Artifact"])) + }); + scheme.PageScreencastStopParams = tOptional(tObject({})); + scheme.PageScreencastStopResult = tOptional(tObject({})); + scheme.PageUpdateSubscriptionParams = tObject({ + event: tEnum(["console", "dialog", "fileChooser", "request", "response", "requestFinished", "requestFailed"]), + enabled: tBoolean + }); + scheme.PageUpdateSubscriptionResult = tOptional(tObject({})); + scheme.PageSetDockTileParams = tObject({ + image: tBinary + }); + scheme.PageSetDockTileResult = tOptional(tObject({})); + scheme.PageWebStorageItemsParams = tObject({ + kind: tEnum(["local", "session"]) + }); + scheme.PageWebStorageItemsResult = tObject({ + items: tArray(tType("NameValue")) + }); + scheme.PageWebStorageGetItemParams = tObject({ + kind: tEnum(["local", "session"]), + name: tString + }); + scheme.PageWebStorageGetItemResult = tObject({ + value: tOptional(tString) + }); + scheme.PageWebStorageSetItemParams = tObject({ + kind: tEnum(["local", "session"]), + name: tString, + value: tString + }); + scheme.PageWebStorageSetItemResult = tOptional(tObject({})); + scheme.PageWebStorageRemoveItemParams = tObject({ + kind: tEnum(["local", "session"]), + name: tString + }); + scheme.PageWebStorageRemoveItemResult = tOptional(tObject({})); + scheme.PageWebStorageClearParams = tObject({ + kind: tEnum(["local", "session"]) + }); + scheme.PageWebStorageClearResult = tOptional(tObject({})); + scheme.RootInitializer = tOptional(tObject({})); + scheme.RootInitializeParams = tObject({ + sdkLanguage: tType("SDKLanguage") + }); + scheme.RootInitializeResult = tObject({ + playwright: tChannel(["Playwright"]) + }); + scheme.PlaywrightInitializer = tObject({ + chromium: tChannel(["BrowserType"]), + firefox: tChannel(["BrowserType"]), + webkit: tChannel(["BrowserType"]), + android: tChannel(["Android"]), + electron: tChannel(["Electron"]), + utils: tOptional(tChannel(["LocalUtils"])), + preLaunchedBrowser: tOptional(tChannel(["Browser"])), + preConnectedAndroidDevice: tOptional(tChannel(["AndroidDevice"])), + socksSupport: tOptional(tChannel(["SocksSupport"])) + }); + scheme.PlaywrightNewRequestParams = tObject({ + baseURL: tOptional(tString), + userAgent: tOptional(tString), + ignoreHTTPSErrors: tOptional(tBoolean), + extraHTTPHeaders: tOptional(tArray(tType("NameValue"))), + failOnStatusCode: tOptional(tBoolean), + clientCertificates: tOptional(tArray(tObject({ + origin: tString, + cert: tOptional(tBinary), + key: tOptional(tBinary), + passphrase: tOptional(tString), + pfx: tOptional(tBinary) + }))), + maxRedirects: tOptional(tInt), + httpCredentials: tOptional(tObject({ + username: tString, + password: tString, + origin: tOptional(tString), + send: tOptional(tEnum(["always", "unauthorized"])) + })), + proxy: tOptional(tObject({ + server: tString, + bypass: tOptional(tString), + username: tOptional(tString), + password: tOptional(tString) + })), + storageState: tOptional(tObject({ + cookies: tOptional(tArray(tType("NetworkCookie"))), + origins: tOptional(tArray(tType("SetOriginStorage"))) + })), + tracesDir: tOptional(tString) + }); + scheme.PlaywrightNewRequestResult = tObject({ + request: tChannel(["APIRequestContext"]) + }); + scheme.DebugControllerInitializer = tOptional(tObject({})); + scheme.DebugControllerInspectRequestedEvent = tObject({ + selector: tString, + locator: tString, + ariaSnapshot: tString + }); + scheme.DebugControllerSetModeRequestedEvent = tObject({ + mode: tString + }); + scheme.DebugControllerStateChangedEvent = tObject({ + pageCount: tInt + }); + scheme.DebugControllerSourceChangedEvent = tObject({ + text: tString, + header: tOptional(tString), + footer: tOptional(tString), + actions: tOptional(tArray(tString)) + }); + scheme.DebugControllerPausedEvent = tObject({ + paused: tBoolean + }); + scheme.DebugControllerInitializeParams = tObject({ + codegenId: tString, + sdkLanguage: tType("SDKLanguage") + }); + scheme.DebugControllerInitializeResult = tOptional(tObject({})); + scheme.DebugControllerSetReportStateChangedParams = tObject({ + enabled: tBoolean + }); + scheme.DebugControllerSetReportStateChangedResult = tOptional(tObject({})); + scheme.DebugControllerSetRecorderModeParams = tObject({ + mode: tEnum(["inspecting", "recording", "none"]), + testIdAttributeName: tOptional(tString), + generateAutoExpect: tOptional(tBoolean) + }); + scheme.DebugControllerSetRecorderModeResult = tOptional(tObject({})); + scheme.DebugControllerHighlightParams = tObject({ + selector: tOptional(tString), + ariaTemplate: tOptional(tString) + }); + scheme.DebugControllerHighlightResult = tOptional(tObject({})); + scheme.DebugControllerHideHighlightParams = tOptional(tObject({})); + scheme.DebugControllerHideHighlightResult = tOptional(tObject({})); + scheme.DebugControllerResumeParams = tOptional(tObject({})); + scheme.DebugControllerResumeResult = tOptional(tObject({})); + scheme.DebugControllerKillParams = tOptional(tObject({})); + scheme.DebugControllerKillResult = tOptional(tObject({})); + scheme.SocksSupportInitializer = tOptional(tObject({})); + scheme.SocksSupportSocksRequestedEvent = tObject({ + uid: tString, + host: tString, + port: tInt + }); + scheme.SocksSupportSocksDataEvent = tObject({ + uid: tString, + data: tBinary + }); + scheme.SocksSupportSocksClosedEvent = tObject({ + uid: tString + }); + scheme.SocksSupportSocksConnectedParams = tObject({ + uid: tString, + host: tString, + port: tInt + }); + scheme.SocksSupportSocksConnectedResult = tOptional(tObject({})); + scheme.SocksSupportSocksFailedParams = tObject({ + uid: tString, + errorCode: tString + }); + scheme.SocksSupportSocksFailedResult = tOptional(tObject({})); + scheme.SocksSupportSocksDataParams = tObject({ + uid: tString, + data: tBinary + }); + scheme.SocksSupportSocksDataResult = tOptional(tObject({})); + scheme.SocksSupportSocksErrorParams = tObject({ + uid: tString, + error: tString + }); + scheme.SocksSupportSocksErrorResult = tOptional(tObject({})); + scheme.SocksSupportSocksEndParams = tObject({ + uid: tString + }); + scheme.SocksSupportSocksEndResult = tOptional(tObject({})); + scheme.JsonPipeInitializer = tOptional(tObject({})); + scheme.JsonPipeMessageEvent = tObject({ + message: tAny + }); + scheme.JsonPipeClosedEvent = tObject({ + reason: tOptional(tString) + }); + scheme.JsonPipeSendParams = tObject({ + message: tAny + }); + scheme.JsonPipeSendResult = tOptional(tObject({})); + scheme.JsonPipeCloseParams = tOptional(tObject({})); + scheme.JsonPipeCloseResult = tOptional(tObject({})); + scheme.ExpectedTextValue = tObject({ + string: tOptional(tString), + regexSource: tOptional(tString), + regexFlags: tOptional(tString), + matchSubstring: tOptional(tBoolean), + ignoreCase: tOptional(tBoolean), + normalizeWhiteSpace: tOptional(tBoolean) + }); + scheme.SelectorEngine = tObject({ + name: tString, + source: tString, + contentScript: tOptional(tBoolean) + }); + scheme.FormField = tObject({ + name: tString, + value: tOptional(tString), + file: tOptional(tObject({ + name: tString, + mimeType: tOptional(tString), + buffer: tBinary + })) + }); + scheme.LifecycleEvent = tEnum(["load", "domcontentloaded", "networkidle", "commit"]); + scheme.ConsoleMessagesFilter = tEnum(["all", "since-navigation"]); + scheme.RecorderSource = tObject({ + isRecorded: tBoolean, + id: tString, + label: tString, + text: tString, + language: tString, + highlight: tArray(tObject({ + line: tInt, + type: tString + })), + revealLine: tOptional(tInt), + group: tOptional(tString) + }); + scheme.IndexedDBDatabase = tObject({ + name: tString, + version: tInt, + stores: tArray(tObject({ + name: tString, + autoIncrement: tBoolean, + keyPath: tOptional(tString), + keyPathArray: tOptional(tArray(tString)), + records: tArray(tObject({ + key: tOptional(tAny), + keyEncoded: tOptional(tAny), + value: tOptional(tAny), + valueEncoded: tOptional(tAny) + })), + indexes: tArray(tObject({ + name: tString, + keyPath: tOptional(tString), + keyPathArray: tOptional(tArray(tString)), + multiEntry: tBoolean, + unique: tBoolean + })) + })) + }); + scheme.SetOriginStorage = tObject({ + origin: tString, + localStorage: tArray(tType("NameValue")), + indexedDB: tOptional(tArray(tType("IndexedDBDatabase"))) + }); + scheme.OriginStorage = tObject({ + origin: tString, + localStorage: tArray(tType("NameValue")), + indexedDB: tOptional(tArray(tType("IndexedDBDatabase"))) + }); + scheme.RecordHarOptions = tObject({ + content: tOptional(tEnum(["embed", "attach", "omit"])), + mode: tOptional(tEnum(["full", "minimal"])), + urlGlob: tOptional(tString), + urlRegexSource: tOptional(tString), + urlRegexFlags: tOptional(tString), + harPath: tOptional(tString), + resourcesDir: tOptional(tString) + }); + scheme.CDPSessionInitializer = tOptional(tObject({})); + scheme.CDPSessionEventEvent = tObject({ + method: tString, + params: tOptional(tAny) + }); + scheme.CDPSessionCloseEvent = tOptional(tObject({})); + scheme.CDPSessionSendParams = tObject({ + method: tString, + params: tOptional(tAny) + }); + scheme.CDPSessionSendResult = tObject({ + result: tAny + }); + scheme.CDPSessionDetachParams = tOptional(tObject({})); + scheme.CDPSessionDetachResult = tOptional(tObject({})); + scheme.BindingCallInitializer = tObject({ + frame: tChannel(["Frame"]), + name: tString, + args: tArray(tType("SerializedValue")) + }); + scheme.BindingCallRejectParams = tObject({ + error: tType("SerializedError") + }); + scheme.BindingCallRejectResult = tOptional(tObject({})); + scheme.BindingCallResolveParams = tObject({ + result: tType("SerializedArgument") + }); + scheme.BindingCallResolveResult = tOptional(tObject({})); + scheme.DebuggerInitializer = tOptional(tObject({})); + scheme.DebuggerPausedStateChangedEvent = tObject({ + pausedDetails: tOptional(tObject({ + location: tObject({ + file: tString, + line: tOptional(tInt), + column: tOptional(tInt) + }), + title: tString, + stack: tOptional(tString) + })) + }); + scheme.DebuggerRequestPauseParams = tOptional(tObject({})); + scheme.DebuggerRequestPauseResult = tOptional(tObject({})); + scheme.DebuggerResumeParams = tOptional(tObject({})); + scheme.DebuggerResumeResult = tOptional(tObject({})); + scheme.DebuggerNextParams = tOptional(tObject({})); + scheme.DebuggerNextResult = tOptional(tObject({})); + scheme.DebuggerRunToParams = tObject({ + location: tObject({ + file: tString, + line: tOptional(tInt), + column: tOptional(tInt) + }) + }); + scheme.DebuggerRunToResult = tOptional(tObject({})); + scheme.DialogInitializer = tObject({ + page: tOptional(tChannel(["Page"])), + type: tString, + message: tString, + defaultValue: tString + }); + scheme.DialogAcceptParams = tObject({ + promptText: tOptional(tString) + }); + scheme.DialogAcceptResult = tOptional(tObject({})); + scheme.DialogDismissParams = tOptional(tObject({})); + scheme.DialogDismissResult = tOptional(tObject({})); + scheme.SerializedValue = tObject({ + n: tOptional(tFloat), + b: tOptional(tBoolean), + s: tOptional(tString), + v: tOptional(tEnum(["null", "undefined", "NaN", "Infinity", "-Infinity", "-0"])), + d: tOptional(tString), + u: tOptional(tString), + bi: tOptional(tString), + ta: tOptional(tObject({ + b: tBinary, + k: tEnum(["i8", "ui8", "ui8c", "i16", "ui16", "i32", "ui32", "f32", "f64", "bi64", "bui64"]) + })), + e: tOptional(tObject({ + m: tString, + n: tString, + s: tString + })), + r: tOptional(tObject({ + p: tString, + f: tString + })), + a: tOptional(tArray(tType("SerializedValue"))), + o: tOptional(tArray(tObject({ + k: tString, + v: tType("SerializedValue") + }))), + h: tOptional(tInt), + id: tOptional(tInt), + ref: tOptional(tInt) + }); + scheme.SerializedArgument = tObject({ + value: tType("SerializedValue"), + handles: tArray(tChannel("*")) + }); + scheme.SerializedError = tObject({ + error: tOptional(tObject({ + message: tString, + name: tString, + stack: tOptional(tString) + })), + value: tOptional(tType("SerializedValue")) + }); + scheme.StackFrame = tObject({ + file: tString, + line: tInt, + column: tInt, + function: tOptional(tString) + }); + scheme.VirtualCredential = tObject({ + id: tString, + rpId: tString, + userHandle: tString, + privateKey: tString, + publicKey: tString + }); + scheme.Point = tObject({ + x: tFloat, + y: tFloat + }); + scheme.Rect = tObject({ + x: tFloat, + y: tFloat, + width: tFloat, + height: tFloat + }); + scheme.URLPattern = tObject({ + hash: tString, + hostname: tString, + password: tString, + pathname: tString, + port: tString, + protocol: tString, + search: tString, + username: tString + }); + scheme.NameValue = tObject({ + name: tString, + value: tString + }); + scheme.TracingInitializer = tOptional(tObject({})); + scheme.TracingTracingStartParams = tObject({ + name: tOptional(tString), + snapshots: tOptional(tBoolean), + screenshots: tOptional(tBoolean), + live: tOptional(tBoolean) + }); + scheme.TracingTracingStartResult = tOptional(tObject({})); + scheme.TracingTracingStartChunkParams = tObject({ + name: tOptional(tString), + title: tOptional(tString) + }); + scheme.TracingTracingStartChunkResult = tObject({ + traceName: tString + }); + scheme.TracingTracingGroupParams = tObject({ + name: tString, + location: tOptional(tObject({ + file: tString, + line: tOptional(tInt), + column: tOptional(tInt) + })) + }); + scheme.TracingTracingGroupResult = tOptional(tObject({})); + scheme.TracingTracingGroupEndParams = tOptional(tObject({})); + scheme.TracingTracingGroupEndResult = tOptional(tObject({})); + scheme.TracingTracingStopChunkParams = tObject({ + mode: tEnum(["archive", "discard", "entries"]) + }); + scheme.TracingTracingStopChunkResult = tObject({ + artifact: tOptional(tChannel(["Artifact"])), + entries: tOptional(tArray(tType("NameValue"))) + }); + scheme.TracingTracingStopParams = tOptional(tObject({})); + scheme.TracingTracingStopResult = tOptional(tObject({})); + scheme.TracingHarStartParams = tObject({ + page: tOptional(tChannel(["Page"])), + options: tType("RecordHarOptions") + }); + scheme.TracingHarStartResult = tObject({ + harId: tString + }); + scheme.TracingHarExportParams = tObject({ + harId: tOptional(tString), + mode: tEnum(["archive", "entries"]) + }); + scheme.TracingHarExportResult = tObject({ + artifact: tOptional(tChannel(["Artifact"])), + entries: tOptional(tArray(tType("NameValue"))) + }); + scheme.WorkerInitializer = tObject({ + url: tString + }); + scheme.WorkerConsoleEvent = tObject({ + type: tString, + text: tString, + args: tArray(tChannel(["ElementHandle", "JSHandle"])), + location: tObject({ + url: tString, + lineNumber: tInt, + columnNumber: tInt + }), + timestamp: tFloat + }); + scheme.WorkerCloseEvent = tOptional(tObject({})); + scheme.WorkerDisconnectParams = tObject({ + reason: tOptional(tString) + }); + scheme.WorkerDisconnectResult = tOptional(tObject({})); + scheme.WorkerEvaluateExpressionParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.WorkerEvaluateExpressionResult = tObject({ + value: tType("SerializedValue") + }); + scheme.WorkerEvaluateExpressionHandleParams = tObject({ + expression: tString, + isFunction: tOptional(tBoolean), + arg: tType("SerializedArgument") + }); + scheme.WorkerEvaluateExpressionHandleResult = tObject({ + handle: tChannel(["ElementHandle", "JSHandle"]) + }); + scheme.WorkerUpdateSubscriptionParams = tObject({ + event: tEnum(["console"]), + enabled: tBoolean + }); + scheme.WorkerUpdateSubscriptionResult = tOptional(tObject({})); + } +}); + +// packages/playwright-core/src/server/protocolError.ts +function isProtocolError(e) { + return e instanceof ProtocolError; +} +function isSessionClosedError(e) { + return e instanceof ProtocolError && (e.type === "closed" || e.type === "crashed"); +} +var ProtocolError; +var init_protocolError = __esm({ + "packages/playwright-core/src/server/protocolError.ts"() { + "use strict"; + init_stackTrace(); + ProtocolError = class extends Error { + constructor(type3, method, logs) { + super(); + this.type = type3; + this.method = method; + this.logs = logs; + } + setMessage(message) { + rewriteErrorMessage(this, `Protocol error (${this.method}): ${message}`); + } + browserLogMessage() { + return this.logs ? "\nBrowser logs:\n" + this.logs : ""; + } + }; + } +}); + +// packages/playwright-core/src/server/callLog.ts +function compressCallLog(log2) { + const lines = []; + for (const block of findRepeatedSubsequences(log2)) { + for (let i = 0; i < block.sequence.length; i++) { + const line = block.sequence[i]; + const leadingWhitespace = line.match(/^\s*/); + const whitespacePrefix = " " + leadingWhitespace?.[0] || ""; + const countPrefix = `${block.count} \xD7 `; + if (block.count > 1 && i === 0) + lines.push(whitespacePrefix + countPrefix + line.trim()); + else if (block.count > 1) + lines.push(whitespacePrefix + " ".repeat(countPrefix.length - 2) + "- " + line.trim()); + else + lines.push(whitespacePrefix + "- " + line.trim()); + } + } + return lines; +} +function findRepeatedSubsequences(s) { + const n = s.length; + const result2 = []; + let i = 0; + const arraysEqual = (a1, a2) => { + if (a1.length !== a2.length) + return false; + for (let j = 0; j < a1.length; j++) { + if (a1[j] !== a2[j]) + return false; + } + return true; + }; + while (i < n) { + let maxRepeatCount = 1; + let maxRepeatSubstr = [s[i]]; + let maxRepeatLength = 1; + for (let p = 1; p <= n - i; p++) { + const substr = s.slice(i, i + p); + let k = 1; + while (i + p * k <= n && arraysEqual(s.slice(i + p * (k - 1), i + p * k), substr)) + k += 1; + k -= 1; + if (k > 1 && k * p > maxRepeatCount * maxRepeatLength) { + maxRepeatCount = k; + maxRepeatSubstr = substr; + maxRepeatLength = p; + } + } + result2.push({ sequence: maxRepeatSubstr, count: maxRepeatCount }); + i += maxRepeatLength * maxRepeatCount; + } + return result2; +} +var findRepeatedSubsequencesForTest; +var init_callLog = __esm({ + "packages/playwright-core/src/server/callLog.ts"() { + "use strict"; + findRepeatedSubsequencesForTest = findRepeatedSubsequences; + } +}); + +// packages/playwright-core/src/server/dispatchers/dispatcher.ts +function setMaxDispatchersForTest(value2) { + maxDispatchersOverride = value2; +} +function maxDispatchersForBucket(gcBucket) { + return maxDispatchersOverride ?? { + "JSHandle": 1e5, + "ElementHandle": 1e5 + }[gcBucket] ?? 1e4; +} +var import_events5, metadataValidator, waitInfoValidator, maxDispatchersOverride, Dispatcher, RootDispatcher, DispatcherConnection; +var init_dispatcher = __esm({ + "packages/playwright-core/src/server/dispatchers/dispatcher.ts"() { + "use strict"; + import_events5 = require("events"); + init_protocolMetainfo(); + init_eventsHelper(); + init_debug(); + init_assert(); + init_time(); + init_stackTrace(); + init_validator(); + init_errors(); + init_instrumentation(); + init_protocolError(); + init_callLog(); + init_progress(); + metadataValidator = createMetadataValidator(); + waitInfoValidator = createWaitInfoValidator(); + Dispatcher = class extends import_events5.EventEmitter { + constructor(parent, object, type3, initializer, gcBucket) { + super(); + this._dispatchers = /* @__PURE__ */ new Map(); + this._disposed = false; + this._eventListeners = []; + this._activeProgressControllers = /* @__PURE__ */ new Set(); + this.connection = parent instanceof DispatcherConnection ? parent : parent.connection; + this._parent = parent instanceof DispatcherConnection ? void 0 : parent; + const guid = object.guid; + this._guid = guid; + this._type = type3; + this._object = object; + this._gcBucket = gcBucket ?? type3; + this.connection.registerDispatcher(this); + if (this._parent) { + assert(!this._parent._dispatchers.has(guid)); + this._parent._dispatchers.set(guid, this); + } + if (this._parent) + this.connection.sendCreate(this._parent, type3, guid, initializer); + this.connection.maybeDisposeStaleDispatchers(this._gcBucket); + } + parentScope() { + return this._parent; + } + addObjectListener(eventName, handler) { + this._eventListeners.push(eventsHelper.addEventListener(this._object, eventName, handler)); + } + adopt(child) { + if (child._parent === this) + return; + const oldParent = child._parent; + oldParent._dispatchers.delete(child._guid); + this._dispatchers.set(child._guid, child); + child._parent = this; + this.connection.sendAdopt(this, child); + } + async _runCommand(callMetadata, method, validParams) { + const controller = ProgressController.createForSdkObject(this._object, callMetadata); + this._activeProgressControllers.add(controller); + try { + return await controller.run((progress2) => this[method](validParams, progress2), validParams?.timeout); + } finally { + this._activeProgressControllers.delete(controller); + } + } + _dispatchEvent(method, params2) { + if (this._disposed) { + if (isUnderTest()) + throw new Error(`${this._guid} is sending "${String(method)}" event after being disposed`); + return; + } + this.connection.sendEvent(this, method, params2); + } + _dispose(reason) { + this._disposeRecursively(new TargetClosedError(this._object.closeReason())); + this.connection.sendDispose(this, reason); + } + _onDispose() { + } + async stopPendingOperations(error) { + const controllers = []; + const collect = (dispatcher) => { + controllers.push(...dispatcher._activeProgressControllers); + for (const child of [...dispatcher._dispatchers.values()]) + collect(child); + }; + collect(this); + await Promise.all(controllers.map((controller) => controller.abort(error))); + } + _disposeRecursively(error) { + assert(!this._disposed, `${this._guid} is disposed more than once`); + this._onDispose(); + this._disposed = true; + eventsHelper.removeEventListeners(this._eventListeners); + this._parent?._dispatchers.delete(this._guid); + const list = this.connection._dispatchersByBucket.get(this._gcBucket); + list?.delete(this._guid); + this.connection._dispatcherByGuid.delete(this._guid); + this.connection._dispatcherByObject.delete(this._object); + for (const dispatcher of [...this._dispatchers.values()]) + dispatcher._disposeRecursively(error); + this._dispatchers.clear(); + } + _debugScopeState() { + return { + _guid: this._guid, + objects: Array.from(this._dispatchers.values()).map((o) => o._debugScopeState()) + }; + } + }; + RootDispatcher = class extends Dispatcher { + constructor(connection, createPlaywright2) { + super(connection, createRootSdkObject(), "Root", {}); + this.createPlaywright = createPlaywright2; + this._initialized = false; + } + async initialize(params2, progress2) { + assert(this.createPlaywright); + assert(!this._initialized); + this._initialized = true; + return { + playwright: await progress2.race(this.createPlaywright(this, params2)) + }; + } + }; + DispatcherConnection = class { + constructor(isInProcess) { + this._dispatcherByGuid = /* @__PURE__ */ new Map(); + this._dispatcherByObject = /* @__PURE__ */ new Map(); + this._dispatchersByBucket = /* @__PURE__ */ new Map(); + this.onmessage = (message) => { + }; + this._waitOperations = /* @__PURE__ */ new Map(); + this._isInProcess = !!isInProcess; + } + sendEvent(dispatcher, event, params2) { + const validator = findValidator(dispatcher._type, event, "Event"); + params2 = validator(params2, "", this._validatorToWireContext()); + this.onmessage({ guid: dispatcher._guid, method: event, params: params2 }); + } + sendCreate(parent, type3, guid, initializer) { + const validator = findValidator(type3, "", "Initializer"); + initializer = validator(initializer, "", this._validatorToWireContext()); + this.onmessage({ guid: parent._guid, method: "__create__", params: { type: type3, initializer, guid } }); + } + sendAdopt(parent, dispatcher) { + this.onmessage({ guid: parent._guid, method: "__adopt__", params: { guid: dispatcher._guid } }); + } + sendDispose(dispatcher, reason) { + this.onmessage({ guid: dispatcher._guid, method: "__dispose__", params: { reason } }); + } + _validatorToWireContext() { + return { + tChannelImpl: this._tChannelImplToWire.bind(this), + binary: this._isInProcess ? "buffer" : "toBase64", + isUnderTest + }; + } + _validatorFromWireContext() { + return { + tChannelImpl: this._tChannelImplFromWire.bind(this), + binary: this._isInProcess ? "buffer" : "fromBase64", + isUnderTest + }; + } + _tChannelImplFromWire(names, arg, path59, context2) { + if (arg && typeof arg === "object" && typeof arg.guid === "string") { + const guid = arg.guid; + const dispatcher = this._dispatcherByGuid.get(guid); + if (!dispatcher) + throw new ValidationError(`${path59}: no object with guid ${guid}`); + if (names !== "*" && !names.includes(dispatcher._type)) + throw new ValidationError(`${path59}: object with guid ${guid} has type ${dispatcher._type}, expected ${names.toString()}`); + return dispatcher; + } + throw new ValidationError(`${path59}: expected guid for ${names.toString()}`); + } + _tChannelImplToWire(names, arg, path59, context2) { + if (arg instanceof Dispatcher) { + if (names !== "*" && !names.includes(arg._type)) + throw new ValidationError(`${path59}: dispatcher with guid ${arg._guid} has type ${arg._type}, expected ${names.toString()}`); + return { guid: arg._guid }; + } + throw new ValidationError(`${path59}: expected dispatcher ${names.toString()}`); + } + existingDispatcher(object) { + return this._dispatcherByObject.get(object); + } + registerDispatcher(dispatcher) { + assert(!this._dispatcherByGuid.has(dispatcher._guid)); + this._dispatcherByGuid.set(dispatcher._guid, dispatcher); + this._dispatcherByObject.set(dispatcher._object, dispatcher); + let list = this._dispatchersByBucket.get(dispatcher._gcBucket); + if (!list) { + list = /* @__PURE__ */ new Set(); + this._dispatchersByBucket.set(dispatcher._gcBucket, list); + } + list.add(dispatcher._guid); + } + maybeDisposeStaleDispatchers(gcBucket) { + const maxDispatchers = maxDispatchersForBucket(gcBucket); + const list = this._dispatchersByBucket.get(gcBucket); + if (!list || list.size <= maxDispatchers) + return; + const dispatchersArray = [...list]; + const disposeCount = maxDispatchers / 10 | 0; + this._dispatchersByBucket.set(gcBucket, new Set(dispatchersArray.slice(disposeCount))); + for (let i = 0; i < disposeCount; ++i) { + const d = this._dispatcherByGuid.get(dispatchersArray[i]); + if (!d) + continue; + d._dispose("gc"); + } + } + async dispatch(message) { + const { id, guid, method, params: params2, metadata } = message; + const dispatcher = this._dispatcherByGuid.get(guid); + if (method === "__waitInfo__") { + if (dispatcher) + await this._dispatchWaitInfo(id, dispatcher, params2, metadata); + return; + } + if (!dispatcher) { + this.onmessage({ id, error: serializeError(new TargetClosedError(void 0)) }); + return; + } + let validParams; + let validMetadata; + try { + const validator = findValidator(dispatcher._type, method, "Params"); + const validatorContext = this._validatorFromWireContext(); + validParams = validator(params2, "", validatorContext); + validMetadata = metadataValidator(metadata, "", validatorContext); + if (typeof dispatcher[method] !== "function") + throw new Error(`Mismatching dispatcher: "${dispatcher._type}" does not implement "${method}"`); + } catch (e) { + this.onmessage({ id, error: serializeError(e) }); + return; + } + const metainfo = getMetainfo({ type: dispatcher._type, method }); + if (metainfo?.internal) { + validMetadata.internal = true; + } + const sdkObject = dispatcher._object; + const callMetadata = { + id: `call@${id}`, + location: validMetadata.location, + title: validMetadata.title, + internal: validMetadata.internal, + stepId: validMetadata.stepId, + objectId: sdkObject.guid, + pageId: sdkObject.attribution?.page?.guid, + frameId: sdkObject.attribution?.frame?.guid, + startTime: monotonicTime(), + endTime: 0, + type: dispatcher._type, + method, + params: params2 || {}, + log: [] + }; + await sdkObject.instrumentation.onBeforeCall(sdkObject, callMetadata); + const response2 = { id }; + try { + if (this._dispatcherByGuid.get(guid) !== dispatcher) + throw new TargetClosedError(sdkObject.closeReason()); + const result2 = await dispatcher._runCommand(callMetadata, method, validParams); + const validator = findValidator(dispatcher._type, method, "Result"); + response2.result = validator(result2, "", this._validatorToWireContext()); + callMetadata.result = result2; + } catch (e) { + if (isTargetClosedError(e)) { + const reason = sdkObject.closeReason(); + if (reason) + rewriteErrorMessage(e, reason); + } else if (isProtocolError(e)) { + if (e.type === "closed") + e = new TargetClosedError(sdkObject.closeReason(), e.browserLogMessage()); + else if (e.type === "crashed") + rewriteErrorMessage(e, "Target crashed " + e.browserLogMessage()); + } + response2.error = serializeError(e); + const detailsValidator = maybeFindValidator(dispatcher._type, method, "ErrorDetails"); + if (detailsValidator) + response2.errorDetails = detailsValidator(e?.details ?? {}, "", this._validatorToWireContext()); + callMetadata.error = response2.error; + } finally { + callMetadata.endTime = monotonicTime(); + await sdkObject.instrumentation.onAfterCall(sdkObject, callMetadata); + if (metainfo?.slowMo) + await this._doSlowMo(sdkObject); + } + if (response2.error) + response2.log = compressCallLog(callMetadata.log); + this.onmessage(response2); + } + async _doSlowMo(sdkObject) { + const slowMo = sdkObject.attribution.browser?.options.slowMo; + if (slowMo) + await new Promise((f) => setTimeout(f, slowMo)); + } + async _dispatchWaitInfo(id, dispatcher, params2, metadata) { + let info; + let validMetadata; + try { + const validatorContext = this._validatorFromWireContext(); + info = waitInfoValidator(params2, "", validatorContext); + validMetadata = metadataValidator(metadata, "", validatorContext); + } catch { + return; + } + const sdkObject = dispatcher._object; + if (info.phase === "before") { + const callMetadata = { + id: `call@${id}`, + location: validMetadata.location, + title: validMetadata.title, + internal: validMetadata.internal, + stepId: validMetadata.stepId, + objectId: sdkObject.guid, + pageId: sdkObject.attribution?.page?.guid, + frameId: sdkObject.attribution?.frame?.guid, + startTime: monotonicTime(), + endTime: 0, + type: dispatcher._type, + method: "__waitInfo__", + params: params2 || {}, + log: [] + }; + this._waitOperations.set(info.waitId, callMetadata); + await sdkObject.instrumentation.onBeforeCall(sdkObject, callMetadata).catch(() => { + }); + return; + } + const originalMetadata = this._waitOperations.get(info.waitId); + if (!originalMetadata) + return; + if (info.phase === "log" && info.message) { + originalMetadata.log.push(info.message); + sdkObject.instrumentation.onCallLog(sdkObject, originalMetadata, "api", info.message); + return; + } + if (info.phase === "after") { + originalMetadata.endTime = monotonicTime(); + originalMetadata.error = info.error ? { error: { name: "Error", message: info.error } } : void 0; + this._waitOperations.delete(info.waitId); + await sdkObject.instrumentation.onAfterCall(sdkObject, originalMetadata).catch(() => { + }); + } + } + }; + } +}); + +// packages/isomorphic/utilityScriptSerializers.ts +function isRegExp5(obj) { + try { + return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]"; + } catch (error) { + return false; + } +} +function isDate2(obj) { + try { + return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]"; + } catch (error) { + return false; + } +} +function isURL2(obj) { + try { + return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]"; + } catch (error) { + return false; + } +} +function isError3(obj) { + try { + return obj instanceof Error || obj && Object.getPrototypeOf(obj)?.name === "Error"; + } catch (error) { + return false; + } +} +function isTypedArray(obj, constructor) { + try { + return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`; + } catch (error) { + return false; + } +} +function isArrayBuffer(obj) { + try { + return obj instanceof ArrayBuffer || Object.prototype.toString.call(obj) === "[object ArrayBuffer]"; + } catch (error) { + return false; + } +} +function typedArrayToBase64(array) { + if ("toBase64" in array) + return array.toBase64(); + const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join(""); + return btoa(binary); +} +function base64ToTypedArray(base64, TypedArrayConstructor) { + const binary = atob(base64); + const bytes = new Uint8Array(binary.length); + for (let i = 0; i < binary.length; i++) + bytes[i] = binary.charCodeAt(i); + return new TypedArrayConstructor(bytes.buffer); +} +function parseEvaluationResultValue(value2, handles = [], refs = /* @__PURE__ */ new Map()) { + if (Object.is(value2, void 0)) + return void 0; + if (typeof value2 === "object" && value2) { + if ("ref" in value2) + return refs.get(value2.ref); + if ("v" in value2) { + if (value2.v === "undefined") + return void 0; + if (value2.v === "null") + return null; + if (value2.v === "NaN") + return NaN; + if (value2.v === "Infinity") + return Infinity; + if (value2.v === "-Infinity") + return -Infinity; + if (value2.v === "-0") + return -0; + return void 0; + } + if ("d" in value2) { + return new Date(value2.d); + } + if ("u" in value2) + return new URL(value2.u); + if ("bi" in value2) + return BigInt(value2.bi); + if ("e" in value2) { + const error = new Error(value2.e.m); + error.name = value2.e.n; + error.stack = value2.e.s; + return error; + } + if ("r" in value2) + return new RegExp(value2.r.p, value2.r.f); + if ("a" in value2) { + const result2 = []; + refs.set(value2.id, result2); + for (const a of value2.a) + result2.push(parseEvaluationResultValue(a, handles, refs)); + return result2; + } + if ("o" in value2) { + const result2 = {}; + refs.set(value2.id, result2); + for (const { k, v } of value2.o) { + if (k === "__proto__") + continue; + result2[k] = parseEvaluationResultValue(v, handles, refs); + } + return result2; + } + if ("h" in value2) + return handles[value2.h]; + if ("ta" in value2) + return base64ToTypedArray(value2.ta.b, typedArrayConstructors[value2.ta.k]); + if ("ab" in value2) + return base64ToTypedArray(value2.ab.b, Uint8Array).buffer; + } + return value2; +} +function serializeAsCallArgument(value2, handleSerializer) { + return serialize(value2, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 }); +} +function serialize(value2, handleSerializer, visitorInfo) { + if (value2 && typeof value2 === "object") { + if (typeof globalThis.Window === "function" && value2 instanceof globalThis.Window) + return "ref: "; + if (typeof globalThis.Document === "function" && value2 instanceof globalThis.Document) + return "ref: "; + if (typeof globalThis.Node === "function" && value2 instanceof globalThis.Node) + return "ref: "; + } + return innerSerialize(value2, handleSerializer, visitorInfo); +} +function innerSerialize(value2, handleSerializer, visitorInfo) { + const result2 = handleSerializer(value2); + if ("fallThrough" in result2) + value2 = result2.fallThrough; + else + return result2; + if (typeof value2 === "symbol") + return { v: "undefined" }; + if (Object.is(value2, void 0)) + return { v: "undefined" }; + if (Object.is(value2, null)) + return { v: "null" }; + if (Object.is(value2, NaN)) + return { v: "NaN" }; + if (Object.is(value2, Infinity)) + return { v: "Infinity" }; + if (Object.is(value2, -Infinity)) + return { v: "-Infinity" }; + if (Object.is(value2, -0)) + return { v: "-0" }; + if (typeof value2 === "boolean") + return value2; + if (typeof value2 === "number") + return value2; + if (typeof value2 === "string") + return value2; + if (typeof value2 === "bigint") + return { bi: value2.toString() }; + if (isError3(value2)) { + let stack; + if (value2.stack?.startsWith(value2.name + ": " + value2.message)) { + stack = value2.stack; + } else { + stack = `${value2.name}: ${value2.message} +${value2.stack}`; + } + return { e: { n: value2.name, m: value2.message, s: stack } }; + } + if (isDate2(value2)) + return { d: value2.toJSON() }; + if (isURL2(value2)) + return { u: value2.toJSON() }; + if (isRegExp5(value2)) + return { r: { p: value2.source, f: value2.flags } }; + for (const [k, ctor] of Object.entries(typedArrayConstructors)) { + if (isTypedArray(value2, ctor)) + return { ta: { b: typedArrayToBase64(value2), k } }; + } + if (isArrayBuffer(value2)) + return { ab: { b: typedArrayToBase64(new Uint8Array(value2)) } }; + const id = visitorInfo.visited.get(value2); + if (id) + return { ref: id }; + if (Array.isArray(value2)) { + const a = []; + const id2 = ++visitorInfo.lastId; + visitorInfo.visited.set(value2, id2); + for (let i = 0; i < value2.length; ++i) + a.push(serialize(value2[i], handleSerializer, visitorInfo)); + return { a, id: id2 }; + } + if (typeof value2 === "object") { + const o = []; + const id2 = ++visitorInfo.lastId; + visitorInfo.visited.set(value2, id2); + for (const name of Object.keys(value2)) { + let item; + try { + item = value2[name]; + } catch (e) { + continue; + } + if (name === "toJSON" && typeof item === "function") + o.push({ k: name, v: { o: [], id: 0 } }); + else + o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) }); + } + let jsonWrapper; + try { + if (o.length === 0 && value2.toJSON && typeof value2.toJSON === "function") + jsonWrapper = { value: value2.toJSON() }; + } catch (e) { + } + if (jsonWrapper) + return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo); + return { o, id: id2 }; + } +} +var typedArrayConstructors; +var init_utilityScriptSerializers = __esm({ + "packages/isomorphic/utilityScriptSerializers.ts"() { + "use strict"; + typedArrayConstructors = { + i8: Int8Array, + ui8: Uint8Array, + ui8c: Uint8ClampedArray, + i16: Int16Array, + ui16: Uint16Array, + i32: Int32Array, + ui32: Uint32Array, + // TODO: add Float16Array once it's in baseline + f32: Float32Array, + f64: Float64Array, + bi64: BigInt64Array, + bui64: BigUint64Array + }; + } +}); + +// packages/playwright-core/src/generated/utilityScriptSource.ts +var source3; +var init_utilityScriptSource = __esm({ + "packages/playwright-core/src/generated/utilityScriptSource.ts"() { + "use strict"; + source3 = '\nvar __commonJS = obj => {\n let required = false;\n let result;\n return function __require() {\n if (!required) {\n required = true;\n let fn;\n for (const name in obj) { fn = obj[name]; break; }\n const module = { exports: {} };\n fn(module.exports, module);\n result = module.exports;\n }\n return result;\n }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/utilityScript.ts\nvar utilityScript_exports = {};\n__export(utilityScript_exports, {\n UtilityScript: () => UtilityScript\n});\nmodule.exports = __toCommonJS(utilityScript_exports);\n\n// packages/isomorphic/utilityScriptSerializers.ts\nfunction isRegExp(obj) {\n try {\n return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";\n } catch (error) {\n return false;\n }\n}\nfunction isDate(obj) {\n try {\n return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";\n } catch (error) {\n return false;\n }\n}\nfunction isURL(obj) {\n try {\n return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";\n } catch (error) {\n return false;\n }\n}\nfunction isError(obj) {\n var _a;\n try {\n return obj instanceof Error || obj && ((_a = Object.getPrototypeOf(obj)) == null ? void 0 : _a.name) === "Error";\n } catch (error) {\n return false;\n }\n}\nfunction isTypedArray(obj, constructor) {\n try {\n return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;\n } catch (error) {\n return false;\n }\n}\nfunction isArrayBuffer(obj) {\n try {\n return obj instanceof ArrayBuffer || Object.prototype.toString.call(obj) === "[object ArrayBuffer]";\n } catch (error) {\n return false;\n }\n}\nvar typedArrayConstructors = {\n i8: Int8Array,\n ui8: Uint8Array,\n ui8c: Uint8ClampedArray,\n i16: Int16Array,\n ui16: Uint16Array,\n i32: Int32Array,\n ui32: Uint32Array,\n // TODO: add Float16Array once it\'s in baseline\n f32: Float32Array,\n f64: Float64Array,\n bi64: BigInt64Array,\n bui64: BigUint64Array\n};\nfunction typedArrayToBase64(array) {\n if ("toBase64" in array)\n return array.toBase64();\n const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");\n return btoa(binary);\n}\nfunction base64ToTypedArray(base64, TypedArrayConstructor) {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++)\n bytes[i] = binary.charCodeAt(i);\n return new TypedArrayConstructor(bytes.buffer);\n}\nfunction parseEvaluationResultValue(value, handles = [], refs = /* @__PURE__ */ new Map()) {\n if (Object.is(value, void 0))\n return void 0;\n if (typeof value === "object" && value) {\n if ("ref" in value)\n return refs.get(value.ref);\n if ("v" in value) {\n if (value.v === "undefined")\n return void 0;\n if (value.v === "null")\n return null;\n if (value.v === "NaN")\n return NaN;\n if (value.v === "Infinity")\n return Infinity;\n if (value.v === "-Infinity")\n return -Infinity;\n if (value.v === "-0")\n return -0;\n return void 0;\n }\n if ("d" in value) {\n return new Date(value.d);\n }\n if ("u" in value)\n return new URL(value.u);\n if ("bi" in value)\n return BigInt(value.bi);\n if ("e" in value) {\n const error = new Error(value.e.m);\n error.name = value.e.n;\n error.stack = value.e.s;\n return error;\n }\n if ("r" in value)\n return new RegExp(value.r.p, value.r.f);\n if ("a" in value) {\n const result = [];\n refs.set(value.id, result);\n for (const a of value.a)\n result.push(parseEvaluationResultValue(a, handles, refs));\n return result;\n }\n if ("o" in value) {\n const result = {};\n refs.set(value.id, result);\n for (const { k, v } of value.o) {\n if (k === "__proto__")\n continue;\n result[k] = parseEvaluationResultValue(v, handles, refs);\n }\n return result;\n }\n if ("h" in value)\n return handles[value.h];\n if ("ta" in value)\n return base64ToTypedArray(value.ta.b, typedArrayConstructors[value.ta.k]);\n if ("ab" in value)\n return base64ToTypedArray(value.ab.b, Uint8Array).buffer;\n }\n return value;\n}\nfunction serializeAsCallArgument(value, handleSerializer) {\n return serialize(value, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });\n}\nfunction serialize(value, handleSerializer, visitorInfo) {\n if (value && typeof value === "object") {\n if (typeof globalThis.Window === "function" && value instanceof globalThis.Window)\n return "ref: ";\n if (typeof globalThis.Document === "function" && value instanceof globalThis.Document)\n return "ref: ";\n if (typeof globalThis.Node === "function" && value instanceof globalThis.Node)\n return "ref: ";\n }\n return innerSerialize(value, handleSerializer, visitorInfo);\n}\nfunction innerSerialize(value, handleSerializer, visitorInfo) {\n var _a;\n const result = handleSerializer(value);\n if ("fallThrough" in result)\n value = result.fallThrough;\n else\n return result;\n if (typeof value === "symbol")\n return { v: "undefined" };\n if (Object.is(value, void 0))\n return { v: "undefined" };\n if (Object.is(value, null))\n return { v: "null" };\n if (Object.is(value, NaN))\n return { v: "NaN" };\n if (Object.is(value, Infinity))\n return { v: "Infinity" };\n if (Object.is(value, -Infinity))\n return { v: "-Infinity" };\n if (Object.is(value, -0))\n return { v: "-0" };\n if (typeof value === "boolean")\n return value;\n if (typeof value === "number")\n return value;\n if (typeof value === "string")\n return value;\n if (typeof value === "bigint")\n return { bi: value.toString() };\n if (isError(value)) {\n let stack;\n if ((_a = value.stack) == null ? void 0 : _a.startsWith(value.name + ": " + value.message)) {\n stack = value.stack;\n } else {\n stack = `${value.name}: ${value.message}\n${value.stack}`;\n }\n return { e: { n: value.name, m: value.message, s: stack } };\n }\n if (isDate(value))\n return { d: value.toJSON() };\n if (isURL(value))\n return { u: value.toJSON() };\n if (isRegExp(value))\n return { r: { p: value.source, f: value.flags } };\n for (const [k, ctor] of Object.entries(typedArrayConstructors)) {\n if (isTypedArray(value, ctor))\n return { ta: { b: typedArrayToBase64(value), k } };\n }\n if (isArrayBuffer(value))\n return { ab: { b: typedArrayToBase64(new Uint8Array(value)) } };\n const id = visitorInfo.visited.get(value);\n if (id)\n return { ref: id };\n if (Array.isArray(value)) {\n const a = [];\n const id2 = ++visitorInfo.lastId;\n visitorInfo.visited.set(value, id2);\n for (let i = 0; i < value.length; ++i)\n a.push(serialize(value[i], handleSerializer, visitorInfo));\n return { a, id: id2 };\n }\n if (typeof value === "object") {\n const o = [];\n const id2 = ++visitorInfo.lastId;\n visitorInfo.visited.set(value, id2);\n for (const name of Object.keys(value)) {\n let item;\n try {\n item = value[name];\n } catch (e) {\n continue;\n }\n if (name === "toJSON" && typeof item === "function")\n o.push({ k: name, v: { o: [], id: 0 } });\n else\n o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });\n }\n let jsonWrapper;\n try {\n if (o.length === 0 && value.toJSON && typeof value.toJSON === "function")\n jsonWrapper = { value: value.toJSON() };\n } catch (e) {\n }\n if (jsonWrapper)\n return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);\n return { o, id: id2 };\n }\n}\n\n// packages/injected/src/utilityScript.ts\nvar UtilityScript = class {\n constructor(global, isUnderTest) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n this.global = global;\n this.isUnderTest = isUnderTest;\n if (global.__pwClock) {\n this.builtins = global.__pwClock.builtins;\n } else {\n this.builtins = {\n setTimeout: (_a = global.setTimeout) == null ? void 0 : _a.bind(global),\n clearTimeout: (_b = global.clearTimeout) == null ? void 0 : _b.bind(global),\n setInterval: (_c = global.setInterval) == null ? void 0 : _c.bind(global),\n clearInterval: (_d = global.clearInterval) == null ? void 0 : _d.bind(global),\n requestAnimationFrame: (_e = global.requestAnimationFrame) == null ? void 0 : _e.bind(global),\n cancelAnimationFrame: (_f = global.cancelAnimationFrame) == null ? void 0 : _f.bind(global),\n requestIdleCallback: (_g = global.requestIdleCallback) == null ? void 0 : _g.bind(global),\n cancelIdleCallback: (_h = global.cancelIdleCallback) == null ? void 0 : _h.bind(global),\n performance: global.performance,\n Intl: global.Intl,\n Date: global.Date,\n AbortSignal: global.AbortSignal\n };\n }\n if (this.isUnderTest)\n global.builtins = this.builtins;\n }\n evaluate(isFunction, returnByValue, expression, argCount, ...argsAndHandles) {\n const args = argsAndHandles.slice(0, argCount);\n const handles = argsAndHandles.slice(argCount);\n const parameters = [];\n for (let i = 0; i < args.length; i++)\n parameters[i] = parseEvaluationResultValue(args[i], handles);\n let result = this.global.eval(expression);\n if (isFunction === true) {\n result = result(...parameters);\n } else if (isFunction === false) {\n result = result;\n } else {\n if (typeof result === "function")\n result = result(...parameters);\n }\n return returnByValue ? this._promiseAwareJsonValueNoThrow(result) : result;\n }\n jsonValue(returnByValue, value) {\n if (value === void 0)\n return void 0;\n return serializeAsCallArgument(value, (value2) => ({ fallThrough: value2 }));\n }\n _promiseAwareJsonValueNoThrow(value) {\n const safeJson = (value2) => {\n try {\n return this.jsonValue(true, value2);\n } catch (e) {\n return void 0;\n }\n };\n if (value && typeof value === "object" && typeof value.then === "function") {\n return (async () => {\n const promiseValue = await value;\n return safeJson(promiseValue);\n })();\n }\n return safeJson(value);\n }\n};\n'; + } +}); + +// packages/playwright-core/src/server/javascript.ts +async function evaluate(context2, returnByValue, pageFunction, ...args) { + return evaluateExpression(context2, String(pageFunction), { returnByValue, isFunction: typeof pageFunction === "function" }, ...args); +} +async function evaluateExpression(context2, expression2, options, ...args) { + expression2 = normalizeEvaluationExpression(expression2, options.isFunction); + const handles = []; + const toDispose = []; + const pushHandle = (handle) => { + handles.push(handle); + return handles.length - 1; + }; + args = args.map((arg) => serializeAsCallArgument(arg, (handle) => { + if (handle instanceof JSHandle) { + if (!handle._objectId) + return { fallThrough: handle._value }; + if (handle._disposed) + throw new JavaScriptErrorInEvaluate("JSHandle is disposed!"); + const adopted = context2.adoptIfNeeded(handle); + if (adopted === null) + return { h: pushHandle(Promise.resolve(handle)) }; + toDispose.push(adopted); + return { h: pushHandle(adopted) }; + } + return { fallThrough: handle }; + })); + const utilityScriptObjects = []; + for (const handle of await Promise.all(handles)) { + if (handle._context !== context2) + throw new JavaScriptErrorInEvaluate("JSHandles can be evaluated only in the context they were created!"); + utilityScriptObjects.push(handle); + } + const utilityScriptValues = [options.isFunction, options.returnByValue, expression2, args.length, ...args]; + const script = `(utilityScript, ...args) => utilityScript.evaluate(...args)`; + try { + return await context2._evaluateWithArguments(script, options.returnByValue || false, utilityScriptValues, utilityScriptObjects); + } finally { + toDispose.map((handlePromise) => handlePromise.then((handle) => handle.dispose())); + } +} +function parseUnserializableValue(unserializableValue) { + if (unserializableValue === "NaN") + return NaN; + if (unserializableValue === "Infinity") + return Infinity; + if (unserializableValue === "-Infinity") + return -Infinity; + if (unserializableValue === "-0") + return -0; +} +function normalizeEvaluationExpression(expression2, isFunction2) { + expression2 = expression2.trim(); + if (isFunction2) { + try { + new Function("(" + expression2 + ")"); + } catch (e1) { + if (expression2.startsWith("async ")) + expression2 = "async function " + expression2.substring("async ".length); + else + expression2 = "function " + expression2; + try { + new Function("(" + expression2 + ")"); + } catch (e2) { + throw new Error("Passed function is not well-serializable!"); + } + } + } + if (/^(async)?\s*function(\s|\()/.test(expression2)) + expression2 = "(" + expression2 + ")"; + return expression2; +} +function isJavaScriptErrorInEvaluate(error) { + return error instanceof JavaScriptErrorInEvaluate; +} +function sparseArrayToString(entries) { + const arrayEntries = []; + for (const { name, value: value2 } of entries) { + const index = +name; + if (isNaN(index) || index < 0) + continue; + arrayEntries.push({ index, value: value2 }); + } + arrayEntries.sort((a, b) => a.index - b.index); + let lastIndex = -1; + const tokens = []; + for (const { index, value: value2 } of arrayEntries) { + const emptyItems = index - lastIndex - 1; + if (emptyItems === 1) + tokens.push(`empty`); + else if (emptyItems > 1) + tokens.push(`empty x ${emptyItems}`); + tokens.push(String(value2)); + lastIndex = index; + } + return "[" + tokens.join(", ") + "]"; +} +var ExecutionContext, JSHandle, JavaScriptErrorInEvaluate, snapshottedFunctionBuiltins, snapshottedObjectBuiltins, snapshottedTimerBuiltins, saveGlobalsSnapshotSource, mainWorldGlobalsSnapshotSource; +var init_javascript = __esm({ + "packages/playwright-core/src/server/javascript.ts"() { + "use strict"; + init_utilityScriptSerializers(); + init_manualPromise(); + init_debug(); + init_instrumentation(); + init_utilityScriptSource(); + ExecutionContext = class extends SdkObject { + constructor(parent, delegate, worldNameForTest, options) { + super(parent, "execution-context"); + this._contextDestroyedScope = new LongStandingScope(); + this.worldNameForTest = worldNameForTest; + this._noUtilityWorld = options?.noUtilityWorld; + this.delegate = delegate; + } + contextDestroyed(reason) { + this._contextDestroyedScope.close(new Error(reason)); + } + async raceAgainstContextDestroyed(promise) { + return this._contextDestroyedScope.race(promise); + } + rawEvaluateJSON(expression2) { + return this.raceAgainstContextDestroyed(this.delegate.rawEvaluateJSON(expression2)); + } + rawEvaluateHandle(expression2) { + return this.raceAgainstContextDestroyed(this.delegate.rawEvaluateHandle(this, expression2)); + } + async _evaluateWithArguments(expression2, returnByValue, values, handles) { + const utilityScript = await this._utilityScript(); + return this.raceAgainstContextDestroyed(this.delegate.evaluateWithArguments(expression2, returnByValue, utilityScript, values, handles)); + } + getProperties(object) { + return this.raceAgainstContextDestroyed(this.delegate.getProperties(object)); + } + _releaseHandle(handle) { + return this.delegate.releaseHandle(handle); + } + adoptIfNeeded(handle) { + return null; + } + _utilityScript() { + if (!this._utilityScriptPromise) { + const globalsSnapshot = this._noUtilityWorld ? mainWorldGlobalsSnapshotSource : ""; + const source11 = ` + (() => { + ${globalsSnapshot} + const module = {}; + ${source3} + return new (module.exports.UtilityScript())(globalThis, ${isUnderTest()}); + })();`; + this._utilityScriptPromise = this.raceAgainstContextDestroyed(this.delegate.rawEvaluateHandle(this, source11)).then((handle) => { + handle._setPreview("UtilityScript"); + return handle; + }); + } + return this._utilityScriptPromise; + } + }; + JSHandle = class extends SdkObject { + constructor(context2, type3, preview, objectId, value2) { + super(context2, "handle"); + this.__jshandle = true; + this._disposed = false; + this._context = context2; + this._objectId = objectId; + this._value = value2; + this._objectType = type3; + this._preview = this._objectId ? preview || `JSHandle@${this._objectType}` : String(value2); + if (this._objectId && globalThis.leakedJSHandles) + globalThis.leakedJSHandles.set(this, new Error("Leaked JSHandle")); + } + async evaluateExpression(progress2, expression2, options, arg) { + return await progress2.race(this.internalEvaluateExpression(expression2, options, arg)); + } + async evaluateExpressionHandle(progress2, expression2, options, arg) { + return await progress2.race(this._evaluateExpressionHandle(expression2, options, arg)); + } + async getProperty(progress2, propertyName) { + return await progress2.race(this._getProperty(propertyName)); + } + async getProperties(progress2) { + return await progress2.race(this.internalGetProperties()); + } + async jsonValue(progress2) { + return await progress2.race(this._jsonValue()); + } + async evaluate(pageFunction, arg) { + return evaluate(this._context, true, pageFunction, this, arg); + } + async evaluateHandle(pageFunction, arg) { + return evaluate(this._context, false, pageFunction, this, arg); + } + async internalEvaluateExpression(expression2, options, arg) { + return await evaluateExpression(this._context, expression2, { ...options, returnByValue: true }, this, arg); + } + async _evaluateExpressionHandle(expression2, options, arg) { + return await evaluateExpression(this._context, expression2, { ...options, returnByValue: false }, this, arg); + } + async _getProperty(propertyName) { + const objectHandle = await this.evaluateHandle((object, propertyName2) => { + const result3 = { __proto__: null }; + result3[propertyName2] = object[propertyName2]; + return result3; + }, propertyName); + const properties = await objectHandle.internalGetProperties(); + const result2 = properties.get(propertyName); + objectHandle.dispose(); + return result2; + } + async internalGetProperties() { + if (!this._objectId) + return /* @__PURE__ */ new Map(); + return this._context.getProperties(this); + } + rawValue() { + return this._value; + } + async _jsonValue() { + if (!this._objectId) + return this._value; + const script = `(utilityScript, ...args) => utilityScript.jsonValue(...args)`; + return this._context._evaluateWithArguments(script, true, [true], [this]); + } + asElement() { + return null; + } + dispose() { + if (this._disposed) + return; + this._disposed = true; + if (this._objectId) { + this._context._releaseHandle(this).catch((e) => { + }); + if (globalThis.leakedJSHandles) + globalThis.leakedJSHandles.delete(this); + } + } + toString() { + return this._preview; + } + _setPreviewCallback(callback) { + this._previewCallback = callback; + } + preview() { + return this._preview; + } + worldNameForTest() { + return this._context.worldNameForTest; + } + _setPreview(preview) { + this._preview = preview; + if (this._previewCallback) + this._previewCallback(preview); + } + }; + JavaScriptErrorInEvaluate = class extends Error { + }; + snapshottedFunctionBuiltins = [ + // DOM + "Node", + "Element", + "NodeFilter", + "HTMLElement", + "Document", + "ShadowRoot", + "MutationObserver", + "Event", + "CustomEvent", + "EventTarget", + // JS standard + "Map", + "Set", + "WeakMap", + "WeakSet", + "Promise", + "Symbol", + "Error", + "TypeError", + "RegExp", + "Array", + "Object" + ]; + snapshottedObjectBuiltins = ["JSON", "Math"]; + snapshottedTimerBuiltins = ["setTimeout"]; + saveGlobalsSnapshotSource = `window.__pwSnapshotGlobals = { +${[...snapshottedFunctionBuiltins, ...snapshottedObjectBuiltins, ...snapshottedTimerBuiltins].map((n) => ` ${n}: window.${n}`).join(",\n")} +};`; + mainWorldGlobalsSnapshotSource = ` + const __snap = globalThis.__pwSnapshotGlobals || {}; +${snapshottedFunctionBuiltins.map((n) => ` const ${n} = (typeof globalThis.${n} === 'function' ? globalThis.${n} : __snap.${n});`).join("\n")} +${snapshottedObjectBuiltins.map((n) => ` const ${n} = (typeof globalThis.${n} === 'object' && globalThis.${n} ? globalThis.${n} : __snap.${n});`).join("\n")} +`; + } +}); + +// packages/playwright-core/src/server/fileUploadUtils.ts +async function filesExceedUploadLimit(files) { + const sizes = await Promise.all(files.map(async (file) => (await import_fs13.default.promises.stat(file)).size)); + return sizes.reduce((total, size) => total + size, 0) >= fileUploadSizeLimit; +} +async function prepareFilesForUpload(frame, params2) { + const { payloads, streams, directoryStream } = params2; + let { localPaths, localDirectory } = params2; + if (localPaths && !frame.attribution.playwright.options.isClientCollocatedWithServer) + throw new Error("localPaths are not allowed when the client is not local"); + if ([payloads, localPaths, localDirectory, streams, directoryStream].filter(Boolean).length !== 1) + throw new Error("Exactly one of payloads, localPaths and streams must be provided"); + if (streams) + localPaths = streams.map((c) => c.path()); + if (directoryStream) + localDirectory = directoryStream.path(); + if (localPaths) { + for (const p of localPaths) + assert(import_path12.default.isAbsolute(p) && import_path12.default.resolve(p) === p, "Paths provided to localPaths must be absolute and fully resolved."); + } + let fileBuffers = payloads; + if (!frame._page.browserContext._browser._isBrowserCollocatedWithServer) { + if (localPaths) { + if (await filesExceedUploadLimit(localPaths)) + throw new Error("Cannot transfer files larger than 50Mb to a browser not co-located with the server"); + fileBuffers = await Promise.all(localPaths.map(async (item) => { + return { + name: import_path12.default.basename(item), + buffer: await import_fs13.default.promises.readFile(item), + lastModifiedMs: (await import_fs13.default.promises.stat(item)).mtimeMs + }; + })); + localPaths = void 0; + } + } + const filePayloads = fileBuffers?.map((payload) => ({ + name: payload.name, + mimeType: payload.mimeType || mime4.getType(payload.name) || "application/octet-stream", + buffer: payload.buffer.toString("base64"), + lastModifiedMs: payload.lastModifiedMs + })); + return { localPaths, localDirectory, filePayloads }; +} +var import_fs13, import_path12, mime4, fileUploadSizeLimit; +var init_fileUploadUtils = __esm({ + "packages/playwright-core/src/server/fileUploadUtils.ts"() { + "use strict"; + import_fs13 = __toESM(require("fs")); + import_path12 = __toESM(require("path")); + init_assert(); + mime4 = require("./utilsBundle").mime; + fileUploadSizeLimit = 50 * 1024 * 1024; + } +}); + +// packages/playwright-core/src/generated/injectedScriptSource.ts +var source4; +var init_injectedScriptSource = __esm({ + "packages/playwright-core/src/generated/injectedScriptSource.ts"() { + "use strict"; + source4 = '\nvar __commonJS = obj => {\n let required = false;\n let result;\n return function __require() {\n if (!required) {\n required = true;\n let fn;\n for (const name in obj) { fn = obj[name]; break; }\n const module = { exports: {} };\n fn(module.exports, module);\n result = module.exports;\n }\n return result;\n }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/injectedScript.ts\nvar injectedScript_exports = {};\n__export(injectedScript_exports, {\n InjectedScript: () => InjectedScript\n});\nmodule.exports = __toCommonJS(injectedScript_exports);\n\n// packages/isomorphic/ariaSnapshot.ts\nfunction ariaNodesEqual(a, b) {\n if (a.role !== b.role || a.name !== b.name)\n return false;\n if (!ariaPropsEqual(a, b) || hasPointerCursor(a) !== hasPointerCursor(b))\n return false;\n const aKeys = Object.keys(a.props);\n const bKeys = Object.keys(b.props);\n return aKeys.length === bKeys.length && aKeys.every((k) => a.props[k] === b.props[k]);\n}\nfunction hasPointerCursor(ariaNode) {\n return ariaNode.box.cursor === "pointer";\n}\nfunction ariaPropsEqual(a, b) {\n return a.active === b.active && a.checked === b.checked && a.disabled === b.disabled && a.expanded === b.expanded && a.invalid === b.invalid && a.selected === b.selected && a.level === b.level && a.pressed === b.pressed;\n}\nfunction parseAriaSnapshot(yaml, text, options = {}) {\n var _a;\n const lineCounter = new yaml.LineCounter();\n const parseOptions = {\n keepSourceTokens: true,\n lineCounter,\n ...options\n };\n const yamlDoc = yaml.parseDocument(text, parseOptions);\n const errors = [];\n const convertRange = (range) => {\n return [lineCounter.linePos(range[0]), lineCounter.linePos(range[1])];\n };\n const addError = (error) => {\n errors.push({\n message: error.message,\n range: [lineCounter.linePos(error.pos[0]), lineCounter.linePos(error.pos[1])]\n });\n };\n const convertSeq = (container, seq) => {\n for (const item of seq.items) {\n const itemIsString = item instanceof yaml.Scalar && typeof item.value === "string";\n if (itemIsString) {\n const childNode = KeyParser.parse(item, parseOptions, errors);\n if (childNode) {\n container.children = container.children || [];\n container.children.push(childNode);\n }\n continue;\n }\n const itemIsMap = item instanceof yaml.YAMLMap;\n if (itemIsMap) {\n convertMap(container, item);\n continue;\n }\n errors.push({\n message: "Sequence items should be strings or maps",\n range: convertRange(item.range || seq.range)\n });\n }\n };\n const convertMap = (container, map) => {\n var _a2;\n for (const entry of map.items) {\n container.children = container.children || [];\n const keyIsString = entry.key instanceof yaml.Scalar && typeof entry.key.value === "string";\n if (!keyIsString) {\n errors.push({\n message: "Only string keys are supported",\n range: convertRange(entry.key.range || map.range)\n });\n continue;\n }\n const key = entry.key;\n const value = entry.value;\n if (key.value === "text") {\n const valueIsString = value instanceof yaml.Scalar && typeof value.value === "string";\n if (!valueIsString) {\n errors.push({\n message: "Text value should be a string",\n range: convertRange(entry.value.range || map.range)\n });\n continue;\n }\n container.children.push({\n kind: "text",\n text: textValue(value.value)\n });\n continue;\n }\n if (key.value === "/children") {\n const valueIsString = value instanceof yaml.Scalar && typeof value.value === "string";\n if (!valueIsString || value.value !== "contain" && value.value !== "equal" && value.value !== "deep-equal") {\n errors.push({\n message: \'Strict value should be "contain", "equal" or "deep-equal"\',\n range: convertRange(entry.value.range || map.range)\n });\n continue;\n }\n container.containerMode = value.value;\n continue;\n }\n if (key.value.startsWith("/")) {\n const valueIsString = value instanceof yaml.Scalar && typeof value.value === "string";\n if (!valueIsString) {\n errors.push({\n message: "Property value should be a string",\n range: convertRange(entry.value.range || map.range)\n });\n continue;\n }\n container.props = (_a2 = container.props) != null ? _a2 : {};\n container.props[key.value.slice(1)] = textValue(value.value);\n continue;\n }\n const childNode = KeyParser.parse(key, parseOptions, errors);\n if (!childNode)\n continue;\n const valueIsScalar = value instanceof yaml.Scalar;\n if (valueIsScalar) {\n const type = typeof value.value;\n if (type !== "string" && type !== "number" && type !== "boolean") {\n errors.push({\n message: "Node value should be a string or a sequence",\n range: convertRange(entry.value.range || map.range)\n });\n continue;\n }\n container.children.push({\n ...childNode,\n children: [{\n kind: "text",\n text: textValue(String(value.value))\n }]\n });\n continue;\n }\n const valueIsSequence = value instanceof yaml.YAMLSeq;\n if (valueIsSequence) {\n container.children.push(childNode);\n convertSeq(childNode, value);\n continue;\n }\n errors.push({\n message: "Map values should be strings or sequences",\n range: convertRange(entry.value.range || map.range)\n });\n }\n };\n const fragment = { kind: "role", role: "fragment" };\n yamlDoc.errors.forEach(addError);\n if (errors.length)\n return { errors, fragment };\n if (!(yamlDoc.contents instanceof yaml.YAMLSeq)) {\n errors.push({\n message: \'Aria snapshot must be a YAML sequence, elements starting with " -"\',\n range: yamlDoc.contents ? convertRange(yamlDoc.contents.range) : [{ line: 0, col: 0 }, { line: 0, col: 0 }]\n });\n }\n if (errors.length)\n return { errors, fragment };\n convertSeq(fragment, yamlDoc.contents);\n if (errors.length)\n return { errors, fragment: emptyFragment };\n if (((_a = fragment.children) == null ? void 0 : _a.length) === 1 && (!fragment.containerMode || fragment.containerMode === "contain"))\n return { fragment: fragment.children[0], errors: [] };\n return { fragment, errors: [] };\n}\nvar emptyFragment = { kind: "role", role: "fragment" };\nfunction normalizeWhitespace(text) {\n return text.replace(/[\\u200b\\u00ad]/g, "").replace(/[\\r\\n\\s\\t]+/g, " ").trim();\n}\nfunction textValue(value) {\n return {\n raw: value,\n normalized: normalizeWhitespace(value)\n };\n}\nvar KeyParser = class _KeyParser {\n static parse(text, options, errors) {\n try {\n return new _KeyParser(text.value)._parse();\n } catch (e) {\n if (e instanceof ParserError) {\n const message = options.prettyErrors === false ? e.message : e.message + ":\\n\\n" + text.value + "\\n" + " ".repeat(e.pos) + "^\\n";\n errors.push({\n message,\n range: [options.lineCounter.linePos(text.range[0]), options.lineCounter.linePos(text.range[0] + e.pos)]\n });\n return null;\n }\n throw e;\n }\n }\n constructor(input) {\n this._input = input;\n this._pos = 0;\n this._length = input.length;\n }\n _peek() {\n return this._input[this._pos] || "";\n }\n _next() {\n if (this._pos < this._length)\n return this._input[this._pos++];\n return null;\n }\n _eof() {\n return this._pos >= this._length;\n }\n _isWhitespace() {\n return !this._eof() && /\\s/.test(this._peek());\n }\n _skipWhitespace() {\n while (this._isWhitespace())\n this._pos++;\n }\n _readIdentifier(type) {\n if (this._eof())\n this._throwError(`Unexpected end of input when expecting ${type}`);\n const start = this._pos;\n while (!this._eof() && /[a-zA-Z]/.test(this._peek()))\n this._pos++;\n return this._input.slice(start, this._pos);\n }\n _readString() {\n let result = "";\n let escaped = false;\n while (!this._eof()) {\n const ch = this._next();\n if (escaped) {\n result += ch;\n escaped = false;\n } else if (ch === "\\\\") {\n escaped = true;\n } else if (ch === \'"\') {\n return result;\n } else {\n result += ch;\n }\n }\n this._throwError("Unterminated string");\n }\n _throwError(message, offset = 0) {\n throw new ParserError(message, offset || this._pos);\n }\n _readRegex() {\n let result = "";\n let escaped = false;\n let insideClass = false;\n while (!this._eof()) {\n const ch = this._next();\n if (escaped) {\n result += ch;\n escaped = false;\n } else if (ch === "\\\\") {\n escaped = true;\n result += ch;\n } else if (ch === "/" && !insideClass) {\n return { pattern: result };\n } else if (ch === "[") {\n insideClass = true;\n result += ch;\n } else if (ch === "]" && insideClass) {\n result += ch;\n insideClass = false;\n } else {\n result += ch;\n }\n }\n this._throwError("Unterminated regex");\n }\n _readStringOrRegex() {\n const ch = this._peek();\n if (ch === \'"\') {\n this._next();\n return normalizeWhitespace(this._readString());\n }\n if (ch === "/") {\n this._next();\n return this._readRegex();\n }\n return null;\n }\n _readAttributes(result) {\n let errorPos = this._pos;\n while (true) {\n this._skipWhitespace();\n if (this._peek() === "[") {\n this._next();\n this._skipWhitespace();\n errorPos = this._pos;\n const flagName = this._readIdentifier("attribute");\n this._skipWhitespace();\n let flagValue = "";\n if (this._peek() === "=") {\n this._next();\n this._skipWhitespace();\n errorPos = this._pos;\n while (this._peek() !== "]" && !this._isWhitespace() && !this._eof())\n flagValue += this._next();\n }\n this._skipWhitespace();\n if (this._peek() !== "]")\n this._throwError("Expected ]");\n this._next();\n this._applyAttribute(result, flagName, flagValue || "true", errorPos);\n } else {\n break;\n }\n }\n }\n _parse() {\n this._skipWhitespace();\n const role = this._readIdentifier("role");\n this._skipWhitespace();\n const name = this._readStringOrRegex() || "";\n const result = { kind: "role", role, name };\n this._readAttributes(result);\n this._skipWhitespace();\n if (!this._eof())\n this._throwError("Unexpected input");\n return result;\n }\n _applyAttribute(node, key, value, errorPos) {\n if (key === "checked") {\n this._assert(value === "true" || value === "false" || value === "mixed", \'Value of "checked" attribute must be a boolean or "mixed"\', errorPos);\n node.checked = value === "true" ? true : value === "false" ? false : "mixed";\n return;\n }\n if (key === "disabled") {\n this._assert(value === "true" || value === "false", \'Value of "disabled" attribute must be a boolean\', errorPos);\n node.disabled = value === "true";\n return;\n }\n if (key === "expanded") {\n this._assert(value === "true" || value === "false", \'Value of "expanded" attribute must be a boolean\', errorPos);\n node.expanded = value === "true";\n return;\n }\n if (key === "active") {\n this._assert(value === "true" || value === "false", \'Value of "active" attribute must be a boolean\', errorPos);\n node.active = value === "true";\n return;\n }\n if (key === "invalid") {\n this._assert(value === "true" || value === "false" || value === "grammar" || value === "spelling", \'Value of "invalid" attribute must be a boolean, "grammar" or "spelling"\', errorPos);\n node.invalid = value === "true" ? true : value === "false" ? false : value;\n return;\n }\n if (key === "level") {\n this._assert(!isNaN(Number(value)), \'Value of "level" attribute must be a number\', errorPos);\n node.level = Number(value);\n return;\n }\n if (key === "pressed") {\n this._assert(value === "true" || value === "false" || value === "mixed", \'Value of "pressed" attribute must be a boolean or "mixed"\', errorPos);\n node.pressed = value === "true" ? true : value === "false" ? false : "mixed";\n return;\n }\n if (key === "selected") {\n this._assert(value === "true" || value === "false", \'Value of "selected" attribute must be a boolean\', errorPos);\n node.selected = value === "true";\n return;\n }\n this._assert(false, `Unsupported attribute [${key}]`, errorPos);\n }\n _assert(value, message, valuePos) {\n if (!value)\n this._throwError(message || "Assertion error", valuePos);\n }\n};\nvar ParserError = class extends Error {\n constructor(message, pos) {\n super(message);\n this.pos = pos;\n }\n};\nfunction findNewNode(from, to) {\n var _a, _b;\n function fillMap(root, map, position) {\n let size = 1;\n let childPosition = position + size;\n for (const child of root.children || []) {\n if (typeof child === "string") {\n size++;\n childPosition++;\n } else {\n size += fillMap(child, map, childPosition);\n childPosition += size;\n }\n }\n if (!["none", "presentation", "fragment", "iframe", "generic"].includes(root.role) && root.name) {\n let byRole = map.get(root.role);\n if (!byRole) {\n byRole = /* @__PURE__ */ new Map();\n map.set(root.role, byRole);\n }\n const existing = byRole.get(root.name);\n const sizeAndPosition = size * 100 - position;\n if (!existing || existing.sizeAndPosition < sizeAndPosition)\n byRole.set(root.name, { node: root, sizeAndPosition });\n }\n return size;\n }\n const fromMap = /* @__PURE__ */ new Map();\n if (from)\n fillMap(from, fromMap, 0);\n const toMap = /* @__PURE__ */ new Map();\n fillMap(to, toMap, 0);\n const result = [];\n for (const [role, byRole] of toMap) {\n for (const [name, byName] of byRole) {\n const inFrom = (_a = fromMap.get(role)) == null ? void 0 : _a.get(name);\n if (!inFrom)\n result.push(byName);\n }\n }\n result.sort((a, b) => b.sizeAndPosition - a.sizeAndPosition);\n return (_b = result[0]) == null ? void 0 : _b.node;\n}\n\n// packages/isomorphic/cssTokenizer.ts\nvar between = function(num, first, last) {\n return num >= first && num <= last;\n};\nfunction digit(code) {\n return between(code, 48, 57);\n}\nfunction hexdigit(code) {\n return digit(code) || between(code, 65, 70) || between(code, 97, 102);\n}\nfunction uppercaseletter(code) {\n return between(code, 65, 90);\n}\nfunction lowercaseletter(code) {\n return between(code, 97, 122);\n}\nfunction letter(code) {\n return uppercaseletter(code) || lowercaseletter(code);\n}\nfunction nonascii(code) {\n return code >= 128;\n}\nfunction namestartchar(code) {\n return letter(code) || nonascii(code) || code === 95;\n}\nfunction namechar(code) {\n return namestartchar(code) || digit(code) || code === 45;\n}\nfunction nonprintable(code) {\n return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;\n}\nfunction newline(code) {\n return code === 10;\n}\nfunction whitespace(code) {\n return newline(code) || code === 9 || code === 32;\n}\nvar maximumallowedcodepoint = 1114111;\nvar InvalidCharacterError = class extends Error {\n constructor(message) {\n super(message);\n this.name = "InvalidCharacterError";\n }\n};\nfunction preprocess(str) {\n const codepoints = [];\n for (let i = 0; i < str.length; i++) {\n let code = str.charCodeAt(i);\n if (code === 13 && str.charCodeAt(i + 1) === 10) {\n code = 10;\n i++;\n }\n if (code === 13 || code === 12)\n code = 10;\n if (code === 0)\n code = 65533;\n if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {\n const lead = code - 55296;\n const trail = str.charCodeAt(i + 1) - 56320;\n code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;\n i++;\n }\n codepoints.push(code);\n }\n return codepoints;\n}\nfunction stringFromCode(code) {\n if (code <= 65535)\n return String.fromCharCode(code);\n code -= Math.pow(2, 16);\n const lead = Math.floor(code / Math.pow(2, 10)) + 55296;\n const trail = code % Math.pow(2, 10) + 56320;\n return String.fromCharCode(lead) + String.fromCharCode(trail);\n}\nfunction tokenize(str1) {\n const str = preprocess(str1);\n let i = -1;\n const tokens = [];\n let code;\n let line = 0;\n let column = 0;\n let lastLineLength = 0;\n const incrLineno = function() {\n line += 1;\n lastLineLength = column;\n column = 0;\n };\n const locStart = { line, column };\n const codepoint = function(i2) {\n if (i2 >= str.length)\n return -1;\n return str[i2];\n };\n const next = function(num) {\n if (num === void 0)\n num = 1;\n if (num > 3)\n throw "Spec Error: no more than three codepoints of lookahead.";\n return codepoint(i + num);\n };\n const consume = function(num) {\n if (num === void 0)\n num = 1;\n i += num;\n code = codepoint(i);\n if (newline(code))\n incrLineno();\n else\n column += num;\n return true;\n };\n const reconsume = function() {\n i -= 1;\n if (newline(code)) {\n line -= 1;\n column = lastLineLength;\n } else {\n column -= 1;\n }\n locStart.line = line;\n locStart.column = column;\n return true;\n };\n const eof = function(codepoint2) {\n if (codepoint2 === void 0)\n codepoint2 = code;\n return codepoint2 === -1;\n };\n const donothing = function() {\n };\n const parseerror = function() {\n };\n const consumeAToken = function() {\n consumeComments();\n consume();\n if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n return new WhitespaceToken();\n } else if (code === 34) {\n return consumeAStringToken();\n } else if (code === 35) {\n if (namechar(next()) || areAValidEscape(next(1), next(2))) {\n const token = new HashToken("");\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n token.type = "id";\n token.value = consumeAName();\n return token;\n } else {\n return new DelimToken(code);\n }\n } else if (code === 36) {\n if (next() === 61) {\n consume();\n return new SuffixMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 39) {\n return consumeAStringToken();\n } else if (code === 40) {\n return new OpenParenToken();\n } else if (code === 41) {\n return new CloseParenToken();\n } else if (code === 42) {\n if (next() === 61) {\n consume();\n return new SubstringMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 43) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 44) {\n return new CommaToken();\n } else if (code === 45) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else if (next(1) === 45 && next(2) === 62) {\n consume(2);\n return new CDCToken();\n } else if (startsWithAnIdentifier()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 46) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 58) {\n return new ColonToken();\n } else if (code === 59) {\n return new SemicolonToken();\n } else if (code === 60) {\n if (next(1) === 33 && next(2) === 45 && next(3) === 45) {\n consume(3);\n return new CDOToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 64) {\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n return new AtKeywordToken(consumeAName());\n else\n return new DelimToken(code);\n } else if (code === 91) {\n return new OpenSquareToken();\n } else if (code === 92) {\n if (startsWithAValidEscape()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n parseerror();\n return new DelimToken(code);\n }\n } else if (code === 93) {\n return new CloseSquareToken();\n } else if (code === 94) {\n if (next() === 61) {\n consume();\n return new PrefixMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 123) {\n return new OpenCurlyToken();\n } else if (code === 124) {\n if (next() === 61) {\n consume();\n return new DashMatchToken();\n } else if (next() === 124) {\n consume();\n return new ColumnToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 125) {\n return new CloseCurlyToken();\n } else if (code === 126) {\n if (next() === 61) {\n consume();\n return new IncludeMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (digit(code)) {\n reconsume();\n return consumeANumericToken();\n } else if (namestartchar(code)) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else if (eof()) {\n return new EOFToken();\n } else {\n return new DelimToken(code);\n }\n };\n const consumeComments = function() {\n while (next(1) === 47 && next(2) === 42) {\n consume(2);\n while (true) {\n consume();\n if (code === 42 && next() === 47) {\n consume();\n break;\n } else if (eof()) {\n parseerror();\n return;\n }\n }\n }\n };\n const consumeANumericToken = function() {\n const num = consumeANumber();\n if (wouldStartAnIdentifier(next(1), next(2), next(3))) {\n const token = new DimensionToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n token.unit = consumeAName();\n return token;\n } else if (next() === 37) {\n consume();\n const token = new PercentageToken();\n token.value = num.value;\n token.repr = num.repr;\n return token;\n } else {\n const token = new NumberToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n return token;\n }\n };\n const consumeAnIdentlikeToken = function() {\n const str2 = consumeAName();\n if (str2.toLowerCase() === "url" && next() === 40) {\n consume();\n while (whitespace(next(1)) && whitespace(next(2)))\n consume();\n if (next() === 34 || next() === 39)\n return new FunctionToken(str2);\n else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))\n return new FunctionToken(str2);\n else\n return consumeAURLToken();\n } else if (next() === 40) {\n consume();\n return new FunctionToken(str2);\n } else {\n return new IdentToken(str2);\n }\n };\n const consumeAStringToken = function(endingCodePoint) {\n if (endingCodePoint === void 0)\n endingCodePoint = code;\n let string = "";\n while (consume()) {\n if (code === endingCodePoint || eof()) {\n return new StringToken(string);\n } else if (newline(code)) {\n parseerror();\n reconsume();\n return new BadStringToken();\n } else if (code === 92) {\n if (eof(next()))\n donothing();\n else if (newline(next()))\n consume();\n else\n string += stringFromCode(consumeEscape());\n } else {\n string += stringFromCode(code);\n }\n }\n throw new Error("Internal error");\n };\n const consumeAURLToken = function() {\n const token = new URLToken("");\n while (whitespace(next()))\n consume();\n if (eof(next()))\n return token;\n while (consume()) {\n if (code === 41 || eof()) {\n return token;\n } else if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n if (next() === 41 || eof(next())) {\n consume();\n return token;\n } else {\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n }\n } else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n } else if (code === 92) {\n if (startsWithAValidEscape()) {\n token.value += stringFromCode(consumeEscape());\n } else {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n }\n } else {\n token.value += stringFromCode(code);\n }\n }\n throw new Error("Internal error");\n };\n const consumeEscape = function() {\n consume();\n if (hexdigit(code)) {\n const digits = [code];\n for (let total = 0; total < 5; total++) {\n if (hexdigit(next())) {\n consume();\n digits.push(code);\n } else {\n break;\n }\n }\n if (whitespace(next()))\n consume();\n let value = parseInt(digits.map(function(x) {\n return String.fromCharCode(x);\n }).join(""), 16);\n if (value > maximumallowedcodepoint)\n value = 65533;\n return value;\n } else if (eof()) {\n return 65533;\n } else {\n return code;\n }\n };\n const areAValidEscape = function(c1, c2) {\n if (c1 !== 92)\n return false;\n if (newline(c2))\n return false;\n return true;\n };\n const startsWithAValidEscape = function() {\n return areAValidEscape(code, next());\n };\n const wouldStartAnIdentifier = function(c1, c2, c3) {\n if (c1 === 45)\n return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);\n else if (namestartchar(c1))\n return true;\n else if (c1 === 92)\n return areAValidEscape(c1, c2);\n else\n return false;\n };\n const startsWithAnIdentifier = function() {\n return wouldStartAnIdentifier(code, next(1), next(2));\n };\n const wouldStartANumber = function(c1, c2, c3) {\n if (c1 === 43 || c1 === 45) {\n if (digit(c2))\n return true;\n if (c2 === 46 && digit(c3))\n return true;\n return false;\n } else if (c1 === 46) {\n if (digit(c2))\n return true;\n return false;\n } else if (digit(c1)) {\n return true;\n } else {\n return false;\n }\n };\n const startsWithANumber = function() {\n return wouldStartANumber(code, next(1), next(2));\n };\n const consumeAName = function() {\n let result = "";\n while (consume()) {\n if (namechar(code)) {\n result += stringFromCode(code);\n } else if (startsWithAValidEscape()) {\n result += stringFromCode(consumeEscape());\n } else {\n reconsume();\n return result;\n }\n }\n throw new Error("Internal parse error");\n };\n const consumeANumber = function() {\n let repr = "";\n let type = "integer";\n if (next() === 43 || next() === 45) {\n consume();\n repr += stringFromCode(code);\n }\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n if (next(1) === 46 && digit(next(2))) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = "number";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n const c1 = next(1);\n const c2 = next(2);\n const c3 = next(3);\n if ((c1 === 69 || c1 === 101) && digit(c2)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = "number";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n } else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = "number";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n const value = convertAStringToANumber(repr);\n return { type, value, repr };\n };\n const convertAStringToANumber = function(string) {\n return +string;\n };\n const consumeTheRemnantsOfABadURL = function() {\n while (consume()) {\n if (code === 41 || eof()) {\n return;\n } else if (startsWithAValidEscape()) {\n consumeEscape();\n donothing();\n } else {\n donothing();\n }\n }\n };\n let iterationCount = 0;\n while (!eof(next())) {\n tokens.push(consumeAToken());\n iterationCount++;\n if (iterationCount > str.length * 2)\n throw new Error("I\'m infinite-looping!");\n }\n return tokens;\n}\nvar CSSParserToken = class {\n constructor() {\n this.tokenType = "";\n }\n toJSON() {\n return { token: this.tokenType };\n }\n toString() {\n return this.tokenType;\n }\n toSource() {\n return "" + this;\n }\n};\nvar BadStringToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "BADSTRING";\n }\n};\nvar BadURLToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "BADURL";\n }\n};\nvar WhitespaceToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "WHITESPACE";\n }\n toString() {\n return "WS";\n }\n toSource() {\n return " ";\n }\n};\nvar CDOToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "CDO";\n }\n toSource() {\n return "";\n }\n};\nvar ColonToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = ":";\n }\n};\nvar SemicolonToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = ";";\n }\n};\nvar CommaToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = ",";\n }\n};\nvar GroupingToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.value = "";\n this.mirror = "";\n }\n};\nvar OpenCurlyToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = "{";\n this.value = "{";\n this.mirror = "}";\n }\n};\nvar CloseCurlyToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = "}";\n this.value = "}";\n this.mirror = "{";\n }\n};\nvar OpenSquareToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = "[";\n this.value = "[";\n this.mirror = "]";\n }\n};\nvar CloseSquareToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = "]";\n this.value = "]";\n this.mirror = "[";\n }\n};\nvar OpenParenToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = "(";\n this.value = "(";\n this.mirror = ")";\n }\n};\nvar CloseParenToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = ")";\n this.value = ")";\n this.mirror = "(";\n }\n};\nvar IncludeMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "~=";\n }\n};\nvar DashMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "|=";\n }\n};\nvar PrefixMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "^=";\n }\n};\nvar SuffixMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "$=";\n }\n};\nvar SubstringMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "*=";\n }\n};\nvar ColumnToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "||";\n }\n};\nvar EOFToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = "EOF";\n }\n toSource() {\n return "";\n }\n};\nvar DelimToken = class extends CSSParserToken {\n constructor(code) {\n super();\n this.tokenType = "DELIM";\n this.value = "";\n this.value = stringFromCode(code);\n }\n toString() {\n return "DELIM(" + this.value + ")";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n }\n toSource() {\n if (this.value === "\\\\")\n return "\\\\\\n";\n else\n return this.value;\n }\n};\nvar StringValuedToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.value = "";\n }\n ASCIIMatch(str) {\n return this.value.toLowerCase() === str.toLowerCase();\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n }\n};\nvar IdentToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = "IDENT";\n this.value = val;\n }\n toString() {\n return "IDENT(" + this.value + ")";\n }\n toSource() {\n return escapeIdent(this.value);\n }\n};\nvar FunctionToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = "FUNCTION";\n this.value = val;\n this.mirror = ")";\n }\n toString() {\n return "FUNCTION(" + this.value + ")";\n }\n toSource() {\n return escapeIdent(this.value) + "(";\n }\n};\nvar AtKeywordToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = "AT-KEYWORD";\n this.value = val;\n }\n toString() {\n return "AT(" + this.value + ")";\n }\n toSource() {\n return "@" + escapeIdent(this.value);\n }\n};\nvar HashToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = "HASH";\n this.value = val;\n this.type = "unrestricted";\n }\n toString() {\n return "HASH(" + this.value + ")";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n return json;\n }\n toSource() {\n if (this.type === "id")\n return "#" + escapeIdent(this.value);\n else\n return "#" + escapeHash(this.value);\n }\n};\nvar StringToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = "STRING";\n this.value = val;\n }\n toString() {\n return \'"\' + escapeString(this.value) + \'"\';\n }\n};\nvar URLToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = "URL";\n this.value = val;\n }\n toString() {\n return "URL(" + this.value + ")";\n }\n toSource() {\n return \'url("\' + escapeString(this.value) + \'")\';\n }\n};\nvar NumberToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = "NUMBER";\n this.type = "integer";\n this.repr = "";\n }\n toString() {\n if (this.type === "integer")\n return "INT(" + this.value + ")";\n return "NUMBER(" + this.value + ")";\n }\n toJSON() {\n const json = super.toJSON();\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n return json;\n }\n toSource() {\n return this.repr;\n }\n};\nvar PercentageToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = "PERCENTAGE";\n this.repr = "";\n }\n toString() {\n return "PERCENTAGE(" + this.value + ")";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.repr = this.repr;\n return json;\n }\n toSource() {\n return this.repr + "%";\n }\n};\nvar DimensionToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = "DIMENSION";\n this.type = "integer";\n this.repr = "";\n this.unit = "";\n }\n toString() {\n return "DIM(" + this.value + "," + this.unit + ")";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n json.unit = this.unit;\n return json;\n }\n toSource() {\n const source = this.repr;\n let unit = escapeIdent(this.unit);\n if (unit[0].toLowerCase() === "e" && (unit[1] === "-" || between(unit.charCodeAt(1), 48, 57))) {\n unit = "\\\\65 " + unit.slice(1, unit.length);\n }\n return source + unit;\n }\n};\nfunction escapeIdent(string) {\n string = "" + string;\n let result = "";\n const firstcode = string.charCodeAt(0);\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)\n result += "\\\\" + code.toString(16) + " ";\n else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n result += string[i];\n else\n result += "\\\\" + string[i];\n }\n return result;\n}\nfunction escapeHash(string) {\n string = "" + string;\n let result = "";\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n result += string[i];\n else\n result += "\\\\" + code.toString(16) + " ";\n }\n return result;\n}\nfunction escapeString(string) {\n string = "" + string;\n let result = "";\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError("Invalid character: the input contains U+0000.");\n if (between(code, 1, 31) || code === 127)\n result += "\\\\" + code.toString(16) + " ";\n else if (code === 34 || code === 92)\n result += "\\\\" + string[i];\n else\n result += string[i];\n }\n return result;\n}\n\n// packages/isomorphic/cssParser.ts\nvar InvalidSelectorError = class extends Error {\n};\nfunction parseCSS(selector, customNames) {\n let tokens;\n try {\n tokens = tokenize(selector);\n if (!(tokens[tokens.length - 1] instanceof EOFToken))\n tokens.push(new EOFToken());\n } catch (e) {\n const newMessage = e.message + ` while parsing css selector "${selector}". Did you mean to CSS.escape it?`;\n const index = (e.stack || "").indexOf(e.message);\n if (index !== -1)\n e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length);\n e.message = newMessage;\n throw e;\n }\n const unsupportedToken = tokens.find((token) => {\n return token instanceof AtKeywordToken || token instanceof BadStringToken || token instanceof BadURLToken || token instanceof ColumnToken || token instanceof CDOToken || token instanceof CDCToken || token instanceof SemicolonToken || // TODO: Consider using these for something, e.g. to escape complex strings.\n // For example :xpath{ (//div/bar[@attr="foo"])[2]/baz }\n // Or this way :xpath( {complex-xpath-goes-here("hello")} )\n token instanceof OpenCurlyToken || token instanceof CloseCurlyToken || // TODO: Consider treating these as strings?\n token instanceof URLToken || token instanceof PercentageToken;\n });\n if (unsupportedToken)\n throw new InvalidSelectorError(`Unsupported token "${unsupportedToken.toSource()}" while parsing css selector "${selector}". Did you mean to CSS.escape it?`);\n let pos = 0;\n const names = /* @__PURE__ */ new Set();\n function unexpected() {\n return new InvalidSelectorError(`Unexpected token "${tokens[pos].toSource()}" while parsing css selector "${selector}". Did you mean to CSS.escape it?`);\n }\n function skipWhitespace() {\n while (tokens[pos] instanceof WhitespaceToken)\n pos++;\n }\n function isIdent(p = pos) {\n return tokens[p] instanceof IdentToken;\n }\n function isString(p = pos) {\n return tokens[p] instanceof StringToken;\n }\n function isNumber(p = pos) {\n return tokens[p] instanceof NumberToken;\n }\n function isComma(p = pos) {\n return tokens[p] instanceof CommaToken;\n }\n function isOpenParen(p = pos) {\n return tokens[p] instanceof OpenParenToken;\n }\n function isCloseParen(p = pos) {\n return tokens[p] instanceof CloseParenToken;\n }\n function isFunction(p = pos) {\n return tokens[p] instanceof FunctionToken;\n }\n function isStar(p = pos) {\n return tokens[p] instanceof DelimToken && tokens[p].value === "*";\n }\n function isEOF(p = pos) {\n return tokens[p] instanceof EOFToken;\n }\n function isClauseCombinator(p = pos) {\n return tokens[p] instanceof DelimToken && [">", "+", "~"].includes(tokens[p].value);\n }\n function isSelectorClauseEnd(p = pos) {\n return isComma(p) || isCloseParen(p) || isEOF(p) || isClauseCombinator(p) || tokens[p] instanceof WhitespaceToken;\n }\n function consumeFunctionArguments() {\n const result2 = [consumeArgument()];\n while (true) {\n skipWhitespace();\n if (!isComma())\n break;\n pos++;\n result2.push(consumeArgument());\n }\n return result2;\n }\n function consumeArgument() {\n skipWhitespace();\n if (isNumber())\n return tokens[pos++].value;\n if (isString())\n return tokens[pos++].value;\n return consumeComplexSelector();\n }\n function consumeComplexSelector() {\n const result2 = { simples: [] };\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples.push({ selector: { functions: [{ name: "scope", args: [] }] }, combinator: "" });\n } else {\n result2.simples.push({ selector: consumeSimpleSelector(), combinator: "" });\n }\n while (true) {\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples[result2.simples.length - 1].combinator = tokens[pos++].value;\n skipWhitespace();\n } else if (isSelectorClauseEnd()) {\n break;\n }\n result2.simples.push({ combinator: "", selector: consumeSimpleSelector() });\n }\n return result2;\n }\n function consumeSimpleSelector() {\n let rawCSSString = "";\n const functions = [];\n while (!isSelectorClauseEnd()) {\n if (isIdent() || isStar()) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof HashToken) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof DelimToken && tokens[pos].value === ".") {\n pos++;\n if (isIdent())\n rawCSSString += "." + tokens[pos++].toSource();\n else\n throw unexpected();\n } else if (tokens[pos] instanceof ColonToken) {\n pos++;\n if (isIdent()) {\n if (!customNames.has(tokens[pos].value.toLowerCase())) {\n rawCSSString += ":" + tokens[pos++].toSource();\n } else {\n const name = tokens[pos++].value.toLowerCase();\n functions.push({ name, args: [] });\n names.add(name);\n }\n } else if (isFunction()) {\n const name = tokens[pos++].value.toLowerCase();\n if (!customNames.has(name)) {\n rawCSSString += `:${name}(${consumeBuiltinFunctionArguments()})`;\n } else {\n functions.push({ name, args: consumeFunctionArguments() });\n names.add(name);\n }\n skipWhitespace();\n if (!isCloseParen())\n throw unexpected();\n pos++;\n } else {\n throw unexpected();\n }\n } else if (tokens[pos] instanceof OpenSquareToken) {\n rawCSSString += "[";\n pos++;\n while (!(tokens[pos] instanceof CloseSquareToken) && !isEOF())\n rawCSSString += tokens[pos++].toSource();\n if (!(tokens[pos] instanceof CloseSquareToken))\n throw unexpected();\n rawCSSString += "]";\n pos++;\n } else {\n throw unexpected();\n }\n }\n if (!rawCSSString && !functions.length)\n throw unexpected();\n return { css: rawCSSString || void 0, functions };\n }\n function consumeBuiltinFunctionArguments() {\n let s = "";\n let balance = 1;\n while (!isEOF()) {\n if (isOpenParen() || isFunction())\n balance++;\n if (isCloseParen())\n balance--;\n if (!balance)\n break;\n s += tokens[pos++].toSource();\n }\n return s;\n }\n const result = consumeFunctionArguments();\n if (!isEOF())\n throw unexpected();\n if (result.some((arg) => typeof arg !== "object" || !("simples" in arg)))\n throw new InvalidSelectorError(`Error while parsing css selector "${selector}". Did you mean to CSS.escape it?`);\n return { selector: result, names: Array.from(names) };\n}\n\n// packages/isomorphic/selectorParser.ts\nvar kNestedSelectorNames = /* @__PURE__ */ new Set(["internal:has", "internal:has-not", "internal:and", "internal:or", "internal:chain", "left-of", "right-of", "above", "below", "near"]);\nvar kNestedSelectorNamesWithDistance = /* @__PURE__ */ new Set(["left-of", "right-of", "above", "below", "near"]);\nvar customCSSNames = /* @__PURE__ */ new Set(["not", "is", "where", "has", "scope", "light", "visible", "text", "text-matches", "text-is", "has-text", "above", "below", "right-of", "left-of", "near", "nth-match"]);\nfunction parseSelector(selector) {\n const parsedStrings = parseSelectorString(selector);\n const parts = [];\n for (const part of parsedStrings.parts) {\n if (part.name === "css" || part.name === "css:light") {\n if (part.name === "css:light")\n part.body = ":light(" + part.body + ")";\n const parsedCSS = parseCSS(part.body, customCSSNames);\n parts.push({\n name: "css",\n body: parsedCSS.selector,\n source: part.body\n });\n continue;\n }\n if (kNestedSelectorNames.has(part.name)) {\n let innerSelector;\n let distance;\n try {\n const unescaped = JSON.parse("[" + part.body + "]");\n if (!Array.isArray(unescaped) || unescaped.length < 1 || unescaped.length > 2 || typeof unescaped[0] !== "string")\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n innerSelector = unescaped[0];\n if (unescaped.length === 2) {\n if (typeof unescaped[1] !== "number" || !kNestedSelectorNamesWithDistance.has(part.name))\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n distance = unescaped[1];\n }\n } catch (e) {\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n }\n const nested = { name: part.name, source: part.body, body: { parsed: parseSelector(innerSelector), distance } };\n const lastFrame = [...nested.body.parsed.parts].reverse().find((part2) => part2.name === "internal:control" && part2.body === "enter-frame");\n const lastFrameIndex = lastFrame ? nested.body.parsed.parts.indexOf(lastFrame) : -1;\n if (lastFrameIndex !== -1 && selectorPartsEqual(nested.body.parsed.parts.slice(0, lastFrameIndex + 1), parts.slice(0, lastFrameIndex + 1)))\n nested.body.parsed.parts.splice(0, lastFrameIndex + 1);\n parts.push(nested);\n continue;\n }\n parts.push({ ...part, source: part.body });\n }\n if (kNestedSelectorNames.has(parts[0].name))\n throw new InvalidSelectorError(`"${parts[0].name}" selector cannot be first`);\n return {\n capture: parsedStrings.capture,\n parts\n };\n}\nfunction selectorPartsEqual(list1, list2) {\n return stringifySelector({ parts: list1 }) === stringifySelector({ parts: list2 });\n}\nfunction stringifySelector(selector, forceEngineName) {\n if (typeof selector === "string")\n return selector;\n return selector.parts.map((p, i) => {\n let includeEngine = true;\n if (!forceEngineName && i !== selector.capture) {\n if (p.name === "css")\n includeEngine = false;\n else if (p.name === "xpath" && p.source.startsWith("//") || p.source.startsWith(".."))\n includeEngine = false;\n }\n const prefix = includeEngine ? p.name + "=" : "";\n return `${i === selector.capture ? "*" : ""}${prefix}${p.source}`;\n }).join(" >> ");\n}\nfunction visitAllSelectorParts(selector, visitor) {\n const visit = (selector2, nested) => {\n for (const part of selector2.parts) {\n visitor(part, nested);\n if (kNestedSelectorNames.has(part.name))\n visit(part.body.parsed, true);\n }\n };\n visit(selector, false);\n}\nfunction parseSelectorString(selector) {\n let index = 0;\n let quote;\n let start = 0;\n const result = { parts: [] };\n const append = () => {\n const part = selector.substring(start, index).trim();\n const eqIndex = part.indexOf("=");\n let name;\n let body;\n if (eqIndex !== -1 && part.substring(0, eqIndex).trim().match(/^[a-zA-Z_0-9-+:*]+$/)) {\n name = part.substring(0, eqIndex).trim();\n body = part.substring(eqIndex + 1);\n } else if (part.length > 1 && part[0] === \'"\' && part[part.length - 1] === \'"\') {\n name = "text";\n body = part;\n } else if (part.length > 1 && part[0] === "\'" && part[part.length - 1] === "\'") {\n name = "text";\n body = part;\n } else if (/^\\(*\\/\\//.test(part) || part.startsWith("..")) {\n name = "xpath";\n body = part;\n } else {\n name = "css";\n body = part;\n }\n let capture = false;\n if (name[0] === "*") {\n capture = true;\n name = name.substring(1);\n }\n result.parts.push({ name, body });\n if (capture) {\n if (result.capture !== void 0)\n throw new InvalidSelectorError(`Only one of the selectors can capture using * modifier`);\n result.capture = result.parts.length - 1;\n }\n };\n if (!selector.includes(">>")) {\n index = selector.length;\n append();\n return result;\n }\n const shouldIgnoreTextSelectorQuote = () => {\n const prefix = selector.substring(start, index);\n const match = prefix.match(/^\\s*text\\s*=(.*)$/);\n return !!match && !!match[1];\n };\n while (index < selector.length) {\n const c = selector[index];\n if (c === "\\\\" && index + 1 < selector.length) {\n index += 2;\n } else if (c === quote) {\n quote = void 0;\n index++;\n } else if (!quote && (c === \'"\' || c === "\'" || c === "`") && !shouldIgnoreTextSelectorQuote()) {\n quote = c;\n index++;\n } else if (!quote && c === ">" && selector[index + 1] === ">") {\n append();\n index += 2;\n start = index;\n } else {\n index++;\n }\n }\n append();\n return result;\n}\nfunction parseAttributeSelector(selector, allowUnquotedStrings) {\n let wp = 0;\n let EOL = selector.length === 0;\n const next = () => selector[wp] || "";\n const eat1 = () => {\n const result2 = next();\n ++wp;\n EOL = wp >= selector.length;\n return result2;\n };\n const syntaxError = (stage) => {\n if (EOL)\n throw new InvalidSelectorError(`Unexpected end of selector while parsing selector \\`${selector}\\``);\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - unexpected symbol "${next()}" at position ${wp}` + (stage ? " during " + stage : ""));\n };\n function skipSpaces() {\n while (!EOL && /\\s/.test(next()))\n eat1();\n }\n function isCSSNameChar(char) {\n return char >= "\\x80" || char >= "0" && char <= "9" || char >= "A" && char <= "Z" || char >= "a" && char <= "z" || char >= "0" && char <= "9" || char === "_" || char === "-";\n }\n function readIdentifier() {\n let result2 = "";\n skipSpaces();\n while (!EOL && isCSSNameChar(next()))\n result2 += eat1();\n return result2;\n }\n function readQuotedString(quote) {\n let result2 = eat1();\n if (result2 !== quote)\n syntaxError("parsing quoted string");\n while (!EOL && next() !== quote) {\n if (next() === "\\\\")\n eat1();\n result2 += eat1();\n }\n if (next() !== quote)\n syntaxError("parsing quoted string");\n result2 += eat1();\n return result2;\n }\n function readRegularExpression() {\n if (eat1() !== "/")\n syntaxError("parsing regular expression");\n let source = "";\n let inClass = false;\n while (!EOL) {\n if (next() === "\\\\") {\n source += eat1();\n if (EOL)\n syntaxError("parsing regular expression");\n } else if (inClass && next() === "]") {\n inClass = false;\n } else if (!inClass && next() === "[") {\n inClass = true;\n } else if (!inClass && next() === "/") {\n break;\n }\n source += eat1();\n }\n if (eat1() !== "/")\n syntaxError("parsing regular expression");\n let flags = "";\n while (!EOL && next().match(/[dgimsuy]/))\n flags += eat1();\n try {\n return new RegExp(source, flags);\n } catch (e) {\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\`: ${e.message}`);\n }\n }\n function readAttributeToken() {\n let token = "";\n skipSpaces();\n if (next() === `\'` || next() === `"`)\n token = readQuotedString(next()).slice(1, -1);\n else\n token = readIdentifier();\n if (!token)\n syntaxError("parsing property path");\n return token;\n }\n function readOperator() {\n skipSpaces();\n let op = "";\n if (!EOL)\n op += eat1();\n if (!EOL && op !== "=")\n op += eat1();\n if (!["=", "*=", "^=", "$=", "|=", "~="].includes(op))\n syntaxError("parsing operator");\n return op;\n }\n function readAttribute() {\n eat1();\n const jsonPath = [];\n jsonPath.push(readAttributeToken());\n skipSpaces();\n while (next() === ".") {\n eat1();\n jsonPath.push(readAttributeToken());\n skipSpaces();\n }\n if (next() === "]") {\n eat1();\n return { name: jsonPath.join("."), jsonPath, op: "", value: null, caseSensitive: false };\n }\n const operator = readOperator();\n let value = void 0;\n let caseSensitive = true;\n skipSpaces();\n if (next() === "/") {\n if (operator !== "=")\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with regular expression`);\n value = readRegularExpression();\n } else if (next() === `\'` || next() === `"`) {\n value = readQuotedString(next()).slice(1, -1);\n skipSpaces();\n if (next() === "i" || next() === "I") {\n caseSensitive = false;\n eat1();\n } else if (next() === "s" || next() === "S") {\n caseSensitive = true;\n eat1();\n }\n } else {\n value = "";\n while (!EOL && (isCSSNameChar(next()) || next() === "+" || next() === "."))\n value += eat1();\n if (value === "true") {\n value = true;\n } else if (value === "false") {\n value = false;\n } else {\n if (!allowUnquotedStrings) {\n value = +value;\n if (Number.isNaN(value))\n syntaxError("parsing attribute value");\n }\n }\n }\n skipSpaces();\n if (next() !== "]")\n syntaxError("parsing attribute value");\n eat1();\n if (operator !== "=" && typeof value !== "string")\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with non-string matching value - ${value}`);\n return { name: jsonPath.join("."), jsonPath, op: operator, value, caseSensitive };\n }\n const result = {\n name: "",\n attributes: []\n };\n result.name = readIdentifier();\n skipSpaces();\n while (next() === "[") {\n result.attributes.push(readAttribute());\n skipSpaces();\n }\n if (!EOL)\n syntaxError(void 0);\n if (!result.name && !result.attributes.length)\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - selector cannot be empty`);\n return result;\n}\n\n// packages/isomorphic/stringUtils.ts\nfunction escapeWithQuotes(text, char = "\'") {\n const stringified = JSON.stringify(text);\n const escapedText = stringified.substring(1, stringified.length - 1).replace(/\\\\"/g, \'"\');\n if (char === "\'")\n return char + escapedText.replace(/[\']/g, "\\\\\'") + char;\n if (char === \'"\')\n return char + escapedText.replace(/["]/g, \'\\\\"\') + char;\n if (char === "`")\n return char + escapedText.replace(/[`]/g, "\\\\`") + char;\n throw new Error("Invalid escape char");\n}\nfunction toTitleCase(name) {\n return name.charAt(0).toUpperCase() + name.substring(1);\n}\nfunction toSnakeCase(name) {\n return name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").toLowerCase();\n}\nfunction quoteCSSAttributeValue(text) {\n return `"${text.replace(/["\\\\]/g, (char) => "\\\\" + char)}"`;\n}\nvar normalizedWhitespaceCache;\nfunction cacheNormalizedWhitespaces() {\n normalizedWhitespaceCache = /* @__PURE__ */ new Map();\n}\nfunction normalizeWhiteSpace(text) {\n let result = normalizedWhitespaceCache == null ? void 0 : normalizedWhitespaceCache.get(text);\n if (result === void 0) {\n result = text.replace(/[\\u200b\\u00ad]/g, "").trim().replace(/\\s+/g, " ");\n normalizedWhitespaceCache == null ? void 0 : normalizedWhitespaceCache.set(text, result);\n }\n return result;\n}\nfunction normalizeEscapedRegexQuotes(source) {\n return source.replace(/(^|[^\\\\])(\\\\\\\\)*\\\\([\'"`])/g, "$1$2$3");\n}\nfunction escapeRegexForSelector(re) {\n if (re.unicode || re.unicodeSets)\n return String(re);\n return String(re).replace(/(^|[^\\\\])(\\\\\\\\)*(["\'`])/g, "$1$2\\\\$3").replace(/>>/g, "\\\\>\\\\>");\n}\nfunction escapeForTextSelector(text, exact) {\n if (typeof text !== "string")\n return escapeRegexForSelector(text);\n return `${JSON.stringify(text)}${exact ? "s" : "i"}`;\n}\nfunction escapeForAttributeSelector(value, exact) {\n if (typeof value !== "string")\n return escapeRegexForSelector(value);\n return `"${value.replace(/\\\\/g, "\\\\\\\\").replace(/["]/g, \'\\\\"\')}"${exact ? "s" : "i"}`;\n}\nfunction trimString(input, cap, suffix = "") {\n if (input.length <= cap)\n return input;\n const chars = [...input];\n if (chars.length > cap)\n return chars.slice(0, cap - suffix.length).join("") + suffix;\n return chars.join("");\n}\nfunction trimStringWithEllipsis(input, cap) {\n return trimString(input, cap, "\\u2026");\n}\nfunction escapeRegExp(s) {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, "\\\\$&");\n}\nfunction longestCommonSubstring(s1, s2) {\n const n = s1.length;\n const m = s2.length;\n let maxLen = 0;\n let endingIndex = 0;\n const dp = Array(n + 1).fill(null).map(() => Array(m + 1).fill(0));\n for (let i = 1; i <= n; i++) {\n for (let j = 1; j <= m; j++) {\n if (s1[i - 1] === s2[j - 1]) {\n dp[i][j] = dp[i - 1][j - 1] + 1;\n if (dp[i][j] > maxLen) {\n maxLen = dp[i][j];\n endingIndex = i;\n }\n }\n }\n }\n return s1.slice(endingIndex - maxLen, endingIndex);\n}\nvar ansiRegex = new RegExp("([\\\\u001B\\\\u009B][[\\\\]()#?]*(?:(?:(?:[a-zA-Z\\\\d]*(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)|(?:(?:\\\\d{0,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~])))", "g");\n\n// packages/isomorphic/locatorGenerators.ts\nfunction asLocator(lang, selector, isFrameLocator = false) {\n return asLocators(lang, selector, isFrameLocator, 1)[0];\n}\nfunction asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, preferredQuote) {\n try {\n return innerAsLocators(new generators[lang](preferredQuote), parseSelector(selector), isFrameLocator, maxOutputSize);\n } catch (e) {\n return [selector];\n }\n}\nfunction innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) {\n const parts = [...parsed.parts];\n const tokens = [];\n let nextBase = isFrameLocator ? "frame-locator" : "page";\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const base = nextBase;\n nextBase = "locator";\n if (part.name === "internal:describe")\n continue;\n if (part.name === "nth") {\n if (part.body === "0")\n tokens.push([factory.generateLocator(base, "first", ""), factory.generateLocator(base, "nth", "0")]);\n else if (part.body === "-1")\n tokens.push([factory.generateLocator(base, "last", ""), factory.generateLocator(base, "nth", "-1")]);\n else\n tokens.push([factory.generateLocator(base, "nth", part.body)]);\n continue;\n }\n if (part.name === "visible") {\n tokens.push([factory.generateLocator(base, "visible", part.body), factory.generateLocator(base, "default", `visible=${part.body}`)]);\n continue;\n }\n if (part.name === "internal:text") {\n const { exact, text } = detectExact(part.body);\n tokens.push([factory.generateLocator(base, "text", text, { exact })]);\n continue;\n }\n if (part.name === "internal:has-text") {\n const { exact, text } = detectExact(part.body);\n if (!exact) {\n tokens.push([factory.generateLocator(base, "has-text", text, { exact })]);\n continue;\n }\n }\n if (part.name === "internal:has-not-text") {\n const { exact, text } = detectExact(part.body);\n if (!exact) {\n tokens.push([factory.generateLocator(base, "has-not-text", text, { exact })]);\n continue;\n }\n }\n if (part.name === "internal:has") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, "has", inner)));\n continue;\n }\n if (part.name === "internal:has-not") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, "hasNot", inner)));\n continue;\n }\n if (part.name === "internal:and") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, "and", inner)));\n continue;\n }\n if (part.name === "internal:or") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, "or", inner)));\n continue;\n }\n if (part.name === "internal:chain") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, "chain", inner)));\n continue;\n }\n if (part.name === "internal:label") {\n const { exact, text } = detectExact(part.body);\n tokens.push([factory.generateLocator(base, "label", text, { exact })]);\n continue;\n }\n if (part.name === "internal:role") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const options = { attrs: [] };\n for (const attr of attrSelector.attributes) {\n if (attr.name === "name") {\n if (options.exact !== void 0 && options.exact !== attr.caseSensitive)\n throw new Error(`Conflicting exactness in internal:role selector: ${stringifySelector({ parts: [part] })}`);\n options.exact = attr.caseSensitive;\n options.name = attr.value;\n } else if (attr.name === "description") {\n if (options.exact !== void 0 && options.exact !== attr.caseSensitive)\n throw new Error(`Conflicting exactness in internal:role selector: ${stringifySelector({ parts: [part] })}`);\n options.exact = attr.caseSensitive;\n options.description = attr.value;\n } else {\n if (attr.name === "level" && typeof attr.value === "string")\n attr.value = +attr.value;\n options.attrs.push({ name: attr.name === "include-hidden" ? "includeHidden" : attr.name, value: attr.value });\n }\n }\n tokens.push([factory.generateLocator(base, "role", attrSelector.name, options)]);\n continue;\n }\n if (part.name === "internal:testid") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const { value } = attrSelector.attributes[0];\n tokens.push([factory.generateLocator(base, "test-id", value)]);\n continue;\n }\n if (part.name === "internal:attr") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const { name, value, caseSensitive } = attrSelector.attributes[0];\n const text = value;\n const exact = !!caseSensitive;\n if (name === "placeholder") {\n tokens.push([factory.generateLocator(base, "placeholder", text, { exact })]);\n continue;\n }\n if (name === "alt") {\n tokens.push([factory.generateLocator(base, "alt", text, { exact })]);\n continue;\n }\n if (name === "title") {\n tokens.push([factory.generateLocator(base, "title", text, { exact })]);\n continue;\n }\n }\n if (part.name === "internal:control" && part.body === "enter-frame") {\n const lastTokens = tokens[tokens.length - 1];\n const lastPart = parts[index - 1];\n const transformed = lastTokens.map((token) => factory.chainLocators([token, factory.generateLocator(base, "frame", "")]));\n if (["xpath", "css"].includes(lastPart.name)) {\n transformed.push(\n factory.generateLocator(base, "frame-locator", stringifySelector({ parts: [lastPart] })),\n factory.generateLocator(base, "frame-locator", stringifySelector({ parts: [lastPart] }, true))\n );\n }\n lastTokens.splice(0, lastTokens.length, ...transformed);\n nextBase = "frame-locator";\n continue;\n }\n const nextPart = parts[index + 1];\n const selectorPart = stringifySelector({ parts: [part] });\n const locatorPart = factory.generateLocator(base, "default", selectorPart);\n if (nextPart && ["internal:has-text", "internal:has-not-text"].includes(nextPart.name)) {\n const { exact, text } = detectExact(nextPart.body);\n if (!exact) {\n const nextLocatorPart = factory.generateLocator("locator", nextPart.name === "internal:has-text" ? "has-text" : "has-not-text", text, { exact });\n const options = {};\n if (nextPart.name === "internal:has-text")\n options.hasText = text;\n else\n options.hasNotText = text;\n const combinedPart = factory.generateLocator(base, "default", selectorPart, options);\n tokens.push([factory.chainLocators([locatorPart, nextLocatorPart]), combinedPart]);\n index++;\n continue;\n }\n }\n let locatorPartWithEngine;\n if (["xpath", "css"].includes(part.name)) {\n const selectorPart2 = stringifySelector(\n { parts: [part] },\n /* forceEngineName */\n true\n );\n locatorPartWithEngine = factory.generateLocator(base, "default", selectorPart2);\n }\n tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean));\n }\n return combineTokens(factory, tokens, maxOutputSize);\n}\nfunction combineTokens(factory, tokens, maxOutputSize) {\n const currentTokens = tokens.map(() => "");\n const result = [];\n const visit = (index) => {\n if (index === tokens.length) {\n result.push(factory.chainLocators(currentTokens));\n return result.length < maxOutputSize;\n }\n for (const taken of tokens[index]) {\n currentTokens[index] = taken;\n if (!visit(index + 1))\n return false;\n }\n return true;\n };\n visit(0);\n return result;\n}\nfunction detectExact(text) {\n let exact = false;\n const match = text.match(/^\\/(.*)\\/([igm]*)$/);\n if (match)\n return { text: new RegExp(match[1], match[2]) };\n if (text.endsWith(\'"\')) {\n text = JSON.parse(text);\n exact = true;\n } else if (text.endsWith(\'"s\')) {\n text = JSON.parse(text.substring(0, text.length - 1));\n exact = true;\n } else if (text.endsWith(\'"i\')) {\n text = JSON.parse(text.substring(0, text.length - 1));\n exact = false;\n }\n return { exact, text };\n}\nvar JavaScriptLocatorFactory = class {\n constructor(preferredQuote) {\n this.preferredQuote = preferredQuote;\n }\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case "default":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`;\n return `locator(${this.quote(body)})`;\n case "frame-locator":\n return `frameLocator(${this.quote(body)})`;\n case "frame":\n return `contentFrame()`;\n case "nth":\n return `nth(${body})`;\n case "first":\n return `first()`;\n case "last":\n return `last()`;\n case "visible":\n return `filter({ visible: ${body === "true" ? "true" : "false"} })`;\n case "role":\n const attrs = [];\n if (isRegExp(options.name))\n attrs.push(`name: ${this.regexToSourceString(options.name)}`);\n else if (typeof options.name === "string")\n attrs.push(`name: ${this.quote(options.name)}`);\n if (isRegExp(options.description))\n attrs.push(`description: ${this.regexToSourceString(options.description)}`);\n else if (typeof options.description === "string")\n attrs.push(`description: ${this.quote(options.description)}`);\n if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))\n attrs.push(`exact: true`);\n for (const { name, value } of options.attrs)\n attrs.push(`${name}: ${typeof value === "string" ? this.quote(value) : value}`);\n const attrString = attrs.length ? `, { ${attrs.join(", ")} }` : "";\n return `getByRole(${this.quote(body)}${attrString})`;\n case "has-text":\n return `filter({ hasText: ${this.toHasText(body)} })`;\n case "has-not-text":\n return `filter({ hasNotText: ${this.toHasText(body)} })`;\n case "has":\n return `filter({ has: ${body} })`;\n case "hasNot":\n return `filter({ hasNot: ${body} })`;\n case "and":\n return `and(${body})`;\n case "or":\n return `or(${body})`;\n case "chain":\n return `locator(${body})`;\n case "test-id":\n return `getByTestId(${this.toTestIdValue(body)})`;\n case "text":\n return this.toCallWithExact("getByText", body, !!options.exact);\n case "alt":\n return this.toCallWithExact("getByAltText", body, !!options.exact);\n case "placeholder":\n return this.toCallWithExact("getByPlaceholder", body, !!options.exact);\n case "label":\n return this.toCallWithExact("getByLabel", body, !!options.exact);\n case "title":\n return this.toCallWithExact("getByTitle", body, !!options.exact);\n default:\n throw new Error("Unknown selector kind " + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(".");\n }\n regexToSourceString(re) {\n return normalizeEscapedRegexQuotes(String(re));\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToSourceString(body)})`;\n return exact ? `${method}(${this.quote(body)}, { exact: true })` : `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToSourceString(body);\n return this.quote(body);\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToSourceString(value);\n return this.quote(value);\n }\n quote(text) {\n var _a;\n return escapeWithQuotes(text, (_a = this.preferredQuote) != null ? _a : "\'");\n }\n};\nvar PythonLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case "default":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`;\n return `locator(${this.quote(body)})`;\n case "frame-locator":\n return `frame_locator(${this.quote(body)})`;\n case "frame":\n return `content_frame`;\n case "nth":\n return `nth(${body})`;\n case "first":\n return `first`;\n case "last":\n return `last`;\n case "visible":\n return `filter(visible=${body === "true" ? "True" : "False"})`;\n case "role":\n const attrs = [];\n if (isRegExp(options.name))\n attrs.push(`name=${this.regexToString(options.name)}`);\n else if (typeof options.name === "string")\n attrs.push(`name=${this.quote(options.name)}`);\n if (isRegExp(options.description))\n attrs.push(`description=${this.regexToString(options.description)}`);\n else if (typeof options.description === "string")\n attrs.push(`description=${this.quote(options.description)}`);\n if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))\n attrs.push(`exact=True`);\n for (const { name, value } of options.attrs) {\n let valueString = typeof value === "string" ? this.quote(value) : value;\n if (typeof value === "boolean")\n valueString = value ? "True" : "False";\n attrs.push(`${toSnakeCase(name)}=${valueString}`);\n }\n const attrString = attrs.length ? `, ${attrs.join(", ")}` : "";\n return `get_by_role(${this.quote(body)}${attrString})`;\n case "has-text":\n return `filter(has_text=${this.toHasText(body)})`;\n case "has-not-text":\n return `filter(has_not_text=${this.toHasText(body)})`;\n case "has":\n return `filter(has=${body})`;\n case "hasNot":\n return `filter(has_not=${body})`;\n case "and":\n return `and_(${body})`;\n case "or":\n return `or_(${body})`;\n case "chain":\n return `locator(${body})`;\n case "test-id":\n return `get_by_test_id(${this.toTestIdValue(body)})`;\n case "text":\n return this.toCallWithExact("get_by_text", body, !!options.exact);\n case "alt":\n return this.toCallWithExact("get_by_alt_text", body, !!options.exact);\n case "placeholder":\n return this.toCallWithExact("get_by_placeholder", body, !!options.exact);\n case "label":\n return this.toCallWithExact("get_by_label", body, !!options.exact);\n case "title":\n return this.toCallWithExact("get_by_title", body, !!options.exact);\n default:\n throw new Error("Unknown selector kind " + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(".");\n }\n regexToString(body) {\n const suffix = body.flags.includes("i") ? ", re.IGNORECASE" : "";\n return `re.compile(r"${normalizeEscapedRegexQuotes(body.source).replace(/\\\\\\//, "/").replace(/"/g, \'\\\\"\')}"${suffix})`;\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, exact=True)`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToString(body);\n return `${this.quote(body)}`;\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n quote(text) {\n return escapeWithQuotes(text, \'"\');\n }\n};\nvar JavaLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n let clazz;\n switch (base) {\n case "page":\n clazz = "Page";\n break;\n case "frame-locator":\n clazz = "FrameLocator";\n break;\n case "locator":\n clazz = "Locator";\n break;\n }\n switch (kind) {\n case "default":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`;\n return `locator(${this.quote(body)})`;\n case "frame-locator":\n return `frameLocator(${this.quote(body)})`;\n case "frame":\n return `contentFrame()`;\n case "nth":\n return `nth(${body})`;\n case "first":\n return `first()`;\n case "last":\n return `last()`;\n case "visible":\n return `filter(new ${clazz}.FilterOptions().setVisible(${body === "true" ? "true" : "false"}))`;\n case "role":\n const attrs = [];\n if (isRegExp(options.name))\n attrs.push(`.setName(${this.regexToString(options.name)})`);\n else if (typeof options.name === "string")\n attrs.push(`.setName(${this.quote(options.name)})`);\n if (isRegExp(options.description))\n attrs.push(`.setDescription(${this.regexToString(options.description)})`);\n else if (typeof options.description === "string")\n attrs.push(`.setDescription(${this.quote(options.description)})`);\n if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))\n attrs.push(`.setExact(true)`);\n for (const { name, value } of options.attrs)\n attrs.push(`.set${toTitleCase(name)}(${typeof value === "string" ? this.quote(value) : value})`);\n const attrString = attrs.length ? `, new ${clazz}.GetByRoleOptions()${attrs.join("")}` : "";\n return `getByRole(AriaRole.${toSnakeCase(body).toUpperCase()}${attrString})`;\n case "has-text":\n return `filter(new ${clazz}.FilterOptions().setHasText(${this.toHasText(body)}))`;\n case "has-not-text":\n return `filter(new ${clazz}.FilterOptions().setHasNotText(${this.toHasText(body)}))`;\n case "has":\n return `filter(new ${clazz}.FilterOptions().setHas(${body}))`;\n case "hasNot":\n return `filter(new ${clazz}.FilterOptions().setHasNot(${body}))`;\n case "and":\n return `and(${body})`;\n case "or":\n return `or(${body})`;\n case "chain":\n return `locator(${body})`;\n case "test-id":\n return `getByTestId(${this.toTestIdValue(body)})`;\n case "text":\n return this.toCallWithExact(clazz, "getByText", body, !!options.exact);\n case "alt":\n return this.toCallWithExact(clazz, "getByAltText", body, !!options.exact);\n case "placeholder":\n return this.toCallWithExact(clazz, "getByPlaceholder", body, !!options.exact);\n case "label":\n return this.toCallWithExact(clazz, "getByLabel", body, !!options.exact);\n case "title":\n return this.toCallWithExact(clazz, "getByTitle", body, !!options.exact);\n default:\n throw new Error("Unknown selector kind " + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(".");\n }\n regexToString(body) {\n const suffix = body.flags.includes("i") ? ", Pattern.CASE_INSENSITIVE" : "";\n return `Pattern.compile(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n }\n toCallWithExact(clazz, method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, new ${clazz}.${toTitleCase(method)}Options().setExact(true))`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToString(body);\n return this.quote(body);\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n quote(text) {\n return escapeWithQuotes(text, \'"\');\n }\n};\nvar CSharpLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case "default":\n if (options.hasText !== void 0)\n return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`;\n if (options.hasNotText !== void 0)\n return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`;\n return `Locator(${this.quote(body)})`;\n case "frame-locator":\n return `FrameLocator(${this.quote(body)})`;\n case "frame":\n return `ContentFrame`;\n case "nth":\n return `Nth(${body})`;\n case "first":\n return `First`;\n case "last":\n return `Last`;\n case "visible":\n return `Filter(new() { Visible = ${body === "true" ? "true" : "false"} })`;\n case "role":\n const attrs = [];\n if (isRegExp(options.name))\n attrs.push(`NameRegex = ${this.regexToString(options.name)}`);\n else if (typeof options.name === "string")\n attrs.push(`Name = ${this.quote(options.name)}`);\n if (isRegExp(options.description))\n attrs.push(`DescriptionRegex = ${this.regexToString(options.description)}`);\n else if (typeof options.description === "string")\n attrs.push(`Description = ${this.quote(options.description)}`);\n if (options.exact && (typeof options.name === "string" || typeof options.description === "string"))\n attrs.push(`Exact = true`);\n for (const { name, value } of options.attrs)\n attrs.push(`${toTitleCase(name)} = ${typeof value === "string" ? this.quote(value) : value}`);\n const attrString = attrs.length ? `, new() { ${attrs.join(", ")} }` : "";\n return `GetByRole(AriaRole.${toTitleCase(body)}${attrString})`;\n case "has-text":\n return `Filter(new() { ${this.toHasText(body)} })`;\n case "has-not-text":\n return `Filter(new() { ${this.toHasNotText(body)} })`;\n case "has":\n return `Filter(new() { Has = ${body} })`;\n case "hasNot":\n return `Filter(new() { HasNot = ${body} })`;\n case "and":\n return `And(${body})`;\n case "or":\n return `Or(${body})`;\n case "chain":\n return `Locator(${body})`;\n case "test-id":\n return `GetByTestId(${this.toTestIdValue(body)})`;\n case "text":\n return this.toCallWithExact("GetByText", body, !!options.exact);\n case "alt":\n return this.toCallWithExact("GetByAltText", body, !!options.exact);\n case "placeholder":\n return this.toCallWithExact("GetByPlaceholder", body, !!options.exact);\n case "label":\n return this.toCallWithExact("GetByLabel", body, !!options.exact);\n case "title":\n return this.toCallWithExact("GetByTitle", body, !!options.exact);\n default:\n throw new Error("Unknown selector kind " + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(".");\n }\n regexToString(body) {\n const suffix = body.flags.includes("i") ? ", RegexOptions.IgnoreCase" : "";\n return `new Regex(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, new() { Exact = true })`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return `HasTextRegex = ${this.regexToString(body)}`;\n return `HasText = ${this.quote(body)}`;\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n toHasNotText(body) {\n if (isRegExp(body))\n return `HasNotTextRegex = ${this.regexToString(body)}`;\n return `HasNotText = ${this.quote(body)}`;\n }\n quote(text) {\n return escapeWithQuotes(text, \'"\');\n }\n};\nvar JsonlLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n return JSON.stringify({\n kind,\n body,\n options\n });\n }\n chainLocators(locators) {\n const objects = locators.map((l) => JSON.parse(l));\n for (let i = 0; i < objects.length - 1; ++i)\n objects[i].next = objects[i + 1];\n return JSON.stringify(objects[0]);\n }\n};\nvar generators = {\n javascript: JavaScriptLocatorFactory,\n python: PythonLocatorFactory,\n java: JavaLocatorFactory,\n csharp: CSharpLocatorFactory,\n jsonl: JsonlLocatorFactory\n};\nfunction isRegExp(obj) {\n return obj instanceof RegExp;\n}\n\n// packages/isomorphic/locatorUtils.ts\nfunction getByAttributeTextSelector(attrName, text, options) {\n return `internal:attr=[${attrName}=${escapeForAttributeSelector(text, (options == null ? void 0 : options.exact) || false)}]`;\n}\nfunction splitTestIdAttributeNames(testIdAttributeName) {\n return testIdAttributeName.split(",");\n}\nfunction encodeTestIdAttributeName(testIdAttributeName) {\n return testIdAttributeName.includes(",") ? JSON.stringify(testIdAttributeName) : testIdAttributeName;\n}\nfunction getByTestIdSelector(testIdAttributeName, testId) {\n return `internal:testid=[${encodeTestIdAttributeName(testIdAttributeName)}=${escapeForAttributeSelector(testId, true)}]`;\n}\nfunction getByLabelSelector(text, options) {\n return "internal:label=" + escapeForTextSelector(text, !!(options == null ? void 0 : options.exact));\n}\nfunction getByAltTextSelector(text, options) {\n return getByAttributeTextSelector("alt", text, options);\n}\nfunction getByTitleSelector(text, options) {\n return getByAttributeTextSelector("title", text, options);\n}\nfunction getByPlaceholderSelector(text, options) {\n return getByAttributeTextSelector("placeholder", text, options);\n}\nfunction getByTextSelector(text, options) {\n return "internal:text=" + escapeForTextSelector(text, !!(options == null ? void 0 : options.exact));\n}\nfunction getByRoleSelector(role, options = {}) {\n const props = [];\n if (options.checked !== void 0)\n props.push(["checked", String(options.checked)]);\n if (options.disabled !== void 0)\n props.push(["disabled", String(options.disabled)]);\n if (options.selected !== void 0)\n props.push(["selected", String(options.selected)]);\n if (options.expanded !== void 0)\n props.push(["expanded", String(options.expanded)]);\n if (options.includeHidden !== void 0)\n props.push(["include-hidden", String(options.includeHidden)]);\n if (options.level !== void 0)\n props.push(["level", String(options.level)]);\n if (options.name !== void 0)\n props.push(["name", escapeForAttributeSelector(options.name, !!options.exact)]);\n if (options.description !== void 0)\n props.push(["description", escapeForAttributeSelector(options.description, !!options.exact)]);\n if (options.pressed !== void 0)\n props.push(["pressed", String(options.pressed)]);\n return `internal:role=${role}${props.map(([n, v]) => `[${n}=${v}]`).join("")}`;\n}\n\n// packages/isomorphic/yaml.ts\nfunction yamlEscapeKeyIfNeeded(str) {\n if (!yamlStringNeedsQuotes(str))\n return str;\n return `\'` + str.replace(/\'/g, `\'\'`) + `\'`;\n}\nfunction yamlEscapeValueIfNeeded(str) {\n if (!yamlStringNeedsQuotes(str))\n return str;\n return \'"\' + str.replace(/[\\\\"\\x00-\\x1f\\x7f-\\x9f]/g, (c) => {\n switch (c) {\n case "\\\\":\n return "\\\\\\\\";\n case \'"\':\n return \'\\\\"\';\n case "\\b":\n return "\\\\b";\n case "\\f":\n return "\\\\f";\n case "\\n":\n return "\\\\n";\n case "\\r":\n return "\\\\r";\n case " ":\n return "\\\\t";\n default:\n const code = c.charCodeAt(0);\n return "\\\\x" + code.toString(16).padStart(2, "0");\n }\n }) + \'"\';\n}\nfunction yamlStringNeedsQuotes(str) {\n if (str.length === 0)\n return true;\n if (/^\\s|\\s$/.test(str))\n return true;\n if (/[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f-\\x9f]/.test(str))\n return true;\n if (/^-/.test(str))\n return true;\n if (/[\\n:](\\s|$)/.test(str))\n return true;\n if (/\\s#/.test(str))\n return true;\n if (/[\\n\\r]/.test(str))\n return true;\n if (/^[&*\\],?!>|@"\'#%]/.test(str))\n return true;\n if (/[{}`]/.test(str))\n return true;\n if (/^\\[/.test(str))\n return true;\n if (!isNaN(Number(str)) || ["y", "n", "yes", "no", "true", "false", "on", "off", "null"].includes(str.toLowerCase()))\n return true;\n return false;\n}\n\n// packages/injected/src/domUtils.ts\nvar globalOptions = {};\nfunction setGlobalOptions(options) {\n globalOptions = options;\n}\nfunction isInsideScope(scope, element) {\n while (element) {\n if (scope.contains(element))\n return true;\n element = enclosingShadowHost(element);\n }\n return false;\n}\nfunction parentElementOrShadowHost(element) {\n if (element.parentElement)\n return element.parentElement;\n if (!element.parentNode)\n return;\n if (element.parentNode.nodeType === 11 && element.parentNode.host)\n return element.parentNode.host;\n}\nfunction enclosingShadowRootOrDocument(element) {\n let node = element;\n while (node.parentNode)\n node = node.parentNode;\n if (node.nodeType === 11 || node.nodeType === 9)\n return node;\n}\nfunction enclosingShadowHost(element) {\n while (element.parentElement)\n element = element.parentElement;\n return parentElementOrShadowHost(element);\n}\nfunction closestCrossShadow(element, css, scope) {\n while (element) {\n const closest = element.closest(css);\n if (scope && closest !== scope && (closest == null ? void 0 : closest.contains(scope)))\n return;\n if (closest)\n return closest;\n element = enclosingShadowHost(element);\n }\n}\nfunction getElementComputedStyle(element, pseudo) {\n const cache = pseudo === "::before" ? cacheStyleBefore : pseudo === "::after" ? cacheStyleAfter : cacheStyle;\n if (cache && cache.has(element))\n return cache.get(element);\n const style = element.ownerDocument && element.ownerDocument.defaultView ? element.ownerDocument.defaultView.getComputedStyle(element, pseudo) : void 0;\n cache == null ? void 0 : cache.set(element, style);\n return style;\n}\nfunction isElementStyleVisibilityVisible(element, style) {\n style = style != null ? style : getElementComputedStyle(element);\n if (!style)\n return true;\n if (Element.prototype.checkVisibility && globalOptions.browserNameForWorkarounds !== "webkit") {\n if (!element.checkVisibility())\n return false;\n } else {\n const detailsOrSummary = element.closest("details,summary");\n if (detailsOrSummary !== element && (detailsOrSummary == null ? void 0 : detailsOrSummary.nodeName) === "DETAILS" && !detailsOrSummary.open)\n return false;\n }\n if (style.visibility !== "visible")\n return false;\n return true;\n}\nfunction computeBox(element) {\n const style = getElementComputedStyle(element);\n if (!style)\n return { visible: true, inline: false };\n const cursor = style.cursor;\n if (style.display === "contents") {\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === 1 && isElementVisible(child))\n return { visible: true, inline: false, cursor };\n if (child.nodeType === 3 && isVisibleTextNode(child))\n return { visible: true, inline: true, cursor };\n }\n return { visible: false, inline: false, cursor };\n }\n if (!isElementStyleVisibilityVisible(element, style))\n return { cursor, visible: false, inline: false };\n const rect = element.getBoundingClientRect();\n return { cursor, visible: rect.width > 0 && rect.height > 0, inline: style.display === "inline" };\n}\nfunction isElementVisible(element) {\n return computeBox(element).visible;\n}\nfunction isVisibleTextNode(node) {\n const range = node.ownerDocument.createRange();\n range.selectNode(node);\n const rect = range.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n}\nfunction elementSafeTagName(element) {\n const tagName = element.tagName;\n if (typeof tagName === "string")\n return tagName.toUpperCase();\n if (element instanceof HTMLFormElement)\n return "FORM";\n return element.tagName.toUpperCase();\n}\nvar cacheStyle;\nvar cacheStyleBefore;\nvar cacheStyleAfter;\nvar cachesCounter = 0;\nfunction beginDOMCaches() {\n ++cachesCounter;\n cacheStyle != null ? cacheStyle : cacheStyle = /* @__PURE__ */ new Map();\n cacheStyleBefore != null ? cacheStyleBefore : cacheStyleBefore = /* @__PURE__ */ new Map();\n cacheStyleAfter != null ? cacheStyleAfter : cacheStyleAfter = /* @__PURE__ */ new Map();\n}\nfunction endDOMCaches() {\n if (!--cachesCounter) {\n cacheStyle = void 0;\n cacheStyleBefore = void 0;\n cacheStyleAfter = void 0;\n }\n}\n\n// packages/injected/src/roleUtils.ts\nfunction hasExplicitAccessibleName(e) {\n return e.hasAttribute("aria-label") || e.hasAttribute("aria-labelledby");\n}\nvar kAncestorPreventingLandmark = "article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]";\nvar kGlobalAriaAttributes = [\n ["aria-atomic", void 0],\n ["aria-busy", void 0],\n ["aria-controls", void 0],\n ["aria-current", void 0],\n ["aria-describedby", void 0],\n ["aria-details", void 0],\n // Global use deprecated in ARIA 1.2\n // [\'aria-disabled\', undefined],\n ["aria-dropeffect", void 0],\n // Global use deprecated in ARIA 1.2\n // [\'aria-errormessage\', undefined],\n ["aria-flowto", void 0],\n ["aria-grabbed", void 0],\n // Global use deprecated in ARIA 1.2\n // [\'aria-haspopup\', undefined],\n ["aria-hidden", void 0],\n // Global use deprecated in ARIA 1.2\n // [\'aria-invalid\', undefined],\n ["aria-keyshortcuts", void 0],\n ["aria-label", ["caption", "code", "deletion", "emphasis", "generic", "insertion", "paragraph", "presentation", "strong", "subscript", "superscript"]],\n ["aria-labelledby", ["caption", "code", "deletion", "emphasis", "generic", "insertion", "paragraph", "presentation", "strong", "subscript", "superscript"]],\n ["aria-live", void 0],\n ["aria-owns", void 0],\n ["aria-relevant", void 0],\n ["aria-roledescription", ["generic"]]\n];\nfunction hasGlobalAriaAttribute(element, forRole) {\n return kGlobalAriaAttributes.some(([attr, prohibited]) => {\n return !(prohibited == null ? void 0 : prohibited.includes(forRole || "")) && element.hasAttribute(attr);\n });\n}\nfunction hasTabIndex(element) {\n return !Number.isNaN(Number(String(element.getAttribute("tabindex"))));\n}\nfunction isFocusable(element) {\n return !isNativelyDisabled(element) && (isNativelyFocusable(element) || hasTabIndex(element));\n}\nfunction isNativelyFocusable(element) {\n const tagName = elementSafeTagName(element);\n if (["BUTTON", "DETAILS", "SELECT", "TEXTAREA"].includes(tagName))\n return true;\n if (tagName === "A" || tagName === "AREA")\n return element.hasAttribute("href");\n if (tagName === "INPUT")\n return !element.hidden;\n return false;\n}\nvar kImplicitRoleByTagName = {\n "A": (e) => {\n return e.hasAttribute("href") ? "link" : null;\n },\n "AREA": (e) => {\n return e.hasAttribute("href") ? "link" : null;\n },\n "ARTICLE": () => "article",\n "ASIDE": () => "complementary",\n "BLOCKQUOTE": () => "blockquote",\n "BUTTON": () => "button",\n "CAPTION": () => "caption",\n "CODE": () => "code",\n "DATALIST": () => "listbox",\n "DD": () => "definition",\n "DEL": () => "deletion",\n "DETAILS": () => "group",\n "DFN": () => "term",\n "DIALOG": () => "dialog",\n "DT": () => "term",\n "EM": () => "emphasis",\n "FIELDSET": () => "group",\n "FIGURE": () => "figure",\n "FOOTER": (e) => closestCrossShadow(e, kAncestorPreventingLandmark) ? null : "contentinfo",\n "FORM": (e) => hasExplicitAccessibleName(e) ? "form" : null,\n "H1": () => "heading",\n "H2": () => "heading",\n "H3": () => "heading",\n "H4": () => "heading",\n "H5": () => "heading",\n "H6": () => "heading",\n "HEADER": (e) => closestCrossShadow(e, kAncestorPreventingLandmark) ? null : "banner",\n "HR": () => "separator",\n "HTML": () => "document",\n "IMG": (e) => e.getAttribute("alt") === "" && !e.getAttribute("title") && !hasGlobalAriaAttribute(e) && !hasTabIndex(e) ? "presentation" : "img",\n "INPUT": (e) => {\n const type = e.type.toLowerCase();\n if (type === "search")\n return e.hasAttribute("list") ? "combobox" : "searchbox";\n if (["email", "tel", "text", "url", ""].includes(type)) {\n const list = getIdRefs(e, e.getAttribute("list"))[0];\n return list && elementSafeTagName(list) === "DATALIST" ? "combobox" : "textbox";\n }\n if (type === "hidden")\n return null;\n if (type === "file")\n return "button";\n return inputTypeToRole[type] || "textbox";\n },\n "INS": () => "insertion",\n "LI": () => "listitem",\n "MAIN": () => "main",\n "MARK": () => "mark",\n "MATH": () => "math",\n "MENU": () => "list",\n "METER": () => "meter",\n "NAV": () => "navigation",\n "OL": () => "list",\n "OPTGROUP": () => "group",\n "OPTION": () => "option",\n "OUTPUT": () => "status",\n "P": () => "paragraph",\n "PROGRESS": () => "progressbar",\n "SEARCH": () => "search",\n "SECTION": (e) => hasExplicitAccessibleName(e) ? "region" : null,\n "SELECT": (e) => e.hasAttribute("multiple") || e.size > 1 ? "listbox" : "combobox",\n "STRONG": () => "strong",\n "SUB": () => "subscript",\n "SUP": () => "superscript",\n // For we default to Chrome behavior:\n // - Chrome reports \'img\'.\n // - Firefox reports \'diagram\' that is not in official ARIA spec yet.\n // - Safari reports \'no role\', but still computes accessible name.\n "SVG": () => "img",\n "TABLE": () => "table",\n "TBODY": () => "rowgroup",\n "TD": (e) => {\n const table = closestCrossShadow(e, "table");\n const role = table ? getExplicitAriaRole(table) : "";\n return role === "grid" || role === "treegrid" ? "gridcell" : "cell";\n },\n "TEXTAREA": () => "textbox",\n "TFOOT": () => "rowgroup",\n "TH": (e) => {\n const scope = e.getAttribute("scope");\n if (scope === "col" || scope === "colgroup")\n return "columnheader";\n if (scope === "row" || scope === "rowgroup")\n return "rowheader";\n const nextSibling = e.nextElementSibling;\n const prevSibling = e.previousElementSibling;\n const row = !!e.parentElement && elementSafeTagName(e.parentElement) === "TR" ? e.parentElement : void 0;\n if (!nextSibling && !prevSibling) {\n if (row) {\n const table = closestCrossShadow(row, "table");\n if (table && table.rows.length <= 1)\n return null;\n }\n return "columnheader";\n }\n if (isHeaderCell(nextSibling) && isHeaderCell(prevSibling))\n return "columnheader";\n if (isNonEmptyDataCell(nextSibling) || isNonEmptyDataCell(prevSibling))\n return "rowheader";\n return "columnheader";\n },\n "THEAD": () => "rowgroup",\n "TIME": () => "time",\n "TR": () => "row",\n "UL": () => "list"\n};\nfunction isHeaderCell(element) {\n return !!element && elementSafeTagName(element) === "TH";\n}\nfunction isNonEmptyDataCell(element) {\n var _a;\n if (!element || elementSafeTagName(element) !== "TD")\n return false;\n return !!(((_a = element.textContent) == null ? void 0 : _a.trim()) || element.children.length > 0);\n}\nvar kPresentationInheritanceParents = {\n "DD": ["DL", "DIV"],\n "DIV": ["DL"],\n "DT": ["DL", "DIV"],\n "LI": ["OL", "UL"],\n "TBODY": ["TABLE"],\n "TD": ["TR"],\n "TFOOT": ["TABLE"],\n "TH": ["TR"],\n "THEAD": ["TABLE"],\n "TR": ["THEAD", "TBODY", "TFOOT", "TABLE"]\n};\nfunction getImplicitAriaRole(element) {\n var _a;\n const implicitRole = ((_a = kImplicitRoleByTagName[elementSafeTagName(element)]) == null ? void 0 : _a.call(kImplicitRoleByTagName, element)) || "";\n if (!implicitRole)\n return null;\n let ancestor = element;\n while (ancestor) {\n const parent = parentElementOrShadowHost(ancestor);\n const parents = kPresentationInheritanceParents[elementSafeTagName(ancestor)];\n if (!parents || !parent || !parents.includes(elementSafeTagName(parent)))\n break;\n const parentExplicitRole = getExplicitAriaRole(parent);\n if ((parentExplicitRole === "none" || parentExplicitRole === "presentation") && !hasPresentationConflictResolution(parent, parentExplicitRole))\n return parentExplicitRole;\n ancestor = parent;\n }\n return implicitRole;\n}\nvar validRoles = [\n "alert",\n "alertdialog",\n "application",\n "article",\n "banner",\n "blockquote",\n "button",\n "caption",\n "cell",\n "checkbox",\n "code",\n "columnheader",\n "combobox",\n "complementary",\n "contentinfo",\n "definition",\n "deletion",\n "dialog",\n "directory",\n "document",\n "emphasis",\n "feed",\n "figure",\n "form",\n "generic",\n "grid",\n "gridcell",\n "group",\n "heading",\n "img",\n "insertion",\n "link",\n "list",\n "listbox",\n "listitem",\n "log",\n "main",\n "mark",\n "marquee",\n "math",\n "meter",\n "menu",\n "menubar",\n "menuitem",\n "menuitemcheckbox",\n "menuitemradio",\n "navigation",\n "none",\n "note",\n "option",\n "paragraph",\n "presentation",\n "progressbar",\n "radio",\n "radiogroup",\n "region",\n "row",\n "rowgroup",\n "rowheader",\n "scrollbar",\n "search",\n "searchbox",\n "separator",\n "slider",\n "spinbutton",\n "status",\n "strong",\n "subscript",\n "superscript",\n "switch",\n "tab",\n "table",\n "tablist",\n "tabpanel",\n "term",\n "textbox",\n "time",\n "timer",\n "toolbar",\n "tooltip",\n "tree",\n "treegrid",\n "treeitem"\n];\nfunction getExplicitAriaRole(element) {\n const roles = (element.getAttribute("role") || "").split(" ").map((role) => role.trim());\n return roles.find((role) => validRoles.includes(role)) || null;\n}\nfunction hasPresentationConflictResolution(element, role) {\n return hasGlobalAriaAttribute(element, role) || isFocusable(element);\n}\nfunction getAriaRole(element) {\n const explicitRole = getExplicitAriaRole(element);\n if (!explicitRole)\n return getImplicitAriaRole(element);\n if (explicitRole === "none" || explicitRole === "presentation") {\n const implicitRole = getImplicitAriaRole(element);\n if (hasPresentationConflictResolution(element, implicitRole))\n return implicitRole;\n }\n return explicitRole;\n}\nfunction getAriaBoolean(attr) {\n return attr === null ? void 0 : attr.toLowerCase() === "true";\n}\nfunction isElementIgnoredForAria(element) {\n return ["STYLE", "SCRIPT", "NOSCRIPT", "TEMPLATE"].includes(elementSafeTagName(element));\n}\nfunction isElementHiddenForAria(element) {\n if (isElementIgnoredForAria(element))\n return true;\n const style = getElementComputedStyle(element);\n const isSlot = element.nodeName === "SLOT";\n if ((style == null ? void 0 : style.display) === "contents" && !isSlot) {\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === 1 && !isElementHiddenForAria(child))\n return false;\n if (child.nodeType === 3 && isVisibleTextNode(child))\n return false;\n }\n return true;\n }\n const isOptionInsideSelect = element.nodeName === "OPTION" && !!element.closest("select");\n if (!isOptionInsideSelect && !isSlot && !isElementStyleVisibilityVisible(element, style))\n return true;\n return belongsToDisplayNoneOrAriaHiddenOrNonSlotted(element);\n}\nfunction belongsToDisplayNoneOrAriaHiddenOrNonSlotted(element) {\n let hidden = cacheIsHidden == null ? void 0 : cacheIsHidden.get(element);\n if (hidden === void 0) {\n hidden = false;\n if (element.parentElement && element.parentElement.shadowRoot && !element.assignedSlot)\n hidden = true;\n if (!hidden) {\n const style = getElementComputedStyle(element);\n hidden = !style || style.display === "none" || getAriaBoolean(element.getAttribute("aria-hidden")) === true;\n }\n if (!hidden) {\n const parent = parentElementOrShadowHost(element);\n if (parent)\n hidden = belongsToDisplayNoneOrAriaHiddenOrNonSlotted(parent);\n }\n cacheIsHidden == null ? void 0 : cacheIsHidden.set(element, hidden);\n }\n return hidden;\n}\nfunction getIdRefs(element, ref) {\n if (!ref)\n return [];\n const root = enclosingShadowRootOrDocument(element);\n if (!root)\n return [];\n try {\n const ids = ref.split(" ").filter((id) => !!id);\n const result = [];\n for (const id of ids) {\n const firstElement = root.querySelector("#" + CSS.escape(id));\n if (firstElement && !result.includes(firstElement))\n result.push(firstElement);\n }\n return result;\n } catch (e) {\n return [];\n }\n}\nfunction trimFlatString(s) {\n return s.trim();\n}\nfunction asFlatString(s) {\n return s.split("\\xA0").map((chunk) => chunk.replace(/\\r\\n/g, "\\n").replace(/[\\u200b\\u00ad]/g, "").replace(/\\s\\s*/g, " ")).join("\\xA0").trim();\n}\nfunction queryInAriaOwned(element, selector) {\n const result = [...element.querySelectorAll(selector)];\n for (const owned of getIdRefs(element, element.getAttribute("aria-owns"))) {\n if (owned.matches(selector))\n result.push(owned);\n result.push(...owned.querySelectorAll(selector));\n }\n return result;\n}\nfunction getCSSContent(element, pseudo) {\n const cache = pseudo === "::before" ? cachePseudoContentBefore : pseudo === "::after" ? cachePseudoContentAfter : cachePseudoContent;\n if (cache == null ? void 0 : cache.has(element))\n return cache == null ? void 0 : cache.get(element);\n const style = getElementComputedStyle(element, pseudo);\n let content;\n if (style) {\n const contentValue = style.content;\n if (contentValue && contentValue !== "none" && contentValue !== "normal") {\n if (style.display !== "none" && style.visibility !== "hidden") {\n content = parseCSSContentPropertyAsString(element, contentValue, !!pseudo);\n }\n }\n }\n if (pseudo && content !== void 0) {\n const display = (style == null ? void 0 : style.display) || "inline";\n if (display !== "inline")\n content = " " + content + " ";\n }\n if (cache)\n cache.set(element, content);\n return content;\n}\nfunction parseCSSContentPropertyAsString(element, content, isPseudo) {\n if (!content || content === "none" || content === "normal") {\n return;\n }\n try {\n let tokens = tokenize(content).filter((token) => !(token instanceof WhitespaceToken));\n const delimIndex = tokens.findIndex((token) => token instanceof DelimToken && token.value === "/");\n if (delimIndex !== -1) {\n tokens = tokens.slice(delimIndex + 1);\n } else if (!isPseudo) {\n return;\n }\n const accumulated = [];\n let index = 0;\n while (index < tokens.length) {\n if (tokens[index] instanceof StringToken) {\n accumulated.push(tokens[index].value);\n index++;\n } else if (index + 2 < tokens.length && tokens[index] instanceof FunctionToken && tokens[index].value === "attr" && tokens[index + 1] instanceof IdentToken && tokens[index + 2] instanceof CloseParenToken) {\n const attrName = tokens[index + 1].value;\n accumulated.push(element.getAttribute(attrName) || "");\n index += 3;\n } else {\n return;\n }\n }\n return accumulated.join("");\n } catch {\n }\n}\nfunction getAriaLabelledByElements(element) {\n const ref = element.getAttribute("aria-labelledby");\n if (ref === null)\n return null;\n const refs = getIdRefs(element, ref);\n return refs.length ? refs : null;\n}\nfunction allowsNameFromContent(role, targetDescendant) {\n const alwaysAllowsNameFromContent = ["button", "cell", "checkbox", "columnheader", "gridcell", "heading", "link", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "radio", "row", "rowheader", "switch", "tab", "tooltip", "treeitem"].includes(role);\n const descendantAllowsNameFromContent = targetDescendant && ["", "caption", "code", "contentinfo", "definition", "deletion", "emphasis", "insertion", "list", "listitem", "mark", "none", "paragraph", "presentation", "region", "row", "rowgroup", "section", "strong", "subscript", "superscript", "table", "term", "time"].includes(role);\n return alwaysAllowsNameFromContent || descendantAllowsNameFromContent;\n}\nfunction getElementAccessibleName(element, includeHidden) {\n const cache = includeHidden ? cacheAccessibleNameHidden : cacheAccessibleName;\n let accessibleName = cache == null ? void 0 : cache.get(element);\n if (accessibleName === void 0) {\n accessibleName = "";\n const elementProhibitsNaming = ["caption", "code", "definition", "deletion", "emphasis", "generic", "insertion", "mark", "paragraph", "presentation", "strong", "subscript", "suggestion", "superscript", "term", "time"].includes(getAriaRole(element) || "");\n if (!elementProhibitsNaming) {\n accessibleName = asFlatString(getTextAlternativeInternal(element, {\n includeHidden,\n visitedElements: /* @__PURE__ */ new Set(),\n embeddedInTargetElement: "self"\n }));\n }\n cache == null ? void 0 : cache.set(element, accessibleName);\n }\n return accessibleName;\n}\nfunction getElementAccessibleDescription(element, includeHidden) {\n const cache = includeHidden ? cacheAccessibleDescriptionHidden : cacheAccessibleDescription;\n let accessibleDescription = cache == null ? void 0 : cache.get(element);\n if (accessibleDescription === void 0) {\n accessibleDescription = "";\n if (element.hasAttribute("aria-describedby")) {\n const describedBy = getIdRefs(element, element.getAttribute("aria-describedby"));\n accessibleDescription = asFlatString(describedBy.map((ref) => getTextAlternativeInternal(ref, {\n includeHidden,\n visitedElements: /* @__PURE__ */ new Set(),\n embeddedInDescribedBy: { element: ref, hidden: isElementHiddenForAria(ref) }\n })).join(" "));\n } else if (element.hasAttribute("aria-description")) {\n accessibleDescription = asFlatString(element.getAttribute("aria-description") || "");\n } else {\n accessibleDescription = asFlatString(element.getAttribute("title") || "");\n }\n cache == null ? void 0 : cache.set(element, accessibleDescription);\n }\n return accessibleDescription;\n}\nvar kAriaInvalidRoles = [\n "application",\n "checkbox",\n "columnheader",\n "combobox",\n "gridcell",\n "listbox",\n "radiogroup",\n "rowheader",\n "searchbox",\n "slider",\n "spinbutton",\n "switch",\n "textbox",\n "tree"\n];\nfunction getAriaInvalid(element) {\n const ariaInvalid = element.getAttribute("aria-invalid");\n if (!ariaInvalid || ariaInvalid.trim() === "" || ariaInvalid.toLocaleLowerCase() === "false")\n return "false";\n if (ariaInvalid === "true" || ariaInvalid === "grammar" || ariaInvalid === "spelling")\n return ariaInvalid;\n return "true";\n}\nfunction getValidityInvalid(element) {\n if ("validity" in element) {\n const validity = element.validity;\n return (validity == null ? void 0 : validity.valid) === false;\n }\n return false;\n}\nfunction getElementAccessibleErrorMessage(element) {\n const cache = cacheAccessibleErrorMessage;\n let accessibleErrorMessage = cacheAccessibleErrorMessage == null ? void 0 : cacheAccessibleErrorMessage.get(element);\n if (accessibleErrorMessage === void 0) {\n accessibleErrorMessage = "";\n const isAriaInvalid = getAriaInvalid(element) !== "false";\n const isValidityInvalid = getValidityInvalid(element);\n if (isAriaInvalid || isValidityInvalid) {\n const errorMessageId = element.getAttribute("aria-errormessage");\n const errorMessages = getIdRefs(element, errorMessageId);\n const parts = errorMessages.map((errorMessage) => asFlatString(\n getTextAlternativeInternal(errorMessage, {\n visitedElements: /* @__PURE__ */ new Set(),\n embeddedInDescribedBy: { element: errorMessage, hidden: isElementHiddenForAria(errorMessage) }\n })\n ));\n accessibleErrorMessage = parts.join(" ").trim();\n }\n cache == null ? void 0 : cache.set(element, accessibleErrorMessage);\n }\n return accessibleErrorMessage;\n}\nfunction getTextAlternativeInternal(element, options) {\n var _a, _b, _c, _d;\n if (options.visitedElements.has(element))\n return "";\n const childOptions = {\n ...options,\n embeddedInTargetElement: options.embeddedInTargetElement === "self" ? "descendant" : options.embeddedInTargetElement\n };\n if (!options.includeHidden) {\n const isEmbeddedInHiddenReferenceTraversal = !!((_a = options.embeddedInLabelledBy) == null ? void 0 : _a.hidden) || !!((_b = options.embeddedInDescribedBy) == null ? void 0 : _b.hidden) || !!((_c = options.embeddedInNativeTextAlternative) == null ? void 0 : _c.hidden) || !!((_d = options.embeddedInLabel) == null ? void 0 : _d.hidden);\n if (isElementIgnoredForAria(element) || !isEmbeddedInHiddenReferenceTraversal && isElementHiddenForAria(element)) {\n options.visitedElements.add(element);\n return "";\n }\n }\n const labelledBy = getAriaLabelledByElements(element);\n if (!options.embeddedInLabelledBy) {\n const accessibleName = (labelledBy || []).map((ref) => getTextAlternativeInternal(ref, {\n ...options,\n embeddedInLabelledBy: { element: ref, hidden: isElementHiddenForAria(ref) },\n embeddedInDescribedBy: void 0,\n embeddedInTargetElement: void 0,\n embeddedInLabel: void 0,\n embeddedInNativeTextAlternative: void 0\n })).join(" ");\n if (accessibleName)\n return accessibleName;\n }\n const role = getAriaRole(element) || "";\n const tagName = elementSafeTagName(element);\n if (!!options.embeddedInLabel || !!options.embeddedInLabelledBy || options.embeddedInTargetElement === "descendant") {\n const isOwnLabel = [...element.labels || []].includes(element);\n const isOwnLabelledBy = (labelledBy || []).includes(element);\n if (!isOwnLabel && !isOwnLabelledBy) {\n if (role === "textbox") {\n options.visitedElements.add(element);\n if (tagName === "INPUT" || tagName === "TEXTAREA")\n return element.value;\n return element.textContent || "";\n }\n if (["combobox", "listbox"].includes(role)) {\n options.visitedElements.add(element);\n let selectedOptions;\n if (tagName === "SELECT") {\n selectedOptions = [...element.selectedOptions];\n if (!selectedOptions.length && element.options.length)\n selectedOptions.push(element.options[0]);\n } else {\n const listbox = role === "combobox" ? queryInAriaOwned(element, "*").find((e) => getAriaRole(e) === "listbox") : element;\n selectedOptions = listbox ? queryInAriaOwned(listbox, \'[aria-selected="true"]\').filter((e) => getAriaRole(e) === "option") : [];\n }\n if (!selectedOptions.length && tagName === "INPUT") {\n return element.value;\n }\n return selectedOptions.map((option) => getTextAlternativeInternal(option, childOptions)).join(" ");\n }\n if (["progressbar", "scrollbar", "slider", "spinbutton", "meter"].includes(role)) {\n options.visitedElements.add(element);\n if (element.hasAttribute("aria-valuetext"))\n return element.getAttribute("aria-valuetext") || "";\n if (element.hasAttribute("aria-valuenow"))\n return element.getAttribute("aria-valuenow") || "";\n return element.getAttribute("value") || "";\n }\n if (["menu"].includes(role)) {\n options.visitedElements.add(element);\n return "";\n }\n }\n }\n const ariaLabel = element.getAttribute("aria-label") || "";\n if (trimFlatString(ariaLabel)) {\n options.visitedElements.add(element);\n return ariaLabel;\n }\n if (!["presentation", "none"].includes(role)) {\n if (tagName === "INPUT" && ["button", "submit", "reset"].includes(element.type)) {\n options.visitedElements.add(element);\n const value = element.value || "";\n if (trimFlatString(value))\n return value;\n if (element.type === "submit")\n return "Submit";\n if (element.type === "reset")\n return "Reset";\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (tagName === "INPUT" && element.type === "file") {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length && !options.embeddedInLabelledBy)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n return "Choose File";\n }\n if (tagName === "INPUT" && element.type === "image") {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length && !options.embeddedInLabelledBy)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n const alt = element.getAttribute("alt") || "";\n if (trimFlatString(alt))\n return alt;\n const title = element.getAttribute("title") || "";\n if (trimFlatString(title))\n return title;\n return "Submit";\n }\n if (!labelledBy && tagName === "BUTTON") {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n }\n if (!labelledBy && tagName === "OUTPUT") {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n return element.getAttribute("title") || "";\n }\n if (!labelledBy && (tagName === "TEXTAREA" || tagName === "SELECT" || tagName === "INPUT")) {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n const usePlaceholder = tagName === "INPUT" && ["text", "password", "search", "tel", "email", "url"].includes(element.type) || tagName === "TEXTAREA";\n const placeholder = element.getAttribute("placeholder") || "";\n const title = element.getAttribute("title") || "";\n if (!usePlaceholder || title)\n return title;\n return placeholder;\n }\n if (!labelledBy && tagName === "FIELDSET") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (elementSafeTagName(child) === "LEGEND") {\n return getTextAlternativeInternal(child, {\n ...childOptions,\n embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n });\n }\n }\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (!labelledBy && tagName === "FIGURE") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (elementSafeTagName(child) === "FIGCAPTION") {\n return getTextAlternativeInternal(child, {\n ...childOptions,\n embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n });\n }\n }\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (tagName === "IMG") {\n options.visitedElements.add(element);\n const alt = element.getAttribute("alt") || "";\n if (trimFlatString(alt))\n return alt;\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (tagName === "TABLE") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (elementSafeTagName(child) === "CAPTION") {\n return getTextAlternativeInternal(child, {\n ...childOptions,\n embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n });\n }\n }\n const summary = element.getAttribute("summary") || "";\n if (summary)\n return summary;\n }\n if (tagName === "AREA") {\n options.visitedElements.add(element);\n const alt = element.getAttribute("alt") || "";\n if (trimFlatString(alt))\n return alt;\n const title = element.getAttribute("title") || "";\n return title;\n }\n if (tagName === "SVG" || element.ownerSVGElement) {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (elementSafeTagName(child) === "TITLE" && child.ownerSVGElement) {\n return getTextAlternativeInternal(child, {\n ...childOptions,\n embeddedInLabelledBy: { element: child, hidden: isElementHiddenForAria(child) }\n });\n }\n }\n }\n if (element.ownerSVGElement && tagName === "A") {\n const title = element.getAttribute("xlink:title") || "";\n if (trimFlatString(title)) {\n options.visitedElements.add(element);\n return title;\n }\n }\n }\n const shouldNameFromContentForSummary = tagName === "SUMMARY" && !["presentation", "none"].includes(role);\n if (allowsNameFromContent(role, options.embeddedInTargetElement === "descendant") || shouldNameFromContentForSummary || !!options.embeddedInLabelledBy || !!options.embeddedInDescribedBy || !!options.embeddedInLabel || !!options.embeddedInNativeTextAlternative) {\n options.visitedElements.add(element);\n const accessibleName = innerAccumulatedElementText(element, childOptions);\n const maybeTrimmedAccessibleName = options.embeddedInTargetElement === "self" ? trimFlatString(accessibleName) : accessibleName;\n if (maybeTrimmedAccessibleName)\n return accessibleName;\n }\n if (!["presentation", "none"].includes(role) || tagName === "IFRAME") {\n options.visitedElements.add(element);\n const title = element.getAttribute("title") || "";\n if (trimFlatString(title))\n return title;\n }\n options.visitedElements.add(element);\n return "";\n}\nfunction innerAccumulatedElementText(element, options) {\n const tokens = [];\n const visit = (node, skipSlotted) => {\n var _a;\n if (skipSlotted && node.assignedSlot)\n return;\n if (node.nodeType === 1) {\n const display = ((_a = getElementComputedStyle(node)) == null ? void 0 : _a.display) || "inline";\n let token = getTextAlternativeInternal(node, options);\n if (display !== "inline" || node.nodeName === "BR")\n token = " " + token + " ";\n tokens.push(token);\n } else if (node.nodeType === 3) {\n tokens.push(node.textContent || "");\n }\n };\n tokens.push(getCSSContent(element, "::before") || "");\n const content = getCSSContent(element);\n if (content !== void 0) {\n tokens.push(content);\n } else {\n const assignedNodes = element.nodeName === "SLOT" ? element.assignedNodes() : [];\n if (assignedNodes.length) {\n for (const child of assignedNodes)\n visit(child, false);\n } else {\n for (let child = element.firstChild; child; child = child.nextSibling)\n visit(child, true);\n if (element.shadowRoot) {\n for (let child = element.shadowRoot.firstChild; child; child = child.nextSibling)\n visit(child, true);\n }\n for (const owned of getIdRefs(element, element.getAttribute("aria-owns")))\n visit(owned, true);\n }\n }\n tokens.push(getCSSContent(element, "::after") || "");\n return tokens.join("");\n}\nvar kAriaSelectedRoles = ["gridcell", "option", "row", "tab", "rowheader", "columnheader", "treeitem"];\nfunction getAriaSelected(element) {\n if (elementSafeTagName(element) === "OPTION")\n return element.selected;\n if (kAriaSelectedRoles.includes(getAriaRole(element) || ""))\n return getAriaBoolean(element.getAttribute("aria-selected")) === true;\n return false;\n}\nvar kAriaCheckedRoles = ["checkbox", "menuitemcheckbox", "option", "radio", "switch", "menuitemradio", "treeitem"];\nfunction getAriaChecked(element) {\n const result = getChecked(element, true);\n return result === "error" ? false : result;\n}\nfunction getCheckedAllowMixed(element) {\n return getChecked(element, true);\n}\nfunction getCheckedWithoutMixed(element) {\n const result = getChecked(element, false);\n return result;\n}\nfunction getChecked(element, allowMixed) {\n const tagName = elementSafeTagName(element);\n if (allowMixed && tagName === "INPUT" && element.indeterminate)\n return "mixed";\n if (tagName === "INPUT" && ["checkbox", "radio"].includes(element.type))\n return element.checked;\n if (kAriaCheckedRoles.includes(getAriaRole(element) || "")) {\n const checked = element.getAttribute("aria-checked");\n if (checked === "true")\n return true;\n if (allowMixed && checked === "mixed")\n return "mixed";\n return false;\n }\n return "error";\n}\nvar kAriaReadonlyRoles = ["checkbox", "combobox", "grid", "gridcell", "listbox", "radiogroup", "slider", "spinbutton", "textbox", "columnheader", "rowheader", "searchbox", "switch", "treegrid"];\nfunction getReadonly(element) {\n const tagName = elementSafeTagName(element);\n if (["INPUT", "TEXTAREA", "SELECT"].includes(tagName))\n return element.hasAttribute("readonly");\n if (kAriaReadonlyRoles.includes(getAriaRole(element) || ""))\n return element.getAttribute("aria-readonly") === "true";\n if (element.isContentEditable)\n return false;\n return "error";\n}\nvar kAriaPressedRoles = ["button"];\nfunction getAriaPressed(element) {\n if (kAriaPressedRoles.includes(getAriaRole(element) || "")) {\n const pressed = element.getAttribute("aria-pressed");\n if (pressed === "true")\n return true;\n if (pressed === "mixed")\n return "mixed";\n }\n return false;\n}\nvar kAriaExpandedRoles = ["application", "button", "checkbox", "combobox", "gridcell", "link", "listbox", "menuitem", "row", "rowheader", "tab", "treeitem", "columnheader", "menuitemcheckbox", "menuitemradio", "rowheader", "switch"];\nfunction getAriaExpanded(element) {\n if (elementSafeTagName(element) === "DETAILS")\n return element.open;\n if (kAriaExpandedRoles.includes(getAriaRole(element) || "")) {\n const expanded = element.getAttribute("aria-expanded");\n if (expanded === null)\n return void 0;\n if (expanded === "true")\n return true;\n return false;\n }\n return void 0;\n}\nvar kAriaLevelRoles = ["heading", "listitem", "row", "treeitem"];\nfunction getAriaLevel(element) {\n const native = { "H1": 1, "H2": 2, "H3": 3, "H4": 4, "H5": 5, "H6": 6 }[elementSafeTagName(element)];\n if (native)\n return native;\n if (kAriaLevelRoles.includes(getAriaRole(element) || "")) {\n const attr = element.getAttribute("aria-level");\n const value = attr === null ? Number.NaN : Number(attr);\n if (Number.isInteger(value) && value >= 1)\n return value;\n }\n return 0;\n}\nvar kAriaDisabledRoles = ["application", "button", "composite", "gridcell", "group", "input", "link", "menuitem", "scrollbar", "separator", "tab", "checkbox", "columnheader", "combobox", "grid", "listbox", "menu", "menubar", "menuitemcheckbox", "menuitemradio", "option", "radio", "radiogroup", "row", "rowheader", "searchbox", "select", "slider", "spinbutton", "switch", "tablist", "textbox", "toolbar", "tree", "treegrid", "treeitem"];\nfunction getAriaDisabled(element) {\n return isNativelyDisabled(element) || hasExplicitAriaDisabled(element);\n}\nfunction isNativelyDisabled(element) {\n const isNativeFormControl = ["BUTTON", "INPUT", "SELECT", "TEXTAREA", "OPTION", "OPTGROUP"].includes(elementSafeTagName(element));\n return isNativeFormControl && (element.hasAttribute("disabled") || belongsToDisabledOptGroup(element) || belongsToDisabledFieldSet(element));\n}\nfunction belongsToDisabledOptGroup(element) {\n return elementSafeTagName(element) === "OPTION" && !!element.closest("OPTGROUP[DISABLED]");\n}\nfunction belongsToDisabledFieldSet(element) {\n const fieldSetElement = element == null ? void 0 : element.closest("FIELDSET[DISABLED]");\n if (!fieldSetElement)\n return false;\n const legendElement = fieldSetElement.querySelector(":scope > LEGEND");\n return !legendElement || !legendElement.contains(element);\n}\nfunction hasExplicitAriaDisabled(element, isAncestor = false) {\n if (!element)\n return false;\n if (isAncestor || kAriaDisabledRoles.includes(getAriaRole(element) || "")) {\n const attribute = (element.getAttribute("aria-disabled") || "").toLowerCase();\n if (attribute === "true")\n return true;\n if (attribute === "false")\n return false;\n return hasExplicitAriaDisabled(parentElementOrShadowHost(element), true);\n }\n return false;\n}\nfunction getAccessibleNameFromAssociatedLabels(labels, options) {\n return [...labels].map((label) => getTextAlternativeInternal(label, {\n ...options,\n embeddedInLabel: { element: label, hidden: isElementHiddenForAria(label) },\n embeddedInNativeTextAlternative: void 0,\n embeddedInLabelledBy: void 0,\n embeddedInDescribedBy: void 0,\n embeddedInTargetElement: void 0\n })).filter((accessibleName) => !!accessibleName).join(" ");\n}\nfunction receivesPointerEvents(element) {\n const cache = cachePointerEvents;\n let e = element;\n let result;\n const parents = [];\n for (; e; e = parentElementOrShadowHost(e)) {\n const cached = cache.get(e);\n if (cached !== void 0) {\n result = cached;\n break;\n }\n parents.push(e);\n const style = getElementComputedStyle(e);\n if (!style) {\n result = true;\n break;\n }\n const value = style.pointerEvents;\n if (value) {\n result = value !== "none";\n break;\n }\n }\n if (result === void 0)\n result = true;\n for (const parent of parents)\n cache.set(parent, result);\n return result;\n}\nvar cacheAccessibleName;\nvar cacheAccessibleNameHidden;\nvar cacheAccessibleDescription;\nvar cacheAccessibleDescriptionHidden;\nvar cacheAccessibleErrorMessage;\nvar cacheIsHidden;\nvar cachePseudoContent;\nvar cachePseudoContentBefore;\nvar cachePseudoContentAfter;\nvar cachePointerEvents;\nvar cachesCounter2 = 0;\nfunction beginAriaCaches() {\n beginDOMCaches();\n ++cachesCounter2;\n cacheAccessibleName != null ? cacheAccessibleName : cacheAccessibleName = /* @__PURE__ */ new Map();\n cacheAccessibleNameHidden != null ? cacheAccessibleNameHidden : cacheAccessibleNameHidden = /* @__PURE__ */ new Map();\n cacheAccessibleDescription != null ? cacheAccessibleDescription : cacheAccessibleDescription = /* @__PURE__ */ new Map();\n cacheAccessibleDescriptionHidden != null ? cacheAccessibleDescriptionHidden : cacheAccessibleDescriptionHidden = /* @__PURE__ */ new Map();\n cacheAccessibleErrorMessage != null ? cacheAccessibleErrorMessage : cacheAccessibleErrorMessage = /* @__PURE__ */ new Map();\n cacheIsHidden != null ? cacheIsHidden : cacheIsHidden = /* @__PURE__ */ new Map();\n cachePseudoContent != null ? cachePseudoContent : cachePseudoContent = /* @__PURE__ */ new Map();\n cachePseudoContentBefore != null ? cachePseudoContentBefore : cachePseudoContentBefore = /* @__PURE__ */ new Map();\n cachePseudoContentAfter != null ? cachePseudoContentAfter : cachePseudoContentAfter = /* @__PURE__ */ new Map();\n cachePointerEvents != null ? cachePointerEvents : cachePointerEvents = /* @__PURE__ */ new Map();\n}\nfunction endAriaCaches() {\n if (!--cachesCounter2) {\n cacheAccessibleName = void 0;\n cacheAccessibleNameHidden = void 0;\n cacheAccessibleDescription = void 0;\n cacheAccessibleDescriptionHidden = void 0;\n cacheAccessibleErrorMessage = void 0;\n cacheIsHidden = void 0;\n cachePseudoContent = void 0;\n cachePseudoContentBefore = void 0;\n cachePseudoContentAfter = void 0;\n cachePointerEvents = void 0;\n }\n endDOMCaches();\n}\nvar inputTypeToRole = {\n "button": "button",\n "checkbox": "checkbox",\n "image": "button",\n "number": "spinbutton",\n "radio": "radio",\n "range": "slider",\n "reset": "button",\n "submit": "button"\n};\n\n// packages/injected/src/ariaSnapshot.ts\nvar lastRef = 0;\nfunction toInternalOptions(options) {\n const renderBoxes = options.boxes;\n if (options.mode === "ai") {\n return {\n visibility: "ariaOrVisible",\n refs: "interactable",\n refPrefix: options.refPrefix,\n includeGenericRole: true,\n renderActive: !options.doNotRenderActive,\n renderCursorPointer: true,\n renderBoxes\n };\n }\n if (options.mode === "autoexpect") {\n return { visibility: "ariaAndVisible", refs: "none", renderBoxes };\n }\n if (options.mode === "codegen") {\n return { visibility: "aria", refs: "none", renderStringsAsRegex: true, renderBoxes };\n }\n return { visibility: "aria", refs: "none", renderBoxes };\n}\nfunction generateAriaTree(rootElement, publicOptions) {\n const options = toInternalOptions(publicOptions);\n const visited = /* @__PURE__ */ new Set();\n const snapshot = {\n root: { role: "fragment", name: "", children: [], props: {}, box: computeBox(rootElement), receivesPointerEvents: true },\n elements: /* @__PURE__ */ new Map(),\n refs: /* @__PURE__ */ new Map(),\n iframeRefs: []\n };\n setAriaNodeElement(snapshot.root, rootElement);\n const visit = (ariaNode, node, parentElementVisible) => {\n if (visited.has(node))\n return;\n visited.add(node);\n if (node.nodeType === Node.TEXT_NODE && node.nodeValue) {\n if (!parentElementVisible)\n return;\n const text = node.nodeValue;\n if (ariaNode.role !== "textbox" && text)\n ariaNode.children.push(node.nodeValue || "");\n return;\n }\n if (node.nodeType !== Node.ELEMENT_NODE)\n return;\n const element = node;\n const isElementVisibleForAria = !isElementHiddenForAria(element);\n let visible = isElementVisibleForAria;\n if (options.visibility === "ariaOrVisible")\n visible = isElementVisibleForAria || isElementVisible(element);\n if (options.visibility === "ariaAndVisible")\n visible = isElementVisibleForAria && isElementVisible(element);\n if (options.visibility === "aria" && !visible)\n return;\n const ariaChildren = [];\n if (element.hasAttribute("aria-owns")) {\n const ids = element.getAttribute("aria-owns").split(/\\s+/);\n for (const id of ids) {\n const ownedElement = rootElement.ownerDocument.getElementById(id);\n if (ownedElement)\n ariaChildren.push(ownedElement);\n }\n }\n const childAriaNode = visible ? toAriaNode(element, options) : null;\n if (childAriaNode) {\n if (childAriaNode.ref) {\n snapshot.elements.set(childAriaNode.ref, element);\n snapshot.refs.set(element, childAriaNode.ref);\n if (childAriaNode.role === "iframe")\n snapshot.iframeRefs.push(childAriaNode.ref);\n }\n ariaNode.children.push(childAriaNode);\n }\n processElement(childAriaNode || ariaNode, element, ariaChildren, visible);\n };\n function processElement(ariaNode, element, ariaChildren, parentElementVisible) {\n var _a;\n const display = ((_a = getElementComputedStyle(element)) == null ? void 0 : _a.display) || "inline";\n const treatAsBlock = display !== "inline" || element.nodeName === "BR" ? " " : "";\n if (treatAsBlock)\n ariaNode.children.push(treatAsBlock);\n ariaNode.children.push(getCSSContent(element, "::before") || "");\n const assignedNodes = element.nodeName === "SLOT" ? element.assignedNodes() : [];\n if (assignedNodes.length) {\n for (const child of assignedNodes)\n visit(ariaNode, child, parentElementVisible);\n } else {\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (!child.assignedSlot)\n visit(ariaNode, child, parentElementVisible);\n }\n if (element.shadowRoot) {\n for (let child = element.shadowRoot.firstChild; child; child = child.nextSibling)\n visit(ariaNode, child, parentElementVisible);\n }\n }\n for (const child of ariaChildren)\n visit(ariaNode, child, parentElementVisible);\n ariaNode.children.push(getCSSContent(element, "::after") || "");\n if (treatAsBlock)\n ariaNode.children.push(treatAsBlock);\n if (ariaNode.children.length === 1 && ariaNode.name === ariaNode.children[0])\n ariaNode.children = [];\n if (ariaNode.role === "link" && element.hasAttribute("href")) {\n const href = element.getAttribute("href");\n ariaNode.props["url"] = href;\n }\n if (ariaNode.role === "textbox" && element.hasAttribute("placeholder") && element.getAttribute("placeholder") !== ariaNode.name) {\n const placeholder = element.getAttribute("placeholder");\n ariaNode.props["placeholder"] = placeholder;\n }\n }\n beginAriaCaches();\n try {\n visit(snapshot.root, rootElement, true);\n } finally {\n endAriaCaches();\n }\n normalizeStringChildren(snapshot.root);\n normalizeGenericRoles(snapshot.root);\n return snapshot;\n}\nfunction computeAriaRef(ariaNode, options) {\n var _a;\n if (options.refs === "none")\n return;\n if (options.refs === "interactable" && (!ariaNode.box.visible || !ariaNode.receivesPointerEvents))\n return;\n const element = ariaNodeElement(ariaNode);\n let ariaRef = element._ariaRef;\n if (!ariaRef || ariaRef.role !== ariaNode.role || ariaRef.name !== ariaNode.name) {\n ariaRef = { role: ariaNode.role, name: ariaNode.name, ref: ((_a = options.refPrefix) != null ? _a : "") + "e" + ++lastRef };\n element._ariaRef = ariaRef;\n }\n ariaNode.ref = ariaRef.ref;\n}\nfunction toAriaNode(element, options) {\n var _a;\n const active = element.ownerDocument.activeElement === element;\n if (element.nodeName === "IFRAME") {\n const ariaNode = {\n role: "iframe",\n name: "",\n children: [],\n props: {},\n box: computeBox(element),\n receivesPointerEvents: true,\n active\n };\n setAriaNodeElement(ariaNode, element);\n computeAriaRef(ariaNode, options);\n return ariaNode;\n }\n const defaultRole = options.includeGenericRole ? "generic" : null;\n const role = (_a = getAriaRole(element)) != null ? _a : defaultRole;\n if (!role || role === "presentation" || role === "none")\n return null;\n const name = normalizeWhiteSpace(getElementAccessibleName(element, false) || "");\n const receivesPointerEvents2 = receivesPointerEvents(element);\n const box = computeBox(element);\n if (role === "generic" && box.inline && element.childNodes.length === 1 && element.childNodes[0].nodeType === Node.TEXT_NODE)\n return null;\n const result = {\n role,\n name,\n children: [],\n props: {},\n box,\n receivesPointerEvents: receivesPointerEvents2,\n active\n };\n setAriaNodeElement(result, element);\n computeAriaRef(result, options);\n if (kAriaCheckedRoles.includes(role))\n result.checked = getAriaChecked(element);\n if (kAriaDisabledRoles.includes(role))\n result.disabled = getAriaDisabled(element);\n if (kAriaExpandedRoles.includes(role))\n result.expanded = getAriaExpanded(element);\n if (kAriaInvalidRoles.includes(role)) {\n const invalid = getAriaInvalid(element);\n result.invalid = invalid === "false" ? false : invalid === "true" ? true : invalid;\n }\n if (kAriaLevelRoles.includes(role))\n result.level = getAriaLevel(element);\n if (kAriaPressedRoles.includes(role))\n result.pressed = getAriaPressed(element);\n if (kAriaSelectedRoles.includes(role))\n result.selected = getAriaSelected(element);\n if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {\n if (element.type !== "checkbox" && element.type !== "radio" && element.type !== "file")\n result.children = [element.value];\n }\n return result;\n}\nfunction normalizeGenericRoles(node) {\n const normalizeChildren = (node2) => {\n const result = [];\n for (const child of node2.children || []) {\n if (typeof child === "string") {\n result.push(child);\n continue;\n }\n const normalized = normalizeChildren(child);\n result.push(...normalized);\n }\n const removeSelf = node2.role === "generic" && !node2.name && result.length <= 1 && result.every((c) => typeof c !== "string" && !!c.ref);\n if (removeSelf)\n return result;\n node2.children = result;\n return [node2];\n };\n normalizeChildren(node);\n}\nfunction normalizeStringChildren(rootA11yNode) {\n const flushChildren = (buffer, normalizedChildren) => {\n if (!buffer.length)\n return;\n const text = normalizeWhiteSpace(buffer.join(""));\n if (text)\n normalizedChildren.push(text);\n buffer.length = 0;\n };\n const visit = (ariaNode) => {\n const normalizedChildren = [];\n const buffer = [];\n for (const child of ariaNode.children || []) {\n if (typeof child === "string") {\n buffer.push(child);\n } else {\n flushChildren(buffer, normalizedChildren);\n visit(child);\n normalizedChildren.push(child);\n }\n }\n flushChildren(buffer, normalizedChildren);\n ariaNode.children = normalizedChildren.length ? normalizedChildren : [];\n if (ariaNode.children.length === 1 && ariaNode.children[0] === ariaNode.name)\n ariaNode.children = [];\n };\n visit(rootA11yNode);\n}\nfunction matchesStringOrRegex(text, template) {\n if (!template)\n return true;\n if (!text)\n return false;\n if (typeof template === "string")\n return text === template;\n return !!text.match(new RegExp(template.pattern));\n}\nfunction matchesTextValue(text, template) {\n if (!(template == null ? void 0 : template.normalized))\n return true;\n if (!text)\n return false;\n if (text === template.normalized)\n return true;\n if (text === template.raw)\n return true;\n const regex = cachedRegex(template);\n if (regex)\n return !!text.match(regex);\n return false;\n}\nvar cachedRegexSymbol = Symbol("cachedRegex");\nfunction cachedRegex(template) {\n if (template[cachedRegexSymbol] !== void 0)\n return template[cachedRegexSymbol];\n const { raw } = template;\n const canBeRegex = raw.startsWith("/") && raw.endsWith("/") && raw.length > 1;\n let regex;\n try {\n regex = canBeRegex ? new RegExp(raw.slice(1, -1)) : null;\n } catch (e) {\n regex = null;\n }\n template[cachedRegexSymbol] = regex;\n return regex;\n}\nfunction matchesExpectAriaTemplate(rootElement, template) {\n const snapshot = generateAriaTree(rootElement, { mode: "default" });\n const matches = matchesNodeDeep(snapshot.root, template, false, false);\n return {\n matches,\n received: {\n raw: renderAriaTree(snapshot, { mode: "default" }).text,\n regex: renderAriaTree(snapshot, { mode: "codegen" }).text\n }\n };\n}\nfunction getAllElementsMatchingExpectAriaTemplate(rootElement, template) {\n const root = generateAriaTree(rootElement, { mode: "default" }).root;\n const matches = matchesNodeDeep(root, template, true, false);\n return matches.map((n) => ariaNodeElement(n));\n}\nfunction matchesNode(node, template, isDeepEqual) {\n var _a;\n if (typeof node === "string" && template.kind === "text")\n return matchesTextValue(node, template.text);\n if (node === null || typeof node !== "object" || template.kind !== "role")\n return false;\n if (template.role !== "fragment" && template.role !== node.role)\n return false;\n if (template.checked !== void 0 && template.checked !== node.checked)\n return false;\n if (template.disabled !== void 0 && template.disabled !== node.disabled)\n return false;\n if (template.expanded !== void 0 && template.expanded !== node.expanded)\n return false;\n if (template.invalid !== void 0 && template.invalid !== node.invalid)\n return false;\n if (template.level !== void 0 && template.level !== node.level)\n return false;\n if (template.pressed !== void 0 && template.pressed !== node.pressed)\n return false;\n if (template.selected !== void 0 && template.selected !== node.selected)\n return false;\n if (!matchesStringOrRegex(node.name, template.name))\n return false;\n if (!matchesTextValue(node.props.url, (_a = template.props) == null ? void 0 : _a.url))\n return false;\n if (template.containerMode === "contain")\n return containsList(node.children || [], template.children || []);\n if (template.containerMode === "equal")\n return listEqual(node.children || [], template.children || [], false);\n if (template.containerMode === "deep-equal" || isDeepEqual)\n return listEqual(node.children || [], template.children || [], true);\n return containsList(node.children || [], template.children || []);\n}\nfunction listEqual(children, template, isDeepEqual) {\n if (template.length !== children.length)\n return false;\n for (let i = 0; i < template.length; ++i) {\n if (!matchesNode(children[i], template[i], isDeepEqual))\n return false;\n }\n return true;\n}\nfunction containsList(children, template) {\n if (template.length > children.length)\n return false;\n const cc = children.slice();\n const tt = template.slice();\n for (const t of tt) {\n let c = cc.shift();\n while (c) {\n if (matchesNode(c, t, false))\n break;\n c = cc.shift();\n }\n if (!c)\n return false;\n }\n return true;\n}\nfunction matchesNodeDeep(root, template, collectAll, isDeepEqual) {\n const results = [];\n const visit = (node, parent) => {\n if (matchesNode(node, template, isDeepEqual)) {\n const result = typeof node === "string" ? parent : node;\n if (result)\n results.push(result);\n return !collectAll;\n }\n if (typeof node === "string")\n return false;\n for (const child of node.children || []) {\n if (visit(child, node))\n return true;\n }\n return false;\n };\n visit(root, null);\n return results;\n}\nfunction buildByRefMap(root, map = /* @__PURE__ */ new Map()) {\n if (root == null ? void 0 : root.ref)\n map.set(root.ref, root);\n for (const child of (root == null ? void 0 : root.children) || []) {\n if (typeof child !== "string")\n buildByRefMap(child, map);\n }\n return map;\n}\nfunction compareSnapshots(ariaSnapshot, previousSnapshot) {\n var _a;\n const previousByRef = buildByRefMap(previousSnapshot == null ? void 0 : previousSnapshot.root);\n const result = /* @__PURE__ */ new Map();\n const visit = (ariaNode, previousNode) => {\n let same = ariaNode.children.length === (previousNode == null ? void 0 : previousNode.children.length) && ariaNodesEqual(ariaNode, previousNode);\n let canBeSkipped = same;\n for (let childIndex = 0; childIndex < ariaNode.children.length; childIndex++) {\n const child = ariaNode.children[childIndex];\n const previousChild = previousNode == null ? void 0 : previousNode.children[childIndex];\n if (typeof child === "string") {\n same && (same = child === previousChild);\n canBeSkipped && (canBeSkipped = child === previousChild);\n } else {\n let previous = typeof previousChild !== "string" ? previousChild : void 0;\n if (child.ref)\n previous = previousByRef.get(child.ref);\n const sameChild = visit(child, previous);\n if (!previous || !sameChild && !child.ref || previous !== previousChild)\n canBeSkipped = false;\n same && (same = sameChild && previous === previousChild);\n }\n }\n result.set(ariaNode, same ? "same" : canBeSkipped ? "skip" : "changed");\n return same;\n };\n visit(ariaSnapshot.root, previousByRef.get((_a = previousSnapshot == null ? void 0 : previousSnapshot.root) == null ? void 0 : _a.ref));\n return result;\n}\nfunction filterSnapshotDiff(nodes, statusMap) {\n const result = [];\n const visit = (ariaNode) => {\n const status = statusMap.get(ariaNode);\n if (status === "same") {\n } else if (status === "skip") {\n for (const child of ariaNode.children) {\n if (typeof child !== "string")\n visit(child);\n }\n } else {\n result.push(ariaNode);\n }\n };\n for (const node of nodes) {\n if (typeof node === "string")\n result.push(node);\n else\n visit(node);\n }\n return result;\n}\nfunction indent(depth) {\n return " ".repeat(depth);\n}\nfunction renderAriaTree(ariaSnapshot, publicOptions, previousSnapshot) {\n const options = toInternalOptions(publicOptions);\n const lines = [];\n const iframeDepths = {};\n const includeText = options.renderStringsAsRegex ? textContributesInfo : () => true;\n const renderString = options.renderStringsAsRegex ? convertToBestGuessRegex : (str) => str;\n let nodesToRender = ariaSnapshot.root.role === "fragment" ? ariaSnapshot.root.children : [ariaSnapshot.root];\n const statusMap = compareSnapshots(ariaSnapshot, previousSnapshot);\n if (previousSnapshot)\n nodesToRender = filterSnapshotDiff(nodesToRender, statusMap);\n const visitText = (text, depth) => {\n if (publicOptions.depth && depth > publicOptions.depth)\n return;\n const escaped = yamlEscapeValueIfNeeded(renderString(text));\n if (escaped)\n lines.push(indent(depth) + "- text: " + escaped);\n };\n const createKey = (ariaNode, renderCursorPointer) => {\n let key = ariaNode.role;\n if (ariaNode.name && ariaNode.name.length <= 900) {\n const name = renderString(ariaNode.name);\n if (name) {\n const stringifiedName = name.startsWith("/") && name.endsWith("/") ? name : JSON.stringify(name);\n key += " " + stringifiedName;\n }\n }\n if (ariaNode.checked === "mixed")\n key += ` [checked=mixed]`;\n if (ariaNode.checked === true)\n key += ` [checked]`;\n if (ariaNode.disabled)\n key += ` [disabled]`;\n if (ariaNode.expanded)\n key += ` [expanded]`;\n if (ariaNode.active && options.renderActive)\n key += ` [active]`;\n if (ariaNode.invalid === "grammar" || ariaNode.invalid === "spelling")\n key += ` [invalid=${ariaNode.invalid}]`;\n if (ariaNode.invalid === true)\n key += ` [invalid]`;\n if (ariaNode.level)\n key += ` [level=${ariaNode.level}]`;\n if (ariaNode.pressed === "mixed")\n key += ` [pressed=mixed]`;\n if (ariaNode.pressed === true)\n key += ` [pressed]`;\n if (ariaNode.selected === true)\n key += ` [selected]`;\n if (ariaNode.ref) {\n key += ` [ref=${ariaNode.ref}]`;\n if (renderCursorPointer && hasPointerCursor(ariaNode))\n key += " [cursor=pointer]";\n }\n if (options.renderBoxes) {\n const element = ariaNodeElement(ariaNode);\n if (element) {\n const r = element.getBoundingClientRect();\n key += ` [box=${Math.round(r.x)},${Math.round(r.y)},${Math.round(r.width)},${Math.round(r.height)}]`;\n }\n }\n return key;\n };\n const getSingleInlinedTextChild = (ariaNode) => {\n return (ariaNode == null ? void 0 : ariaNode.children.length) === 1 && typeof ariaNode.children[0] === "string" && !Object.keys(ariaNode.props).length ? ariaNode.children[0] : void 0;\n };\n const visit = (ariaNode, depth, renderCursorPointer) => {\n if (publicOptions.depth && depth > publicOptions.depth)\n return;\n if (ariaNode.role === "iframe" && ariaNode.ref)\n iframeDepths[ariaNode.ref] = depth;\n if (statusMap.get(ariaNode) === "same" && ariaNode.ref) {\n lines.push(indent(depth) + `- ref=${ariaNode.ref} [unchanged]`);\n return;\n }\n const isDiffRoot = !!previousSnapshot && !depth;\n const escapedKey = indent(depth) + "- " + (isDiffRoot ? " " : "") + yamlEscapeKeyIfNeeded(createKey(ariaNode, renderCursorPointer));\n const singleInlinedTextChild = getSingleInlinedTextChild(ariaNode);\n const isAtDepthLimit = !!publicOptions.depth && depth === publicOptions.depth;\n const hasNoChildren = !singleInlinedTextChild && (!ariaNode.children.length || isAtDepthLimit);\n if (hasNoChildren && !Object.keys(ariaNode.props).length) {\n lines.push(escapedKey);\n } else if (singleInlinedTextChild !== void 0) {\n const shouldInclude = includeText(ariaNode, singleInlinedTextChild);\n if (shouldInclude)\n lines.push(escapedKey + ": " + yamlEscapeValueIfNeeded(renderString(singleInlinedTextChild)));\n else\n lines.push(escapedKey);\n } else {\n lines.push(escapedKey + ":");\n for (const [name, value] of Object.entries(ariaNode.props))\n lines.push(indent(depth + 1) + "- /" + name + ": " + yamlEscapeValueIfNeeded(value));\n const inCursorPointer = !!ariaNode.ref && renderCursorPointer && hasPointerCursor(ariaNode);\n for (const child of ariaNode.children) {\n if (typeof child === "string")\n visitText(includeText(ariaNode, child) ? child : "", depth + 1);\n else\n visit(child, depth + 1, renderCursorPointer && !inCursorPointer);\n }\n }\n };\n for (const nodeToRender of nodesToRender) {\n if (typeof nodeToRender === "string")\n visitText(nodeToRender, 0);\n else\n visit(nodeToRender, 0, !!options.renderCursorPointer);\n }\n return { text: lines.join("\\n"), iframeDepths };\n}\nfunction convertToBestGuessRegex(text) {\n const dynamicContent = [\n // 550e8400-e29b-41d4-a716-446655440000\n { regex: /\\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\b/, replacement: "[0-9a-fA-F-]+" },\n // 2mb\n { regex: /\\b[\\d,.]+[bkmBKM]+\\b/, replacement: "[\\\\d,.]+[bkmBKM]+" },\n // 2ms, 20s\n { regex: /\\b\\d+[hmsp]+\\b/, replacement: "\\\\d+[hmsp]+" },\n { regex: /\\b[\\d,.]+[hmsp]+\\b/, replacement: "[\\\\d,.]+[hmsp]+" },\n // Do not replace single digits with regex by default.\n // 2+ digits: [Issue 22, 22.3, 2.33, 2,333]\n { regex: /\\b\\d+,\\d+\\b/, replacement: "\\\\d+,\\\\d+" },\n { regex: /\\b\\d+\\.\\d{2,}\\b/, replacement: "\\\\d+\\\\.\\\\d+" },\n { regex: /\\b\\d{2,}\\.\\d+\\b/, replacement: "\\\\d+\\\\.\\\\d+" },\n { regex: /\\b\\d{2,}\\b/, replacement: "\\\\d+" }\n ];\n let pattern = "";\n let lastIndex = 0;\n const combinedRegex = new RegExp(dynamicContent.map((r) => "(" + r.regex.source + ")").join("|"), "g");\n text.replace(combinedRegex, (match, ...args) => {\n const offset = args[args.length - 2];\n const groups = args.slice(0, -2);\n pattern += escapeRegExp(text.slice(lastIndex, offset));\n for (let i = 0; i < groups.length; i++) {\n if (groups[i]) {\n const { replacement } = dynamicContent[i];\n pattern += replacement;\n break;\n }\n }\n lastIndex = offset + match.length;\n return match;\n });\n if (!pattern)\n return text;\n pattern += escapeRegExp(text.slice(lastIndex));\n return String(new RegExp(pattern));\n}\nfunction textContributesInfo(node, text) {\n if (!text.length)\n return false;\n if (!node.name)\n return true;\n const substr = text.length <= 200 && node.name.length <= 200 ? longestCommonSubstring(text, node.name) : "";\n let filtered = text;\n while (substr && filtered.includes(substr))\n filtered = filtered.replace(substr, "");\n return filtered.trim().length / text.length > 0.1;\n}\nvar elementSymbol = Symbol("element");\nfunction ariaNodeElement(ariaNode) {\n return ariaNode[elementSymbol];\n}\nfunction setAriaNodeElement(ariaNode, element) {\n ariaNode[elementSymbol] = element;\n}\nfunction findNewElement(from, to) {\n const node = findNewNode(from, to);\n return node ? ariaNodeElement(node) : void 0;\n}\n\n// packages/injected/src/highlight.css?inline\nvar highlight_default = ":host{font-size:13px;font-family:system-ui,Ubuntu,Droid Sans,sans-serif;color:#333;color-scheme:light}svg{position:absolute;height:0}x-pw-tooltip{backdrop-filter:blur(5px);background-color:#fff;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:none;font-size:12.8px;font-weight:400;left:0;line-height:1.5;max-width:600px;position:absolute;top:0;padding:0;flex-direction:column;overflow:hidden}x-pw-tooltip-line{display:flex;max-width:600px;padding:6px;user-select:none;cursor:pointer}x-pw-tooltip-footer{display:flex;max-width:600px;padding:6px;user-select:none;color:#777}x-pw-dialog{background-color:#fff;pointer-events:auto;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:flex;flex-direction:column;position:absolute;z-index:10;font-size:13px}x-pw-dialog:not(.autosize){width:400px;height:150px}x-pw-dialog-body{display:flex;flex-direction:column;flex:auto}x-pw-dialog-body label{margin:5px 8px;display:flex;flex-direction:row;align-items:center}x-pw-highlight{position:absolute;top:0;left:0;width:0;height:0}x-pw-action-point{position:absolute;width:20px;height:20px;background:red;border-radius:10px;margin:-10px 0 0 -10px;z-index:2}x-pw-action-cursor{position:absolute;width:18px;height:22px;pointer-events:none;z-index:4;filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}x-pw-action-cursor svg{width:100%;height:100%;position:static}x-pw-title{position:absolute;backdrop-filter:blur(5px);background-color:#00000080;color:#fff;border-radius:6px;padding:6px;font-size:24px;line-height:1.4;white-space:nowrap;user-select:none;z-index:3}x-pw-user-overlays,x-pw-user-overlay{position:absolute;inset:0}@keyframes pw-fade-out{0%{opacity:1}to{opacity:0}}x-pw-separator{height:1px;margin:6px 9px;background:#949494e5}x-pw-tool-gripper{height:28px;width:24px;margin:2px 0;cursor:grab}x-pw-tool-gripper:active{cursor:grabbing}x-pw-tool-gripper>x-div{width:16px;height:16px;margin:6px 4px;clip-path:url(#icon-gripper);background-color:#555}x-pw-tools-list>label{display:flex;align-items:center;margin:0 10px;user-select:none}x-pw-tools-list{display:flex;width:100%;border-bottom:1px solid #dddddd}x-pw-tool-item{pointer-events:auto;height:28px;width:28px;border-radius:3px}x-pw-tool-item:not(.disabled){cursor:pointer}x-pw-tool-item:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.toggled{background-color:#8acae480}x-pw-tool-item.toggled:not(.disabled):hover{background-color:#8acae4c4}x-pw-tool-item>x-div{width:16px;height:16px;margin:6px;background-color:#3a3a3a}x-pw-tool-item.disabled>x-div{background-color:#61616180;cursor:default}x-pw-tool-item.record.toggled{background-color:transparent}x-pw-tool-item.record.toggled:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.record.toggled>x-div{background-color:#a1260d}x-pw-tool-item.record.disabled.toggled>x-div{opacity:.8}x-pw-tool-item.accept>x-div{background-color:#388a34}x-pw-tool-item.record>x-div{clip-path:url(#icon-circle-large-filled)}x-pw-tool-item.record.toggled>x-div{clip-path:url(#icon-stop-circle)}x-pw-tool-item.pick-locator>x-div{clip-path:url(#icon-inspect)}x-pw-tool-item.text>x-div{clip-path:url(#icon-whole-word)}x-pw-tool-item.visibility>x-div{clip-path:url(#icon-eye)}x-pw-tool-item.value>x-div{clip-path:url(#icon-symbol-constant)}x-pw-tool-item.snapshot>x-div{clip-path:url(#icon-gist)}x-pw-tool-item.accept>x-div{clip-path:url(#icon-check)}x-pw-tool-item.cancel>x-div{clip-path:url(#icon-close)}x-pw-tool-item.succeeded>x-div{clip-path:url(#icon-pass);background-color:#388a34!important}x-pw-overlay{position:absolute;top:0;max-width:min-content;z-index:2147483647;background:transparent;pointer-events:auto}x-pw-overlay x-pw-tools-list{background-color:#fffd;box-shadow:#0000001a 0 5px 5px;border-radius:3px;border-bottom:none}x-pw-overlay x-pw-tool-item{margin:2px}textarea.text-editor{font-family:system-ui,Ubuntu,Droid Sans,sans-serif;flex:auto;border:none;margin:6px 10px;color:#333;outline:1px solid transparent!important;resize:none;padding:0;font-size:13px}textarea.text-editor.does-not-match{outline:1px solid red!important}x-div{display:block}x-spacer{flex:auto}*{box-sizing:border-box}*[hidden]{display:none!important}x-locator-editor{flex:none;width:100%;height:60px;padding:4px;border-bottom:1px solid #dddddd;outline:1px solid transparent}x-locator-editor.does-not-match{outline:1px solid red}.CodeMirror{width:100%!important;height:100%!important}x-pw-action-list{flex:auto;display:flex;flex-direction:column;user-select:none}x-pw-action-item{padding:6px 10px;cursor:pointer;overflow:hidden}x-pw-action-item:hover{background-color:#f2f2f2}x-pw-action-item:last-child{border-bottom-left-radius:6px;border-bottom-right-radius:6px}\\n";\n\n// packages/injected/src/highlight.ts\nvar Highlight = class {\n constructor(injectedScript) {\n this._renderedEntries = [];\n this._userOverlays = /* @__PURE__ */ new Map();\n this._userOverlayHidden = false;\n this._language = "javascript";\n this._elementHighlightSelectors = /* @__PURE__ */ new Map();\n this._injectedScript = injectedScript;\n const document = injectedScript.document;\n this._isUnderTest = injectedScript.isUnderTest;\n this._glassPaneElement = document.createElement("x-pw-glass");\n this._glassPaneElement.setAttribute("popover", "manual");\n this._glassPaneElement.style.inset = "0";\n this._glassPaneElement.style.width = "100%";\n this._glassPaneElement.style.height = "100%";\n this._glassPaneElement.style.maxWidth = "none";\n this._glassPaneElement.style.maxHeight = "none";\n this._glassPaneElement.style.padding = "0";\n this._glassPaneElement.style.margin = "0";\n this._glassPaneElement.style.border = "none";\n this._glassPaneElement.style.overflow = "visible";\n this._glassPaneElement.style.pointerEvents = "none";\n this._glassPaneElement.style.display = "flex";\n this._glassPaneElement.style.backgroundColor = "transparent";\n this._actionPointElement = document.createElement("x-pw-action-point");\n this._actionPointElement.setAttribute("hidden", "true");\n this._actionCursorElement = document.createElement("x-pw-action-cursor");\n this._actionCursorElement.style.visibility = "hidden";\n this._actionCursorElement.appendChild(this._createCursorSvg(document));\n this._titleElement = document.createElement("x-pw-title");\n this._titleElement.setAttribute("hidden", "true");\n this._userOverlayContainer = document.createElement("x-pw-user-overlays");\n this._userOverlayContainer.setAttribute("hidden", "true");\n this._glassPaneShadow = this._glassPaneElement.attachShadow({ mode: this._isUnderTest ? "open" : "closed" });\n if (typeof this._glassPaneShadow.adoptedStyleSheets.push === "function") {\n const sheet = new this._injectedScript.window.CSSStyleSheet();\n sheet.replaceSync(highlight_default);\n this._glassPaneShadow.adoptedStyleSheets.push(sheet);\n } else {\n const styleElement = this._injectedScript.document.createElement("style");\n styleElement.textContent = highlight_default;\n this._glassPaneShadow.appendChild(styleElement);\n }\n this._glassPaneShadow.appendChild(this._actionPointElement);\n this._glassPaneShadow.appendChild(this._actionCursorElement);\n this._glassPaneShadow.appendChild(this._titleElement);\n this._glassPaneShadow.appendChild(this._userOverlayContainer);\n }\n install() {\n if (!this._injectedScript.document.documentElement)\n return;\n if (!this._injectedScript.document.documentElement.contains(this._glassPaneElement) || this._glassPaneElement.nextElementSibling)\n this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);\n this._bringToFront();\n }\n _bringToFront() {\n this._glassPaneElement.hidePopover();\n this._glassPaneElement.showPopover();\n }\n setLanguage(language) {\n this._language = language;\n }\n addElementHighlight(selector, cssStyle) {\n const key = stringifySelector(selector);\n this._elementHighlightSelectors.set(key, { selector, cssStyle });\n this._ensureElementHighlightRaf();\n }\n removeElementHighlight(selector) {\n const key = stringifySelector(selector);\n if (!this._elementHighlightSelectors.delete(key))\n return;\n if (this._elementHighlightSelectors.size === 0) {\n if (this._rafRequest) {\n this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);\n this._rafRequest = void 0;\n }\n this.clearHighlight();\n }\n }\n _ensureElementHighlightRaf() {\n if (this._rafRequest)\n return;\n const tick = () => {\n const entries = [];\n for (const { selector, cssStyle } of this._elementHighlightSelectors.values()) {\n const elements = this._injectedScript.querySelectorAll(selector, this._injectedScript.document.documentElement);\n const locator = asLocator(this._language, stringifySelector(selector));\n const color = elements.length > 1 ? "#f6b26b7f" : "#6fa8dc7f";\n for (let i = 0; i < elements.length; ++i) {\n const suffix = elements.length > 1 ? ` [${i + 1} of ${elements.length}]` : "";\n entries.push({ element: elements[i], color, tooltipText: locator + suffix, cssStyle });\n }\n }\n this.updateHighlight(entries);\n this._rafRequest = this._injectedScript.utils.builtins.requestAnimationFrame(tick);\n };\n this._rafRequest = this._injectedScript.utils.builtins.requestAnimationFrame(tick);\n }\n uninstall() {\n if (this._rafRequest) {\n this._injectedScript.utils.builtins.cancelAnimationFrame(this._rafRequest);\n this._rafRequest = void 0;\n }\n this._elementHighlightSelectors.clear();\n this._glassPaneElement.remove();\n }\n showActionPoint(x, y, fadeDuration) {\n this._actionPointElement.style.top = y + "px";\n this._actionPointElement.style.left = x + "px";\n this._actionPointElement.hidden = false;\n if (fadeDuration)\n this._actionPointElement.style.animation = `pw-fade-out ${fadeDuration}ms ease-out forwards`;\n else\n this._actionPointElement.style.animation = "";\n }\n hideActionPoint() {\n this._actionPointElement.hidden = true;\n }\n moveActionCursor(x, y, fadeDuration) {\n const moveDuration = fadeDuration ? Math.max(80, Math.min(fadeDuration * 0.6, 400)) : 0;\n this._actionCursorElement.style.transition = `top ${moveDuration}ms ease, left ${moveDuration}ms ease`;\n this._actionCursorElement.style.left = x + "px";\n this._actionCursorElement.style.top = y + "px";\n this._actionCursorElement.style.visibility = "visible";\n }\n hideActionCursor() {\n this._actionCursorElement.style.visibility = "hidden";\n }\n _createCursorSvg(document) {\n const svgNs = "http://www.w3.org/2000/svg";\n const svg = document.createElementNS(svgNs, "svg");\n svg.setAttribute("viewBox", "0 0 18 22");\n const path = document.createElementNS(svgNs, "path");\n path.setAttribute("d", "M1 1 L1 17 L5.5 13 L8 20.5 L11 19.5 L8.5 12 L15 12 Z");\n path.setAttribute("fill", "white");\n path.setAttribute("stroke", "black");\n path.setAttribute("stroke-width", "1.5");\n path.setAttribute("stroke-linejoin", "round");\n svg.appendChild(path);\n return svg;\n }\n showActionTitle(text, fadeDuration, position, fontSize) {\n this._titleElement.textContent = text;\n this._titleElement.hidden = false;\n if (fadeDuration) {\n const fadeTime = fadeDuration / 4;\n this._titleElement.style.animation = `pw-fade-out ${fadeTime}ms ease-out ${fadeDuration - fadeTime}ms forwards`;\n } else {\n this._titleElement.style.animation = "";\n }\n this._titleElement.style.top = "";\n this._titleElement.style.bottom = "";\n this._titleElement.style.left = "";\n this._titleElement.style.right = "";\n this._titleElement.style.transform = "";\n switch (position) {\n case "top-left":\n this._titleElement.style.top = "6px";\n this._titleElement.style.left = "6px";\n break;\n case "top":\n this._titleElement.style.top = "6px";\n this._titleElement.style.left = "50%";\n this._titleElement.style.transform = "translateX(-50%)";\n break;\n case "bottom-left":\n this._titleElement.style.bottom = "6px";\n this._titleElement.style.left = "6px";\n break;\n case "bottom":\n this._titleElement.style.bottom = "6px";\n this._titleElement.style.left = "50%";\n this._titleElement.style.transform = "translateX(-50%)";\n break;\n case "bottom-right":\n this._titleElement.style.bottom = "6px";\n this._titleElement.style.right = "6px";\n break;\n case "top-right":\n default:\n this._titleElement.style.top = "6px";\n this._titleElement.style.right = "6px";\n break;\n }\n if (fontSize)\n this._titleElement.style.fontSize = fontSize + "px";\n }\n hideActionTitle() {\n this._titleElement.hidden = true;\n }\n addUserOverlay(id, html) {\n const element = this._injectedScript.document.createElement("div");\n element.className = "x-pw-user-overlay";\n element.innerHTML = html;\n for (const script of element.querySelectorAll("script"))\n script.remove();\n for (const el of element.querySelectorAll("*")) {\n for (const attr of [...el.attributes]) {\n if (attr.name.startsWith("on"))\n el.removeAttribute(attr.name);\n }\n }\n this._userOverlays.set(id, element);\n this._userOverlayContainer.appendChild(element);\n this._userOverlayContainer.hidden = this._userOverlayHidden;\n return id;\n }\n getUserOverlay(id) {\n return this._userOverlays.get(id);\n }\n removeUserOverlay(id) {\n const element = this._userOverlays.get(id);\n if (element) {\n element.remove();\n this._userOverlays.delete(id);\n }\n if (this._userOverlays.size === 0)\n this._userOverlayContainer.hidden = true;\n }\n setUserOverlaysVisible(visible) {\n this._userOverlayHidden = !visible;\n this._userOverlayContainer.hidden = !visible || this._userOverlays.size === 0;\n }\n clearHighlight() {\n var _a, _b;\n for (const entry of this._renderedEntries) {\n (_a = entry.highlightElement) == null ? void 0 : _a.remove();\n (_b = entry.tooltipElement) == null ? void 0 : _b.remove();\n }\n this._renderedEntries = [];\n }\n maskElements(elements, color) {\n this.updateHighlight(elements.map((element) => ({ element, color })));\n }\n updateHighlight(entries) {\n if (this._highlightIsUpToDate(entries))\n return;\n this.clearHighlight();\n for (const entry of entries) {\n const highlightElement = this._createHighlightElement();\n this._glassPaneShadow.appendChild(highlightElement);\n let tooltipElement;\n if (entry.tooltipText) {\n tooltipElement = this._injectedScript.document.createElement("x-pw-tooltip");\n this._glassPaneShadow.appendChild(tooltipElement);\n tooltipElement.style.top = "0";\n tooltipElement.style.left = "0";\n tooltipElement.style.display = "flex";\n const lineElement = this._injectedScript.document.createElement("x-pw-tooltip-line");\n lineElement.textContent = entry.tooltipText;\n tooltipElement.appendChild(lineElement);\n }\n this._renderedEntries.push({ targetElement: entry.element, box: toDOMRect(entry.box), color: entry.color, borderColor: entry.borderColor, fadeDuration: entry.fadeDuration, cssStyle: entry.cssStyle, tooltipElement, highlightElement });\n }\n for (const entry of this._renderedEntries) {\n if (!entry.box && !entry.targetElement)\n continue;\n entry.box = entry.box || entry.targetElement.getBoundingClientRect();\n if (!entry.tooltipElement)\n continue;\n const { anchorLeft, anchorTop } = this.tooltipPosition(entry.box, entry.tooltipElement);\n entry.tooltipTop = anchorTop;\n entry.tooltipLeft = anchorLeft;\n }\n for (const entry of this._renderedEntries) {\n if (entry.tooltipElement) {\n entry.tooltipElement.style.top = entry.tooltipTop + "px";\n entry.tooltipElement.style.left = entry.tooltipLeft + "px";\n }\n const box = entry.box;\n entry.highlightElement.style.backgroundColor = entry.color;\n entry.highlightElement.style.left = box.x + "px";\n entry.highlightElement.style.top = box.y + "px";\n entry.highlightElement.style.width = box.width + "px";\n entry.highlightElement.style.height = box.height + "px";\n entry.highlightElement.style.display = "block";\n if (entry.borderColor)\n entry.highlightElement.style.border = "2px solid " + entry.borderColor;\n if (entry.fadeDuration)\n entry.highlightElement.style.animation = `pw-fade-out ${entry.fadeDuration}ms ease-out forwards`;\n if (entry.cssStyle)\n entry.highlightElement.style.cssText += ";" + entry.cssStyle;\n if (this._isUnderTest)\n console.error("Highlight box for test: " + JSON.stringify({ x: box.x, y: box.y, width: box.width, height: box.height }));\n }\n }\n firstBox() {\n var _a;\n return (_a = this._renderedEntries[0]) == null ? void 0 : _a.box;\n }\n firstTooltipBox() {\n const entry = this._renderedEntries[0];\n if (!entry || !entry.tooltipElement || entry.tooltipLeft === void 0 || entry.tooltipTop === void 0)\n return;\n return {\n x: entry.tooltipLeft,\n y: entry.tooltipTop,\n left: entry.tooltipLeft,\n top: entry.tooltipTop,\n width: entry.tooltipElement.offsetWidth,\n height: entry.tooltipElement.offsetHeight,\n bottom: entry.tooltipTop + entry.tooltipElement.offsetHeight,\n right: entry.tooltipLeft + entry.tooltipElement.offsetWidth,\n toJSON: () => {\n }\n };\n }\n // Note: there is a copy of this method in dialog.tsx. Please fix bugs in both places.\n tooltipPosition(box, tooltipElement) {\n const tooltipWidth = tooltipElement.offsetWidth;\n const tooltipHeight = tooltipElement.offsetHeight;\n const totalWidth = this._glassPaneElement.offsetWidth;\n const totalHeight = this._glassPaneElement.offsetHeight;\n let anchorLeft = Math.max(5, box.left);\n if (anchorLeft + tooltipWidth > totalWidth - 5)\n anchorLeft = totalWidth - tooltipWidth - 5;\n let anchorTop = Math.max(0, box.bottom) + 5;\n if (anchorTop + tooltipHeight > totalHeight - 5) {\n if (Math.max(0, box.top) > tooltipHeight + 5) {\n anchorTop = Math.max(0, box.top) - tooltipHeight - 5;\n } else {\n anchorTop = totalHeight - 5 - tooltipHeight;\n }\n }\n return { anchorLeft, anchorTop };\n }\n _highlightIsUpToDate(entries) {\n if (entries.length !== this._renderedEntries.length)\n return false;\n for (let i = 0; i < this._renderedEntries.length; ++i) {\n if (entries[i].element !== this._renderedEntries[i].targetElement)\n return false;\n if (entries[i].color !== this._renderedEntries[i].color)\n return false;\n if (entries[i].cssStyle !== this._renderedEntries[i].cssStyle)\n return false;\n const oldBox = this._renderedEntries[i].box;\n if (!oldBox)\n return false;\n const box = entries[i].box ? toDOMRect(entries[i].box) : entries[i].element.getBoundingClientRect();\n if (box.top !== oldBox.top || box.right !== oldBox.right || box.bottom !== oldBox.bottom || box.left !== oldBox.left)\n return false;\n }\n return true;\n }\n _createHighlightElement() {\n return this._injectedScript.document.createElement("x-pw-highlight");\n }\n appendChild(element) {\n this._glassPaneShadow.appendChild(element);\n }\n onGlassPaneClick(handler) {\n this._glassPaneElement.style.pointerEvents = "auto";\n this._glassPaneElement.style.backgroundColor = "rgba(0, 0, 0, 0.3)";\n this._glassPaneElement.addEventListener("click", handler);\n }\n offGlassPaneClick(handler) {\n this._glassPaneElement.style.pointerEvents = "none";\n this._glassPaneElement.style.backgroundColor = "transparent";\n this._glassPaneElement.removeEventListener("click", handler);\n }\n};\nfunction toDOMRect(box) {\n if (!box)\n return void 0;\n return new DOMRect(box.x, box.y, box.width, box.height);\n}\n\n// packages/injected/src/layoutSelectorUtils.ts\nfunction boxRightOf(box1, box2, maxDistance) {\n const distance = box1.left - box2.right;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box2.bottom - box1.bottom, 0) + Math.max(box1.top - box2.top, 0);\n}\nfunction boxLeftOf(box1, box2, maxDistance) {\n const distance = box2.left - box1.right;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box2.bottom - box1.bottom, 0) + Math.max(box1.top - box2.top, 0);\n}\nfunction boxAbove(box1, box2, maxDistance) {\n const distance = box2.top - box1.bottom;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box1.left - box2.left, 0) + Math.max(box2.right - box1.right, 0);\n}\nfunction boxBelow(box1, box2, maxDistance) {\n const distance = box1.top - box2.bottom;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box1.left - box2.left, 0) + Math.max(box2.right - box1.right, 0);\n}\nfunction boxNear(box1, box2, maxDistance) {\n const kThreshold = maxDistance === void 0 ? 50 : maxDistance;\n let score = 0;\n if (box1.left - box2.right >= 0)\n score += box1.left - box2.right;\n if (box2.left - box1.right >= 0)\n score += box2.left - box1.right;\n if (box2.top - box1.bottom >= 0)\n score += box2.top - box1.bottom;\n if (box1.top - box2.bottom >= 0)\n score += box1.top - box2.bottom;\n return score > kThreshold ? void 0 : score;\n}\nvar kLayoutSelectorNames = ["left-of", "right-of", "above", "below", "near"];\nfunction layoutSelectorScore(name, element, inner, maxDistance) {\n const box = element.getBoundingClientRect();\n const scorer = { "left-of": boxLeftOf, "right-of": boxRightOf, "above": boxAbove, "below": boxBelow, "near": boxNear }[name];\n let bestScore;\n for (const e of inner) {\n if (e === element)\n continue;\n const score = scorer(box, e.getBoundingClientRect(), maxDistance);\n if (score === void 0)\n continue;\n if (bestScore === void 0 || score < bestScore)\n bestScore = score;\n }\n return bestScore;\n}\n\n// packages/injected/src/selectorUtils.ts\nfunction matchesAttributePart(value, attr) {\n const objValue = typeof value === "string" && !attr.caseSensitive ? value.toUpperCase() : value;\n const attrValue = typeof attr.value === "string" && !attr.caseSensitive ? attr.value.toUpperCase() : attr.value;\n if (attr.op === "")\n return !!objValue;\n if (attr.op === "=") {\n if (attrValue instanceof RegExp)\n return typeof objValue === "string" && !!objValue.match(attrValue);\n return objValue === attrValue;\n }\n if (typeof objValue !== "string" || typeof attrValue !== "string")\n return false;\n if (attr.op === "*=")\n return objValue.includes(attrValue);\n if (attr.op === "^=")\n return objValue.startsWith(attrValue);\n if (attr.op === "$=")\n return objValue.endsWith(attrValue);\n if (attr.op === "|=")\n return objValue === attrValue || objValue.startsWith(attrValue + "-");\n if (attr.op === "~=")\n return objValue.split(" ").includes(attrValue);\n return false;\n}\nfunction shouldSkipForTextMatching(element) {\n const document = element.ownerDocument;\n return element.nodeName === "SCRIPT" || element.nodeName === "NOSCRIPT" || element.nodeName === "STYLE" || document.head && document.head.contains(element);\n}\nfunction elementText(cache, root) {\n let value = cache.get(root);\n if (value === void 0) {\n value = { full: "", normalized: "", immediate: [] };\n if (!shouldSkipForTextMatching(root)) {\n let currentImmediate = "";\n if (root instanceof HTMLInputElement && (root.type === "submit" || root.type === "button")) {\n value = { full: root.value, normalized: normalizeWhiteSpace(root.value), immediate: [root.value] };\n } else {\n for (let child = root.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === Node.TEXT_NODE) {\n value.full += child.nodeValue || "";\n currentImmediate += child.nodeValue || "";\n } else if (child.nodeType === Node.COMMENT_NODE) {\n continue;\n } else {\n if (currentImmediate)\n value.immediate.push(currentImmediate);\n currentImmediate = "";\n if (child.nodeType === Node.ELEMENT_NODE)\n value.full += elementText(cache, child).full;\n }\n }\n if (currentImmediate)\n value.immediate.push(currentImmediate);\n if (root.shadowRoot)\n value.full += elementText(cache, root.shadowRoot).full;\n if (value.full)\n value.normalized = normalizeWhiteSpace(value.full);\n }\n }\n cache.set(root, value);\n }\n return value;\n}\nfunction elementMatchesText(cache, element, matcher) {\n if (shouldSkipForTextMatching(element))\n return "none";\n if (!matcher(elementText(cache, element)))\n return "none";\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === Node.ELEMENT_NODE && matcher(elementText(cache, child)))\n return "selfAndChildren";\n }\n if (element.shadowRoot && matcher(elementText(cache, element.shadowRoot)))\n return "selfAndChildren";\n return "self";\n}\nfunction getElementLabels(textCache, element) {\n const labels = getAriaLabelledByElements(element);\n if (labels)\n return labels.map((label) => elementText(textCache, label));\n const ariaLabel = element.getAttribute("aria-label");\n if (ariaLabel !== null && !!ariaLabel.trim())\n return [{ full: ariaLabel, normalized: normalizeWhiteSpace(ariaLabel), immediate: [ariaLabel] }];\n const isNonHiddenInput = element.nodeName === "INPUT" && element.type !== "hidden";\n if (["BUTTON", "METER", "OUTPUT", "PROGRESS", "SELECT", "TEXTAREA"].includes(element.nodeName) || isNonHiddenInput) {\n const labels2 = element.labels;\n if (labels2)\n return [...labels2].map((label) => elementText(textCache, label));\n }\n return [];\n}\n\n// packages/injected/src/roleSelectorEngine.ts\nvar kSupportedAttributes = ["selected", "checked", "pressed", "expanded", "level", "disabled", "name", "description", "include-hidden"];\nkSupportedAttributes.sort();\nfunction validateSupportedRole(attr, roles, role) {\n if (!roles.includes(role))\n throw new Error(`"${attr}" attribute is only supported for roles: ${roles.slice().sort().map((role2) => `"${role2}"`).join(", ")}`);\n}\nfunction validateSupportedValues(attr, values) {\n if (attr.op !== "" && !values.includes(attr.value))\n throw new Error(`"${attr.name}" must be one of ${values.map((v) => JSON.stringify(v)).join(", ")}`);\n}\nfunction validateSupportedOp(attr, ops) {\n if (!ops.includes(attr.op))\n throw new Error(`"${attr.name}" does not support "${attr.op}" matcher`);\n}\nfunction validateAttributes(attrs, role) {\n const options = { role };\n for (const attr of attrs) {\n switch (attr.name) {\n case "checked": {\n validateSupportedRole(attr.name, kAriaCheckedRoles, role);\n validateSupportedValues(attr, [true, false, "mixed"]);\n validateSupportedOp(attr, ["", "="]);\n options.checked = attr.op === "" ? true : attr.value;\n break;\n }\n case "pressed": {\n validateSupportedRole(attr.name, kAriaPressedRoles, role);\n validateSupportedValues(attr, [true, false, "mixed"]);\n validateSupportedOp(attr, ["", "="]);\n options.pressed = attr.op === "" ? true : attr.value;\n break;\n }\n case "selected": {\n validateSupportedRole(attr.name, kAriaSelectedRoles, role);\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, ["", "="]);\n options.selected = attr.op === "" ? true : attr.value;\n break;\n }\n case "expanded": {\n validateSupportedRole(attr.name, kAriaExpandedRoles, role);\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, ["", "="]);\n options.expanded = attr.op === "" ? true : attr.value;\n break;\n }\n case "level": {\n validateSupportedRole(attr.name, kAriaLevelRoles, role);\n if (typeof attr.value === "string")\n attr.value = +attr.value;\n if (attr.op !== "=" || typeof attr.value !== "number" || Number.isNaN(attr.value))\n throw new Error(`"level" attribute must be compared to a number`);\n options.level = attr.value;\n break;\n }\n case "disabled": {\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, ["", "="]);\n options.disabled = attr.op === "" ? true : attr.value;\n break;\n }\n case "name": {\n if (attr.op === "")\n throw new Error(`"name" attribute must have a value`);\n if (typeof attr.value !== "string" && !(attr.value instanceof RegExp))\n throw new Error(`"name" attribute must be a string or a regular expression`);\n options.name = attr.value;\n options.nameOp = attr.op;\n options.nameExact = attr.caseSensitive;\n break;\n }\n case "description": {\n if (attr.op === "")\n throw new Error(`"description" attribute must have a value`);\n if (typeof attr.value !== "string" && !(attr.value instanceof RegExp))\n throw new Error(`"description" attribute must be a string or a regular expression`);\n options.description = attr.value;\n options.descriptionOp = attr.op;\n options.descriptionExact = attr.caseSensitive;\n break;\n }\n case "include-hidden": {\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, ["", "="]);\n options.includeHidden = attr.op === "" ? true : attr.value;\n break;\n }\n default: {\n throw new Error(`Unknown attribute "${attr.name}", must be one of ${kSupportedAttributes.map((a) => `"${a}"`).join(", ")}.`);\n }\n }\n }\n return options;\n}\nfunction queryRole(scope, options, internal) {\n const result = [];\n const match = (element) => {\n if (getAriaRole(element) !== options.role)\n return;\n if (options.selected !== void 0 && getAriaSelected(element) !== options.selected)\n return;\n if (options.checked !== void 0 && getAriaChecked(element) !== options.checked)\n return;\n if (options.pressed !== void 0 && getAriaPressed(element) !== options.pressed)\n return;\n if (options.expanded !== void 0 && getAriaExpanded(element) !== options.expanded)\n return;\n if (options.level !== void 0 && getAriaLevel(element) !== options.level)\n return;\n if (options.disabled !== void 0 && getAriaDisabled(element) !== options.disabled)\n return;\n if (!options.includeHidden) {\n const isHidden = isElementHiddenForAria(element);\n if (isHidden)\n return;\n }\n if (options.name !== void 0) {\n const accessibleName = normalizeWhiteSpace(getElementAccessibleName(element, !!options.includeHidden));\n if (typeof options.name === "string")\n options.name = normalizeWhiteSpace(options.name);\n if (internal && !options.nameExact && options.nameOp === "=")\n options.nameOp = "*=";\n if (!matchesAttributePart(accessibleName, { name: "", jsonPath: [], op: options.nameOp || "=", value: options.name, caseSensitive: !!options.nameExact }))\n return;\n }\n if (options.description !== void 0) {\n const accessibleDescription = normalizeWhiteSpace(getElementAccessibleDescription(element, !!options.includeHidden));\n if (typeof options.description === "string")\n options.description = normalizeWhiteSpace(options.description);\n if (internal && !options.descriptionExact && options.descriptionOp === "=")\n options.descriptionOp = "*=";\n if (!matchesAttributePart(accessibleDescription, { name: "", jsonPath: [], op: options.descriptionOp || "=", value: options.description, caseSensitive: !!options.descriptionExact }))\n return;\n }\n result.push(element);\n };\n const query = (root) => {\n const shadows = [];\n if (root.shadowRoot)\n shadows.push(root.shadowRoot);\n for (const element of root.querySelectorAll("*")) {\n match(element);\n if (element.shadowRoot)\n shadows.push(element.shadowRoot);\n }\n shadows.forEach(query);\n };\n query(scope);\n return result;\n}\nfunction createRoleEngine(internal) {\n return {\n queryAll: (scope, selector) => {\n const parsed = parseAttributeSelector(selector, true);\n const role = parsed.name.toLowerCase();\n if (!role)\n throw new Error(`Role must not be empty`);\n const options = validateAttributes(parsed.attributes, role);\n beginAriaCaches();\n try {\n return queryRole(scope, options, internal);\n } finally {\n endAriaCaches();\n }\n }\n };\n}\n\n// packages/injected/src/selectorEvaluator.ts\nvar SelectorEvaluatorImpl = class {\n constructor() {\n this._retainCacheCounter = 0;\n this._cacheText = /* @__PURE__ */ new Map();\n this._cacheQueryCSS = /* @__PURE__ */ new Map();\n this._cacheMatches = /* @__PURE__ */ new Map();\n this._cacheQuery = /* @__PURE__ */ new Map();\n this._cacheMatchesSimple = /* @__PURE__ */ new Map();\n this._cacheMatchesParents = /* @__PURE__ */ new Map();\n this._cacheCallMatches = /* @__PURE__ */ new Map();\n this._cacheCallQuery = /* @__PURE__ */ new Map();\n this._cacheQuerySimple = /* @__PURE__ */ new Map();\n this._engines = /* @__PURE__ */ new Map();\n this._engines.set("not", notEngine);\n this._engines.set("is", isEngine);\n this._engines.set("where", isEngine);\n this._engines.set("has", hasEngine);\n this._engines.set("scope", scopeEngine);\n this._engines.set("light", lightEngine);\n this._engines.set("visible", visibleEngine);\n this._engines.set("text", textEngine);\n this._engines.set("text-is", textIsEngine);\n this._engines.set("text-matches", textMatchesEngine);\n this._engines.set("has-text", hasTextEngine);\n this._engines.set("right-of", createLayoutEngine("right-of"));\n this._engines.set("left-of", createLayoutEngine("left-of"));\n this._engines.set("above", createLayoutEngine("above"));\n this._engines.set("below", createLayoutEngine("below"));\n this._engines.set("near", createLayoutEngine("near"));\n this._engines.set("nth-match", nthMatchEngine);\n const allNames = [...this._engines.keys()];\n allNames.sort();\n const parserNames = [...customCSSNames];\n parserNames.sort();\n if (allNames.join("|") !== parserNames.join("|"))\n throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${allNames.join("|")} vs ${parserNames.join("|")}`);\n }\n begin() {\n ++this._retainCacheCounter;\n }\n end() {\n --this._retainCacheCounter;\n if (!this._retainCacheCounter) {\n this._cacheQueryCSS.clear();\n this._cacheMatches.clear();\n this._cacheQuery.clear();\n this._cacheMatchesSimple.clear();\n this._cacheMatchesParents.clear();\n this._cacheCallMatches.clear();\n this._cacheCallQuery.clear();\n this._cacheQuerySimple.clear();\n this._cacheText.clear();\n }\n }\n _cached(cache, main, rest, cb) {\n if (!cache.has(main))\n cache.set(main, []);\n const entries = cache.get(main);\n const entry = entries.find((e) => rest.every((value, index) => e.rest[index] === value));\n if (entry)\n return entry.result;\n const result = cb();\n entries.push({ rest, result });\n return result;\n }\n _checkSelector(s) {\n const wellFormed = typeof s === "object" && s && (Array.isArray(s) || "simples" in s && s.simples.length);\n if (!wellFormed)\n throw new Error(`Malformed selector "${s}"`);\n return s;\n }\n matches(element, s, context) {\n const selector = this._checkSelector(s);\n this.begin();\n try {\n return this._cached(this._cacheMatches, element, [selector, context.scope, context.pierceShadow, context.originalScope], () => {\n if (Array.isArray(selector))\n return this._matchesEngine(isEngine, element, selector, context);\n if (this._hasScopeClause(selector))\n context = this._expandContextForScopeMatching(context);\n if (!this._matchesSimple(element, selector.simples[selector.simples.length - 1].selector, context))\n return false;\n return this._matchesParents(element, selector, selector.simples.length - 2, context);\n });\n } finally {\n this.end();\n }\n }\n query(context, s) {\n const selector = this._checkSelector(s);\n this.begin();\n try {\n return this._cached(this._cacheQuery, selector, [context.scope, context.pierceShadow, context.originalScope], () => {\n if (Array.isArray(selector))\n return this._queryEngine(isEngine, context, selector);\n if (this._hasScopeClause(selector))\n context = this._expandContextForScopeMatching(context);\n const previousScoreMap = this._scoreMap;\n this._scoreMap = /* @__PURE__ */ new Map();\n let elements = this._querySimple(context, selector.simples[selector.simples.length - 1].selector);\n elements = elements.filter((element) => this._matchesParents(element, selector, selector.simples.length - 2, context));\n if (this._scoreMap.size) {\n elements.sort((a, b) => {\n const aScore = this._scoreMap.get(a);\n const bScore = this._scoreMap.get(b);\n if (aScore === bScore)\n return 0;\n if (aScore === void 0)\n return 1;\n if (bScore === void 0)\n return -1;\n return aScore - bScore;\n });\n }\n this._scoreMap = previousScoreMap;\n return elements;\n });\n } finally {\n this.end();\n }\n }\n _markScore(element, score) {\n if (this._scoreMap)\n this._scoreMap.set(element, score);\n }\n _hasScopeClause(selector) {\n return selector.simples.some((simple) => simple.selector.functions.some((f) => f.name === "scope"));\n }\n _expandContextForScopeMatching(context) {\n if (context.scope.nodeType !== 1)\n return context;\n const scope = parentElementOrShadowHost(context.scope);\n if (!scope)\n return context;\n return { ...context, scope, originalScope: context.originalScope || context.scope };\n }\n _matchesSimple(element, simple, context) {\n return this._cached(this._cacheMatchesSimple, element, [simple, context.scope, context.pierceShadow, context.originalScope], () => {\n if (element === context.scope)\n return false;\n if (simple.css && !this._matchesCSS(element, simple.css))\n return false;\n for (const func of simple.functions) {\n if (!this._matchesEngine(this._getEngine(func.name), element, func.args, context))\n return false;\n }\n return true;\n });\n }\n _querySimple(context, simple) {\n if (!simple.functions.length)\n return this._queryCSS(context, simple.css || "*");\n return this._cached(this._cacheQuerySimple, simple, [context.scope, context.pierceShadow, context.originalScope], () => {\n let css = simple.css;\n const funcs = simple.functions;\n if (css === "*" && funcs.length)\n css = void 0;\n let elements;\n let firstIndex = -1;\n if (css !== void 0) {\n elements = this._queryCSS(context, css);\n } else {\n firstIndex = funcs.findIndex((func) => this._getEngine(func.name).query !== void 0);\n if (firstIndex === -1)\n firstIndex = 0;\n elements = this._queryEngine(this._getEngine(funcs[firstIndex].name), context, funcs[firstIndex].args);\n }\n for (let i = 0; i < funcs.length; i++) {\n if (i === firstIndex)\n continue;\n const engine = this._getEngine(funcs[i].name);\n if (engine.matches !== void 0)\n elements = elements.filter((e) => this._matchesEngine(engine, e, funcs[i].args, context));\n }\n for (let i = 0; i < funcs.length; i++) {\n if (i === firstIndex)\n continue;\n const engine = this._getEngine(funcs[i].name);\n if (engine.matches === void 0)\n elements = elements.filter((e) => this._matchesEngine(engine, e, funcs[i].args, context));\n }\n return elements;\n });\n }\n _matchesParents(element, complex, index, context) {\n if (index < 0)\n return true;\n return this._cached(this._cacheMatchesParents, element, [complex, index, context.scope, context.pierceShadow, context.originalScope], () => {\n const { selector: simple, combinator } = complex.simples[index];\n if (combinator === ">") {\n const parent = parentElementOrShadowHostInContext(element, context);\n if (!parent || !this._matchesSimple(parent, simple, context))\n return false;\n return this._matchesParents(parent, complex, index - 1, context);\n }\n if (combinator === "+") {\n const previousSibling = previousSiblingInContext(element, context);\n if (!previousSibling || !this._matchesSimple(previousSibling, simple, context))\n return false;\n return this._matchesParents(previousSibling, complex, index - 1, context);\n }\n if (combinator === "") {\n let parent = parentElementOrShadowHostInContext(element, context);\n while (parent) {\n if (this._matchesSimple(parent, simple, context)) {\n if (this._matchesParents(parent, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === "")\n break;\n }\n parent = parentElementOrShadowHostInContext(parent, context);\n }\n return false;\n }\n if (combinator === "~") {\n let previousSibling = previousSiblingInContext(element, context);\n while (previousSibling) {\n if (this._matchesSimple(previousSibling, simple, context)) {\n if (this._matchesParents(previousSibling, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === "~")\n break;\n }\n previousSibling = previousSiblingInContext(previousSibling, context);\n }\n return false;\n }\n if (combinator === ">=") {\n let parent = element;\n while (parent) {\n if (this._matchesSimple(parent, simple, context)) {\n if (this._matchesParents(parent, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === "")\n break;\n }\n parent = parentElementOrShadowHostInContext(parent, context);\n }\n return false;\n }\n throw new Error(`Unsupported combinator "${combinator}"`);\n });\n }\n _matchesEngine(engine, element, args, context) {\n if (engine.matches)\n return this._callMatches(engine, element, args, context);\n if (engine.query)\n return this._callQuery(engine, args, context).includes(element);\n throw new Error(`Selector engine should implement "matches" or "query"`);\n }\n _queryEngine(engine, context, args) {\n if (engine.query)\n return this._callQuery(engine, args, context);\n if (engine.matches)\n return this._queryCSS(context, "*").filter((element) => this._callMatches(engine, element, args, context));\n throw new Error(`Selector engine should implement "matches" or "query"`);\n }\n _callMatches(engine, element, args, context) {\n return this._cached(this._cacheCallMatches, element, [engine, context.scope, context.pierceShadow, context.originalScope, ...args], () => {\n return engine.matches(element, args, context, this);\n });\n }\n _callQuery(engine, args, context) {\n return this._cached(this._cacheCallQuery, engine, [context.scope, context.pierceShadow, context.originalScope, ...args], () => {\n return engine.query(context, args, this);\n });\n }\n _matchesCSS(element, css) {\n return element.matches(css);\n }\n _queryCSS(context, css) {\n return this._cached(this._cacheQueryCSS, css, [context.scope, context.pierceShadow, context.originalScope], () => {\n let result = [];\n function query(root) {\n result = result.concat([...root.querySelectorAll(css)]);\n if (!context.pierceShadow)\n return;\n if (root.shadowRoot)\n query(root.shadowRoot);\n for (const element of root.querySelectorAll("*")) {\n if (element.shadowRoot)\n query(element.shadowRoot);\n }\n }\n query(context.scope);\n return result;\n });\n }\n _getEngine(name) {\n const engine = this._engines.get(name);\n if (!engine)\n throw new Error(`Unknown selector engine "${name}"`);\n return engine;\n }\n};\nvar isEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`"is" engine expects non-empty selector list`);\n return args.some((selector) => evaluator.matches(element, selector, context));\n },\n query(context, args, evaluator) {\n if (args.length === 0)\n throw new Error(`"is" engine expects non-empty selector list`);\n let elements = [];\n for (const arg of args)\n elements = elements.concat(evaluator.query(context, arg));\n return args.length === 1 ? elements : sortInDOMOrder(elements);\n }\n};\nvar hasEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`"has" engine expects non-empty selector list`);\n return evaluator.query({ ...context, scope: element }, args).length > 0;\n }\n // TODO: we can implement efficient "query" by matching "args" and returning\n // all parents/descendants, just have to be careful with the ":scope" matching.\n};\nvar scopeEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 0)\n throw new Error(`"scope" engine expects no arguments`);\n const actualScope = context.originalScope || context.scope;\n if (actualScope.nodeType === 9)\n return element === actualScope.documentElement;\n return element === actualScope;\n },\n query(context, args, evaluator) {\n if (args.length !== 0)\n throw new Error(`"scope" engine expects no arguments`);\n const actualScope = context.originalScope || context.scope;\n if (actualScope.nodeType === 9) {\n const root = actualScope.documentElement;\n return root ? [root] : [];\n }\n if (actualScope.nodeType === 1)\n return [actualScope];\n return [];\n }\n};\nvar notEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`"not" engine expects non-empty selector list`);\n return !evaluator.matches(element, args, context);\n }\n};\nvar lightEngine = {\n query(context, args, evaluator) {\n return evaluator.query({ ...context, pierceShadow: false }, args);\n },\n matches(element, args, context, evaluator) {\n return evaluator.matches(element, args, { ...context, pierceShadow: false });\n }\n};\nvar visibleEngine = {\n matches(element, args, context, evaluator) {\n if (args.length)\n throw new Error(`"visible" engine expects no arguments`);\n return isElementVisible(element);\n }\n};\nvar textEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== "string")\n throw new Error(`"text" engine expects a single string`);\n const text = normalizeWhiteSpace(args[0]).toLowerCase();\n const matcher = (elementText2) => elementText2.normalized.toLowerCase().includes(text);\n return elementMatchesText(evaluator._cacheText, element, matcher) === "self";\n }\n};\nvar textIsEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== "string")\n throw new Error(`"text-is" engine expects a single string`);\n const text = normalizeWhiteSpace(args[0]);\n const matcher = (elementText2) => {\n if (!text && !elementText2.immediate.length)\n return true;\n return elementText2.immediate.some((s) => normalizeWhiteSpace(s) === text);\n };\n return elementMatchesText(evaluator._cacheText, element, matcher) !== "none";\n }\n};\nvar textMatchesEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0 || typeof args[0] !== "string" || args.length > 2 || args.length === 2 && typeof args[1] !== "string")\n throw new Error(`"text-matches" engine expects a regexp body and optional regexp flags`);\n const re = new RegExp(args[0], args.length === 2 ? args[1] : void 0);\n const matcher = (elementText2) => re.test(elementText2.full);\n return elementMatchesText(evaluator._cacheText, element, matcher) === "self";\n }\n};\nvar hasTextEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== "string")\n throw new Error(`"has-text" engine expects a single string`);\n if (shouldSkipForTextMatching(element))\n return false;\n const text = normalizeWhiteSpace(args[0]).toLowerCase();\n const matcher = (elementText2) => elementText2.normalized.toLowerCase().includes(text);\n return matcher(elementText(evaluator._cacheText, element));\n }\n};\nfunction createLayoutEngine(name) {\n return {\n matches(element, args, context, evaluator) {\n const maxDistance = args.length && typeof args[args.length - 1] === "number" ? args[args.length - 1] : void 0;\n const queryArgs = maxDistance === void 0 ? args : args.slice(0, args.length - 1);\n if (args.length < 1 + (maxDistance === void 0 ? 0 : 1))\n throw new Error(`"${name}" engine expects a selector list and optional maximum distance in pixels`);\n const inner = evaluator.query(context, queryArgs);\n const score = layoutSelectorScore(name, element, inner, maxDistance);\n if (score === void 0)\n return false;\n evaluator._markScore(element, score);\n return true;\n }\n };\n}\nvar nthMatchEngine = {\n query(context, args, evaluator) {\n let index = args[args.length - 1];\n if (args.length < 2)\n throw new Error(`"nth-match" engine expects non-empty selector list and an index argument`);\n if (typeof index !== "number" || index < 1)\n throw new Error(`"nth-match" engine expects a one-based index as the last argument`);\n const elements = isEngine.query(context, args.slice(0, args.length - 1), evaluator);\n index--;\n return index < elements.length ? [elements[index]] : [];\n }\n};\nfunction parentElementOrShadowHostInContext(element, context) {\n if (element === context.scope)\n return;\n if (!context.pierceShadow)\n return element.parentElement || void 0;\n return parentElementOrShadowHost(element);\n}\nfunction previousSiblingInContext(element, context) {\n if (element === context.scope)\n return;\n return element.previousElementSibling || void 0;\n}\nfunction sortInDOMOrder(elements) {\n const elementToEntry = /* @__PURE__ */ new Map();\n const roots = [];\n const result = [];\n function append(element) {\n let entry = elementToEntry.get(element);\n if (entry)\n return entry;\n const parent = parentElementOrShadowHost(element);\n if (parent) {\n const parentEntry = append(parent);\n parentEntry.children.push(element);\n } else {\n roots.push(element);\n }\n entry = { children: [], taken: false };\n elementToEntry.set(element, entry);\n return entry;\n }\n for (const e of elements)\n append(e).taken = true;\n function visit(element) {\n const entry = elementToEntry.get(element);\n if (entry.taken)\n result.push(element);\n if (entry.children.length > 1) {\n const set = new Set(entry.children);\n entry.children = [];\n let child = element.firstElementChild;\n while (child && entry.children.length < set.size) {\n if (set.has(child))\n entry.children.push(child);\n child = child.nextElementSibling;\n }\n child = element.shadowRoot ? element.shadowRoot.firstElementChild : null;\n while (child && entry.children.length < set.size) {\n if (set.has(child))\n entry.children.push(child);\n child = child.nextElementSibling;\n }\n }\n entry.children.forEach(visit);\n }\n roots.forEach(visit);\n return result;\n}\n\n// packages/injected/src/selectorGenerator.ts\nvar kTextScoreRange = 10;\nvar kExactPenalty = kTextScoreRange / 2;\nvar kTestIdScore = 1;\nvar kOtherTestIdScore = 2;\nvar kIframeByAttributeScore = 10;\nvar kBeginPenalizedScore = 50;\nvar kRoleWithNameScore = 100;\nvar kPlaceholderScore = 120;\nvar kLabelScore = 140;\nvar kAltTextScore = 160;\nvar kTextScore = 180;\nvar kTitleScore = 200;\nvar kTextScoreRegex = 250;\nvar kPlaceholderScoreExact = kPlaceholderScore + kExactPenalty;\nvar kLabelScoreExact = kLabelScore + kExactPenalty;\nvar kRoleWithNameScoreExact = kRoleWithNameScore + kExactPenalty;\nvar kAltTextScoreExact = kAltTextScore + kExactPenalty;\nvar kTextScoreExact = kTextScore + kExactPenalty;\nvar kTitleScoreExact = kTitleScore + kExactPenalty;\nvar kEndPenalizedScore = 300;\nvar kCSSIdScore = 500;\nvar kRoleWithoutNameScore = 510;\nvar kCSSInputTypeNameScore = 520;\nvar kCSSTagNameScore = 530;\nvar kNthScore = 1e4;\nvar kCSSFallbackScore = 1e7;\nvar kScoreThresholdForTextExpect = 1e3;\nfunction generateSelector(injectedScript, targetElement, options) {\n var _a;\n injectedScript._evaluator.begin();\n const cache = { allowText: /* @__PURE__ */ new Map(), disallowText: /* @__PURE__ */ new Map() };\n beginAriaCaches();\n beginDOMCaches();\n try {\n let selectors = [];\n if (options.forTextExpect) {\n let targetTokens = cssFallback(injectedScript, targetElement.ownerDocument.documentElement, options);\n for (let element = targetElement; element; element = parentElementOrShadowHost(element)) {\n const tokens = generateSelectorFor(cache, injectedScript, element, { ...options, noText: true });\n if (!tokens)\n continue;\n const score = combineScores(tokens);\n if (score <= kScoreThresholdForTextExpect) {\n targetTokens = tokens;\n break;\n }\n }\n selectors = [joinTokens(targetTokens)];\n } else {\n if (!targetElement.matches("input,textarea,select") && !targetElement.isContentEditable) {\n const interactiveParent = closestCrossShadow(targetElement, "button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]", options.root);\n if (interactiveParent && isElementVisible(interactiveParent))\n targetElement = interactiveParent;\n }\n if (options.multiple) {\n const withText = generateSelectorFor(cache, injectedScript, targetElement, options);\n const withoutText = generateSelectorFor(cache, injectedScript, targetElement, { ...options, noText: true });\n let tokens = [withText, withoutText];\n cache.allowText.clear();\n cache.disallowText.clear();\n if (withText && hasCSSIdToken(withText))\n tokens.push(generateSelectorFor(cache, injectedScript, targetElement, { ...options, noCSSId: true }));\n if (withoutText && hasCSSIdToken(withoutText))\n tokens.push(generateSelectorFor(cache, injectedScript, targetElement, { ...options, noText: true, noCSSId: true }));\n tokens = tokens.filter(Boolean);\n if (!tokens.length) {\n const css = cssFallback(injectedScript, targetElement, options);\n tokens.push(css);\n if (hasCSSIdToken(css))\n tokens.push(cssFallback(injectedScript, targetElement, { ...options, noCSSId: true }));\n }\n selectors = [...new Set(tokens.map((t) => joinTokens(t)))];\n } else {\n const targetTokens = generateSelectorFor(cache, injectedScript, targetElement, options) || cssFallback(injectedScript, targetElement, options);\n selectors = [joinTokens(targetTokens)];\n }\n }\n const selector = selectors[0];\n const parsedSelector = injectedScript.parseSelector(selector);\n return {\n selector,\n selectors,\n elements: injectedScript.querySelectorAll(parsedSelector, (_a = options.root) != null ? _a : targetElement.ownerDocument)\n };\n } finally {\n endDOMCaches();\n endAriaCaches();\n injectedScript._evaluator.end();\n }\n}\nfunction generateSelectorFor(cache, injectedScript, targetElement, options) {\n var _a;\n if (options.root && !isInsideScope(options.root, targetElement))\n throw new Error(`Target element must belong to the root\'s subtree`);\n if (targetElement === options.root)\n return [{ engine: "css", selector: ":scope", score: 1 }];\n if (targetElement.ownerDocument.documentElement === targetElement)\n return [{ engine: "css", selector: "html", score: 1 }];\n let result = null;\n const updateResult = (candidate) => {\n if (!result || combineScores(candidate) < combineScores(result))\n result = candidate;\n };\n const candidates = [];\n if (!options.noText) {\n for (const candidate of buildTextCandidates(injectedScript, targetElement, !options.isRecursive))\n candidates.push({ candidate, isTextCandidate: true });\n }\n for (const token of buildNoTextCandidates(injectedScript, targetElement, options)) {\n if (options.omitInternalEngines && token.engine.startsWith("internal:"))\n continue;\n candidates.push({ candidate: [token], isTextCandidate: false });\n }\n candidates.sort((a, b) => combineScores(a.candidate) - combineScores(b.candidate));\n for (const { candidate, isTextCandidate } of candidates) {\n const elements = injectedScript.querySelectorAll(injectedScript.parseSelector(joinTokens(candidate)), (_a = options.root) != null ? _a : targetElement.ownerDocument);\n if (!elements.includes(targetElement)) {\n continue;\n }\n if (elements.length === 1) {\n updateResult(candidate);\n break;\n }\n const index = elements.indexOf(targetElement);\n if (index > 5) {\n continue;\n }\n updateResult([...candidate, { engine: "nth", selector: String(index), score: kNthScore }]);\n if (options.isRecursive) {\n continue;\n }\n for (let parent = parentElementOrShadowHost(targetElement); parent && parent !== options.root; parent = parentElementOrShadowHost(parent)) {\n const filtered = elements.filter((e) => isInsideScope(parent, e) && e !== parent);\n const newIndex = filtered.indexOf(targetElement);\n if (filtered.length > 5 || newIndex === -1 || newIndex === index && filtered.length > 1) {\n continue;\n }\n const inParent = filtered.length === 1 ? candidate : [...candidate, { engine: "nth", selector: String(newIndex), score: kNthScore }];\n const idealSelectorForParent = { engine: "", selector: "", score: 1 };\n if (result && combineScores([idealSelectorForParent, ...inParent]) >= combineScores(result)) {\n continue;\n }\n const noText = !!options.noText || isTextCandidate;\n const cacheMap = noText ? cache.disallowText : cache.allowText;\n let parentTokens = cacheMap.get(parent);\n if (parentTokens === void 0) {\n parentTokens = generateSelectorFor(cache, injectedScript, parent, { ...options, isRecursive: true, noText }) || cssFallback(injectedScript, parent, options);\n cacheMap.set(parent, parentTokens);\n }\n if (!parentTokens)\n continue;\n updateResult([...parentTokens, ...inParent]);\n }\n }\n return result;\n}\nfunction buildNoTextCandidates(injectedScript, element, options) {\n const candidates = [];\n const testIdAttributeNames = splitTestIdAttributeNames(options.testIdAttributeName);\n {\n for (const attr of ["data-testid", "data-test-id", "data-test"]) {\n if (!testIdAttributeNames.includes(attr) && element.getAttribute(attr))\n candidates.push({ engine: "css", selector: `[${attr}=${quoteCSSAttributeValue(element.getAttribute(attr))}]`, score: kOtherTestIdScore });\n }\n if (!options.noCSSId) {\n const idAttr = element.getAttribute("id");\n if (idAttr && !isGuidLike(idAttr))\n candidates.push({ engine: "css", selector: makeSelectorForId(idAttr), score: kCSSIdScore });\n }\n candidates.push({ engine: "css", selector: escapeNodeName(element), score: kCSSTagNameScore });\n }\n if (element.nodeName === "IFRAME") {\n for (const attribute of ["name", "title"]) {\n if (element.getAttribute(attribute))\n candidates.push({ engine: "css", selector: `${escapeNodeName(element)}[${attribute}=${quoteCSSAttributeValue(element.getAttribute(attribute))}]`, score: kIframeByAttributeScore });\n }\n for (const testIdAttr of testIdAttributeNames) {\n if (element.getAttribute(testIdAttr))\n candidates.push({ engine: "css", selector: `[${testIdAttr}=${quoteCSSAttributeValue(element.getAttribute(testIdAttr))}]`, score: kTestIdScore });\n }\n penalizeScoreForLength([candidates]);\n return candidates;\n }\n for (const testIdAttr of testIdAttributeNames) {\n if (element.getAttribute(testIdAttr))\n candidates.push({ engine: "internal:testid", selector: `[${testIdAttr}=${escapeForAttributeSelector(element.getAttribute(testIdAttr), true)}]`, score: kTestIdScore });\n }\n if (element.nodeName === "INPUT" || element.nodeName === "TEXTAREA") {\n const input = element;\n if (input.placeholder) {\n candidates.push({ engine: "internal:attr", selector: `[placeholder=${escapeForAttributeSelector(input.placeholder, true)}]`, score: kPlaceholderScoreExact });\n for (const alternative of suitableTextAlternatives(input.placeholder))\n candidates.push({ engine: "internal:attr", selector: `[placeholder=${escapeForAttributeSelector(alternative.text, false)}]`, score: kPlaceholderScore - alternative.scoreBonus });\n }\n }\n const labels = getElementLabels(injectedScript._evaluator._cacheText, element);\n for (const label of labels) {\n const labelText = label.normalized;\n candidates.push({ engine: "internal:label", selector: escapeForTextSelector(labelText, true), score: kLabelScoreExact });\n for (const alternative of suitableTextAlternatives(labelText))\n candidates.push({ engine: "internal:label", selector: escapeForTextSelector(alternative.text, false), score: kLabelScore - alternative.scoreBonus });\n }\n const ariaRole = getAriaRole(element);\n if (ariaRole && !["none", "presentation"].includes(ariaRole))\n candidates.push({ engine: "internal:role", selector: ariaRole, score: kRoleWithoutNameScore });\n if (element.getAttribute("name") && ["BUTTON", "FORM", "FIELDSET", "FRAME", "IFRAME", "INPUT", "KEYGEN", "OBJECT", "OUTPUT", "SELECT", "TEXTAREA", "MAP", "META", "PARAM"].includes(element.nodeName))\n candidates.push({ engine: "css", selector: `${escapeNodeName(element)}[name=${quoteCSSAttributeValue(element.getAttribute("name"))}]`, score: kCSSInputTypeNameScore });\n if (["INPUT", "TEXTAREA"].includes(element.nodeName) && element.getAttribute("type") !== "hidden") {\n if (element.getAttribute("type"))\n candidates.push({ engine: "css", selector: `${escapeNodeName(element)}[type=${quoteCSSAttributeValue(element.getAttribute("type"))}]`, score: kCSSInputTypeNameScore });\n }\n if (["INPUT", "TEXTAREA", "SELECT"].includes(element.nodeName) && element.getAttribute("type") !== "hidden")\n candidates.push({ engine: "css", selector: escapeNodeName(element), score: kCSSInputTypeNameScore + 1 });\n penalizeScoreForLength([candidates]);\n return candidates;\n}\nfunction buildTextCandidates(injectedScript, element, isTargetNode) {\n if (element.nodeName === "SELECT")\n return [];\n const candidates = [];\n const title = element.getAttribute("title");\n if (title) {\n candidates.push([{ engine: "internal:attr", selector: `[title=${escapeForAttributeSelector(title, true)}]`, score: kTitleScoreExact }]);\n for (const alternative of suitableTextAlternatives(title))\n candidates.push([{ engine: "internal:attr", selector: `[title=${escapeForAttributeSelector(alternative.text, false)}]`, score: kTitleScore - alternative.scoreBonus }]);\n }\n const alt = element.getAttribute("alt");\n if (alt && ["APPLET", "AREA", "IMG", "INPUT"].includes(element.nodeName)) {\n candidates.push([{ engine: "internal:attr", selector: `[alt=${escapeForAttributeSelector(alt, true)}]`, score: kAltTextScoreExact }]);\n for (const alternative of suitableTextAlternatives(alt))\n candidates.push([{ engine: "internal:attr", selector: `[alt=${escapeForAttributeSelector(alternative.text, false)}]`, score: kAltTextScore - alternative.scoreBonus }]);\n }\n const text = elementText(injectedScript._evaluator._cacheText, element).normalized;\n const textAlternatives = text ? suitableTextAlternatives(text) : [];\n if (text) {\n if (isTargetNode) {\n if (text.length <= 80)\n candidates.push([{ engine: "internal:text", selector: escapeForTextSelector(text, true), score: kTextScoreExact }]);\n for (const alternative of textAlternatives)\n candidates.push([{ engine: "internal:text", selector: escapeForTextSelector(alternative.text, false), score: kTextScore - alternative.scoreBonus }]);\n }\n const cssToken = { engine: "css", selector: escapeNodeName(element), score: kCSSTagNameScore };\n for (const alternative of textAlternatives)\n candidates.push([cssToken, { engine: "internal:has-text", selector: escapeForTextSelector(alternative.text, false), score: kTextScore - alternative.scoreBonus }]);\n if (isTargetNode && text.length <= 80) {\n const re = new RegExp("^" + escapeRegExp(text) + "$");\n candidates.push([cssToken, { engine: "internal:has-text", selector: escapeForTextSelector(re, false), score: kTextScoreRegex }]);\n }\n }\n const ariaRole = getAriaRole(element);\n if (ariaRole && !["none", "presentation"].includes(ariaRole)) {\n const ariaName = getElementAccessibleName(element, false);\n if (ariaName && !ariaName.match(/^\\p{Co}+$/u)) {\n const roleToken = { engine: "internal:role", selector: `${ariaRole}[name=${escapeForAttributeSelector(ariaName, true)}]`, score: kRoleWithNameScoreExact };\n candidates.push([roleToken]);\n for (const alternative of suitableTextAlternatives(ariaName))\n candidates.push([{ engine: "internal:role", selector: `${ariaRole}[name=${escapeForAttributeSelector(alternative.text, false)}]`, score: kRoleWithNameScore - alternative.scoreBonus }]);\n const ariaDescription = getElementAccessibleDescription(element, false);\n if (ariaDescription) {\n candidates.push([{ engine: "internal:role", selector: `${ariaRole}[name=${escapeForAttributeSelector(ariaName, true)}][description=${escapeForAttributeSelector(ariaDescription, true)}]`, score: kRoleWithNameScoreExact + 1 }]);\n for (const alternative of suitableTextAlternatives(ariaName))\n candidates.push([{ engine: "internal:role", selector: `${ariaRole}[name=${escapeForAttributeSelector(alternative.text, false)}][description=${escapeForAttributeSelector(ariaDescription, false)}]`, score: kRoleWithNameScore - alternative.scoreBonus + 1 }]);\n }\n } else {\n const roleToken = { engine: "internal:role", selector: `${ariaRole}`, score: kRoleWithoutNameScore };\n const ariaDescription = getElementAccessibleDescription(element, false);\n if (ariaDescription)\n candidates.push([{ engine: "internal:role", selector: `${ariaRole}[description=${escapeForAttributeSelector(ariaDescription, true)}]`, score: kRoleWithoutNameScore + 1 }]);\n for (const alternative of textAlternatives)\n candidates.push([roleToken, { engine: "internal:has-text", selector: escapeForTextSelector(alternative.text, false), score: kTextScore - alternative.scoreBonus }]);\n if (isTargetNode && text.length <= 80) {\n const re = new RegExp("^" + escapeRegExp(text) + "$");\n candidates.push([roleToken, { engine: "internal:has-text", selector: escapeForTextSelector(re, false), score: kTextScoreRegex }]);\n }\n }\n }\n penalizeScoreForLength(candidates);\n return candidates;\n}\nfunction makeSelectorForId(id) {\n return /^[a-zA-Z][a-zA-Z0-9\\-\\_]+$/.test(id) ? "#" + id : `[id=${quoteCSSAttributeValue(id)}]`;\n}\nfunction hasCSSIdToken(tokens) {\n return tokens.some((token) => token.engine === "css" && (token.selector.startsWith("#") || token.selector.startsWith(\'[id="\')));\n}\nfunction cssFallback(injectedScript, targetElement, options) {\n var _a;\n const root = (_a = options.root) != null ? _a : targetElement.ownerDocument;\n const tokens = [];\n function uniqueCSSSelector(prefix) {\n const path = tokens.slice();\n if (prefix)\n path.unshift(prefix);\n const selector = path.join(" > ");\n const parsedSelector = injectedScript.parseSelector(selector);\n const node = injectedScript.querySelector(parsedSelector, root, false);\n return node === targetElement ? selector : void 0;\n }\n function makeStrict(selector) {\n const token = { engine: "css", selector, score: kCSSFallbackScore };\n const parsedSelector = injectedScript.parseSelector(selector);\n const elements = injectedScript.querySelectorAll(parsedSelector, root);\n if (elements.length === 1)\n return [token];\n const nth = { engine: "nth", selector: String(elements.indexOf(targetElement)), score: kNthScore };\n return [token, nth];\n }\n for (let element = targetElement; element && element !== root; element = parentElementOrShadowHost(element)) {\n let bestTokenForLevel = "";\n if (element.id && !options.noCSSId) {\n const token = makeSelectorForId(element.id);\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n bestTokenForLevel = token;\n }\n const parent = element.parentNode;\n const classes = [...element.classList].map(escapeClassName);\n for (let i = 0; i < classes.length; ++i) {\n const token = "." + classes.slice(0, i + 1).join(".");\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n if (!bestTokenForLevel && parent) {\n const sameClassSiblings = parent.querySelectorAll(token);\n if (sameClassSiblings.length === 1)\n bestTokenForLevel = token;\n }\n }\n if (parent) {\n const siblings = [...parent.children];\n const nodeName = element.nodeName;\n const sameTagSiblings = siblings.filter((sibling) => sibling.nodeName === nodeName);\n const token = sameTagSiblings.indexOf(element) === 0 ? escapeNodeName(element) : `${escapeNodeName(element)}:nth-child(${1 + siblings.indexOf(element)})`;\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n if (!bestTokenForLevel)\n bestTokenForLevel = token;\n } else if (!bestTokenForLevel) {\n bestTokenForLevel = escapeNodeName(element);\n }\n tokens.unshift(bestTokenForLevel);\n }\n return makeStrict(uniqueCSSSelector());\n}\nfunction penalizeScoreForLength(groups) {\n for (const group of groups) {\n for (const token of group) {\n if (token.score > kBeginPenalizedScore && token.score < kEndPenalizedScore)\n token.score += Math.min(kTextScoreRange, token.selector.length / 10 | 0);\n }\n }\n}\nfunction joinTokens(tokens) {\n const parts = [];\n let lastEngine = "";\n for (const { engine, selector } of tokens) {\n if (parts.length && (lastEngine !== "css" || engine !== "css" || selector.startsWith(":nth-match(")))\n parts.push(">>");\n lastEngine = engine;\n if (engine === "css")\n parts.push(selector);\n else\n parts.push(`${engine}=${selector}`);\n }\n return parts.join(" ");\n}\nfunction combineScores(tokens) {\n let score = 0;\n for (let i = 0; i < tokens.length; i++)\n score += tokens[i].score * (tokens.length - i);\n return score;\n}\nfunction isGuidLike(id) {\n let lastCharacterType;\n let transitionCount = 0;\n for (let i = 0; i < id.length; ++i) {\n const c = id[i];\n let characterType;\n if (c === "-" || c === "_")\n continue;\n if (c >= "a" && c <= "z")\n characterType = "lower";\n else if (c >= "A" && c <= "Z")\n characterType = "upper";\n else if (c >= "0" && c <= "9")\n characterType = "digit";\n else\n characterType = "other";\n if (characterType === "lower" && lastCharacterType === "upper") {\n lastCharacterType = characterType;\n continue;\n }\n if (lastCharacterType && lastCharacterType !== characterType)\n ++transitionCount;\n lastCharacterType = characterType;\n }\n return transitionCount >= id.length / 4;\n}\nfunction trimWordBoundary(text, maxLength) {\n if (text.length <= maxLength)\n return text;\n text = text.substring(0, maxLength);\n const match = text.match(/^(.*)\\b(.+?)$/);\n if (!match)\n return "";\n return match[1].trimEnd();\n}\nfunction suitableTextAlternatives(text) {\n let result = [];\n {\n const match = text.match(/^([\\d.,]+)[^.,\\w]/);\n const leadingNumberLength = match ? match[1].length : 0;\n if (leadingNumberLength) {\n const alt = trimWordBoundary(text.substring(leadingNumberLength).trimStart(), 80);\n result.push({ text: alt, scoreBonus: alt.length <= 30 ? 2 : 1 });\n }\n }\n {\n const match = text.match(/[^.,\\w]([\\d.,]+)$/);\n const trailingNumberLength = match ? match[1].length : 0;\n if (trailingNumberLength) {\n const alt = trimWordBoundary(text.substring(0, text.length - trailingNumberLength).trimEnd(), 80);\n result.push({ text: alt, scoreBonus: alt.length <= 30 ? 2 : 1 });\n }\n }\n if (text.length <= 30) {\n result.push({ text, scoreBonus: 0 });\n } else {\n result.push({ text: trimWordBoundary(text, 80), scoreBonus: 0 });\n result.push({ text: trimWordBoundary(text, 30), scoreBonus: 1 });\n }\n result = result.filter((r) => r.text);\n if (!result.length)\n result.push({ text: text.substring(0, 80), scoreBonus: 0 });\n return result;\n}\nfunction escapeNodeName(node) {\n return node.nodeName.toLocaleLowerCase().replace(/[:\\.]/g, (char) => "\\\\" + char);\n}\nfunction escapeClassName(className) {\n let result = "";\n for (let i = 0; i < className.length; i++)\n result += cssEscapeCharacter(className, i);\n return result;\n}\nfunction cssEscapeCharacter(s, i) {\n const c = s.charCodeAt(i);\n if (c === 0)\n return "\\uFFFD";\n if (c >= 1 && c <= 31 || c >= 48 && c <= 57 && (i === 0 || i === 1 && s.charCodeAt(0) === 45))\n return "\\\\" + c.toString(16) + " ";\n if (i === 0 && c === 45 && s.length === 1)\n return "\\\\" + s.charAt(i);\n if (c >= 128 || c === 45 || c === 95 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122)\n return s.charAt(i);\n return "\\\\" + s.charAt(i);\n}\n\n// packages/injected/src/xpathSelectorEngine.ts\nvar XPathEngine = {\n queryAll(root, selector) {\n if (selector.startsWith("/") && root.nodeType !== Node.DOCUMENT_NODE)\n selector = "." + selector;\n const result = [];\n const document = root.ownerDocument || root;\n if (!document)\n return result;\n const it = document.evaluate(selector, root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE);\n for (let node = it.iterateNext(); node; node = it.iterateNext()) {\n if (node.nodeType === Node.ELEMENT_NODE)\n result.push(node);\n }\n return result;\n }\n};\n\n// packages/injected/src/consoleApi.ts\nvar selectorSymbol = Symbol("selector");\nselectorSymbol;\nvar _Locator = class _Locator {\n constructor(injectedScript, selector, options) {\n if (options == null ? void 0 : options.hasText)\n selector += ` >> internal:has-text=${escapeForTextSelector(options.hasText, false)}`;\n if (options == null ? void 0 : options.hasNotText)\n selector += ` >> internal:has-not-text=${escapeForTextSelector(options.hasNotText, false)}`;\n if (options == null ? void 0 : options.has)\n selector += ` >> internal:has=` + JSON.stringify(options.has[selectorSymbol]);\n if (options == null ? void 0 : options.hasNot)\n selector += ` >> internal:has-not=` + JSON.stringify(options.hasNot[selectorSymbol]);\n if ((options == null ? void 0 : options.visible) !== void 0)\n selector += ` >> visible=${options.visible ? "true" : "false"}`;\n this[selectorSymbol] = selector;\n if (selector) {\n const parsed = injectedScript.parseSelector(selector);\n this.element = injectedScript.querySelector(parsed, injectedScript.document, false);\n this.elements = injectedScript.querySelectorAll(parsed, injectedScript.document);\n }\n const selectorBase = selector;\n const self = this;\n self.locator = (selector2, options2) => {\n return new _Locator(injectedScript, selectorBase ? selectorBase + " >> " + selector2 : selector2, options2);\n };\n self.getByTestId = (testId) => self.locator(getByTestIdSelector(injectedScript.testIdAttributeNameForStrictErrorAndConsoleCodegen(), testId));\n self.getByAltText = (text, options2) => self.locator(getByAltTextSelector(text, options2));\n self.getByLabel = (text, options2) => self.locator(getByLabelSelector(text, options2));\n self.getByPlaceholder = (text, options2) => self.locator(getByPlaceholderSelector(text, options2));\n self.getByText = (text, options2) => self.locator(getByTextSelector(text, options2));\n self.getByTitle = (text, options2) => self.locator(getByTitleSelector(text, options2));\n self.getByRole = (role, options2 = {}) => self.locator(getByRoleSelector(role, options2));\n self.filter = (options2) => new _Locator(injectedScript, selector, options2);\n self.first = () => self.locator("nth=0");\n self.last = () => self.locator("nth=-1");\n self.nth = (index) => self.locator(`nth=${index}`);\n self.and = (locator) => new _Locator(injectedScript, selectorBase + ` >> internal:and=` + JSON.stringify(locator[selectorSymbol]));\n self.or = (locator) => new _Locator(injectedScript, selectorBase + ` >> internal:or=` + JSON.stringify(locator[selectorSymbol]));\n }\n};\nvar Locator = _Locator;\nvar ConsoleAPI = class {\n constructor(injectedScript) {\n this._injectedScript = injectedScript;\n }\n install() {\n if (this._injectedScript.window.playwright)\n return;\n this._injectedScript.window.playwright = {\n $: (selector, strict) => this._querySelector(selector, !!strict),\n $$: (selector) => this._querySelectorAll(selector),\n inspect: (selector) => this._inspect(selector),\n selector: (element) => this._selector(element),\n generateLocator: (element, language) => this._generateLocator(element, language),\n ariaSnapshot: (element, options) => {\n return this._injectedScript.ariaSnapshot(element || this._injectedScript.document.body, options || { mode: "default" });\n },\n resume: () => this._resume(),\n ...new Locator(this._injectedScript, "")\n };\n delete this._injectedScript.window.playwright.filter;\n delete this._injectedScript.window.playwright.first;\n delete this._injectedScript.window.playwright.last;\n delete this._injectedScript.window.playwright.nth;\n delete this._injectedScript.window.playwright.and;\n delete this._injectedScript.window.playwright.or;\n }\n _querySelector(selector, strict) {\n if (typeof selector !== "string")\n throw new Error(`Usage: playwright.query(\'Playwright >> selector\').`);\n const parsed = this._injectedScript.parseSelector(selector);\n return this._injectedScript.querySelector(parsed, this._injectedScript.document, strict);\n }\n _querySelectorAll(selector) {\n if (typeof selector !== "string")\n throw new Error(`Usage: playwright.$$(\'Playwright >> selector\').`);\n const parsed = this._injectedScript.parseSelector(selector);\n return this._injectedScript.querySelectorAll(parsed, this._injectedScript.document);\n }\n _inspect(selector) {\n if (typeof selector !== "string")\n throw new Error(`Usage: playwright.inspect(\'Playwright >> selector\').`);\n this._injectedScript.window.inspect(this._querySelector(selector, false));\n }\n _selector(element) {\n if (!(element instanceof Element))\n throw new Error(`Usage: playwright.selector(element).`);\n return this._injectedScript.generateSelectorSimple(element);\n }\n _generateLocator(element, language) {\n if (!(element instanceof Element))\n throw new Error(`Usage: playwright.locator(element).`);\n const selector = this._injectedScript.generateSelectorSimple(element);\n return asLocator(language || "javascript", selector);\n }\n _resume() {\n if (!this._injectedScript.window.__pw_resume)\n return false;\n this._injectedScript.window.__pw_resume().catch(() => {\n });\n }\n};\n\n// packages/isomorphic/utilityScriptSerializers.ts\nfunction isRegExp2(obj) {\n try {\n return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";\n } catch (error) {\n return false;\n }\n}\nfunction isDate(obj) {\n try {\n return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";\n } catch (error) {\n return false;\n }\n}\nfunction isURL(obj) {\n try {\n return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";\n } catch (error) {\n return false;\n }\n}\nfunction isError(obj) {\n var _a;\n try {\n return obj instanceof Error || obj && ((_a = Object.getPrototypeOf(obj)) == null ? void 0 : _a.name) === "Error";\n } catch (error) {\n return false;\n }\n}\nfunction isTypedArray(obj, constructor) {\n try {\n return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;\n } catch (error) {\n return false;\n }\n}\nfunction isArrayBuffer(obj) {\n try {\n return obj instanceof ArrayBuffer || Object.prototype.toString.call(obj) === "[object ArrayBuffer]";\n } catch (error) {\n return false;\n }\n}\nvar typedArrayConstructors = {\n i8: Int8Array,\n ui8: Uint8Array,\n ui8c: Uint8ClampedArray,\n i16: Int16Array,\n ui16: Uint16Array,\n i32: Int32Array,\n ui32: Uint32Array,\n // TODO: add Float16Array once it\'s in baseline\n f32: Float32Array,\n f64: Float64Array,\n bi64: BigInt64Array,\n bui64: BigUint64Array\n};\nfunction typedArrayToBase64(array) {\n if ("toBase64" in array)\n return array.toBase64();\n const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");\n return btoa(binary);\n}\nfunction base64ToTypedArray(base64, TypedArrayConstructor) {\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++)\n bytes[i] = binary.charCodeAt(i);\n return new TypedArrayConstructor(bytes.buffer);\n}\nfunction parseEvaluationResultValue(value, handles = [], refs = /* @__PURE__ */ new Map()) {\n if (Object.is(value, void 0))\n return void 0;\n if (typeof value === "object" && value) {\n if ("ref" in value)\n return refs.get(value.ref);\n if ("v" in value) {\n if (value.v === "undefined")\n return void 0;\n if (value.v === "null")\n return null;\n if (value.v === "NaN")\n return NaN;\n if (value.v === "Infinity")\n return Infinity;\n if (value.v === "-Infinity")\n return -Infinity;\n if (value.v === "-0")\n return -0;\n return void 0;\n }\n if ("d" in value) {\n return new Date(value.d);\n }\n if ("u" in value)\n return new URL(value.u);\n if ("bi" in value)\n return BigInt(value.bi);\n if ("e" in value) {\n const error = new Error(value.e.m);\n error.name = value.e.n;\n error.stack = value.e.s;\n return error;\n }\n if ("r" in value)\n return new RegExp(value.r.p, value.r.f);\n if ("a" in value) {\n const result = [];\n refs.set(value.id, result);\n for (const a of value.a)\n result.push(parseEvaluationResultValue(a, handles, refs));\n return result;\n }\n if ("o" in value) {\n const result = {};\n refs.set(value.id, result);\n for (const { k, v } of value.o) {\n if (k === "__proto__")\n continue;\n result[k] = parseEvaluationResultValue(v, handles, refs);\n }\n return result;\n }\n if ("h" in value)\n return handles[value.h];\n if ("ta" in value)\n return base64ToTypedArray(value.ta.b, typedArrayConstructors[value.ta.k]);\n if ("ab" in value)\n return base64ToTypedArray(value.ab.b, Uint8Array).buffer;\n }\n return value;\n}\nfunction serializeAsCallArgument(value, handleSerializer) {\n return serialize(value, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });\n}\nfunction serialize(value, handleSerializer, visitorInfo) {\n if (value && typeof value === "object") {\n if (typeof globalThis.Window === "function" && value instanceof globalThis.Window)\n return "ref: ";\n if (typeof globalThis.Document === "function" && value instanceof globalThis.Document)\n return "ref: ";\n if (typeof globalThis.Node === "function" && value instanceof globalThis.Node)\n return "ref: ";\n }\n return innerSerialize(value, handleSerializer, visitorInfo);\n}\nfunction innerSerialize(value, handleSerializer, visitorInfo) {\n var _a;\n const result = handleSerializer(value);\n if ("fallThrough" in result)\n value = result.fallThrough;\n else\n return result;\n if (typeof value === "symbol")\n return { v: "undefined" };\n if (Object.is(value, void 0))\n return { v: "undefined" };\n if (Object.is(value, null))\n return { v: "null" };\n if (Object.is(value, NaN))\n return { v: "NaN" };\n if (Object.is(value, Infinity))\n return { v: "Infinity" };\n if (Object.is(value, -Infinity))\n return { v: "-Infinity" };\n if (Object.is(value, -0))\n return { v: "-0" };\n if (typeof value === "boolean")\n return value;\n if (typeof value === "number")\n return value;\n if (typeof value === "string")\n return value;\n if (typeof value === "bigint")\n return { bi: value.toString() };\n if (isError(value)) {\n let stack;\n if ((_a = value.stack) == null ? void 0 : _a.startsWith(value.name + ": " + value.message)) {\n stack = value.stack;\n } else {\n stack = `${value.name}: ${value.message}\n${value.stack}`;\n }\n return { e: { n: value.name, m: value.message, s: stack } };\n }\n if (isDate(value))\n return { d: value.toJSON() };\n if (isURL(value))\n return { u: value.toJSON() };\n if (isRegExp2(value))\n return { r: { p: value.source, f: value.flags } };\n for (const [k, ctor] of Object.entries(typedArrayConstructors)) {\n if (isTypedArray(value, ctor))\n return { ta: { b: typedArrayToBase64(value), k } };\n }\n if (isArrayBuffer(value))\n return { ab: { b: typedArrayToBase64(new Uint8Array(value)) } };\n const id = visitorInfo.visited.get(value);\n if (id)\n return { ref: id };\n if (Array.isArray(value)) {\n const a = [];\n const id2 = ++visitorInfo.lastId;\n visitorInfo.visited.set(value, id2);\n for (let i = 0; i < value.length; ++i)\n a.push(serialize(value[i], handleSerializer, visitorInfo));\n return { a, id: id2 };\n }\n if (typeof value === "object") {\n const o = [];\n const id2 = ++visitorInfo.lastId;\n visitorInfo.visited.set(value, id2);\n for (const name of Object.keys(value)) {\n let item;\n try {\n item = value[name];\n } catch (e) {\n continue;\n }\n if (name === "toJSON" && typeof item === "function")\n o.push({ k: name, v: { o: [], id: 0 } });\n else\n o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });\n }\n let jsonWrapper;\n try {\n if (o.length === 0 && value.toJSON && typeof value.toJSON === "function")\n jsonWrapper = { value: value.toJSON() };\n } catch (e) {\n }\n if (jsonWrapper)\n return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);\n return { o, id: id2 };\n }\n}\n\n// packages/injected/src/utilityScript.ts\nvar UtilityScript = class {\n constructor(global, isUnderTest) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n this.global = global;\n this.isUnderTest = isUnderTest;\n if (global.__pwClock) {\n this.builtins = global.__pwClock.builtins;\n } else {\n this.builtins = {\n setTimeout: (_a = global.setTimeout) == null ? void 0 : _a.bind(global),\n clearTimeout: (_b = global.clearTimeout) == null ? void 0 : _b.bind(global),\n setInterval: (_c = global.setInterval) == null ? void 0 : _c.bind(global),\n clearInterval: (_d = global.clearInterval) == null ? void 0 : _d.bind(global),\n requestAnimationFrame: (_e = global.requestAnimationFrame) == null ? void 0 : _e.bind(global),\n cancelAnimationFrame: (_f = global.cancelAnimationFrame) == null ? void 0 : _f.bind(global),\n requestIdleCallback: (_g = global.requestIdleCallback) == null ? void 0 : _g.bind(global),\n cancelIdleCallback: (_h = global.cancelIdleCallback) == null ? void 0 : _h.bind(global),\n performance: global.performance,\n Intl: global.Intl,\n Date: global.Date,\n AbortSignal: global.AbortSignal\n };\n }\n if (this.isUnderTest)\n global.builtins = this.builtins;\n }\n evaluate(isFunction, returnByValue, expression, argCount, ...argsAndHandles) {\n const args = argsAndHandles.slice(0, argCount);\n const handles = argsAndHandles.slice(argCount);\n const parameters = [];\n for (let i = 0; i < args.length; i++)\n parameters[i] = parseEvaluationResultValue(args[i], handles);\n let result = this.global.eval(expression);\n if (isFunction === true) {\n result = result(...parameters);\n } else if (isFunction === false) {\n result = result;\n } else {\n if (typeof result === "function")\n result = result(...parameters);\n }\n return returnByValue ? this._promiseAwareJsonValueNoThrow(result) : result;\n }\n jsonValue(returnByValue, value) {\n if (value === void 0)\n return void 0;\n return serializeAsCallArgument(value, (value2) => ({ fallThrough: value2 }));\n }\n _promiseAwareJsonValueNoThrow(value) {\n const safeJson = (value2) => {\n try {\n return this.jsonValue(true, value2);\n } catch (e) {\n return void 0;\n }\n };\n if (value && typeof value === "object" && typeof value.then === "function") {\n return (async () => {\n const promiseValue = await value;\n return safeJson(promiseValue);\n })();\n }\n return safeJson(value);\n }\n};\n\n// packages/injected/src/injectedScript.ts\nvar InjectedScript = class {\n constructor(window, options) {\n this._testIdAttributeNameForStrictErrorAndConsoleCodegen = "data-testid";\n this._lastAriaSnapshotForTrack = /* @__PURE__ */ new Map();\n // Recorder must use any external dependencies through InjectedScript.\n // Otherwise it will end up with a copy of all modules it uses, and any\n // module-level globals will be duplicated, which leads to subtle bugs.\n this.utils = {\n asLocator,\n cacheNormalizedWhitespaces,\n elementText,\n getAriaRole,\n getElementAccessibleDescription,\n getElementAccessibleName,\n isElementVisible,\n isInsideScope,\n normalizeWhiteSpace,\n parseAriaSnapshot,\n generateAriaTree,\n findNewElement,\n // Builtins protect injected code from clock emulation.\n builtins: null\n };\n this.window = window;\n this.document = window.document;\n this.isUnderTest = options.isUnderTest;\n this.utils.builtins = new UtilityScript(window, options.isUnderTest).builtins;\n this._sdkLanguage = options.sdkLanguage;\n this._testIdAttributeNameForStrictErrorAndConsoleCodegen = options.testIdAttributeName;\n this._evaluator = new SelectorEvaluatorImpl();\n this.consoleApi = new ConsoleAPI(this);\n this.onGlobalListenersRemoved = /* @__PURE__ */ new Set();\n this._autoClosingTags = /* @__PURE__ */ new Set(["AREA", "BASE", "BR", "COL", "COMMAND", "EMBED", "HR", "IMG", "INPUT", "KEYGEN", "LINK", "MENUITEM", "META", "PARAM", "SOURCE", "TRACK", "WBR"]);\n this._booleanAttributes = /* @__PURE__ */ new Set(["checked", "selected", "disabled", "readonly", "multiple"]);\n this._eventTypes = /* @__PURE__ */ new Map([\n ["auxclick", "mouse"],\n ["click", "mouse"],\n ["dblclick", "mouse"],\n ["mousedown", "mouse"],\n ["mouseeenter", "mouse"],\n ["mouseleave", "mouse"],\n ["mousemove", "mouse"],\n ["mouseout", "mouse"],\n ["mouseover", "mouse"],\n ["mouseup", "mouse"],\n ["mouseleave", "mouse"],\n ["mousewheel", "mouse"],\n ["keydown", "keyboard"],\n ["keyup", "keyboard"],\n ["keypress", "keyboard"],\n ["textInput", "keyboard"],\n ["touchstart", "touch"],\n ["touchmove", "touch"],\n ["touchend", "touch"],\n ["touchcancel", "touch"],\n ["pointerover", "pointer"],\n ["pointerout", "pointer"],\n ["pointerenter", "pointer"],\n ["pointerleave", "pointer"],\n ["pointerdown", "pointer"],\n ["pointerup", "pointer"],\n ["pointermove", "pointer"],\n ["pointercancel", "pointer"],\n ["gotpointercapture", "pointer"],\n ["lostpointercapture", "pointer"],\n ["focus", "focus"],\n ["blur", "focus"],\n ["drag", "drag"],\n ["dragstart", "drag"],\n ["dragend", "drag"],\n ["dragover", "drag"],\n ["dragenter", "drag"],\n ["dragleave", "drag"],\n ["dragexit", "drag"],\n ["drop", "drag"],\n ["wheel", "wheel"],\n ["deviceorientation", "deviceorientation"],\n ["deviceorientationabsolute", "deviceorientation"],\n ["devicemotion", "devicemotion"]\n ]);\n this._hoverHitTargetInterceptorEvents = /* @__PURE__ */ new Set(["mousemove"]);\n this._tapHitTargetInterceptorEvents = /* @__PURE__ */ new Set(["pointerdown", "pointerup", "touchstart", "touchend", "touchcancel"]);\n this._mouseHitTargetInterceptorEvents = /* @__PURE__ */ new Set(["mousedown", "mouseup", "pointerdown", "pointerup", "click", "auxclick", "dblclick", "contextmenu"]);\n this._allHitTargetInterceptorEvents = /* @__PURE__ */ new Set([...this._hoverHitTargetInterceptorEvents, ...this._tapHitTargetInterceptorEvents, ...this._mouseHitTargetInterceptorEvents]);\n this._engines = /* @__PURE__ */ new Map();\n this._engines.set("xpath", XPathEngine);\n this._engines.set("xpath:light", XPathEngine);\n this._engines.set("role", createRoleEngine(false));\n this._engines.set("text", this._createTextEngine(true, false));\n this._engines.set("text:light", this._createTextEngine(false, false));\n this._engines.set("id", this._createAttributeEngine("id", true));\n this._engines.set("id:light", this._createAttributeEngine("id", false));\n this._engines.set("data-testid", this._createAttributeEngine("data-testid", true));\n this._engines.set("data-testid:light", this._createAttributeEngine("data-testid", false));\n this._engines.set("data-test-id", this._createAttributeEngine("data-test-id", true));\n this._engines.set("data-test-id:light", this._createAttributeEngine("data-test-id", false));\n this._engines.set("data-test", this._createAttributeEngine("data-test", true));\n this._engines.set("data-test:light", this._createAttributeEngine("data-test", false));\n this._engines.set("css", this._createCSSEngine());\n this._engines.set("nth", { queryAll: () => [] });\n this._engines.set("visible", this._createVisibleEngine());\n this._engines.set("internal:control", this._createControlEngine());\n this._engines.set("internal:has", this._createHasEngine());\n this._engines.set("internal:has-not", this._createHasNotEngine());\n this._engines.set("internal:and", { queryAll: () => [] });\n this._engines.set("internal:or", { queryAll: () => [] });\n this._engines.set("internal:chain", this._createInternalChainEngine());\n this._engines.set("internal:label", this._createInternalLabelEngine());\n this._engines.set("internal:text", this._createTextEngine(true, true));\n this._engines.set("internal:has-text", this._createInternalHasTextEngine());\n this._engines.set("internal:has-not-text", this._createInternalHasNotTextEngine());\n this._engines.set("internal:attr", this._createNamedAttributeEngine());\n this._engines.set("internal:testid", this._createTestIdEngine());\n this._engines.set("internal:role", createRoleEngine(true));\n this._engines.set("internal:describe", this._createDescribeEngine());\n this._engines.set("aria-ref", this._createAriaRefEngine());\n for (const { name, source } of options.customEngines)\n this._engines.set(name, this.eval(source));\n this._stableRafCount = options.stableRafCount;\n this._browserName = options.browserName;\n this._shouldPrependErrorPrefix = !!options.shouldPrependErrorPrefix;\n this._isUtilityWorld = !!options.isUtilityWorld;\n setGlobalOptions({ browserNameForWorkarounds: options.browserName });\n this._setupGlobalListenersRemovalDetection();\n this._setupHitTargetInterceptors();\n if (this.isUnderTest)\n this.window.__injectedScript = this;\n }\n eval(expression) {\n return this.window.eval(expression);\n }\n testIdAttributeNameForStrictErrorAndConsoleCodegen() {\n return this._testIdAttributeNameForStrictErrorAndConsoleCodegen;\n }\n parseSelector(selector) {\n const result = parseSelector(selector);\n visitAllSelectorParts(result, (part) => {\n if (!this._engines.has(part.name))\n throw this.createStacklessError(`Unknown engine "${part.name}" while parsing selector ${selector}`);\n });\n return result;\n }\n generateSelector(targetElement, options) {\n return generateSelector(this, targetElement, options);\n }\n generateSelectorSimple(targetElement, options) {\n return generateSelector(this, targetElement, { ...options, testIdAttributeName: this._testIdAttributeNameForStrictErrorAndConsoleCodegen }).selector;\n }\n querySelector(selector, root, strict) {\n const result = this.querySelectorAll(selector, root);\n if (strict && result.length > 1)\n throw this.strictModeViolationError(selector, result);\n this.checkDeprecatedSelectorUsage(selector, result);\n return result[0];\n }\n _queryNth(elements, part) {\n const list = [...elements];\n let nth = +part.body;\n if (nth === -1)\n nth = list.length - 1;\n return new Set(list.slice(nth, nth + 1));\n }\n _queryLayoutSelector(elements, part, originalRoot) {\n const name = part.name;\n const body = part.body;\n const result = [];\n const inner = this.querySelectorAll(body.parsed, originalRoot);\n for (const element of elements) {\n const score = layoutSelectorScore(name, element, inner, body.distance);\n if (score !== void 0)\n result.push({ element, score });\n }\n result.sort((a, b) => a.score - b.score);\n return new Set(result.map((r) => r.element));\n }\n ariaSnapshot(node, options) {\n return this.incrementalAriaSnapshot(node, options).full;\n }\n incrementalAriaSnapshot(node, options) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");\n const ariaSnapshot = generateAriaTree(node, options);\n const rendered = renderAriaTree(ariaSnapshot, options);\n let incremental;\n if (options.track) {\n const previousSnapshot = this._lastAriaSnapshotForTrack.get(options.track);\n if (previousSnapshot)\n incremental = renderAriaTree(ariaSnapshot, options, previousSnapshot).text;\n this._lastAriaSnapshotForTrack.set(options.track, ariaSnapshot);\n }\n this._lastAriaSnapshotForQuery = ariaSnapshot;\n return { full: rendered.text, incremental, iframeRefs: ariaSnapshot.iframeRefs, iframeDepths: rendered.iframeDepths };\n }\n ariaSnapshotForRecorder() {\n const tree = generateAriaTree(this.document.body, { mode: "ai" });\n const { text: ariaSnapshot } = renderAriaTree(tree, { mode: "ai" });\n return { ariaSnapshot, refs: tree.refs };\n }\n getAllElementsMatchingExpectAriaTemplate(document, template) {\n return getAllElementsMatchingExpectAriaTemplate(document.documentElement, template);\n }\n querySelectorAll(selector, root) {\n if (selector.capture !== void 0) {\n if (selector.parts.some((part) => part.name === "nth"))\n throw this.createStacklessError(`Can\'t query n-th element in a request with the capture.`);\n const withHas = { parts: selector.parts.slice(0, selector.capture + 1) };\n if (selector.capture < selector.parts.length - 1) {\n const parsed = { parts: selector.parts.slice(selector.capture + 1) };\n const has = { name: "internal:has", body: { parsed }, source: stringifySelector(parsed) };\n withHas.parts.push(has);\n }\n return this.querySelectorAll(withHas, root);\n }\n if (!root["querySelectorAll"])\n throw this.createStacklessError("Node is not queryable.");\n if (selector.capture !== void 0) {\n throw this.createStacklessError("Internal error: there should not be a capture in the selector.");\n }\n if (root.nodeType === 11 && selector.parts.length === 1 && selector.parts[0].name === "css" && selector.parts[0].source === ":scope")\n return [root];\n this._evaluator.begin();\n try {\n let roots = /* @__PURE__ */ new Set([root]);\n for (const part of selector.parts) {\n if (part.name === "nth") {\n roots = this._queryNth(roots, part);\n } else if (part.name === "internal:and") {\n const andElements = this.querySelectorAll(part.body.parsed, root);\n roots = new Set(andElements.filter((e) => roots.has(e)));\n } else if (part.name === "internal:or") {\n const orElements = this.querySelectorAll(part.body.parsed, root);\n roots = new Set(sortInDOMOrder(/* @__PURE__ */ new Set([...roots, ...orElements])));\n } else if (kLayoutSelectorNames.includes(part.name)) {\n roots = this._queryLayoutSelector(roots, part, root);\n } else {\n const next = /* @__PURE__ */ new Set();\n for (const root2 of roots) {\n const all = this._queryEngineAll(part, root2);\n for (const one of all)\n next.add(one);\n }\n roots = next;\n }\n }\n return [...roots];\n } finally {\n this._evaluator.end();\n }\n }\n _queryEngineAll(part, root) {\n const result = this._engines.get(part.name).queryAll(root, part.body);\n for (const element of result) {\n if (!("nodeName" in element))\n throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(element)}`);\n }\n return result;\n }\n _createAttributeEngine(attribute, shadow) {\n const toCSS = (selector) => {\n const css = `[${attribute}=${JSON.stringify(selector)}]`;\n return [{ simples: [{ selector: { css, functions: [] }, combinator: "" }] }];\n };\n return {\n queryAll: (root, selector) => {\n return this._evaluator.query({ scope: root, pierceShadow: shadow }, toCSS(selector));\n }\n };\n }\n _createCSSEngine() {\n return {\n queryAll: (root, body) => {\n return this._evaluator.query({ scope: root, pierceShadow: true }, body);\n }\n };\n }\n _createTextEngine(shadow, internal) {\n const queryAll = (root, selector) => {\n const { matcher, kind } = createTextMatcher(selector, internal);\n const result = [];\n let lastDidNotMatchSelf = null;\n const appendElement = (element) => {\n if (kind === "lax" && lastDidNotMatchSelf && lastDidNotMatchSelf.contains(element))\n return false;\n const matches = elementMatchesText(this._evaluator._cacheText, element, matcher);\n if (matches === "none")\n lastDidNotMatchSelf = element;\n if (matches === "self" || matches === "selfAndChildren" && kind === "strict" && !internal)\n result.push(element);\n };\n if (root.nodeType === Node.ELEMENT_NODE)\n appendElement(root);\n const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: shadow }, "*");\n for (const element of elements)\n appendElement(element);\n return result;\n };\n return { queryAll };\n }\n _createInternalHasTextEngine() {\n return {\n queryAll: (root, selector) => {\n if (root.nodeType !== 1)\n return [];\n const element = root;\n const text = elementText(this._evaluator._cacheText, element);\n const { matcher } = createTextMatcher(selector, true);\n return matcher(text) ? [element] : [];\n }\n };\n }\n _createInternalHasNotTextEngine() {\n return {\n queryAll: (root, selector) => {\n if (root.nodeType !== 1)\n return [];\n const element = root;\n const text = elementText(this._evaluator._cacheText, element);\n const { matcher } = createTextMatcher(selector, true);\n return matcher(text) ? [] : [element];\n }\n };\n }\n _createInternalLabelEngine() {\n return {\n queryAll: (root, selector) => {\n const { matcher } = createTextMatcher(selector, true);\n const allElements = this._evaluator._queryCSS({ scope: root, pierceShadow: true }, "*");\n return allElements.filter((element) => {\n return getElementLabels(this._evaluator._cacheText, element).some((label) => matcher(label));\n });\n }\n };\n }\n _createNamedAttributeEngine() {\n const queryAll = (root, selector) => {\n const parsed = parseAttributeSelector(selector, true);\n if (parsed.name || parsed.attributes.length !== 1)\n throw new Error("Malformed attribute selector: " + selector);\n const { name } = parsed.attributes[0];\n const matcher = createAttributeMatcher(parsed.attributes[0]);\n const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: true }, `[${name}]`);\n return elements.filter((e) => matcher(e.getAttribute(name)));\n };\n return { queryAll };\n }\n _createTestIdEngine() {\n const queryAll = (root, selector) => {\n const parsed = parseAttributeSelector(selector, true);\n if (parsed.name || parsed.attributes.length !== 1)\n throw new Error("Malformed test id selector: " + selector);\n const names = splitTestIdAttributeNames(parsed.attributes[0].name);\n const matcher = createAttributeMatcher(parsed.attributes[0]);\n const cssQuery = names.map((n) => `[${n}]`).join(",");\n const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: true }, cssQuery);\n return elements.filter((e) => names.some((n) => {\n const actual = e.getAttribute(n);\n return actual !== null && matcher(actual);\n }));\n };\n return { queryAll };\n }\n _createDescribeEngine() {\n const queryAll = (root) => {\n if (root.nodeType !== 1)\n return [];\n return [root];\n };\n return { queryAll };\n }\n _createControlEngine() {\n return {\n queryAll(root, body) {\n if (body === "enter-frame")\n return [];\n if (body === "return-empty")\n return [];\n if (body === "component") {\n if (root.nodeType !== 1)\n return [];\n return [root.childElementCount === 1 ? root.firstElementChild : root];\n }\n throw new Error(`Internal error, unknown internal:control selector ${body}`);\n }\n };\n }\n _createHasEngine() {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n const has = !!this.querySelector(body.parsed, root, false);\n return has ? [root] : [];\n };\n return { queryAll };\n }\n _createHasNotEngine() {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n const has = !!this.querySelector(body.parsed, root, false);\n return has ? [] : [root];\n };\n return { queryAll };\n }\n _createVisibleEngine() {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n const visible = body === "true";\n return isElementVisible(root) === visible ? [root] : [];\n };\n return { queryAll };\n }\n _createInternalChainEngine() {\n const queryAll = (root, body) => {\n return this.querySelectorAll(body.parsed, root);\n };\n return { queryAll };\n }\n extend(source, params) {\n const constrFunction = this.window.eval(`\n (() => {\n const module = {};\n ${source}\n return module.exports.default();\n })()`);\n return new constrFunction(this, params);\n }\n async viewportRatio(element) {\n return await new Promise((resolve) => {\n const observer = new IntersectionObserver((entries) => {\n resolve(entries[0].intersectionRatio);\n observer.disconnect();\n });\n observer.observe(element);\n this.utils.builtins.requestAnimationFrame(() => {\n });\n });\n }\n getElementBorderWidth(node) {\n if (node.nodeType !== Node.ELEMENT_NODE || !node.ownerDocument || !node.ownerDocument.defaultView)\n return { left: 0, top: 0 };\n const style = node.ownerDocument.defaultView.getComputedStyle(node);\n return { left: parseInt(style.borderLeftWidth || "", 10), top: parseInt(style.borderTopWidth || "", 10) };\n }\n describeIFrameStyle(iframe) {\n if (!iframe.ownerDocument || !iframe.ownerDocument.defaultView)\n return "error:notconnected";\n const defaultView = iframe.ownerDocument.defaultView;\n for (let e = iframe; e; e = parentElementOrShadowHost(e)) {\n if (defaultView.getComputedStyle(e).transform !== "none")\n return "transformed";\n }\n const iframeStyle = defaultView.getComputedStyle(iframe);\n return {\n left: parseInt(iframeStyle.borderLeftWidth || "", 10) + parseInt(iframeStyle.paddingLeft || "", 10),\n top: parseInt(iframeStyle.borderTopWidth || "", 10) + parseInt(iframeStyle.paddingTop || "", 10)\n };\n }\n retarget(node, behavior) {\n let element = node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n if (!element)\n return null;\n if (behavior === "none")\n return element;\n if (!element.matches("input, textarea, select") && !element.isContentEditable) {\n if (behavior === "button-link")\n element = element.closest("button, [role=button], a, [role=link]") || element;\n else\n element = element.closest("button, [role=button], [role=checkbox], [role=radio]") || element;\n }\n if (behavior === "follow-label") {\n if (!element.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]") && !element.isContentEditable) {\n const enclosingLabel = element.closest("label");\n if (enclosingLabel && enclosingLabel.control)\n element = enclosingLabel.control;\n }\n }\n return element;\n }\n async checkElementStates(node, states) {\n if (states.includes("stable")) {\n const stableResult = await this._checkElementIsStable(node);\n if (stableResult === false)\n return { missingState: "stable" };\n if (stableResult === "error:notconnected")\n return "error:notconnected";\n }\n for (const state of states) {\n if (state !== "stable") {\n const result = this.elementState(node, state);\n if (result.received === "error:notconnected")\n return "error:notconnected";\n if (!result.matches)\n return { missingState: state };\n }\n }\n }\n async _checkElementIsStable(node) {\n const continuePolling = Symbol("continuePolling");\n let lastRect;\n let stableRafCounter = 0;\n let lastTime = 0;\n const check = () => {\n const element = this.retarget(node, "no-follow-label");\n if (!element)\n return "error:notconnected";\n const time = this.utils.builtins.performance.now();\n if (this._stableRafCount > 1 && time - lastTime < 15)\n return continuePolling;\n lastTime = time;\n const clientRect = element.getBoundingClientRect();\n const rect = { x: clientRect.top, y: clientRect.left, width: clientRect.width, height: clientRect.height };\n if (lastRect) {\n const samePosition = rect.x === lastRect.x && rect.y === lastRect.y && rect.width === lastRect.width && rect.height === lastRect.height;\n if (!samePosition)\n return false;\n if (++stableRafCounter >= this._stableRafCount)\n return true;\n }\n lastRect = rect;\n return continuePolling;\n };\n let fulfill;\n let reject;\n const result = new Promise((f, r) => {\n fulfill = f;\n reject = r;\n });\n const raf = () => {\n try {\n const success = check();\n if (success !== continuePolling)\n fulfill(success);\n else\n this.utils.builtins.requestAnimationFrame(raf);\n } catch (e) {\n reject(e);\n }\n };\n this.utils.builtins.requestAnimationFrame(raf);\n return result;\n }\n _createAriaRefEngine() {\n const queryAll = (root, selector) => {\n var _a, _b;\n const result = (_b = (_a = this._lastAriaSnapshotForQuery) == null ? void 0 : _a.elements) == null ? void 0 : _b.get(selector);\n return result && result.isConnected ? [result] : [];\n };\n return { queryAll };\n }\n elementState(node, state) {\n const element = this.retarget(node, ["visible", "hidden"].includes(state) ? "none" : "follow-label");\n if (!element || !element.isConnected) {\n if (state === "hidden")\n return { matches: true, received: "hidden" };\n return { matches: false, received: "error:notconnected" };\n }\n if (state === "visible" || state === "hidden") {\n const visible = isElementVisible(element);\n return {\n matches: state === "visible" ? visible : !visible,\n received: visible ? "visible" : "hidden"\n };\n }\n if (state === "disabled" || state === "enabled") {\n const disabled = getAriaDisabled(element);\n return {\n matches: state === "disabled" ? disabled : !disabled,\n received: disabled ? "disabled" : "enabled"\n };\n }\n if (state === "editable") {\n const disabled = getAriaDisabled(element);\n const readonly = getReadonly(element);\n if (readonly === "error")\n throw this.createStacklessError("Element is not an
${escapeHTML(options.description)}
` : ""; + const styleSheet = ` + @keyframes pw-chapter-fade-in { + from { opacity: 0; } + to { opacity: 1; } + } + @keyframes pw-chapter-fade-out { + from { opacity: 1; } + to { opacity: 0; } + } + #background { + position: absolute; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + backdrop-filter: blur(2px); + animation: pw-chapter-fade-in ${fadeDuration}ms ease-out forwards; + } + #background.fade-out { + animation: pw-chapter-fade-out ${fadeDuration}ms ease-in forwards; + } + #content { + background: rgba(0, 0, 0, 0.7); + border: 1px solid rgba(255, 255, 255, 0.15); + border-radius: 16px; + padding: 40px 56px; + max-width: 560px; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); + } + #title { + color: white; + font-family: system-ui, -apple-system, sans-serif; + font-size: 28px; + font-weight: 600; + line-height: 1.3; + text-align: center; + letter-spacing: -0.01em; + } + #description { + color: rgba(255, 255, 255, 0.7); + font-family: system-ui, -apple-system, sans-serif; + font-size: 15px; + line-height: 1.5; + margin-top: 12px; + text-align: center; + } + `; + const duration = options.duration ?? 2e3; + const html = `
${escapeHTML(options.title)}
${descriptionHtml}
`; + const id = await this.show(html); + await new Promise((f) => setTimeout(f, duration)); + const utility = await this._page.mainFrame().utilityContext(); + await utility.evaluate(({ injected, id: id2, fadeDuration: fadeDuration2 }) => { + const overlay = injected.getUserOverlay(id2); + const bg = overlay?.querySelector("#background"); + if (bg) + bg.classList.add("fade-out"); + return new Promise((f) => injected.utils.builtins.setTimeout(f, fadeDuration2)); + }, { injected: await utility.injectedScript(), id, fadeDuration }).catch((e) => debugLogger.log("error", e)); + await this.remove(id); + } + async setVisible(visible) { + if (!this._overlays.size) + return; + const utility = await this._page.mainFrame().utilityContext(); + await utility.evaluate(({ injected, visible: visible2 }) => { + injected.setUserOverlaysVisible(visible2); + }, { injected: await utility.injectedScript(), visible }).catch((e) => debugLogger.log("error", e)); + } + }; + } +}); + +// packages/playwright-core/src/server/screencast.ts +var Screencast; +var init_screencast = __esm({ + "packages/playwright-core/src/server/screencast.ts"() { + "use strict"; + init_manualPromise(); + init_protocolFormatter(); + init_debugLogger(); + init_progress(); + init_dom(); + Screencast = class { + constructor(page) { + this._clients = /* @__PURE__ */ new Map(); + this.page = page; + this.page.instrumentation.addListener(this, this.page.browserContext); + } + async handlePageOrContextClose() { + const clients = [...this._clients.keys()]; + this._clients.clear(); + for (const client of clients) { + if (client.gracefulClose) + await client.gracefulClose(); + } + } + dispose() { + for (const client of this._clients.keys()) + client.dispose(); + this._clients.clear(); + this.page.instrumentation.removeListener(this); + } + showActions(options) { + this._actions = options; + } + hideActions() { + this._actions = void 0; + } + addClient(client) { + const isFirst = this._clients.size === 0; + this._clients.set(client, new ManualPromise()); + if (isFirst) { + this._startScreencast(client.size, client.quality); + } else if (this._lastFrame) { + const frame = this._lastFrame; + setTimeout(() => { + if (this._clients.has(client)) + void client.onFrame(frame); + }, 0); + } + return { size: this._size }; + } + removeClient(client) { + const disconnected = this._clients.get(client); + if (!disconnected) + return; + this._clients.delete(client); + disconnected.resolve(); + if (!this._clients.size) + this._stopScreencast(); + } + _startScreencast(size, quality) { + this._size = size; + if (!this._size) { + const viewport = this.page.browserContext._options.viewport || { width: 800, height: 600 }; + const scale = Math.min(1, 800 / Math.max(viewport.width, viewport.height)); + this._size = { + width: Math.floor(viewport.width * scale), + height: Math.floor(viewport.height * scale) + }; + } + this._size = { + width: this._size.width & ~1, + height: this._size.height & ~1 + }; + this.page.delegate.startScreencast({ + width: this._size.width, + height: this._size.height, + quality: quality ?? 90 + }); + } + _stopScreencast() { + this._lastFrame = void 0; + this.page.delegate.stopScreencast(); + } + onScreencastFrame(frame, ack) { + this._lastFrame = frame; + const asyncResults = []; + for (const [client, disconnected] of this._clients) { + const result2 = client.onFrame(frame); + if (!result2) + continue; + asyncResults.push(Promise.race([result2.catch(() => { + }), disconnected])); + } + if (ack) { + if (!asyncResults.length) + ack(); + else + Promise.race(asyncResults).then(ack); + } + } + async onBeforeInputAction(sdkObject, metadata, point, box) { + if (!this._actions) + return; + const page = sdkObject.attribution.page; + if (page !== this.page) + return; + if (!box && sdkObject instanceof ElementHandle) + box = await sdkObject.boundingBox(nullProgress) || void 0; + const actionTitle2 = renderTitleForCall(metadata); + const utility = await page.mainFrame().utilityContext(); + await utility.evaluate(async (options) => { + const { injected, duration } = options; + injected.setScreencastAnnotation(options); + await new Promise((f) => injected.utils.builtins.setTimeout(f, duration)); + injected.setScreencastAnnotation(null); + }, { + injected: await utility.injectedScript(), + duration: this._actions?.duration ?? 500, + point, + box, + actionTitle: actionTitle2, + position: this._actions?.position, + fontSize: this._actions?.fontSize, + cursor: this._actions?.cursor ?? "pointer" + }).catch((e) => debugLogger.log("error", e)); + } + }; + } +}); + +// packages/playwright-core/src/server/page.ts +async function ariaSnapshotForFrame(progress2, frame, options = {}) { + const snapshot3 = await frame.retryWithProgressAndTimeouts(progress2, [1e3, 2e3, 4e3, 8e3], async (progress3, continuePolling) => { + try { + const context2 = await progress3.race(frame.utilityContext()); + const injectedScript = await progress3.race(context2.injectedScript()); + const snapshotOrRetry = await progress3.race(injectedScript.evaluate((injected, options2) => { + if (options2.info) { + const element2 = injected.querySelector(options2.info.parsed, injected.document, options2.info.strict); + if (!element2) + return false; + return injected.incrementalAriaSnapshot(element2, options2); + } + const node = injected.document.body; + if (!node) + return true; + return injected.incrementalAriaSnapshot(node, options2); + }, { + mode: options.mode ?? "default", + refPrefix: frame.seq ? "f" + frame.seq : "", + track: options.track, + doNotRenderActive: options.doNotRenderActive, + info: options.info, + depth: options.depth, + boxes: options.boxes + })); + if (snapshotOrRetry === true) + return continuePolling; + if (snapshotOrRetry === false) + throw new NonRecoverableDOMError(`Selector "${stringifySelector(options.info.parsed)}" does not match any element`); + return snapshotOrRetry; + } catch (e) { + if (frame.isNonRetriableError(e)) + throw e; + return continuePolling; + } + }); + const renderedIframeRefs = snapshot3.iframeRefs.filter((ref) => ref in snapshot3.iframeDepths); + progress2.setAllowConcurrentOrNestedRaces(true); + const childSnapshotPromises = renderedIframeRefs.map((ref) => { + const iframeDepth = snapshot3.iframeDepths[ref]; + const childDepth = options.depth ? options.depth - iframeDepth - 1 : void 0; + return ariaSnapshotFrameRef(progress2, frame, ref, { ...options, depth: childDepth }); + }); + const childSnapshots = await Promise.all(childSnapshotPromises); + progress2.setAllowConcurrentOrNestedRaces(false); + const full = []; + let incremental; + if (snapshot3.incremental !== void 0) { + incremental = snapshot3.incremental.split("\n"); + for (let i = 0; i < renderedIframeRefs.length; i++) { + const childSnapshot = childSnapshots[i]; + if (childSnapshot.incremental) + incremental.push(...childSnapshot.incremental); + else if (childSnapshot.full.length) + incremental.push("- iframe [ref=" + renderedIframeRefs[i] + "]:", ...childSnapshot.full.map((l) => " " + l)); + } + } + for (const line of snapshot3.full.split("\n")) { + const match = line.match(/^(\s*)- iframe (?:\[active\] )?\[ref=([^\]]*)\]/); + if (!match) { + full.push(line); + continue; + } + const leadingSpace = match[1]; + const ref = match[2]; + const childSnapshot = childSnapshots[renderedIframeRefs.indexOf(ref)] ?? { full: [] }; + full.push(childSnapshot.full.length ? line + ":" : line); + full.push(...childSnapshot.full.map((l) => leadingSpace + " " + l)); + } + return { full, incremental }; +} +async function ariaSnapshotFrameRef(progress2, parentFrame, frameRef, options) { + const frameSelector = `aria-ref=${frameRef} >> internal:control=enter-frame`; + const frameBodySelector = `${frameSelector} >> body`; + const child = await progress2.race(parentFrame.selectors.resolveFrameForSelector(frameBodySelector, { strict: true })); + if (!child) + return { full: [] }; + try { + return await ariaSnapshotForFrame(progress2, child.frame, { ...options, info: void 0 }); + } catch { + return { full: [] }; + } +} +function ensureArrayLimit(array, limit) { + if (array.length > limit) + return array.splice(0, limit / 10); + return []; +} +var PageEvent, navigationMarkSymbol, Page, WorkerEvent, Worker, PageBinding, InitScript; +var init_page = __esm({ + "packages/playwright-core/src/server/page.ts"() { + "use strict"; + init_selectorParser(); + init_manualPromise(); + init_utilityScriptSerializers(); + init_comparators(); + init_debugLogger(); + init_manualPromise(); + init_assert(); + init_stringUtils(); + init_locatorGenerators(); + init_browserContext(); + init_disposable2(); + init_console(); + init_errors(); + init_fileChooser(); + init_frames(); + init_helper(); + init_input(); + init_instrumentation(); + init_javascript(); + init_screenshotter(); + init_callLog(); + init_bindingsControllerSource(); + init_overlay(); + init_dom(); + init_screencast(); + init_javascript(); + PageEvent = { + Close: "close", + Crash: "crash", + Download: "download", + EmulatedSizeChanged: "emulatedsizechanged", + FileChooser: "filechooser", + FrameAttached: "frameattached", + FrameDetached: "framedetached", + InternalFrameNavigatedToNewDocument: "internalframenavigatedtonewdocument", + LocatorHandlerTriggered: "locatorhandlertriggered", + WebSocket: "websocket", + Worker: "worker" + }; + navigationMarkSymbol = Symbol("navigationMark"); + Page = class _Page extends SdkObject { + constructor(delegate, browserContext) { + super(browserContext, "page"); + this._closedState = "open"; + this.closedPromise = new ManualPromise(); + this._initializedPromise = new ManualPromise(); + this._consoleMessages = []; + this._pageErrors = []; + this._crashed = false; + this.openScope = new LongStandingScope(); + this._emulatedMedia = {}; + this._fileChooserInterceptedBy = /* @__PURE__ */ new Set(); + this._pageBindings = /* @__PURE__ */ new Map(); + this.initScripts = []; + this._workers = /* @__PURE__ */ new Map(); + this.requestInterceptors = []; + this._locatorHandlers = /* @__PURE__ */ new Map(); + this._lastLocatorHandlerUid = 0; + this._locatorHandlerRunningCounter = 0; + this._networkRequests = []; + this.attribution.page = this; + this.delegate = delegate; + this.browserContext = browserContext; + this.keyboard = new Keyboard(delegate.rawKeyboard, this); + this.mouse = new Mouse(delegate.rawMouse, this); + this.touchscreen = new Touchscreen(delegate.rawTouchscreen, this); + this.screenshotter = new Screenshotter(this); + this.frameManager = new FrameManager(this); + this.overlay = new Overlay(this); + this.screencast = new Screencast(this); + if (delegate.pdf) + this.pdf = delegate.pdf.bind(delegate); + this.coverage = delegate.coverage ? delegate.coverage() : null; + this.isStorageStatePage = browserContext.isCreatingStorageStatePage(); + } + static { + this.Events = PageEvent; + } + async reportAsNew(opener, error) { + if (this.delegate.noUtilityWorld?.()) { + await this._addInitScript(saveGlobalsSnapshotSource); + await this.safeNonStallingEvaluateInAllFrames(saveGlobalsSnapshotSource, "main"); + } + if (opener) { + const openerPageOrError = await opener.waitForInitializedOrError(); + if (openerPageOrError instanceof _Page && !openerPageOrError.isClosed()) + this._opener = openerPageOrError; + } + this._markInitialized(error); + } + _markInitialized(error = void 0) { + if (error) { + if (this.browserContext.isClosingOrClosed()) + return; + this.frameManager.createDummyMainFrameIfNeeded(); + } + this._initialized = error || this; + this.emitOnContext(BrowserContext.Events.Page, this); + for (const pageError of this._pageErrors) + this.emitOnContext(BrowserContext.Events.PageError, pageError, this); + for (const message of this._consoleMessages) + this.emitOnContext(BrowserContext.Events.Console, message); + if (this.isClosed()) + this.emit(_Page.Events.Close); + else + this.instrumentation.onPageOpen(this); + this._initializedPromise.resolve(this._initialized); + } + initializedOrUndefined() { + return this._initialized ? this : void 0; + } + waitForInitializedOrError() { + return this._initializedPromise; + } + emitOnContext(event, ...args) { + if (this.isStorageStatePage) + return; + this.browserContext.emit(event, ...args); + } + async resetForReuse(progress2) { + await this.mainFrame().gotoImpl(progress2, "about:blank", {}); + this._emulatedSize = void 0; + this._emulatedMedia = {}; + this._extraHTTPHeaders = void 0; + await progress2.race(Promise.all([ + this.delegate.updateEmulatedViewportSize(), + this.delegate.updateEmulateMedia(), + this.delegate.updateExtraHTTPHeaders() + ])); + await this.delegate.resetForReuse(progress2); + } + _didClose() { + this.frameManager.dispose(); + this.screencast.dispose(); + this.overlay.dispose(); + assert(this._closedState !== "closed", "Page closed twice"); + this._closedState = "closed"; + this.emit(_Page.Events.Close); + this.browserContext.emit(BrowserContext.Events.PageClosed, this); + this.closedPromise.resolve(); + this.instrumentation.onPageClose(this); + this.openScope.close(new TargetClosedError(this.closeReason())); + } + _didCrash() { + this.frameManager.dispose(); + this.screencast.dispose(); + this.overlay.dispose(); + this.emit(_Page.Events.Crash); + this._crashed = true; + this.instrumentation.onPageClose(this); + this.openScope.close(new Error("Page crashed")); + } + async _onFileChooserOpened(handle) { + let multiple; + try { + multiple = await handle.evaluate((element2) => !!element2.multiple); + } catch (e) { + return; + } + if (!this.listenerCount(_Page.Events.FileChooser)) { + handle.dispose(); + return; + } + const fileChooser = new FileChooser(handle, multiple); + this.emit(_Page.Events.FileChooser, fileChooser); + } + opener() { + return this._opener; + } + mainFrame() { + return this.frameManager.mainFrame(); + } + frames() { + return this.frameManager.frames(); + } + async exposeBinding(progress2, name, playwrightBinding) { + if (this._pageBindings.has(name)) + throw new Error(`Function "${name}" has been already registered`); + if (this.browserContext._pageBindings.has(name)) + throw new Error(`Function "${name}" has been already registered in the browser context`); + await progress2.race(this.browserContext.exposePlaywrightBindingIfNeeded()); + const binding = new PageBinding(this, name, playwrightBinding); + this._pageBindings.set(name, binding); + try { + await progress2.race(this.delegate.addInitScript(binding.initScript)); + await progress2.race(this.safeNonStallingEvaluateInAllFrames(binding.initScript.source, "main")); + return binding; + } catch (error) { + this._pageBindings.delete(name); + throw error; + } + } + async removeExposedBinding(binding) { + if (this._pageBindings.get(binding.name) !== binding) + return; + this._pageBindings.delete(binding.name); + await this.delegate.removeInitScripts([binding.initScript]); + const cleanup = `{ ${binding.cleanupScript} };`; + await this.safeNonStallingEvaluateInAllFrames(cleanup, "main"); + } + async setExtraHTTPHeaders(progress2, headers) { + const oldHeaders = this._extraHTTPHeaders; + try { + this._extraHTTPHeaders = headers; + await progress2.race(this.delegate.updateExtraHTTPHeaders()); + } catch (error) { + this._extraHTTPHeaders = oldHeaders; + this.delegate.updateExtraHTTPHeaders().catch(() => { + }); + throw error; + } + } + extraHTTPHeaders() { + return this._extraHTTPHeaders; + } + addNetworkRequest(request2) { + this._networkRequests.push(request2); + ensureArrayLimit(this._networkRequests, 100); + } + networkRequests() { + return this._networkRequests; + } + async onBindingCalled(payload, context2) { + if (this._closedState === "closed") + return; + await PageBinding.dispatch(this, payload, context2); + } + addConsoleMessage(worker, type3, args, location2, text2, timestamp) { + const message = new ConsoleMessage(this, worker, type3, text2, args, location2, timestamp); + const intercepted = this.frameManager.interceptConsoleMessage(message); + if (intercepted) { + args.forEach((arg) => arg.dispose()); + return; + } + this._consoleMessages.push(message); + ensureArrayLimit(this._consoleMessages, 200); + if (this._initialized) + this.emitOnContext(BrowserContext.Events.Console, message); + } + clearConsoleMessages() { + this._consoleMessages.length = 0; + } + consoleMessages(filter) { + if (filter === "all") + return this._consoleMessages; + const marked = this._consoleMessages.findLastIndex((m) => m[navigationMarkSymbol]); + return marked === -1 ? this._consoleMessages : this._consoleMessages.slice(marked + 1); + } + addPageError(error, location2) { + const pageError = { error, location: location2 }; + this._pageErrors.push(pageError); + ensureArrayLimit(this._pageErrors, 200); + if (this._initialized) + this.emitOnContext(BrowserContext.Events.PageError, pageError, this); + } + clearPageErrors() { + this._pageErrors.length = 0; + } + pageErrors(filter) { + if (filter === "all") + return this._pageErrors.map((e) => e.error); + const marked = this._pageErrors.findLastIndex((e) => e[navigationMarkSymbol]); + return (marked === -1 ? this._pageErrors : this._pageErrors.slice(marked + 1)).map((e) => e.error); + } + async reload(progress2, options) { + return this.mainFrame().raceNavigationAction(progress2, async () => { + const [response2] = await Promise.all([ + // Reload must be a new document, and should not be confused with a stray pushState. + this.mainFrame().waitForNavigation(progress2, true, options), + progress2.race(this.delegate.reload()) + ]); + return response2; + }); + } + async goBack(progress2, options) { + return this.mainFrame().raceNavigationAction(progress2, async () => { + let error; + const waitPromise = this.mainFrame().waitForNavigation(progress2, false, options).catch((e) => { + error = e; + return null; + }); + const result2 = await progress2.race(this.delegate.goBack()); + if (!result2) { + waitPromise.catch(() => { + }); + return null; + } + const response2 = await waitPromise; + if (error) + throw error; + return response2; + }); + } + async goForward(progress2, options) { + return this.mainFrame().raceNavigationAction(progress2, async () => { + let error; + const waitPromise = this.mainFrame().waitForNavigation(progress2, false, options).catch((e) => { + error = e; + return null; + }); + const result2 = await progress2.race(this.delegate.goForward()); + if (!result2) { + waitPromise.catch(() => { + }); + return null; + } + const response2 = await waitPromise; + if (error) + throw error; + return response2; + }); + } + requestGC(progress2) { + return progress2.race(this.delegate.requestGC()); + } + registerLocatorHandler(selector, noWaitAfter) { + const uid = ++this._lastLocatorHandlerUid; + this._locatorHandlers.set(uid, { selector, noWaitAfter }); + return uid; + } + resolveLocatorHandler(uid, remove) { + const handler = this._locatorHandlers.get(uid); + if (remove) + this._locatorHandlers.delete(uid); + if (handler) { + handler.resolved?.resolve(); + handler.resolved = void 0; + } + } + unregisterLocatorHandler(uid) { + this._locatorHandlers.delete(uid); + } + async performActionPreChecks(progress2) { + await this._performWaitForNavigationCheck(progress2); + await this._performLocatorHandlersCheckpoint(progress2); + await this._performWaitForNavigationCheck(progress2); + } + async _performWaitForNavigationCheck(progress2) { + if (process.env.PLAYWRIGHT_SKIP_NAVIGATION_CHECK) + return; + const mainFrame = this.frameManager.mainFrame(); + if (!mainFrame || !mainFrame.pendingDocument()) + return; + const url2 = mainFrame.pendingDocument()?.request?.url(); + const toUrl = url2 ? `" ${trimStringWithEllipsis(url2, 200)}"` : ""; + progress2.log(` waiting for${toUrl} navigation to finish...`); + await helper.waitForEvent(progress2, mainFrame, Frame.Events.InternalNavigation, (e) => { + if (!e.isPublic) + return false; + if (!e.error) + progress2.log(` navigated to "${trimStringWithEllipsis(mainFrame.url(), 200)}"`); + return true; + }).promise; + } + async _performLocatorHandlersCheckpoint(progress2) { + if (this._locatorHandlerRunningCounter) + return; + for (const [uid, handler] of this._locatorHandlers) { + if (!handler.resolved) { + if (await this.mainFrame().isVisibleInternal(progress2, handler.selector, { strict: true })) { + handler.resolved = new ManualPromise(); + this.emit(_Page.Events.LocatorHandlerTriggered, uid); + } + } + if (handler.resolved) { + ++this._locatorHandlerRunningCounter; + progress2.log(` found ${asLocator(this.browserContext._browser.sdkLanguage(), handler.selector)}, intercepting action to run the handler`); + const promise = handler.resolved.then(async () => { + if (!handler.noWaitAfter) { + progress2.log(` locator handler has finished, waiting for ${asLocator(this.browserContext._browser.sdkLanguage(), handler.selector)} to be hidden`); + await this.mainFrame().waitForSelector(progress2, handler.selector, false, { state: "hidden" }); + } else { + progress2.log(` locator handler has finished`); + } + }); + try { + progress2.setAllowConcurrentOrNestedRaces(true); + await progress2.race(this.openScope.race(promise)); + } finally { + progress2.setAllowConcurrentOrNestedRaces(false); + --this._locatorHandlerRunningCounter; + } + progress2.log(` interception handler has finished, continuing`); + } + } + } + async emulateMedia(progress2, options) { + const oldEmulatedMedia = { ...this._emulatedMedia }; + if (options.media !== void 0) + this._emulatedMedia.media = options.media; + if (options.colorScheme !== void 0) + this._emulatedMedia.colorScheme = options.colorScheme; + if (options.reducedMotion !== void 0) + this._emulatedMedia.reducedMotion = options.reducedMotion; + if (options.forcedColors !== void 0) + this._emulatedMedia.forcedColors = options.forcedColors; + if (options.contrast !== void 0) + this._emulatedMedia.contrast = options.contrast; + try { + await progress2.race(this.delegate.updateEmulateMedia()); + } catch (error) { + this._emulatedMedia = oldEmulatedMedia; + this.delegate.updateEmulateMedia().catch(() => { + }); + throw error; + } + } + emulatedMedia() { + const contextOptions = this.browserContext._options; + return { + media: this._emulatedMedia.media || "no-override", + colorScheme: this._emulatedMedia.colorScheme !== void 0 ? this._emulatedMedia.colorScheme : contextOptions.colorScheme ?? "light", + reducedMotion: this._emulatedMedia.reducedMotion !== void 0 ? this._emulatedMedia.reducedMotion : contextOptions.reducedMotion ?? "no-preference", + forcedColors: this._emulatedMedia.forcedColors !== void 0 ? this._emulatedMedia.forcedColors : contextOptions.forcedColors ?? "none", + contrast: this._emulatedMedia.contrast !== void 0 ? this._emulatedMedia.contrast : contextOptions.contrast ?? "no-preference" + }; + } + async setViewportSize(progress2, viewportSize) { + const oldEmulatedSize = this._emulatedSize; + try { + this._setEmulatedSize({ viewport: { ...viewportSize }, screen: { ...viewportSize } }); + await progress2.race(this.delegate.updateEmulatedViewportSize()); + } catch (error) { + this._emulatedSize = oldEmulatedSize; + this.delegate.updateEmulatedViewportSize().catch(() => { + }); + throw error; + } + } + setEmulatedSizeFromWindowOpen(emulatedSize) { + this._setEmulatedSize(emulatedSize); + } + _setEmulatedSize(emulatedSize) { + this._emulatedSize = emulatedSize; + this.emit(_Page.Events.EmulatedSizeChanged); + } + emulatedSize() { + if (this._emulatedSize) + return this._emulatedSize; + const contextOptions = this.browserContext._options; + return contextOptions.viewport ? { viewport: contextOptions.viewport, screen: contextOptions.screen || contextOptions.viewport } : void 0; + } + async bringToFront(progress2) { + await progress2.race(this.delegate.bringToFront()); + } + async addInitScript(progress2, source11) { + return await progress2.race(this._addInitScript(source11)); + } + async _addInitScript(source11) { + const initScript = new InitScript(this, source11); + this.initScripts.push(initScript); + try { + await this.delegate.addInitScript(initScript); + } catch (error) { + initScript.dispose().catch(() => { + }); + throw error; + } + return initScript; + } + async removeInitScript(initScript) { + this.initScripts = this.initScripts.filter((script) => initScript !== script); + await this.delegate.removeInitScripts([initScript]); + } + needsRequestInterception() { + return this.requestInterceptors.length > 0 || this.browserContext.requestInterceptors.length > 0; + } + async addRequestInterceptor(progress2, handler, prepend) { + if (prepend) + this.requestInterceptors.unshift(handler); + else + this.requestInterceptors.push(handler); + await progress2.race(this.delegate.updateRequestInterception()); + } + async removeRequestInterceptor(handler) { + const index = this.requestInterceptors.indexOf(handler); + if (index === -1) + return; + this.requestInterceptors.splice(index, 1); + await this.browserContext.notifyRoutesInFlightAboutRemovedHandler(handler); + await this.delegate.updateRequestInterception(); + } + async expectScreenshot(progress2, options) { + const locator2 = options.locator; + const rafrafScreenshot = locator2 ? async (progress3, timeout) => { + return await locator2.frame.rafrafTimeoutScreenshotElementWithProgress(progress3, locator2.selector, timeout, options || {}); + } : async (progress3, timeout) => { + await this.performActionPreChecks(progress3); + await this.mainFrame().rafrafTimeout(progress3, timeout); + return await this.screenshotter.screenshotPage(progress3, options || {}); + }; + const comparator = getComparator("image/png"); + let intermediateResult; + const areEqualScreenshots = (actual, expected, previous) => { + const comparatorResult = actual && expected ? comparator(actual, expected, options) : void 0; + if (comparatorResult !== void 0 && !!comparatorResult === !!options.isNot) + return true; + if (comparatorResult) + intermediateResult = { errorMessage: comparatorResult.errorMessage, diff: comparatorResult.diff, actual, previous }; + return false; + }; + try { + if (!options.expected && options.isNot) + throw new Error('"not" matcher requires expected result'); + const format2 = validateScreenshotOptions(options || {}); + if (format2 !== "png") + throw new Error("Only PNG screenshots are supported"); + let actual; + let previous; + const pollIntervals = [0, 100, 250, 500]; + if (options.expected) + progress2.log(` verifying given screenshot expectation`); + else + progress2.log(` generating new stable screenshot expectation`); + let isFirstIteration = true; + while (true) { + if (this.isClosed()) + throw new Error("The page has closed"); + const screenshotTimeout = pollIntervals.shift() ?? 1e3; + if (screenshotTimeout) + progress2.log(`waiting ${screenshotTimeout}ms before taking screenshot`); + previous = actual; + actual = await rafrafScreenshot(progress2, screenshotTimeout).catch((e) => { + if (this.mainFrame().isNonRetriableError(e)) + throw e; + progress2.log(`failed to take screenshot - ` + e.message); + return void 0; + }); + if (!actual) + continue; + const expectation = options.expected && isFirstIteration ? options.expected : previous; + if (areEqualScreenshots(actual, expectation, previous)) + break; + if (intermediateResult) + progress2.log(intermediateResult.errorMessage); + isFirstIteration = false; + } + if (!isFirstIteration) + progress2.log(`captured a stable screenshot`); + if (!options.expected) + return { actual }; + if (isFirstIteration) { + progress2.log(`screenshot matched expectation`); + return {}; + } + if (areEqualScreenshots(actual, options.expected, void 0)) { + progress2.log(`screenshot matched expectation`); + return {}; + } + throw new Error(intermediateResult.errorMessage); + } catch (e) { + if (isJavaScriptErrorInEvaluate(e) || isInvalidSelectorError(e)) + throw e; + let errorMessage = e.message; + if (e instanceof TimeoutError && intermediateResult?.previous) + errorMessage = `Failed to take two consecutive stable screenshots.`; + const details = { + log: compressCallLog(e.message ? [...progress2.metadata.log, e.message] : progress2.metadata.log), + actual: intermediateResult?.actual, + previous: intermediateResult?.previous, + diff: intermediateResult?.diff, + timedOut: e instanceof TimeoutError, + customErrorMessage: errorMessage + }; + const error = new Error("Expect failed"); + error.details = details; + throw error; + } + } + async screenshot(progress2, options) { + return await this.screenshotter.screenshotPage(progress2, options); + } + async close(progress2, options = {}) { + await progress2.race(this._close(options)); + } + async _close(options = {}) { + if (this._closedState === "closed") + return; + if (options.reason) + this._closeReason = options.reason; + await this.screencast.handlePageOrContextClose(); + if (this._closedState !== "closing") { + this._closedState = "closing"; + await this.delegate.closePage(false).catch((e) => debugLogger.log("error", e)); + } + await this.closedPromise; + } + async runBeforeUnload(progress2) { + await progress2.race(this._runBeforeUnload()); + } + async _runBeforeUnload() { + await this.delegate.closePage(true).catch((e) => debugLogger.log("error", e)); + } + isClosed() { + return this._closedState === "closed"; + } + hasCrashed() { + return this._crashed; + } + isClosedOrClosingOrCrashed() { + return this._closedState !== "open" || this._crashed; + } + addWorker(workerId, worker) { + this._workers.set(workerId, worker); + this.emit(_Page.Events.Worker, worker); + } + removeWorker(workerId) { + const worker = this._workers.get(workerId); + if (!worker) + return; + worker.didClose(); + this._workers.delete(workerId); + } + clearWorkers() { + for (const [workerId, worker] of this._workers) { + worker.didClose(); + this._workers.delete(workerId); + } + } + async setFileChooserInterceptedBy(progress2, enabled, by) { + await progress2.race(this._setFileChooserInterceptedBy(enabled, by)); + } + async _setFileChooserInterceptedBy(enabled, by) { + const wasIntercepted = this.fileChooserIntercepted(); + if (enabled) + this._fileChooserInterceptedBy.add(by); + else + this._fileChooserInterceptedBy.delete(by); + if (wasIntercepted !== this.fileChooserIntercepted()) + await this.delegate.updateFileChooserInterception(); + } + fileChooserIntercepted() { + return this._fileChooserInterceptedBy.size > 0; + } + frameNavigatedToNewDocument(frame) { + this.emit(_Page.Events.InternalFrameNavigatedToNewDocument, frame); + this.browserContext.emit(BrowserContext.Events.InternalFrameNavigatedToNewDocument, frame); + const origin = frame.origin(); + if (origin) + this.browserContext.addVisitedOrigin(origin); + if (frame === this.mainFrame()) { + if (this._consoleMessages.length > 0) + this._consoleMessages[this._consoleMessages.length - 1][navigationMarkSymbol] = true; + if (this._pageErrors.length > 0) + this._pageErrors[this._pageErrors.length - 1][navigationMarkSymbol] = true; + } + } + allInitScripts() { + const bindings = [...this.browserContext._pageBindings.values(), ...this._pageBindings.values()].map((binding) => binding.initScript); + if (this.browserContext.bindingsInitScript) + bindings.unshift(this.browserContext.bindingsInitScript); + return [...bindings, ...this.browserContext.initScripts, ...this.initScripts]; + } + getBinding(name) { + return this._pageBindings.get(name) || this.browserContext._pageBindings.get(name); + } + async safeNonStallingEvaluateInAllFrames(expression2, world, options = {}) { + await Promise.all(this.frames().map(async (frame) => { + try { + await frame.nonStallingEvaluateInExistingContext(expression2, world); + } catch (e) { + if (options.throwOnJSErrors && isJavaScriptErrorInEvaluate(e)) + throw e; + } + })); + } + async hideHighlight() { + await Promise.all(this.frames().map((frame) => frame.hideHighlight().catch(() => { + }))); + } + async setDockTile(image) { + await this.delegate.setDockTile(image); + } + async webStorageItems(progress2, kind) { + const storage = `${kind}Storage`; + return await this.mainFrame().evaluateExpression(progress2, `(() => { + const result = []; + for (let i = 0; i < ${storage}.length; i++) { + const name = ${storage}.key(i); + if (name !== null) + result.push({ name, value: ${storage}.getItem(name) ?? '' }); + } + return result; + })()`, { world: "utility" }); + } + async webStorageGetItem(progress2, kind, name) { + const value2 = await this.mainFrame().evaluateExpression(progress2, `${kind}Storage.getItem(${JSON.stringify(name)})`, { world: "utility" }); + return value2 === null ? void 0 : value2; + } + async webStorageSetItem(progress2, kind, name, value2) { + await this.mainFrame().evaluateExpression(progress2, `${kind}Storage.setItem(${JSON.stringify(name)}, ${JSON.stringify(value2)})`, { world: "utility" }); + } + async webStorageRemoveItem(progress2, kind, name) { + await this.mainFrame().evaluateExpression(progress2, `${kind}Storage.removeItem(${JSON.stringify(name)})`, { world: "utility" }); + } + async webStorageClear(progress2, kind) { + await this.mainFrame().evaluateExpression(progress2, `${kind}Storage.clear()`, { world: "utility" }); + } + }; + WorkerEvent = { + Console: "console", + Close: "close" + }; + Worker = class _Worker extends SdkObject { + constructor(parent, url2, onDisconnect) { + super(parent, "worker"); + this._executionContextPromise = new ManualPromise(); + this._workerScriptLoaded = false; + this.existingExecutionContext = null; + this.openScope = new LongStandingScope(); + this.attribution.worker = this; + this.url = url2; + this._onDisconnect = onDisconnect; + } + static { + this.Events = WorkerEvent; + } + createExecutionContext(delegate) { + this.existingExecutionContext = new ExecutionContext(this, delegate, "worker"); + if (this._workerScriptLoaded) + this._executionContextPromise.resolve(this.existingExecutionContext); + return this.existingExecutionContext; + } + destroyExecutionContext(errorMessage) { + if (this.existingExecutionContext) + this.existingExecutionContext.contextDestroyed(errorMessage); + this.existingExecutionContext = null; + this._workerScriptLoaded = false; + this._executionContextPromise = new ManualPromise(); + } + workerScriptLoaded() { + this._workerScriptLoaded = true; + if (this.existingExecutionContext) + this._executionContextPromise.resolve(this.existingExecutionContext); + } + didClose() { + if (this.existingExecutionContext) + this.existingExecutionContext.contextDestroyed("Worker was closed"); + this.emit(_Worker.Events.Close, this); + this.openScope.close(new Error("Worker closed")); + } + async evaluateExpression(progress2, expression2, isFunction2, arg) { + return progress2.race(evaluateExpression(await this._executionContextPromise, expression2, { returnByValue: true, isFunction: isFunction2 }, arg)); + } + async evaluateExpressionHandle(progress2, expression2, isFunction2, arg) { + return progress2.race(evaluateExpression(await this._executionContextPromise, expression2, { returnByValue: false, isFunction: isFunction2 }, arg)); + } + async disconnect(progress2, options = {}) { + if (!this._onDisconnect) + throw new Error("Cannot disconnect from this worker"); + this._closeReason = options.reason; + await progress2.race(this._onDisconnect()); + } + }; + PageBinding = class _PageBinding extends DisposableObject { + static { + this.kController = "__playwright__binding__controller__"; + } + static { + this.kBindingName = "__playwright__binding__"; + } + static createInitScript(browserContext) { + return new InitScript(browserContext, ` + (() => { + const module = {}; + ${source5} + const property = '${_PageBinding.kController}'; + if (!globalThis[property]) + globalThis[property] = new (module.exports.BindingsController())(globalThis, '${_PageBinding.kBindingName}'); + })(); + `); + } + constructor(parent, name, playwrightFunction) { + super(parent); + this.name = name; + this.playwrightFunction = playwrightFunction; + this.initScript = new InitScript(parent, `globalThis['${_PageBinding.kController}'].addBinding(${JSON.stringify(name)})`); + this.cleanupScript = `globalThis['${_PageBinding.kController}'].removeBinding(${JSON.stringify(name)})`; + } + static async dispatch(page, payload, context2) { + const { name, seq, serializedArgs } = JSON.parse(payload); + try { + assert(context2.world); + const binding = page.getBinding(name); + if (!binding) + throw new Error(`Function "${name}" is not exposed`); + if (!Array.isArray(serializedArgs)) + throw new Error(`serializedArgs is not an array. This can happen when Array.prototype.toJSON is defined incorrectly`); + const args = serializedArgs.map((a) => parseEvaluationResultValue(a)); + const result2 = await binding.playwrightFunction({ frame: context2.frame, page, context: page.browserContext }, ...args); + context2.evaluateExpressionHandle(`arg => globalThis['${_PageBinding.kController}'].deliverBindingResult(arg)`, { isFunction: true }, { name, seq, result: result2 }).catch((e) => debugLogger.log("error", e)); + } catch (error) { + context2.evaluateExpressionHandle(`arg => globalThis['${_PageBinding.kController}'].deliverBindingResult(arg)`, { isFunction: true }, { name, seq, error }).catch((e) => debugLogger.log("error", e)); + } + } + async dispose() { + await this.parent.removeExposedBinding(this); + } + }; + InitScript = class extends DisposableObject { + constructor(owner, source11) { + super(owner); + this.source = `(() => { + ${source11} + })();`; + } + async dispose() { + await this.parent.removeInitScript(this); + } + }; + } +}); + +// packages/playwright-core/src/server/types.ts +var kLifecycleEvents; +var init_types = __esm({ + "packages/playwright-core/src/server/types.ts"() { + "use strict"; + kLifecycleEvents = /* @__PURE__ */ new Set(["load", "domcontentloaded", "networkidle", "commit"]); + } +}); + +// packages/playwright-core/src/server/frames.ts +function verifyLifecycle(name, waitUntil) { + if (waitUntil === "networkidle0") + waitUntil = "networkidle"; + if (!kLifecycleEvents.has(waitUntil)) + throw new Error(`${name}: expected one of (load|domcontentloaded|networkidle|commit)`); + return waitUntil; +} +function renderUnexpectedValue(expression2, received) { + if (expression2 === "to.match.aria") + return received ? received.raw : received; + return received; +} +var yaml, NavigationAbortedError, ExpectError, kDummyFrameId, FrameManager, FrameEvent, Frame, SignalBarrier; +var init_frames = __esm({ + "packages/playwright-core/src/server/frames.ts"() { + "use strict"; + init_ariaSnapshot(); + init_selectorParser(); + init_manualPromise(); + init_eventsHelper(); + init_manualPromise(); + init_locatorGenerators(); + init_assert(); + init_urlMatch(); + init_task(); + init_crypto(); + init_browserContext(); + init_dom(); + init_errors(); + init_fileUploadUtils(); + init_frameSelectors(); + init_helper(); + init_instrumentation(); + init_javascript(); + init_network2(); + init_page(); + init_progress(); + init_types(); + init_protocolError(); + yaml = require("./utilsBundle").yaml; + NavigationAbortedError = class extends Error { + constructor(documentId, message) { + super(message); + this.documentId = documentId; + } + }; + ExpectError = class extends Error { + constructor(details) { + super("Expect failed"); + this.name = "ExpectError"; + this.details = details; + } + }; + kDummyFrameId = ""; + FrameManager = class { + constructor(page) { + this._frames = /* @__PURE__ */ new Map(); + this._consoleMessageTags = /* @__PURE__ */ new Map(); + this._signalBarriers = /* @__PURE__ */ new Set(); + this._webSockets = /* @__PURE__ */ new Map(); + this._nextFrameSeq = 0; + this._page = page; + this._mainFrame = void 0; + } + _allocateFrameSeq() { + return this._nextFrameSeq++; + } + createDummyMainFrameIfNeeded() { + if (!this._mainFrame) + this.frameAttached(kDummyFrameId, null); + } + dispose() { + for (const frame of this._frames.values()) { + frame._stopNetworkIdleTimer(); + frame.invalidateNonStallingEvaluations("Target crashed"); + } + } + mainFrame() { + return this._mainFrame; + } + frames() { + const frames = []; + collect(this._mainFrame); + return frames; + function collect(frame) { + frames.push(frame); + for (const subframe of frame._getChildFrames()) + collect(subframe); + } + } + frame(frameId) { + return this._frames.get(frameId) || null; + } + frameAttached(frameId, parentFrameId) { + const parentFrame = parentFrameId ? this._frames.get(parentFrameId) : null; + if (!parentFrame) { + if (this._mainFrame) { + this._frames.delete(this._mainFrame._id); + this._mainFrame._id = frameId; + } else { + assert(!this._frames.has(frameId)); + this._mainFrame = new Frame(this._page, frameId, parentFrame); + } + this._frames.set(frameId, this._mainFrame); + return this._mainFrame; + } else { + assert(!this._frames.has(frameId)); + const frame = new Frame(this._page, frameId, parentFrame); + this._frames.set(frameId, frame); + this._page.emit(Page.Events.FrameAttached, frame); + this._page.browserContext.emit(BrowserContext.Events.FrameAttached, frame); + return frame; + } + } + async waitForSignalsCreatedBy(progress2, waitAfter, action) { + if (!waitAfter) + return action(progress2); + const barrier = new SignalBarrier(progress2); + this._signalBarriers.add(barrier); + try { + const result2 = await action(progress2); + await progress2.race(this._page.delegate.inputActionEpilogue()); + await barrier.waitFor(progress2); + await new Promise(makeWaitForNextTask()); + return result2; + } finally { + this._signalBarriers.delete(barrier); + } + } + frameWillPotentiallyRequestNavigation() { + for (const barrier of this._signalBarriers) + barrier.retain(); + } + frameDidPotentiallyRequestNavigation() { + for (const barrier of this._signalBarriers) + barrier.release(); + } + frameRequestedNavigation(frameId, documentId) { + const frame = this._frames.get(frameId); + if (!frame) + return; + for (const barrier of this._signalBarriers) + barrier.addFrameNavigation(frame); + if (frame.pendingDocument() && frame.pendingDocument().documentId === documentId) { + return; + } + const request2 = documentId ? Array.from(frame._inflightRequests).find((request3) => request3._documentId === documentId) : void 0; + frame._setPendingDocument({ documentId, request: request2 }); + } + frameCommittedNewDocumentNavigation(frameId, url2, name, documentId, initial) { + const frame = this._frames.get(frameId); + this.removeChildFramesRecursively(frame); + this._clearWebSockets(frame); + frame._url = url2; + frame._name = name; + let keepPending; + const pendingDocument = frame.pendingDocument(); + if (pendingDocument) { + if (pendingDocument.documentId === void 0) { + pendingDocument.documentId = documentId; + } + if (pendingDocument.documentId === documentId) { + frame._currentDocument = pendingDocument; + } else { + keepPending = pendingDocument; + frame._currentDocument = { documentId, request: void 0 }; + } + frame._setPendingDocument(void 0); + } else { + frame._currentDocument = { documentId, request: void 0 }; + } + frame._onClearLifecycle(); + const navigationEvent = { url: url2, name, newDocument: frame._currentDocument, isPublic: true }; + this._fireInternalFrameNavigation(frame, navigationEvent); + if (!initial) { + frame.apiLog(` navigated to "${url2}"`); + this._page.frameNavigatedToNewDocument(frame); + } + frame._setPendingDocument(keepPending); + } + frameCommittedSameDocumentNavigation(frameId, url2) { + const frame = this._frames.get(frameId); + if (!frame) + return; + const pending = frame.pendingDocument(); + if (pending && pending.documentId === void 0 && pending.request === void 0) { + frame._setPendingDocument(void 0); + } + frame._url = url2; + const navigationEvent = { url: url2, name: frame._name, isPublic: true }; + this._fireInternalFrameNavigation(frame, navigationEvent); + frame.apiLog(` navigated to "${url2}"`); + } + frameAbortedNavigation(frameId, errorText, documentId) { + const frame = this._frames.get(frameId); + if (!frame || !frame.pendingDocument()) + return; + if (documentId !== void 0 && frame.pendingDocument().documentId !== documentId) + return; + const navigationEvent = { + url: frame._url, + name: frame._name, + newDocument: frame.pendingDocument(), + error: new NavigationAbortedError(documentId, errorText), + isPublic: !(documentId && frame._redirectedNavigations.has(documentId)) + }; + frame._setPendingDocument(void 0); + this._fireInternalFrameNavigation(frame, navigationEvent); + } + frameDetached(frameId) { + const frame = this._frames.get(frameId); + if (frame) { + this._removeFramesRecursively(frame); + this._page.mainFrame()._recalculateNetworkIdle(); + } + } + frameLifecycleEvent(frameId, event) { + const frame = this._frames.get(frameId); + if (frame) + frame.onLifecycleEvent(event); + } + requestStarted(request2, route2) { + const frame = request2.frame(); + this._inflightRequestStarted(request2); + if (request2._documentId) + frame._setPendingDocument({ documentId: request2._documentId, request: request2 }); + if (request2._isFavicon) { + route2?.abort("aborted").catch(() => { + }); + return; + } + this._page.addNetworkRequest(request2); + this._page.emitOnContext(BrowserContext.Events.Request, request2); + if (route2) + new Route(request2, route2).handle([...this._page.requestInterceptors, ...this._page.browserContext.requestInterceptors]); + } + requestReceivedResponse(response2) { + if (response2.request()._isFavicon) + return; + this._page.emitOnContext(BrowserContext.Events.Response, response2); + } + reportRequestFinished(request2, response2) { + this._inflightRequestFinished(request2); + if (request2._isFavicon) + return; + this._page.emitOnContext(BrowserContext.Events.RequestFinished, { request: request2, response: response2 }); + } + requestFailed(request2, canceled) { + const frame = request2.frame(); + this._inflightRequestFinished(request2); + if (frame.pendingDocument() && frame.pendingDocument().request === request2) { + let errorText = request2.failure().errorText; + if (canceled) + errorText += "; maybe frame was detached?"; + this.frameAbortedNavigation(frame._id, errorText, frame.pendingDocument().documentId); + } + if (request2._isFavicon) + return; + this._page.emitOnContext(BrowserContext.Events.RequestFailed, request2); + } + removeChildFramesRecursively(frame) { + for (const child of frame._getChildFrames()) + this._removeFramesRecursively(child); + } + _removeFramesRecursively(frame) { + this.removeChildFramesRecursively(frame); + frame._onDetached(); + this._frames.delete(frame._id); + if (!this._page.isClosed()) + this._page.emit(Page.Events.FrameDetached, frame); + } + _inflightRequestFinished(request2) { + const frame = request2.frame(); + if (request2._isFavicon) + return; + if (!frame._inflightRequests.has(request2)) + return; + frame._inflightRequests.delete(request2); + if (frame._inflightRequests.size === 0) + frame._startNetworkIdleTimer(); + } + _inflightRequestStarted(request2) { + const frame = request2.frame(); + if (request2._isFavicon) + return; + frame._inflightRequests.add(request2); + if (frame._inflightRequests.size === 1) + frame._stopNetworkIdleTimer(); + } + interceptConsoleMessage(message) { + if (message.type() !== "debug") + return false; + const tag = message.text(); + const handler = this._consoleMessageTags.get(tag); + if (!handler) + return false; + this._consoleMessageTags.delete(tag); + handler(); + return true; + } + _clearWebSockets(frame) { + if (frame.parentFrame()) + return; + this._webSockets.clear(); + } + onWebSocketCreated(requestId, url2) { + const ws4 = new WebSocket(this._page, url2); + this._webSockets.set(requestId, ws4); + } + onWebSocketRequest(requestId, headers, wallTimeMs) { + const ws4 = this._webSockets.get(requestId); + if (!ws4) + return; + ws4.setWallTimeMs(wallTimeMs); + if (ws4.markAsNotified()) { + this._page.emit(Page.Events.WebSocket, ws4); + this._page.browserContext.emit(BrowserContext.Events.WebSocket, ws4, this._page); + } + ws4.requestSent(headers); + } + onWebSocketResponse(requestId, status, statusText2, headers) { + const ws4 = this._webSockets.get(requestId); + if (!ws4) + return; + ws4.responseReceived(status, statusText2, headers); + if (status >= 400) + ws4.error(`${statusText2}: ${status}`); + } + onWebSocketFrameSent(requestId, opcode, data, wallTimeMs) { + const ws4 = this._webSockets.get(requestId); + if (ws4) + ws4.frameSent(opcode, data, wallTimeMs); + } + webSocketFrameReceived(requestId, opcode, data, wallTimeMs) { + const ws4 = this._webSockets.get(requestId); + if (ws4) + ws4.frameReceived(opcode, data, wallTimeMs); + } + webSocketClosed(requestId) { + const ws4 = this._webSockets.get(requestId); + if (ws4) { + if (ws4.markAsNotified()) { + this._page.emit(Page.Events.WebSocket, ws4); + this._page.browserContext.emit(BrowserContext.Events.WebSocket, ws4, this._page); + } + ws4.closed(); + } + this._webSockets.delete(requestId); + } + webSocketError(requestId, errorMessage) { + const ws4 = this._webSockets.get(requestId); + if (ws4) { + if (ws4.markAsNotified()) { + this._page.emit(Page.Events.WebSocket, ws4); + this._page.browserContext.emit(BrowserContext.Events.WebSocket, ws4, this._page); + } + ws4.error(errorMessage); + } + } + _fireInternalFrameNavigation(frame, event) { + frame.emit(Frame.Events.InternalNavigation, event); + } + }; + FrameEvent = { + InternalNavigation: "internalnavigation", + AddLifecycle: "addlifecycle", + RemoveLifecycle: "removelifecycle" + }; + Frame = class _Frame extends SdkObject { + constructor(page, id, parentFrame) { + super(page, "frame"); + this._firedLifecycleEvents = /* @__PURE__ */ new Set(); + this._firedNetworkIdleSelf = false; + this._url = ""; + this._contextData = /* @__PURE__ */ new Map(); + this._childFrames = /* @__PURE__ */ new Set(); + this._name = ""; + this._inflightRequests = /* @__PURE__ */ new Set(); + this._detachedScope = new LongStandingScope(); + this._raceAgainstEvaluationStallingEventsPromises = /* @__PURE__ */ new Set(); + this._redirectedNavigations = /* @__PURE__ */ new Map(); + this.attribution.frame = this; + this.seq = page.frameManager._allocateFrameSeq(); + this._id = id; + this._page = page; + this._parentFrame = parentFrame; + this._currentDocument = { documentId: void 0, request: void 0 }; + this.selectors = new FrameSelectors(this); + this._contextData.set("main", { contextPromise: new ManualPromise(), context: null }); + this._contextData.set("utility", { contextPromise: new ManualPromise(), context: null }); + this._setContext("main", null); + this._setContext("utility", null); + if (this._parentFrame) + this._parentFrame._childFrames.add(this); + this._firedLifecycleEvents.add("commit"); + if (id !== kDummyFrameId) + this._startNetworkIdleTimer(); + } + static { + this.Events = FrameEvent; + } + _isDetached() { + return this._detachedScope.isClosed(); + } + onLifecycleEvent(event) { + if (this._firedLifecycleEvents.has(event)) + return; + this._firedLifecycleEvents.add(event); + this.emit(_Frame.Events.AddLifecycle, event); + if (this === this._page.mainFrame() && this._url !== "about:blank") + this.apiLog(` "${event}" event fired`); + this._page.mainFrame()._recalculateNetworkIdle(); + } + _onClearLifecycle() { + for (const event of this._firedLifecycleEvents) + this.emit(_Frame.Events.RemoveLifecycle, event); + this._firedLifecycleEvents.clear(); + this._inflightRequests = new Set(Array.from(this._inflightRequests).filter((request2) => request2 === this._currentDocument.request)); + this._stopNetworkIdleTimer(); + if (this._inflightRequests.size === 0) + this._startNetworkIdleTimer(); + this._page.mainFrame()._recalculateNetworkIdle(this); + this.onLifecycleEvent("commit"); + } + _setPendingDocument(documentInfo) { + this._pendingDocument = documentInfo; + if (documentInfo) + this.invalidateNonStallingEvaluations("Navigation interrupted the evaluation"); + } + pendingDocument() { + return this._pendingDocument; + } + invalidateNonStallingEvaluations(message) { + if (!this._raceAgainstEvaluationStallingEventsPromises.size) + return; + const error = new Error(message); + for (const promise of this._raceAgainstEvaluationStallingEventsPromises) + promise.reject(error); + } + async raceAgainstEvaluationStallingEvents(cb) { + if (this._pendingDocument) + throw new Error("Frame is currently attempting a navigation"); + if (this._page.browserContext.dialogManager.hasOpenDialogsForPage(this._page)) + throw new Error("Open JavaScript dialog prevents evaluation"); + const promise = new ManualPromise(); + this._raceAgainstEvaluationStallingEventsPromises.add(promise); + try { + return await Promise.race([ + cb(), + promise + ]); + } finally { + this._raceAgainstEvaluationStallingEventsPromises.delete(promise); + } + } + nonStallingRawEvaluateInExistingMainContext(expression2) { + return this.raceAgainstEvaluationStallingEvents(() => { + const context2 = this._existingMainContext(); + if (!context2) + throw new Error("Frame does not yet have a main execution context"); + return context2.rawEvaluateJSON(expression2); + }); + } + nonStallingEvaluateInExistingContext(expression2, world) { + return this.raceAgainstEvaluationStallingEvents(() => { + const context2 = this._contextData.get(world)?.context; + if (!context2) + throw new Error("Frame does not yet have the execution context"); + return context2.evaluateExpression(expression2, { isFunction: false }); + }); + } + _recalculateNetworkIdle(frameThatAllowsRemovingNetworkIdle) { + let isNetworkIdle = this._firedNetworkIdleSelf; + for (const child of this._childFrames) { + child._recalculateNetworkIdle(frameThatAllowsRemovingNetworkIdle); + if (!child._firedLifecycleEvents.has("networkidle")) + isNetworkIdle = false; + } + if (isNetworkIdle && !this._firedLifecycleEvents.has("networkidle")) { + this._firedLifecycleEvents.add("networkidle"); + this.emit(_Frame.Events.AddLifecycle, "networkidle"); + if (this === this._page.mainFrame() && this._url !== "about:blank") + this.apiLog(` "networkidle" event fired`); + } + if (frameThatAllowsRemovingNetworkIdle !== this && this._firedLifecycleEvents.has("networkidle") && !isNetworkIdle) { + this._firedLifecycleEvents.delete("networkidle"); + this.emit(_Frame.Events.RemoveLifecycle, "networkidle"); + } + } + async raceNavigationAction(progress2, action) { + progress2.setAllowConcurrentOrNestedRaces(true); + const result2 = await progress2.race(LongStandingScope.raceMultiple([ + this._detachedScope, + this._page.openScope + ], action().catch((e) => { + if (e instanceof NavigationAbortedError && e.documentId) { + const data = this._redirectedNavigations.get(e.documentId); + if (data) { + progress2.log(`waiting for redirected navigation to "${data.url}"`); + return progress2.race(data.gotoPromise); + } + } + throw e; + }))); + progress2.setAllowConcurrentOrNestedRaces(false); + return result2; + } + redirectNavigation(url2, documentId, referer) { + const controller = new ProgressController(); + const data = { + url: url2, + gotoPromise: controller.run((progress2) => this.gotoImpl(progress2, url2, { referer }), 0) + }; + this._redirectedNavigations.set(documentId, data); + data.gotoPromise.finally(() => this._redirectedNavigations.delete(documentId)); + } + async goto(progress2, url2, options = {}) { + const constructedNavigationURL = constructURLBasedOnBaseURL(this._page.browserContext._options.baseURL, url2); + return this.raceNavigationAction(progress2, async () => this.gotoImpl(progress2, constructedNavigationURL, options)); + } + async gotoImpl(progress2, url2, options) { + const waitUntil = verifyLifecycle("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil); + progress2.log(`navigating to "${url2}", waiting until "${waitUntil}"`); + const headers = this._page.extraHTTPHeaders() || []; + const refererHeader = headers.find((h) => h.name.toLowerCase() === "referer"); + let referer = refererHeader ? refererHeader.value : void 0; + if (options.referer !== void 0) { + if (referer !== void 0 && referer !== options.referer) + throw new Error('"referer" is already specified as extra HTTP header'); + referer = options.referer; + } + url2 = helper.completeUserURL(url2); + const navigationEvents = []; + const collectNavigations = (arg) => navigationEvents.push(arg); + this.on(_Frame.Events.InternalNavigation, collectNavigations); + let navigateResult; + try { + navigateResult = await progress2.race(this._page.delegate.navigateFrame(this, url2, referer)); + } finally { + this.off(_Frame.Events.InternalNavigation, collectNavigations); + } + let event; + if (navigateResult.newDocumentId) { + const predicate = (event2) => { + return event2.newDocument && (event2.newDocument.documentId === navigateResult.newDocumentId || !event2.error); + }; + const events = navigationEvents.filter(predicate); + if (events.length) + event = events[0]; + else + event = await helper.waitForEvent(progress2, this, _Frame.Events.InternalNavigation, predicate).promise; + if (event.newDocument.documentId !== navigateResult.newDocumentId) { + throw new NavigationAbortedError(navigateResult.newDocumentId, `Navigation to "${url2}" is interrupted by another navigation to "${event.url}"`); + } + if (event.error) + throw event.error; + } else { + const predicate = (e) => !e.newDocument; + const events = navigationEvents.filter(predicate); + if (events.length) + event = events[0]; + else + event = await helper.waitForEvent(progress2, this, _Frame.Events.InternalNavigation, predicate).promise; + } + if (!this._firedLifecycleEvents.has(waitUntil)) + await helper.waitForEvent(progress2, this, _Frame.Events.AddLifecycle, (e) => e === waitUntil).promise; + const request2 = event.newDocument ? event.newDocument.request : void 0; + const response2 = request2 ? await request2._finalRequest().response(progress2) : null; + return response2; + } + async waitForNavigation(progress2, requiresNewDocument, options) { + const waitUntil = verifyLifecycle("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil); + progress2.log(`waiting for navigation until "${waitUntil}"`); + const navigationEvent = await helper.waitForEvent(progress2, this, _Frame.Events.InternalNavigation, (event) => { + if (event.error) + return true; + if (requiresNewDocument && !event.newDocument) + return false; + progress2.log(` navigated to "${this._url}"`); + return true; + }).promise; + if (navigationEvent.error) + throw navigationEvent.error; + if (!this._firedLifecycleEvents.has(waitUntil)) + await helper.waitForEvent(progress2, this, _Frame.Events.AddLifecycle, (e) => e === waitUntil).promise; + const request2 = navigationEvent.newDocument ? navigationEvent.newDocument.request : void 0; + return request2 ? request2._finalRequest().response(progress2) : null; + } + async waitForLoadState(progress2, state) { + const waitUntil = verifyLifecycle("state", state); + if (!this._firedLifecycleEvents.has(waitUntil)) + await helper.waitForEvent(progress2, this, _Frame.Events.AddLifecycle, (e) => e === waitUntil).promise; + } + async frameElement(progress2) { + return await progress2.race(this._page.delegate.getFrameElement(this)); + } + context(world) { + if (this._page.delegate.noUtilityWorld?.()) + world = "main"; + return this._contextData.get(world).contextPromise.then((contextOrDestroyedReason) => { + if (contextOrDestroyedReason instanceof ExecutionContext) + return contextOrDestroyedReason; + throw new Error(contextOrDestroyedReason.destroyedReason); + }); + } + mainContext() { + return this.context("main"); + } + _existingMainContext() { + return this._contextData.get("main")?.context || null; + } + utilityContext() { + return this.context("utility"); + } + async evaluateExpression(progress2, expression2, options = {}, arg) { + return await progress2.race(this._evaluateExpression(expression2, options, arg)); + } + async _evaluateExpression(expression2, options = {}, arg) { + const context2 = await this.context(options.world ?? "main"); + const value2 = await context2.evaluateExpression(expression2, options, arg); + return value2; + } + async evaluateExpressionHandle(progress2, expression2, options = {}, arg) { + return await progress2.race(this._evaluateExpressionHandle(expression2, options, arg)); + } + async _evaluateExpressionHandle(expression2, options = {}, arg) { + const context2 = await this.context(options.world ?? "main"); + const value2 = await context2.evaluateExpressionHandle(expression2, options, arg); + return value2; + } + async querySelector(progress2, selector, options) { + this.apiLog(` finding element using the selector "${selector}"`); + return progress2.race(this.selectors.query(selector, options)); + } + async waitForSelector(progress2, selector, performActionPreChecksAndLog, options, scope) { + if (options.visibility) + throw new Error("options.visibility is not supported, did you mean options.state?"); + if (options.waitFor && options.waitFor !== "visible") + throw new Error("options.waitFor is not supported, did you mean options.state?"); + const { state = "visible" } = options; + if (!["attached", "detached", "visible", "hidden"].includes(state)) + throw new Error(`state: expected one of (attached|detached|visible|hidden)`); + if (performActionPreChecksAndLog) + progress2.log(`waiting for ${this._asLocator(selector)}${state === "attached" ? "" : " to be " + state}`); + const promise = this.retryWithProgressAndBackoff(progress2, async (progress3, continuePolling) => { + if (performActionPreChecksAndLog) + await this._page.performActionPreChecks(progress3); + const resolved = await progress3.race(this.selectors.resolveInjectedForSelector(selector, options, scope)); + if (!resolved) { + if (state === "hidden" || state === "detached") + return null; + return continuePolling; + } + const result2 = await progress3.race(resolved.injected.evaluateHandle((injected, { info, root }) => { + if (root && !root.isConnected) + throw injected.createStacklessError("Element is not attached to the DOM"); + const elements = injected.querySelectorAll(info.parsed, root || document); + const element3 = elements[0]; + const visible2 = element3 ? injected.utils.isElementVisible(element3) : false; + let log3 = ""; + if (elements.length > 1) { + if (info.strict) + throw injected.strictModeViolationError(info.parsed, elements); + log3 = ` locator resolved to ${elements.length} elements. Proceeding with the first one: ${injected.previewNode(elements[0])}`; + } else if (element3) { + log3 = ` locator resolved to ${visible2 ? "visible" : "hidden"} ${injected.previewNode(element3)}`; + } + injected.checkDeprecatedSelectorUsage(info.parsed, elements); + return { log: log3, element: element3, visible: visible2, attached: !!element3 }; + }, { info: resolved.info, root: resolved.frame === this ? scope : void 0 })); + const { log: log2, visible, attached } = await progress3.race(result2.evaluate((r) => ({ log: r.log, visible: r.visible, attached: r.attached }))); + if (log2) + progress3.log(log2); + const success = { attached, detached: !attached, visible, hidden: !visible }[state]; + if (!success) { + result2.dispose(); + return continuePolling; + } + if (options.omitReturnValue) { + result2.dispose(); + return null; + } + const element2 = state === "attached" || state === "visible" ? await progress3.race(result2.evaluateHandle((r) => r.element)) : null; + result2.dispose(); + if (!element2) + return null; + if (options.__testHookBeforeAdoptNode) + await progress3.race(options.__testHookBeforeAdoptNode()); + try { + const mainContext = await progress3.race(resolved.frame.mainContext()); + return await progress3.race(element2._adoptTo(mainContext)); + } catch (e) { + return continuePolling; + } + }); + return scope ? scope._context.raceAgainstContextDestroyed(promise) : promise; + } + async dispatchEvent(progress2, selector, type3, eventInit = {}, options, scope) { + await this._callOnElementOnceMatches(progress2, selector, (injectedScript, element2, data) => { + injectedScript.dispatchEvent(element2, data.type, data.eventInit); + }, { type: type3, eventInit }, { mainWorld: true, ...options }, scope); + } + async evalOnSelector(progress2, selector, strict, expression2, isFunction2, arg, scope) { + return progress2.race(this._evalOnSelector(selector, strict, expression2, isFunction2, arg, scope)); + } + async _evalOnSelector(selector, strict, expression2, isFunction2, arg, scope) { + const handle = await this.selectors.query(selector, { strict }, scope); + if (!handle) + throw new Error(`Failed to find element matching selector "${selector}"`); + const result2 = await handle.internalEvaluateExpression(expression2, { isFunction: isFunction2 }, arg); + handle.dispose(); + return result2; + } + async evalOnSelectorAll(progress2, selector, expression2, isFunction2, arg, scope) { + return progress2.race(this._evalOnSelectorAll(selector, expression2, isFunction2, arg, scope)); + } + async _evalOnSelectorAll(selector, expression2, isFunction2, arg, scope) { + const arrayHandle = await this.selectors.queryArrayInMainWorld(selector, scope); + const result2 = await arrayHandle.internalEvaluateExpression(expression2, { isFunction: isFunction2 }, arg); + arrayHandle.dispose(); + return result2; + } + async maskSelectors(selectors, color) { + const context2 = await this.utilityContext(); + const injectedScript = await context2.injectedScript(); + await injectedScript.evaluate((injected, { parsed, color: color2 }) => { + injected.maskSelectors(parsed, color2); + }, { parsed: selectors, color }); + } + async querySelectorAll(progress2, selector) { + return progress2.race(this.selectors.queryAll(selector)); + } + async queryCount(progress2, selector, options) { + try { + return await progress2.race(this.selectors.queryCount(selector, options)); + } catch (e) { + if (this.isNonRetriableError(e)) + throw e; + return 0; + } + } + async content(progress2) { + return progress2.race(this._content()); + } + async _content() { + try { + const context2 = await this.utilityContext(); + return await context2.evaluate(() => { + let retVal = ""; + if (document.doctype) + retVal = new XMLSerializer().serializeToString(document.doctype); + if (document.documentElement) + retVal += document.documentElement.outerHTML; + return retVal; + }); + } catch (e) { + if (this.isNonRetriableError(e)) + throw e; + throw new Error(`Unable to retrieve content because the page is navigating and changing the content.`); + } + } + async setContent(progress2, html, options) { + const tag = `--playwright--set--content--${createGuid()}--`; + await this.raceNavigationAction(progress2, async () => { + const waitUntil = options.waitUntil === void 0 ? "load" : options.waitUntil; + progress2.log(`setting frame content, waiting until "${waitUntil}"`); + const context2 = await progress2.race(this.utilityContext()); + const tagPromise = new ManualPromise(); + this._page.frameManager._consoleMessageTags.set(tag, () => { + this._onClearLifecycle(); + tagPromise.resolve(); + }); + progress2.setAllowConcurrentOrNestedRaces(true); + const lifecyclePromise = progress2.race(tagPromise).then(() => this.waitForLoadState(progress2, waitUntil)); + const contentPromise = progress2.race(context2.evaluate(({ html: html2, tag: tag2 }) => { + document.open(); + console.debug(tag2); + document.write(html2); + document.close(); + }, { html, tag })); + await Promise.all([contentPromise, lifecyclePromise]); + progress2.setAllowConcurrentOrNestedRaces(false); + return null; + }).finally(() => { + this._page.frameManager._consoleMessageTags.delete(tag); + }); + } + name() { + return this._name || ""; + } + url() { + return this._url; + } + origin() { + if (!this._url.startsWith("http")) + return; + return parseURL2(this._url)?.origin; + } + parentFrame() { + return this._parentFrame; + } + _getChildFrames() { + return Array.from(this._childFrames); + } + async addScriptTag(progress2, params2) { + return await progress2.race(this._addScriptTag(params2)); + } + async _addScriptTag(params2) { + const { + url: url2 = null, + content = null, + type: type3 = "" + } = params2; + if (!url2 && !content) + throw new Error("Provide an object with a `url`, `path` or `content` property"); + const context2 = await this.mainContext(); + return this._raceWithCSPError(async () => { + if (url2 !== null) + return (await context2.evaluateHandle(addScriptUrl, { url: url2, type: type3 })).asElement(); + const result2 = (await context2.evaluateHandle(addScriptContent, { content, type: type3 })).asElement(); + if (this._page.delegate.cspErrorsAsynchronousForInlineScripts) + await context2.evaluate(() => true); + return result2; + }); + async function addScriptUrl(params3) { + const script = document.createElement("script"); + script.src = params3.url; + if (params3.type) + script.type = params3.type; + const promise = new Promise((res, rej) => { + script.onload = res; + script.onerror = (e) => rej(typeof e === "string" ? new Error(e) : new Error(`Failed to load script at ${script.src}`)); + }); + document.head.appendChild(script); + await promise; + return script; + } + function addScriptContent(params3) { + const script = document.createElement("script"); + script.type = params3.type || "text/javascript"; + script.text = params3.content; + let error = null; + script.onerror = (e) => error = e; + document.head.appendChild(script); + if (error) + throw error; + return script; + } + } + async addStyleTag(progress2, params2) { + return await progress2.race(this._addStyleTag(params2)); + } + async _addStyleTag(params2) { + const { + url: url2 = null, + content = null + } = params2; + if (!url2 && !content) + throw new Error("Provide an object with a `url`, `path` or `content` property"); + const context2 = await this.mainContext(); + return this._raceWithCSPError(async () => { + if (url2 !== null) + return (await context2.evaluateHandle(addStyleUrl, url2)).asElement(); + return (await context2.evaluateHandle(addStyleContent, content)).asElement(); + }); + async function addStyleUrl(url3) { + const link = document.createElement("link"); + link.rel = "stylesheet"; + link.href = url3; + const promise = new Promise((res, rej) => { + link.onload = res; + link.onerror = rej; + }); + document.head.appendChild(link); + await promise; + return link; + } + async function addStyleContent(content2) { + const style = document.createElement("style"); + style.type = "text/css"; + style.appendChild(document.createTextNode(content2)); + const promise = new Promise((res, rej) => { + style.onload = res; + style.onerror = rej; + }); + document.head.appendChild(style); + await promise; + return style; + } + } + async _raceWithCSPError(func) { + const listeners = []; + let result2; + let error; + let cspMessage; + const actionPromise = func().then((r) => result2 = r).catch((e) => error = e); + const errorPromise = new Promise((resolve) => { + listeners.push(eventsHelper.addEventListener(this._page.browserContext, BrowserContext.Events.Console, (message) => { + if (message.page() !== this._page || message.type() !== "error") + return; + if (message.text().includes("Content-Security-Policy") || message.text().includes("Content Security Policy")) { + cspMessage = message; + resolve(); + } + })); + }); + await Promise.race([actionPromise, errorPromise]); + eventsHelper.removeEventListeners(listeners); + if (cspMessage) + throw new Error(cspMessage.text()); + if (error) + throw error; + return result2; + } + async retryWithProgressAndBackoff(progress2, action) { + const backoffScale = [20, 50, 100, 100, 500]; + if (progress2.timeout) { + while (backoffScale.length && backoffScale[backoffScale.length - 1] > progress2.timeout / 5) + backoffScale.pop(); + } + return await this.retryWithProgressAndTimeouts(progress2, backoffScale, action); + } + async retryWithProgressAndTimeouts(progress2, timeouts, action) { + const continuePolling = Symbol("continuePolling"); + timeouts = [0, ...timeouts]; + let timeoutIndex = 0; + while (true) { + const timeout = timeouts[Math.min(timeoutIndex++, timeouts.length - 1)]; + if (timeout) { + const actionPromise = new Promise((f) => setTimeout(f, timeout)); + await progress2.race(LongStandingScope.raceMultiple([ + this._page.openScope, + this._detachedScope + ], actionPromise)); + } + try { + const result2 = await action(progress2, continuePolling); + if (result2 === continuePolling) + continue; + return result2; + } catch (e) { + if (this.isNonRetriableError(e)) + throw e; + continue; + } + } + } + isNonRetriableError(e) { + if (isAbortError(e)) + return true; + if (isJavaScriptErrorInEvaluate(e) || isSessionClosedError(e)) + return true; + if (isNonRecoverableDOMError(e) || isInvalidSelectorError(e)) + return true; + if (this._isDetached()) + return true; + return false; + } + async _retryWithProgressIfNotConnected(progress2, selector, options, action) { + progress2.log(`waiting for ${this._asLocator(selector)}`); + const noAutoWaiting = options.__testHookNoAutoWaiting ?? options.noAutoWaiting; + const performActionPreChecks = (options.performActionPreChecks ?? !options.force) && !noAutoWaiting; + return this.retryWithProgressAndBackoff(progress2, async (progress3, continuePolling) => { + if (performActionPreChecks) + await this._page.performActionPreChecks(progress3); + const resolved = await progress3.race(this.selectors.resolveInjectedForSelector(selector, { strict: options.strict })); + if (!resolved) { + if (noAutoWaiting) + throw new NonRecoverableDOMError("Element(s) not found"); + return continuePolling; + } + const result2 = await progress3.race(resolved.injected.evaluateHandle((injected, { info }) => { + const elements = injected.querySelectorAll(info.parsed, document); + injected.markTargetElements(new Set(elements)); + const element3 = elements[0]; + let log3 = ""; + if (elements.length > 1) { + if (info.strict) + throw injected.strictModeViolationError(info.parsed, elements); + log3 = ` locator resolved to ${elements.length} elements. Proceeding with the first one: ${injected.previewNode(elements[0])}`; + } else if (element3) { + log3 = ` locator resolved to ${injected.previewNode(element3)}`; + } + injected.checkDeprecatedSelectorUsage(info.parsed, elements); + return { log: log3, success: !!element3, element: element3 }; + }, { info: resolved.info })); + const { log: log2, success } = await progress3.race(result2.evaluate((r) => ({ log: r.log, success: r.success }))); + if (log2) + progress3.log(log2); + if (!success) { + if (noAutoWaiting) + throw new NonRecoverableDOMError("Element(s) not found"); + result2.dispose(); + return continuePolling; + } + const element2 = await progress3.race(result2.evaluateHandle((r) => r.element)); + result2.dispose(); + try { + const result3 = await action(progress3, element2); + if (result3 === "error:notconnected") { + if (noAutoWaiting) + throw new NonRecoverableDOMError("Element is not attached to the DOM"); + progress3.log("element was detached from the DOM, retrying"); + return continuePolling; + } + return result3; + } finally { + element2?.dispose(); + } + }); + } + async rafrafTimeoutScreenshotElementWithProgress(progress2, selector, timeout, options) { + return await this._retryWithProgressIfNotConnected(progress2, selector, { strict: true, performActionPreChecks: true }, async (progress3, handle) => { + await handle._frame.rafrafTimeout(progress3, timeout); + return await this._page.screenshotter.screenshotElement(progress3, handle, options); + }); + } + async click(progress2, selector, options) { + return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._click(progress3, { ...options, waitAfter: !options.noWaitAfter }))); + } + async dblclick(progress2, selector, options) { + return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._dblclick(progress3, options))); + } + async dragAndDrop(progress2, source11, target, options) { + assertDone(await this._retryWithProgressIfNotConnected(progress2, source11, options, async (progress3, handle) => { + return handle._retryPointerAction(progress3, "move and down", false, async (progress4, point) => { + await this._page.mouse.move(progress4, point.x, point.y); + await this._page.mouse.down(progress4); + }, { + ...options, + waitAfter: "disabled", + position: options.sourcePosition + }); + })); + assertDone(await this._retryWithProgressIfNotConnected(progress2, target, { ...options, performActionPreChecks: false }, async (progress3, handle) => { + return handle._retryPointerAction(progress3, "move and up", false, async (progress4, point) => { + await this._page.mouse.move(progress4, point.x, point.y, { steps: options.steps }); + await this._page.mouse.up(progress4); + }, { + ...options, + waitAfter: "disabled", + position: options.targetPosition + }); + })); + } + async tap(progress2, selector, options) { + if (!this._page.browserContext._options.hasTouch) + throw new Error("The page does not support tap. Use hasTouch context option to enable touch support."); + return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._tap(progress3, options))); + } + async fill(progress2, selector, value2, options) { + return assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._fill(progress3, value2, options))); + } + async focus(progress2, selector, options) { + assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._focus(progress3))); + } + async blur(progress2, selector, options) { + assertDone(await this._retryWithProgressIfNotConnected(progress2, selector, options, (progress3, handle) => handle._blur(progress3))); + } + async resolveSelector(progress2, selector, options = {}) { + const element2 = await progress2.race(this.selectors.query(selector, options)); + if (!element2) + throw new Error(`No element matching ${selector}`); + const generated = await progress2.race(element2.evaluateInUtility(async ([injected, node]) => { + return injected.generateSelectorSimple(node); + }, {})); + if (!generated) + throw new Error(`Unable to generate locator for ${selector}`); + let frame = element2._frame; + const result2 = [generated]; + while (frame?.parentFrame()) { + const frameElement = await frame.frameElement(progress2); + if (frameElement) { + const generated2 = await progress2.race(frameElement.evaluateInUtility(async ([injected, node]) => { + return injected.generateSelectorSimple(node); + }, {})); + frameElement.dispose(); + if (generated2 === "error:notconnected" || !generated2) + throw new Error(`Unable to generate locator for ${selector}`); + result2.push(generated2); + } + frame = frame.parentFrame(); + } + const resolvedSelector = result2.reverse().join(" >> internal:control=enter-frame >> "); + return { resolvedSelector }; + } + async textContent(progress2, selector, options, scope) { + return this._callOnElementOnceMatches(progress2, selector, (injected, element2) => element2.textContent, void 0, options, scope); + } + async innerText(progress2, selector, options, scope) { + return this._callOnElementOnceMatches(progress2, selector, (injectedScript, element2) => { + if (element2.namespaceURI !== "http://www.w3.org/1999/xhtml") + throw injectedScript.createStacklessError("Node is not an HTMLElement"); + return element2.innerText; + }, void 0, options, scope); + } + async innerHTML(progress2, selector, options, scope) { + return this._callOnElementOnceMatches(progress2, selector, (injected, element2) => element2.innerHTML, void 0, options, scope); + } + async getAttribute(progress2, selector, name, options, scope) { + return this._callOnElementOnceMatches(progress2, selector, (injected, element2, data) => element2.getAttribute(data.name), { name }, options, scope); + } + async inputValue(progress2, selector, options, scope) { + return this._callOnElementOnceMatches(progress2, selector, (injectedScript, node) => { + const element2 = injectedScript.retarget(node, "follow-label"); + if (!element2 || element2.nodeName !== "INPUT" && element2.nodeName !== "TEXTAREA" && element2.nodeName !== "SELECT") + throw injectedScript.createStacklessError("Node is not an ,
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+